@contractspec/bundle.library 3.8.11 → 3.9.0

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 (202) hide show
  1. package/.turbo/turbo-build.log +290 -282
  2. package/CHANGELOG.md +68 -0
  3. package/dist/application/index.js +11 -11
  4. package/dist/application/mcp/cliMcp.js +6 -6
  5. package/dist/application/mcp/cliMcp.onboarding.d.ts +4 -0
  6. package/dist/application/mcp/cliMcp.onboarding.js +2 -0
  7. package/dist/application/mcp/cliMcp.test.d.ts +1 -0
  8. package/dist/application/mcp/contractsMcp.js +2 -2
  9. package/dist/application/mcp/contractsMcp.test.d.ts +1 -0
  10. package/dist/application/mcp/contractsMcpAdoptionTools.d.ts +3 -0
  11. package/dist/application/mcp/contractsMcpAdoptionTools.js +2 -0
  12. package/dist/application/mcp/contractsMcpResources.js +1 -1
  13. package/dist/application/mcp/contractsMcpTools.js +1 -1
  14. package/dist/application/mcp/contractsMcpTypes.d.ts +16 -0
  15. package/dist/application/mcp/index.js +11 -11
  16. package/dist/components/docs/DocsIndexPage.js +1 -1
  17. package/dist/components/docs/docsManifest.js +1 -1
  18. package/dist/components/docs/examples/DocsExamplesPage.js +1 -17
  19. package/dist/components/docs/examples/ExampleShowcasePage.d.ts +1 -1
  20. package/dist/components/docs/examples/ExampleShowcasePage.js +2 -17
  21. package/dist/components/docs/examples/exampleShowcaseData.d.ts +2 -2
  22. package/dist/components/docs/examples/exampleShowcaseData.js +2 -17
  23. package/dist/components/docs/examples/exampleShowcaseData.test.d.ts +1 -0
  24. package/dist/components/docs/examples/index.js +2 -17
  25. package/dist/components/docs/getting-started/CLIPage.js +5 -4
  26. package/dist/components/docs/getting-started/DataViewTutorialPage.js +44 -67
  27. package/dist/components/docs/getting-started/StartHerePage.js +4 -2
  28. package/dist/components/docs/getting-started/index.js +56 -76
  29. package/dist/components/docs/guides/GuideConnectInRepoPage.js +29 -4
  30. package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.js +21 -6
  31. package/dist/components/docs/guides/GuideReleaseCapsulesPage.d.ts +1 -0
  32. package/dist/components/docs/guides/GuideReleaseCapsulesPage.js +16 -0
  33. package/dist/components/docs/guides/GuidesIndexPage.js +1 -1
  34. package/dist/components/docs/guides/index.d.ts +1 -0
  35. package/dist/components/docs/guides/index.js +93 -39
  36. package/dist/components/docs/index.js +572 -421
  37. package/dist/components/docs/libraries/LibrariesContractsPage.js +43 -18
  38. package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +43 -31
  39. package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  40. package/dist/components/docs/libraries/LibrariesUIKitPage.js +42 -16
  41. package/dist/components/docs/libraries/LibrariesUIKitWebPage.d.ts +1 -0
  42. package/dist/components/docs/libraries/LibrariesUIKitWebPage.js +47 -0
  43. package/dist/components/docs/libraries/index.d.ts +1 -0
  44. package/dist/components/docs/libraries/index.js +221 -113
  45. package/dist/components/docs/specs/SpecsBuilderControlPlanePage.js +18 -3
  46. package/dist/components/docs/specs/SpecsConnectPage.js +4 -2
  47. package/dist/components/docs/specs/SpecsDataViewsPage.js +39 -32
  48. package/dist/components/docs/specs/index.js +65 -41
  49. package/dist/index.js +583 -432
  50. package/dist/node/application/index.js +11 -11
  51. package/dist/node/application/mcp/cliMcp.js +6 -6
  52. package/dist/node/application/mcp/cliMcp.onboarding.js +1 -0
  53. package/dist/node/application/mcp/contractsMcp.js +2 -2
  54. package/dist/node/application/mcp/contractsMcpAdoptionTools.js +1 -0
  55. package/dist/node/application/mcp/contractsMcpResources.js +1 -1
  56. package/dist/node/application/mcp/contractsMcpTools.js +1 -1
  57. package/dist/node/application/mcp/index.js +11 -11
  58. package/dist/node/components/docs/DocsIndexPage.js +1 -1
  59. package/dist/node/components/docs/docsManifest.js +1 -1
  60. package/dist/node/components/docs/examples/DocsExamplesPage.js +1 -17
  61. package/dist/node/components/docs/examples/ExampleShowcasePage.js +2 -17
  62. package/dist/node/components/docs/examples/exampleShowcaseData.js +2 -17
  63. package/dist/node/components/docs/examples/index.js +2 -17
  64. package/dist/node/components/docs/getting-started/CLIPage.js +5 -4
  65. package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +44 -67
  66. package/dist/node/components/docs/getting-started/StartHerePage.js +4 -2
  67. package/dist/node/components/docs/getting-started/index.js +56 -76
  68. package/dist/node/components/docs/guides/GuideConnectInRepoPage.js +29 -4
  69. package/dist/node/components/docs/guides/GuideHostBuilderWorkbenchPage.js +21 -6
  70. package/dist/node/components/docs/guides/GuideReleaseCapsulesPage.js +15 -0
  71. package/dist/node/components/docs/guides/GuidesIndexPage.js +1 -1
  72. package/dist/node/components/docs/guides/index.js +93 -39
  73. package/dist/node/components/docs/index.js +572 -421
  74. package/dist/node/components/docs/libraries/LibrariesContractsPage.js +43 -18
  75. package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +43 -31
  76. package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  77. package/dist/node/components/docs/libraries/LibrariesUIKitPage.js +42 -16
  78. package/dist/node/components/docs/libraries/LibrariesUIKitWebPage.js +46 -0
  79. package/dist/node/components/docs/libraries/index.js +221 -113
  80. package/dist/node/components/docs/specs/SpecsBuilderControlPlanePage.js +18 -3
  81. package/dist/node/components/docs/specs/SpecsConnectPage.js +4 -2
  82. package/dist/node/components/docs/specs/SpecsDataViewsPage.js +39 -32
  83. package/dist/node/components/docs/specs/index.js +65 -41
  84. package/dist/node/index.js +583 -432
  85. package/package.json +66 -17
  86. package/src/application/mcp/cliMcp.onboarding.ts +297 -0
  87. package/src/application/mcp/cliMcp.test.ts +99 -0
  88. package/src/application/mcp/cliMcp.ts +30 -3
  89. package/src/application/mcp/contractsMcp.test.ts +65 -0
  90. package/src/application/mcp/contractsMcpAdoptionTools.ts +131 -0
  91. package/src/application/mcp/contractsMcpResources.ts +49 -0
  92. package/src/application/mcp/contractsMcpTools.ts +2 -0
  93. package/src/application/mcp/contractsMcpTypes.ts +16 -0
  94. package/src/components/docs/docsManifest.ts +12 -0
  95. package/src/components/docs/examples/DocsExamplesPage.tsx +6 -14
  96. package/src/components/docs/examples/ExampleShowcasePage.tsx +22 -18
  97. package/src/components/docs/examples/exampleShowcaseData.test.ts +22 -0
  98. package/src/components/docs/examples/exampleShowcaseData.ts +75 -50
  99. package/src/components/docs/generated/docs-index._common.json +2008 -1691
  100. package/src/components/docs/generated/docs-index.agent-console.json +377 -377
  101. package/src/components/docs/generated/docs-index.ai-chat-assistant.json +17 -17
  102. package/src/components/docs/generated/docs-index.ai-chat.json +105 -105
  103. package/src/components/docs/generated/docs-index.ai-support-bot.json +9 -9
  104. package/src/components/docs/generated/docs-index.analytics-dashboard.json +169 -169
  105. package/src/components/docs/generated/docs-index.app-config.json +137 -137
  106. package/src/components/docs/generated/docs-index.artisan-knowledge-product.json +17 -17
  107. package/src/components/docs/generated/docs-index.artisan-payments-stripe.json +33 -33
  108. package/src/components/docs/generated/docs-index.audit-trail.json +49 -49
  109. package/src/components/docs/generated/docs-index.calendar-google.json +9 -9
  110. package/src/components/docs/generated/docs-index.content-generation.json +9 -9
  111. package/src/components/docs/generated/docs-index.control-plane.json +17 -17
  112. package/src/components/docs/generated/docs-index.crm-pipeline.json +161 -161
  113. package/src/components/docs/generated/docs-index.data-grid-showcase.json +25 -17
  114. package/src/components/docs/generated/docs-index.defineExample.json +9 -9
  115. package/src/components/docs/generated/docs-index.email-gmail.json +9 -9
  116. package/src/components/docs/generated/docs-index.feature-flags.json +217 -217
  117. package/src/components/docs/generated/docs-index.files.json +177 -177
  118. package/src/components/docs/generated/docs-index.generated.ts +20 -20
  119. package/src/components/docs/generated/docs-index.harness-lab.json +9 -9
  120. package/src/components/docs/generated/docs-index.health.json +97 -97
  121. package/src/components/docs/generated/docs-index.identity-rbac.json +313 -313
  122. package/src/components/docs/generated/docs-index.in-app-docs.json +9 -9
  123. package/src/components/docs/generated/docs-index.integration-hub.json +265 -265
  124. package/src/components/docs/generated/docs-index.integration-posthog.json +9 -9
  125. package/src/components/docs/generated/docs-index.integration-stripe.json +9 -9
  126. package/src/components/docs/generated/docs-index.integration-supabase.json +9 -9
  127. package/src/components/docs/generated/docs-index.jobs.json +137 -137
  128. package/src/components/docs/generated/docs-index.kb-update-pipeline.json +129 -129
  129. package/src/components/docs/generated/docs-index.knowledge-canon.json +9 -9
  130. package/src/components/docs/generated/docs-index.learning-journey-ambient-coach.json +9 -9
  131. package/src/components/docs/generated/docs-index.learning-journey-crm-onboarding.json +49 -49
  132. package/src/components/docs/generated/docs-index.learning-journey-duo-drills.json +9 -9
  133. package/src/components/docs/generated/docs-index.learning-journey-platform-tour.json +49 -49
  134. package/src/components/docs/generated/docs-index.learning-journey-quest-challenges.json +9 -9
  135. package/src/components/docs/generated/docs-index.learning-journey-registry.json +33 -33
  136. package/src/components/docs/generated/docs-index.learning-journey-studio-onboarding.json +49 -49
  137. package/src/components/docs/generated/docs-index.learning-journey-ui-coaching.json +9 -9
  138. package/src/components/docs/generated/docs-index.learning-journey-ui-gamified.json +9 -9
  139. package/src/components/docs/generated/docs-index.learning-journey-ui-onboarding.json +9 -9
  140. package/src/components/docs/generated/docs-index.learning-journey-ui-shared.json +9 -9
  141. package/src/components/docs/generated/docs-index.learning-journey.json +241 -217
  142. package/src/components/docs/generated/docs-index.learning-patterns.json +9 -9
  143. package/src/components/docs/generated/docs-index.lifecycle-cli.json +9 -9
  144. package/src/components/docs/generated/docs-index.lifecycle-dashboard.json +9 -9
  145. package/src/components/docs/generated/docs-index.locale-jurisdiction-gate.json +65 -57
  146. package/src/components/docs/generated/docs-index.manifest.json +432 -432
  147. package/src/components/docs/generated/docs-index.marketplace.json +337 -337
  148. package/src/components/docs/generated/docs-index.meeting-recorder-providers.json +9 -9
  149. package/src/components/docs/generated/docs-index.meeting-recorder.json +49 -49
  150. package/src/components/docs/generated/docs-index.messaging-agent-actions.json +17 -17
  151. package/src/components/docs/generated/docs-index.metrics.json +201 -201
  152. package/src/components/docs/generated/docs-index.minimal.json +17 -17
  153. package/src/components/docs/generated/docs-index.mobile-demo-tasks.json +33 -33
  154. package/src/components/docs/generated/docs-index.notifications.json +65 -65
  155. package/src/components/docs/generated/docs-index.openbanking-powens.json +9 -9
  156. package/src/components/docs/generated/docs-index.openbanking.json +65 -65
  157. package/src/components/docs/generated/docs-index.opencode-cli.json +17 -17
  158. package/src/components/docs/generated/docs-index.personalization.json +9 -9
  159. package/src/components/docs/generated/docs-index.platform-acp.json +137 -137
  160. package/src/components/docs/generated/docs-index.platform-agent.json +201 -185
  161. package/src/components/docs/generated/docs-index.platform-context.json +121 -105
  162. package/src/components/docs/generated/docs-index.platform-control-plane.json +321 -321
  163. package/src/components/docs/generated/docs-index.platform-database.json +89 -89
  164. package/src/components/docs/generated/docs-index.platform-docs.json +161 -153
  165. package/src/components/docs/generated/docs-index.platform-harness.json +177 -177
  166. package/src/components/docs/generated/docs-index.platform-integrations.json +329 -329
  167. package/src/components/docs/generated/docs-index.platform-knowledge.json +57 -57
  168. package/src/components/docs/generated/docs-index.platform-provider-ranking.json +217 -185
  169. package/src/components/docs/generated/docs-index.pocket-family-office.json +129 -129
  170. package/src/components/docs/generated/docs-index.policy-safe-knowledge-assistant.json +9 -9
  171. package/src/components/docs/generated/docs-index.product-intent.json +9 -9
  172. package/src/components/docs/generated/docs-index.project-management-sync.json +9 -9
  173. package/src/components/docs/generated/docs-index.saas-boilerplate.json +209 -209
  174. package/src/components/docs/generated/docs-index.service-business-os.json +193 -193
  175. package/src/components/docs/generated/docs-index.team-hub.json +185 -185
  176. package/src/components/docs/generated/docs-index.unknown.json +521 -521
  177. package/src/components/docs/generated/docs-index.versioned-knowledge-base.json +81 -81
  178. package/src/components/docs/generated/docs-index.video-api-showcase.json +33 -33
  179. package/src/components/docs/generated/docs-index.video-docs-terminal.json +9 -9
  180. package/src/components/docs/generated/docs-index.video-marketing-clip.json +9 -9
  181. package/src/components/docs/generated/docs-index.visualization-showcase.json +17 -17
  182. package/src/components/docs/generated/docs-index.voice-providers.json +9 -9
  183. package/src/components/docs/generated/docs-index.wealth-snapshot.json +153 -153
  184. package/src/components/docs/generated/docs-index.workflow-system.json +433 -433
  185. package/src/components/docs/generated/docs-index.workspace-cli.json +9 -9
  186. package/src/components/docs/getting-started/CLIPage.tsx +10 -2
  187. package/src/components/docs/getting-started/DataViewTutorialPage.tsx +63 -70
  188. package/src/components/docs/getting-started/StartHerePage.tsx +10 -9
  189. package/src/components/docs/guides/GuideConnectInRepoPage.tsx +52 -3
  190. package/src/components/docs/guides/GuideHostBuilderWorkbenchPage.tsx +55 -6
  191. package/src/components/docs/guides/GuideReleaseCapsulesPage.tsx +147 -0
  192. package/src/components/docs/guides/GuidesIndexPage.tsx +7 -0
  193. package/src/components/docs/guides/index.ts +1 -0
  194. package/src/components/docs/libraries/LibrariesContractsPage.tsx +72 -27
  195. package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +67 -61
  196. package/src/components/docs/libraries/LibrariesOverviewPage.tsx +7 -1
  197. package/src/components/docs/libraries/LibrariesUIKitPage.tsx +63 -25
  198. package/src/components/docs/libraries/LibrariesUIKitWebPage.tsx +115 -0
  199. package/src/components/docs/libraries/index.ts +1 -0
  200. package/src/components/docs/specs/SpecsBuilderControlPlanePage.tsx +58 -3
  201. package/src/components/docs/specs/SpecsConnectPage.tsx +30 -0
  202. package/src/components/docs/specs/SpecsDataViewsPage.tsx +63 -42
@@ -1,15 +1,16 @@
1
1
  // @bun
2
- import{CodeBlock as C,InstallCommand as q}from"@contractspec/lib.design-system";import E from"@contractspec/lib.ui-link";import{ChevronRight as H}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function M(){return l("div",{className:"space-y-8",children:[l("div",{className:"space-y-2",children:[a("h1",{className:"font-bold text-4xl",children:"ContractSpec CLI"}),a("p",{className:"text-lg text-muted-foreground",children:"Command-line interface for creating, building, and validating contract specifications with AI-powered code generation."})]}),l("div",{className:"space-y-6",children:[l("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"Installation"}),a(q,{package:"contractspec",dev:!0})]}),l("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"Quick Start"}),a(C,{language:"bash",code:`# Initialize project
2
+ import{CodeBlock as C,InstallCommand as q}from"@contractspec/lib.design-system";import V from"@contractspec/lib.ui-link";import{ChevronRight as F}from"lucide-react";import{jsx as a,jsxs as l}from"react/jsx-runtime";function H(){return l("div",{className:"space-y-8",children:[l("div",{className:"space-y-2",children:[a("h1",{className:"font-bold text-4xl",children:"ContractSpec CLI"}),a("p",{className:"text-lg text-muted-foreground",children:"Command-line interface for creating, building, and validating contract specifications with AI-powered code generation."})]}),l("div",{className:"space-y-6",children:[l("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"Installation"}),a(q,{package:"contractspec",dev:!0})]}),l("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"Quick Start"}),a(C,{language:"bash",code:`# Initialize project
3
+ contractspec onboard
3
4
  bunx contractspec init
4
5
 
5
6
  # Create a spec
6
7
  contractspec create --type operation
7
8
 
8
9
  # Generate code
9
- contractspec build src/contracts/mySpec.ts
10
+ contractspec generate
10
11
 
11
12
  # Validate
12
- contractspec validate src/contracts/mySpec.ts`})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Commands"}),a("div",{className:"grid gap-4",children:[{name:"create",description:"Interactive wizard to create contract specifications",usage:"contractspec create [--type operation] [--ai]"},{name:"build",description:"Generate implementation code from contract specs using AI agents",usage:"contractspec build <spec-file> [--agent-mode claude-code]"},{name:"validate",description:"Validate contract specifications and implementations",usage:"contractspec validate <spec-file> [--check-implementation]"},{name:"list",description:"List all contract specifications in the project",usage:"contractspec list [--type operation] [--json]"},{name:"watch",description:"Watch specs and auto-regenerate on changes",usage:"contractspec watch [--build] [--validate]"},{name:"sync",description:"Sync contracts by building all discovered specs",usage:"contractspec sync [--dry-run]"},{name:"ci",description:"Run all validation checks for CI/CD pipelines",usage:"contractspec ci [--format sarif] [--output results.sarif]"},{name:"deps",description:"Analyze contract dependencies and relationships",usage:"contractspec deps [--circular] [--format dot]"},{name:"diff",description:"Compare contract specifications and show differences",usage:"contractspec diff <spec1> <spec2> [--breaking]"}].map((u)=>l("div",{className:"card-subtle space-y-2 p-4",children:[a("h3",{className:"font-bold font-mono text-violet-400",children:u.name}),a("p",{className:"text-muted-foreground text-sm",children:u.description}),a(C,{language:"bash",code:u.usage,showCopyButton:!1})]},u.name))})]}),l("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"AI Agent Modes"}),a("p",{className:"text-muted-foreground",children:"The CLI supports multiple AI agent modes for different use cases:"}),l("div",{className:"grid gap-3 md:grid-cols-2",children:[l("div",{className:"card-subtle p-4",children:[a("h4",{className:"font-bold",children:"simple"}),a("p",{className:"text-muted-foreground text-sm",children:"Direct LLM API calls, fast and straightforward. Best for rapid prototyping."})]}),l("div",{className:"card-subtle p-4",children:[a("h4",{className:"font-bold",children:"claude-code"}),a("p",{className:"text-muted-foreground text-sm",children:"Extended thinking with Claude. Best for production-quality code."})]}),l("div",{className:"card-subtle p-4",children:[a("h4",{className:"font-bold",children:"openai-codex"}),a("p",{className:"text-muted-foreground text-sm",children:"GPT-4o/o1 models. Excellent for algorithms and optimization."})]}),l("div",{className:"card-subtle p-4",children:[a("h4",{className:"font-bold",children:"cursor"}),a("p",{className:"text-muted-foreground text-sm",children:"Leverages Cursor agentic capabilities. Requires Cursor environment."})]})]})]}),l("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"CI/CD Integration"}),a("p",{className:"text-muted-foreground",children:"Run all validation checks in CI/CD with machine-readable output:"}),a(C,{language:"yaml",filename:".github/workflows/validate.yml",code:`- name: Validate Contracts
13
+ contractspec validate`})]}),l("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Commands"}),a("div",{className:"grid gap-4",children:[{name:"onboard",description:"Primary OSS onboarding flow that recommends tracks, examples, and repo-local guides",usage:"contractspec onboard [track...] [--example <key>] [--dry-run] [--json]"},{name:"create",description:"Interactive wizard to create contract specifications",usage:"contractspec create [--type operation] [--ai]"},{name:"build",description:"Generate implementation code from contract specs using AI agents",usage:"contractspec build <spec-file> [--agent-mode claude-code]"},{name:"validate",description:"Validate contract specifications and implementations",usage:"contractspec validate <spec-file> [--check-implementation]"},{name:"list",description:"List all contract specifications in the project",usage:"contractspec list [--type operation] [--json]"},{name:"watch",description:"Watch specs and auto-regenerate on changes",usage:"contractspec watch [--build] [--validate]"},{name:"sync",description:"Sync contracts by building all discovered specs",usage:"contractspec sync [--dry-run]"},{name:"ci",description:"Run all validation checks for CI/CD pipelines",usage:"contractspec ci [--format sarif] [--output results.sarif]"},{name:"deps",description:"Analyze contract dependencies and relationships",usage:"contractspec deps [--circular] [--format dot]"},{name:"diff",description:"Compare contract specifications and show differences",usage:"contractspec diff <spec1> <spec2> [--breaking]"}].map((u)=>l("div",{className:"card-subtle space-y-2 p-4",children:[a("h3",{className:"font-bold font-mono text-violet-400",children:u.name}),a("p",{className:"text-muted-foreground text-sm",children:u.description}),a(C,{language:"bash",code:u.usage,showCopyButton:!1})]},u.name))})]}),l("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"AI Agent Modes"}),a("p",{className:"text-muted-foreground",children:"The CLI supports multiple AI agent modes for different use cases:"}),l("div",{className:"grid gap-3 md:grid-cols-2",children:[l("div",{className:"card-subtle p-4",children:[a("h4",{className:"font-bold",children:"simple"}),a("p",{className:"text-muted-foreground text-sm",children:"Direct LLM API calls, fast and straightforward. Best for rapid prototyping."})]}),l("div",{className:"card-subtle p-4",children:[a("h4",{className:"font-bold",children:"claude-code"}),a("p",{className:"text-muted-foreground text-sm",children:"Extended thinking with Claude. Best for production-quality code."})]}),l("div",{className:"card-subtle p-4",children:[a("h4",{className:"font-bold",children:"openai-codex"}),a("p",{className:"text-muted-foreground text-sm",children:"GPT-4o/o1 models. Excellent for algorithms and optimization."})]}),l("div",{className:"card-subtle p-4",children:[a("h4",{className:"font-bold",children:"cursor"}),a("p",{className:"text-muted-foreground text-sm",children:"Leverages Cursor agentic capabilities. Requires Cursor environment."})]})]})]}),l("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"CI/CD Integration"}),a("p",{className:"text-muted-foreground",children:"Run all validation checks in CI/CD with machine-readable output:"}),a(C,{language:"yaml",filename:".github/workflows/validate.yml",code:`- name: Validate Contracts
13
14
  run: contractspec ci --format sarif --output results.sarif
14
15
 
15
16
  - name: Upload SARIF
@@ -23,20 +24,7 @@ contractspec validate src/contracts/mySpec.ts`})]}),l("div",{className:"space-y-
23
24
  "operations": "interactions/commands|queries",
24
25
  "events": "events"
25
26
  }
26
- }`})]})]}),l("div",{className:"flex items-center gap-4 pt-4",children:[l(E,{href:"/docs/getting-started/tools/vscode",className:"btn-primary",children:["Next: VS Code Extension ",a(H,{size:16})]}),a(E,{href:"/docs/getting-started/tools",className:"btn-ghost",children:"Back to Tools"})]})]})}import k from"@contractspec/lib.ui-link";import{ChevronRight as W}from"lucide-react";import{jsx as i,jsxs as p}from"react/jsx-runtime";function G(){return p("div",{className:"space-y-8",children:[p("div",{className:"space-y-2",children:[i("h1",{className:"font-bold text-4xl",children:"Compatibility"}),i("p",{className:"text-lg text-muted-foreground",children:"Supported runtimes, frameworks, and agent modes for ContractSpec."})]}),p("div",{className:"space-y-6",children:[p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Runtimes"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"Node.js 20+"}),i("li",{children:"Bun 1.0+"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Frameworks"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"Next.js 14+ (App Router preferred)"}),i("li",{children:"Bun + Elysia or compatible HTTP servers"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Package managers"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"bun (recommended)"}),i("li",{children:"npm"}),i("li",{children:"pnpm"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"AI agent modes"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"claude-code"}),i("li",{children:"openai-codex"}),i("li",{children:"cursor"}),i("li",{children:"opencode"}),i("li",{children:"simple (direct LLM)"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Datastores"}),i("p",{className:"text-muted-foreground",children:"ContractSpec ships with Prisma-friendly defaults and can integrate with custom adapters for other databases."}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"PostgreSQL via Prisma"}),i("li",{children:"Custom adapters for other SQL/NoSQL stores"})]})]})]}),p("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[i(k,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),i(k,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),p(k,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",i(W,{size:16})]})]})]})}import{CodeBlock as I}from"@contractspec/lib.design-system";import V from"@contractspec/lib.ui-link";import{ChevronRight as Q}from"lucide-react";import{jsx as c,jsxs as b}from"react/jsx-runtime";function U(){return b("div",{className:"space-y-8",children:[b("div",{className:"space-y-4",children:[c("h1",{className:"font-bold text-4xl",children:"Display Data with DataViews"}),c("p",{className:"text-lg text-muted-foreground",children:"Define a filterable, sortable transaction history view that works across web and mobile without duplicating UI code."})]}),b("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"1. Define the underlying query"}),c("p",{className:"text-muted-foreground",children:"First, create a query operation to fetch the data:"}),c(I,{language:"typescript",filename:"lib/specs/billing/list-transactions.ts",code:`import { defineQuery } from '@contractspec/lib.contracts-spec';
27
-
28
- export const ListTransactions = defineQuery({
29
- meta: {
30
- key: 'billing.listTransactions',
31
- version: '1.0.0',
32
- description: 'Fetch customer transaction history',
33
- },
34
- io: {
35
- input: /* pagination + filters */,
36
- output: /* array of transactions */,
37
- },
38
- policy: { auth: 'user' },
39
- });`})]}),b("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"2. Define the DataView spec"}),c("p",{className:"text-muted-foreground",children:"Wrap your query with presentation metadata:"}),c(I,{language:"typescript",filename:"lib/specs/billing/transaction-history.data-view.ts",code:`import { defineDataView } from '@contractspec/lib.contracts-spec';
27
+ }`})]})]}),l("div",{className:"flex items-center gap-4 pt-4",children:[l(V,{href:"/docs/getting-started/tools/vscode",className:"btn-primary",children:["Next: VS Code Extension ",a(F,{size:16})]}),a(V,{href:"/docs/getting-started/tools",className:"btn-ghost",children:"Back to Tools"})]})]})}import I from"@contractspec/lib.ui-link";import{ChevronRight as M}from"lucide-react";import{jsx as i,jsxs as p}from"react/jsx-runtime";function W(){return p("div",{className:"space-y-8",children:[p("div",{className:"space-y-2",children:[i("h1",{className:"font-bold text-4xl",children:"Compatibility"}),i("p",{className:"text-lg text-muted-foreground",children:"Supported runtimes, frameworks, and agent modes for ContractSpec."})]}),p("div",{className:"space-y-6",children:[p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Runtimes"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"Node.js 20+"}),i("li",{children:"Bun 1.0+"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Frameworks"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"Next.js 14+ (App Router preferred)"}),i("li",{children:"Bun + Elysia or compatible HTTP servers"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Package managers"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"bun (recommended)"}),i("li",{children:"npm"}),i("li",{children:"pnpm"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"AI agent modes"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"claude-code"}),i("li",{children:"openai-codex"}),i("li",{children:"cursor"}),i("li",{children:"opencode"}),i("li",{children:"simple (direct LLM)"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Datastores"}),i("p",{className:"text-muted-foreground",children:"ContractSpec ships with Prisma-friendly defaults and can integrate with custom adapters for other databases."}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"PostgreSQL via Prisma"}),i("li",{children:"Custom adapters for other SQL/NoSQL stores"})]})]})]}),p("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[i(I,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),i(I,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),p(I,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",i(M,{size:16})]})]})]})}import{CodeBlock as P}from"@contractspec/lib.design-system";import L from"@contractspec/lib.ui-link";import{ChevronRight as G}from"lucide-react";import{jsx as n,jsxs as v}from"react/jsx-runtime";var U=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
40
28
  import { ListTransactions } from './list-transactions';
41
29
 
42
30
  export const TransactionHistory = defineDataView({
@@ -44,68 +32,58 @@ export const TransactionHistory = defineDataView({
44
32
  key: 'billing.transactionHistory',
45
33
  version: '1.0.0',
46
34
  entity: 'transaction',
35
+ title: 'Transaction History',
47
36
  description: 'Customer payment history',
48
- goal: 'Help customers track spending',
49
- context: 'Account dashboard',
37
+ domain: 'billing',
50
38
  owners: ['team-billing'],
51
- stability: 'stable',
52
39
  tags: ['payments'],
40
+ stability: 'stable',
53
41
  },
54
42
  source: {
55
- primary: ListTransactions,
43
+ primary: {
44
+ key: ListTransactions.meta.key,
45
+ version: ListTransactions.meta.version,
46
+ },
56
47
  },
57
48
  view: {
58
- kind: 'list',
59
- fields: [
60
- {
61
- key: 'date',
62
- label: 'Date',
63
- dataPath: 'createdAt',
64
- format: 'date',
65
- sortable: true
66
- },
67
- {
68
- key: 'description',
69
- label: 'Description',
70
- dataPath: 'description'
71
- },
72
- {
73
- key: 'amount',
74
- label: 'Amount',
75
- dataPath: 'amount',
76
- format: 'currency',
77
- sortable: true
78
- },
79
- {
80
- key: 'status',
81
- label: 'Status',
82
- dataPath: 'status',
83
- format: 'badge'
84
- },
85
- ],
86
- filters: [
87
- {
88
- key: 'status',
89
- label: 'Status',
90
- field: 'status',
91
- type: 'enum',
92
- options: [
93
- { value: 'succeeded', label: 'Paid' },
94
- { value: 'pending', label: 'Pending' },
95
- { value: 'failed', label: 'Failed' },
96
- ],
97
- },
98
- {
99
- key: 'dateRange',
100
- label: 'Date Range',
101
- field: 'createdAt',
102
- type: 'dateRange',
49
+ kind: 'table',
50
+ executionMode: 'client',
51
+ selection: 'multiple',
52
+ columnVisibility: true,
53
+ columnResizing: true,
54
+ columnPinning: true,
55
+ rowExpansion: {
56
+ fields: ['notes', 'renewalDate', 'lastActivityAt'],
57
+ },
58
+ initialState: {
59
+ pageSize: 4,
60
+ hiddenColumns: ['notes'],
61
+ pinnedColumns: {
62
+ left: ['account'],
103
63
  },
64
+ sorting: [{ field: 'arr', desc: true }],
65
+ },
66
+ fields: [
67
+ { key: 'account', label: 'Account', dataPath: 'account', sortable: true },
68
+ { key: 'owner', label: 'Owner', dataPath: 'owner', sortable: true },
69
+ { key: 'status', label: 'Status', dataPath: 'status', sortable: true },
70
+ { key: 'notes', label: 'Notes', dataPath: 'notes' },
104
71
  ],
105
- defaultSort: { field: 'date', direction: 'desc' },
106
- pagination: { pageSize: 25 },
107
72
  },
108
- });`})]}),b("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"3. Render on the frontend"}),c("p",{className:"text-muted-foreground",children:"Use the runtime renderer in your React or React Native app:"}),c(I,{language:"tsx",filename:"app/dashboard/transactions/page.tsx",code:`'use client';
73
+ });`;function Q(){return v("div",{className:"space-y-8",children:[v("div",{className:"space-y-4",children:[n("h1",{className:"font-bold text-4xl",children:"Display Data with DataViews"}),n("p",{className:"text-lg text-muted-foreground",children:"Define a filterable, sortable transaction history view that works across web and mobile without duplicating UI code."})]}),v("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"1. Define the underlying query"}),n("p",{className:"text-muted-foreground",children:"First, create a query operation to fetch the data:"}),n(P,{language:"typescript",filename:"lib/specs/billing/list-transactions.ts",code:`import { defineQuery } from '@contractspec/lib.contracts-spec';
74
+
75
+ export const ListTransactions = defineQuery({
76
+ meta: {
77
+ key: 'billing.listTransactions',
78
+ version: '1.0.0',
79
+ description: 'Fetch customer transaction history',
80
+ },
81
+ io: {
82
+ input: /* pagination + filters */,
83
+ output: /* array of transactions */,
84
+ },
85
+ policy: { auth: 'user' },
86
+ });`})]}),v("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"2. Define the DataView spec"}),n("p",{className:"text-muted-foreground",children:"Wrap your query with presentation metadata:"}),n(P,{language:"typescript",filename:"lib/specs/billing/transaction-history.data-view.ts",code:U}),v("p",{className:"text-muted-foreground text-sm",children:["The live version of this pattern is available in the canonical"," ",n(L,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),"."]})]}),v("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"3. Render on the frontend"}),n("p",{className:"text-muted-foreground",children:"Use the runtime renderer in your React or React Native app:"}),n(P,{language:"tsx",filename:"app/dashboard/transactions/page.tsx",code:`'use client';
109
87
 
110
88
  import { DataViewRenderer } from '@contractspec/lib.design-system';
111
89
  import { TransactionHistory } from '@/lib/specs/billing/transaction-history.data-view';
@@ -130,7 +108,7 @@ export function TransactionsPage() {
130
108
  />
131
109
  </div>
132
110
  );
133
- }`})]}),b("div",{className:"card-subtle space-y-4 p-6",children:[c("h3",{className:"font-bold",children:"Why DataViews?"}),b("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[c("li",{children:"Same spec renders on web (React) and mobile (React Native)"}),c("li",{children:"Filters, sorting, and pagination handled automatically"}),c("li",{children:"Format rules (currency, dates, badges) applied consistently"}),c("li",{children:"Export to CSV/PDF using the same spec"}),c("li",{children:"A/B test different layouts without touching the backend"})]})]}),b("div",{className:"flex items-center gap-4 pt-4",children:[b(V,{href:"/docs/libraries/data-views",className:"btn-primary",children:["DataView API Reference ",c(Q,{size:16})]}),c(V,{href:"/docs/specs/workflows",className:"btn-ghost",children:"Next: Workflows"})]})]})}import{CodeBlock as J,InstallCommand as _}from"@contractspec/lib.design-system";import P from"@contractspec/lib.ui-link";import{ChevronRight as B,Code2 as K,Cpu as X,Layers as Y,Terminal as $}from"lucide-react";import{jsx as s,jsxs as h}from"react/jsx-runtime";function De(){return h("div",{className:"space-y-8",children:[h("div",{className:"space-y-2",children:[s("h1",{className:"font-bold text-4xl",children:"Developer Tools"}),s("p",{className:"text-lg text-muted-foreground",children:"Use the OSS toolchain to define contracts, validate changes, inspect generated surfaces, and adopt the system incrementally across different environments."})]}),s("div",{className:"grid gap-6 md:grid-cols-2",children:[{name:"CLI",href:"/docs/getting-started/tools/cli",description:"Command-line interface for spec creation, building, validation, and CI/CD integration.",icon:$,status:"available",highlights:["AI-powered code generation","Multiple agent modes","SARIF/JSON output"]},{name:"VS Code Extension",href:"/docs/getting-started/tools/vscode",description:"Real-time validation, scaffolding, and navigation directly in your editor.",icon:K,status:"available",highlights:["Specs Explorer sidebar","Watch mode","Interactive walkthroughs"]},{name:"ContractSpec Studio",href:"https://www.contractspec.studio",description:"The operating layer on top of OSS ContractSpec for teams that want evidence-backed decisions, workflow automation, and managed delivery loops.",icon:Y,status:"available",highlights:["Evidence-to-decision loop","Compiled spec diffs and task packs","Exports to Linear, Jira, Notion, and GitHub"]},{name:"JetBrains Plugin",href:"#",description:"Full ContractSpec support for IntelliJ, WebStorm, and other JetBrains IDEs.",icon:X,status:"coming-soon",highlights:["Code navigation","Inline validation","Refactoring support"]}].map((u)=>{let y=u.icon,N=u.status==="coming-soon";return h("div",{className:`card-subtle relative space-y-4 p-6 ${N?"opacity-75":""}`,children:[N&&s("span",{className:"absolute -top-2 right-4 rounded-full bg-violet-500/20 px-2 py-0.5 font-medium text-violet-400 text-xs",children:"Coming Soon"}),h("div",{className:"flex items-center gap-3",children:[s("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-violet-500/10",children:s(y,{className:"h-5 w-5 text-violet-400"})}),s("h3",{className:"font-bold text-lg",children:u.name})]}),s("p",{className:"text-muted-foreground text-sm",children:u.description}),s("ul",{className:"space-y-1",children:u.highlights.map((A)=>h("li",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[s("span",{className:"text-violet-400",children:"-"}),A]},A))}),!N&&h(P,{href:u.href,className:"btn-ghost inline-flex items-center gap-1 text-sm",children:["Learn more ",s(B,{size:14})]})]},u.name)})}),h("div",{className:"card-subtle space-y-4 p-6",children:[s("h3",{className:"font-bold",children:"Quick Install"}),h("div",{className:"space-y-3",children:[h("div",{children:[s("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"CLI"}),s(_,{package:"contractspec",dev:!0})]}),h("div",{children:[s("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"VS Code Extension"}),s(J,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"})]})]})]}),h("div",{className:"flex items-center gap-4 pt-4",children:[h(P,{href:"/docs/getting-started/tools/cli",className:"btn-primary",children:["Get Started with CLI ",s(B,{size:16})]}),s(P,{href:"/docs/getting-started/tools/vscode",className:"btn-ghost",children:"VS Code Extension"})]})]})}import{CodeBlock as w}from"@contractspec/lib.design-system";import Z from"@contractspec/lib.ui-link";import{ChevronRight as x}from"lucide-react";import{jsx as o,jsxs as f}from"react/jsx-runtime";function j(){return f("div",{className:"space-y-8",children:[f("div",{className:"space-y-2",children:[o("h1",{className:"font-bold text-4xl",children:"Your First Operation"}),o("p",{className:"text-lg text-muted-foreground",children:"Build a payment capture operation with policy enforcement in under 10 minutes."})]}),f("div",{className:"space-y-6",children:[f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"What you'll build"}),o("p",{className:"text-muted-foreground",children:"A real-world payment processing operation that validates input, enforces business rules, integrates with Stripe, and audits every transaction. This is production-ready code, not a toy example."})]}),f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"1. Define the operation spec"}),f("p",{className:"text-muted-foreground",children:["Create ",o("code",{children:"lib/specs/billing/capture-payment.ts"}),":"]}),o(w,{language:"typescript",filename:"lib/specs/billing/capture-payment.ts",code:`import { defineCommand } from '@contractspec/lib.contracts-spec';
111
+ }`})]}),v("div",{className:"card-subtle space-y-4 p-6",children:[n("h3",{className:"font-bold",children:"Why DataViews?"}),v("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[n("li",{children:"Same spec renders on web (React) and mobile (React Native)"}),n("li",{children:"Filters, sorting, and pagination handled automatically"}),n("li",{children:"Column visibility, pinning, resizing, and row expansion stay contract-driven"}),n("li",{children:"Format rules (currency, dates, badges) applied consistently"}),n("li",{children:"Export to CSV/PDF using the same spec"}),n("li",{children:"A/B test different layouts without touching the backend"})]})]}),v("div",{className:"flex items-center gap-4 pt-4",children:[v(L,{href:"/docs/libraries/data-views",className:"btn-primary",children:["DataView API Reference ",n(G,{size:16})]}),n(L,{href:"/docs/specs/workflows",className:"btn-ghost",children:"Next: Workflows"})]})]})}import{CodeBlock as _,InstallCommand as J}from"@contractspec/lib.design-system";import T from"@contractspec/lib.ui-link";import{ChevronRight as B,Code2 as X,Cpu as K,Layers as Y,Terminal as $}from"lucide-react";import{jsx as s,jsxs as h}from"react/jsx-runtime";function De(){return h("div",{className:"space-y-8",children:[h("div",{className:"space-y-2",children:[s("h1",{className:"font-bold text-4xl",children:"Developer Tools"}),s("p",{className:"text-lg text-muted-foreground",children:"Use the OSS toolchain to define contracts, validate changes, inspect generated surfaces, and adopt the system incrementally across different environments."})]}),s("div",{className:"grid gap-6 md:grid-cols-2",children:[{name:"CLI",href:"/docs/getting-started/tools/cli",description:"Command-line interface for spec creation, building, validation, and CI/CD integration.",icon:$,status:"available",highlights:["AI-powered code generation","Multiple agent modes","SARIF/JSON output"]},{name:"VS Code Extension",href:"/docs/getting-started/tools/vscode",description:"Real-time validation, scaffolding, and navigation directly in your editor.",icon:X,status:"available",highlights:["Specs Explorer sidebar","Watch mode","Interactive walkthroughs"]},{name:"ContractSpec Studio",href:"https://www.contractspec.studio",description:"The operating layer on top of OSS ContractSpec for teams that want evidence-backed decisions, workflow automation, and managed delivery loops.",icon:Y,status:"available",highlights:["Evidence-to-decision loop","Compiled spec diffs and task packs","Exports to Linear, Jira, Notion, and GitHub"]},{name:"JetBrains Plugin",href:"#",description:"Full ContractSpec support for IntelliJ, WebStorm, and other JetBrains IDEs.",icon:K,status:"coming-soon",highlights:["Code navigation","Inline validation","Refactoring support"]}].map((u)=>{let b=u.icon,N=u.status==="coming-soon";return h("div",{className:`card-subtle relative space-y-4 p-6 ${N?"opacity-75":""}`,children:[N&&s("span",{className:"absolute -top-2 right-4 rounded-full bg-violet-500/20 px-2 py-0.5 font-medium text-violet-400 text-xs",children:"Coming Soon"}),h("div",{className:"flex items-center gap-3",children:[s("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-violet-500/10",children:s(b,{className:"h-5 w-5 text-violet-400"})}),s("h3",{className:"font-bold text-lg",children:u.name})]}),s("p",{className:"text-muted-foreground text-sm",children:u.description}),s("ul",{className:"space-y-1",children:u.highlights.map((E)=>h("li",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[s("span",{className:"text-violet-400",children:"-"}),E]},E))}),!N&&h(T,{href:u.href,className:"btn-ghost inline-flex items-center gap-1 text-sm",children:["Learn more ",s(B,{size:14})]})]},u.name)})}),h("div",{className:"card-subtle space-y-4 p-6",children:[s("h3",{className:"font-bold",children:"Quick Install"}),h("div",{className:"space-y-3",children:[h("div",{children:[s("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"CLI"}),s(J,{package:"contractspec",dev:!0})]}),h("div",{children:[s("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"VS Code Extension"}),s(_,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"})]})]})]}),h("div",{className:"flex items-center gap-4 pt-4",children:[h(T,{href:"/docs/getting-started/tools/cli",className:"btn-primary",children:["Get Started with CLI ",s(B,{size:16})]}),s(T,{href:"/docs/getting-started/tools/vscode",className:"btn-ghost",children:"VS Code Extension"})]})]})}import{CodeBlock as w}from"@contractspec/lib.design-system";import Z from"@contractspec/lib.ui-link";import{ChevronRight as x}from"lucide-react";import{jsx as o,jsxs as f}from"react/jsx-runtime";function j(){return f("div",{className:"space-y-8",children:[f("div",{className:"space-y-2",children:[o("h1",{className:"font-bold text-4xl",children:"Your First Operation"}),o("p",{className:"text-lg text-muted-foreground",children:"Build a payment capture operation with policy enforcement in under 10 minutes."})]}),f("div",{className:"space-y-6",children:[f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"What you'll build"}),o("p",{className:"text-muted-foreground",children:"A real-world payment processing operation that validates input, enforces business rules, integrates with Stripe, and audits every transaction. This is production-ready code, not a toy example."})]}),f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"1. Define the operation spec"}),f("p",{className:"text-muted-foreground",children:["Create ",o("code",{children:"lib/specs/billing/capture-payment.ts"}),":"]}),o(w,{language:"typescript",filename:"lib/specs/billing/capture-payment.ts",code:`import { defineCommand } from '@contractspec/lib.contracts-spec';
134
112
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
135
113
 
136
114
  const CapturePaymentInput = new SchemaModel({
@@ -224,14 +202,16 @@ const handler = makeNextAppHandler(registry, async (req) => {
224
202
  return { actor: 'user', userId: session.userId, tenantId: session.tenantId };
225
203
  });
226
204
 
227
- export { handler as GET, handler as POST };`})]}),f("div",{className:"card-subtle space-y-4 p-6",children:[o("h3",{className:"font-bold",children:"What you just built:"}),f("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[f("li",{children:["Type-safe API endpoint at"," ",o("code",{children:"/api/ops/billing.capturePayment"})]}),o("li",{children:"Automatic input validation (amount must be positive, IDs required)"}),o("li",{children:"Policy enforcement\u2014only invoice owner can pay"}),o("li",{children:"Stripe integration with error handling"}),o("li",{children:"Database transaction with audit trail"}),o("li",{children:"Same spec works with GraphQL, MCP, or webhooks"})]})]}),o("div",{className:"flex items-center gap-4 pt-4",children:f(Z,{href:"/docs/getting-started/dataviews",className:"btn-primary",children:["Next: Display Data with DataViews ",o(x,{size:16})]})})]})]})}import{CodeBlock as z,InstallCommand as L}from"@contractspec/lib.design-system";import ee from"@contractspec/lib.ui-link";import{ChevronRight as te}from"lucide-react";import{jsx as n,jsxs as g}from"react/jsx-runtime";function ae(){return g("div",{className:"space-y-8",children:[g("div",{className:"space-y-2",children:[n("h1",{className:"font-bold text-4xl",children:"Installation"}),n("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec to your existing Next.js or Bun project, or start fresh."})]}),g("div",{className:"space-y-6",children:[g("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"Prerequisites"}),g("ul",{className:"space-y-2 text-muted-foreground",children:[n("li",{children:"Node.js 20+ (or Bun 1.0+)"}),n("li",{children:"Existing Next.js app or Bun HTTP server"}),n("li",{children:"PostgreSQL database (for persistence)"})]})]}),g("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"Install Core Libraries"}),n("p",{className:"text-muted-foreground",children:"Add the contracts runtime and your choice of adapter:"}),n(L,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.schema"]})]}),g("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"For Next.js projects"}),n(L,{package:"@contractspec/lib.contracts-spec"})]}),g("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"For database models"}),n(L,{package:["@contractspec/app.cli-database","prisma","@prisma/client"]})]}),g("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"Set up your project"}),n("p",{className:"text-muted-foreground",children:"Initialize a new ContractSpec project structure:"}),n(z,{language:"bash",filename:"installation-init",code:`bunx contractspec init
228
- # Follow the interactive prompts to configure your project`})]}),g("div",{className:"space-y-3",children:[n("h2",{className:"font-bold text-2xl",children:"Initialize the database"}),n("p",{className:"text-muted-foreground",children:"If using Prisma, set up your schema and generate the client:"}),n(z,{language:"bash",filename:"installation-prisma",code:`bunx prisma init
205
+ export { handler as GET, handler as POST };`})]}),f("div",{className:"card-subtle space-y-4 p-6",children:[o("h3",{className:"font-bold",children:"What you just built:"}),f("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[f("li",{children:["Type-safe API endpoint at"," ",o("code",{children:"/api/ops/billing.capturePayment"})]}),o("li",{children:"Automatic input validation (amount must be positive, IDs required)"}),o("li",{children:"Policy enforcement\u2014only invoice owner can pay"}),o("li",{children:"Stripe integration with error handling"}),o("li",{children:"Database transaction with audit trail"}),o("li",{children:"Same spec works with GraphQL, MCP, or webhooks"})]})]}),o("div",{className:"flex items-center gap-4 pt-4",children:f(Z,{href:"/docs/getting-started/dataviews",className:"btn-primary",children:["Next: Display Data with DataViews ",o(x,{size:16})]})})]})]})}import{CodeBlock as z,InstallCommand as R}from"@contractspec/lib.design-system";import ee from"@contractspec/lib.ui-link";import{ChevronRight as te}from"lucide-react";import{jsx as r,jsxs as g}from"react/jsx-runtime";function ae(){return g("div",{className:"space-y-8",children:[g("div",{className:"space-y-2",children:[r("h1",{className:"font-bold text-4xl",children:"Installation"}),r("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec to your existing Next.js or Bun project, or start fresh."})]}),g("div",{className:"space-y-6",children:[g("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"Prerequisites"}),g("ul",{className:"space-y-2 text-muted-foreground",children:[r("li",{children:"Node.js 20+ (or Bun 1.0+)"}),r("li",{children:"Existing Next.js app or Bun HTTP server"}),r("li",{children:"PostgreSQL database (for persistence)"})]})]}),g("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"Install Core Libraries"}),r("p",{className:"text-muted-foreground",children:"Add the contracts runtime and your choice of adapter:"}),r(R,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.schema"]})]}),g("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"For Next.js projects"}),r(R,{package:"@contractspec/lib.contracts-spec"})]}),g("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"For database models"}),r(R,{package:["@contractspec/app.cli-database","prisma","@prisma/client"]})]}),g("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"Set up your project"}),r("p",{className:"text-muted-foreground",children:"Initialize a new ContractSpec project structure:"}),r(z,{language:"bash",filename:"installation-init",code:`bunx contractspec init
206
+ # Follow the interactive prompts to configure your project`})]}),g("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"Initialize the database"}),r("p",{className:"text-muted-foreground",children:"If using Prisma, set up your schema and generate the client:"}),r(z,{language:"bash",filename:"installation-prisma",code:`bunx prisma init
229
207
  # Edit prisma/schema.prisma with your models
230
208
  bunx prisma generate
231
- bunx prisma migrate dev --name init`})]}),n("div",{className:"flex items-center gap-4 pt-4",children:g(ee,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: First Operation ",n(te,{size:16})]})})]})]})}import{CodeBlock as R,InstallCommand as O}from"@contractspec/lib.design-system";import T from"@contractspec/lib.ui-link";import{ChevronRight as ie}from"lucide-react";import{jsx as m,jsxs as v}from"react/jsx-runtime";function oe(){return v("div",{className:"space-y-8",children:[v("div",{className:"space-y-2",children:[m("h1",{className:"font-bold text-4xl",children:"Start here"}),m("p",{className:"text-lg text-muted-foreground",children:"A fast onboarding path from install to your first generated contract."})]}),v("div",{className:"space-y-6",children:[v("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Install the CLI"}),m(O,{package:"contractspec",dev:!0})]}),v("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Add core libraries"}),m(O,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.schema"]})]}),v("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Initialize your project"}),m(R,{language:"bash",filename:"start-here-init",code:"bunx contractspec init"})]}),v("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Create your first contract"}),m(R,{language:"bash",filename:"start-here-create",code:"contractspec create --type operation"})]}),v("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Generate implementation"}),m(R,{language:"bash",filename:"start-here-build",code:`contractspec build src/contracts/mySpec.ts
232
- contractspec validate src/contracts/mySpec.ts`})]})]}),v("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[v(T,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: Hello World ",m(ie,{size:16})]}),m(T,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),m(T,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"})]})]})}import{CodeBlock as ne}from"@contractspec/lib.design-system";import D from"@contractspec/lib.ui-link";import{ChevronRight as re}from"lucide-react";import{jsx as r,jsxs as d}from"react/jsx-runtime";function ce(){return d("div",{className:"space-y-8",children:[d("div",{className:"space-y-2",children:[r("h1",{className:"font-bold text-4xl",children:"Troubleshooting"}),r("p",{className:"text-lg text-muted-foreground",children:"Common issues and fixes when installing or generating with ContractSpec."})]}),d("div",{className:"space-y-6",children:[d("div",{className:"card-subtle space-y-3 p-6",children:[r("h2",{className:"font-bold text-2xl",children:"Command not found"}),d("ul",{className:"space-y-2 text-muted-foreground",children:[r("li",{children:"Reinstall the CLI and ensure it is in your PATH."}),r("li",{children:"Confirm Node.js 20+ or Bun 1.0+ is installed."})]})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[r("h2",{className:"font-bold text-2xl",children:"Specs not discovered"}),d("ul",{className:"space-y-2 text-muted-foreground",children:[d("li",{children:["Run ",r("code",{children:"contractspec list"})," to see discovered specs."]}),r("li",{children:"Verify your spec path conventions in .contractsrc.json."})]})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[r("h2",{className:"font-bold text-2xl",children:"Build or validate fails"}),d("ul",{className:"space-y-2 text-muted-foreground",children:[d("li",{children:["Run ",r("code",{children:"contractspec validate"})," to surface schema errors."]}),r("li",{children:"Check that generated files were not manually edited."})]})]}),d("div",{className:"space-y-3",children:[r("h2",{className:"font-bold text-2xl",children:"Diagnostics"}),r(ne,{language:"bash",filename:"troubleshooting-diagnostics",code:`contractspec --version
209
+ bunx prisma migrate dev --name init`})]}),r("div",{className:"flex items-center gap-4 pt-4",children:g(ee,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: First Operation ",r(te,{size:16})]})})]})]})}import{CodeBlock as S,InstallCommand as ie}from"@contractspec/lib.design-system";import A from"@contractspec/lib.ui-link";import{ChevronRight as oe}from"lucide-react";import{jsx as m,jsxs as y}from"react/jsx-runtime";function ne(){return y("div",{className:"space-y-8",children:[y("div",{className:"space-y-2",children:[m("h1",{className:"font-bold text-4xl",children:"Start here"}),m("p",{className:"text-lg text-muted-foreground",children:"A fast onboarding path from install to your first generated contract."})]}),y("div",{className:"space-y-6",children:[y("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Install the CLI"}),m(ie,{package:"contractspec",dev:!0})]}),y("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Generate repo-local guidance"}),m(S,{language:"bash",filename:"start-here-onboard",code:`contractspec onboard
210
+ # optional focused track
211
+ contractspec onboard knowledge --example knowledge-canon`})]}),y("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Initialize your project"}),m(S,{language:"bash",filename:"start-here-init",code:"bunx contractspec init"})]}),y("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Author your first contract"}),m(S,{language:"bash",filename:"start-here-create",code:"contractspec create --type operation"})]}),y("div",{className:"space-y-3",children:[m("h2",{className:"font-bold text-2xl",children:"Generate implementation"}),m(S,{language:"bash",filename:"start-here-build",code:`contractspec generate
212
+ contractspec validate`})]})]}),y("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[y(A,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: Hello World ",m(oe,{size:16})]}),m(A,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),m(A,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"})]})]})}import{CodeBlock as re}from"@contractspec/lib.design-system";import D from"@contractspec/lib.ui-link";import{ChevronRight as ce}from"lucide-react";import{jsx as c,jsxs as d}from"react/jsx-runtime";function le(){return d("div",{className:"space-y-8",children:[d("div",{className:"space-y-2",children:[c("h1",{className:"font-bold text-4xl",children:"Troubleshooting"}),c("p",{className:"text-lg text-muted-foreground",children:"Common issues and fixes when installing or generating with ContractSpec."})]}),d("div",{className:"space-y-6",children:[d("div",{className:"card-subtle space-y-3 p-6",children:[c("h2",{className:"font-bold text-2xl",children:"Command not found"}),d("ul",{className:"space-y-2 text-muted-foreground",children:[c("li",{children:"Reinstall the CLI and ensure it is in your PATH."}),c("li",{children:"Confirm Node.js 20+ or Bun 1.0+ is installed."})]})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[c("h2",{className:"font-bold text-2xl",children:"Specs not discovered"}),d("ul",{className:"space-y-2 text-muted-foreground",children:[d("li",{children:["Run ",c("code",{children:"contractspec list"})," to see discovered specs."]}),c("li",{children:"Verify your spec path conventions in .contractsrc.json."})]})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[c("h2",{className:"font-bold text-2xl",children:"Build or validate fails"}),d("ul",{className:"space-y-2 text-muted-foreground",children:[d("li",{children:["Run ",c("code",{children:"contractspec validate"})," to surface schema errors."]}),c("li",{children:"Check that generated files were not manually edited."})]})]}),d("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"Diagnostics"}),c(re,{language:"bash",filename:"troubleshooting-diagnostics",code:`contractspec --version
233
213
  contractspec list
234
- contractspec validate src/contracts/mySpec.ts`})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[r("h2",{className:"font-bold text-2xl",children:"Still blocked?"}),d("ul",{className:"space-y-2 text-muted-foreground",children:[r("li",{children:"Confirm compatibility requirements for runtime and framework."}),r("li",{children:"Re-run builds on a clean branch to isolate changes."}),r("li",{children:"Use a new spec and minimal adapter to validate setup."})]})]})]}),d("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[r(D,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),r(D,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"}),d(D,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",r(re,{size:16})]})]})]})}import{CodeBlock as le}from"@contractspec/lib.design-system";import F from"@contractspec/lib.ui-link";import{ChevronRight as se,ExternalLink as de}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function at(){let S=[{category:"Core Functionality",items:["Real-time validation with instant feedback on spec errors","Build/Scaffold handlers and components from specs","Interactive spec creation wizard","Watch mode for auto-rebuild on changes","Sync all specs in workspace with one command"]},{category:"Visual Navigation",items:["Specs Explorer sidebar with organized tree view","Dependencies view to visualize spec relationships","Build Results tracking with history","Circular dependency detection"]},{category:"Comparison & Export",items:["Semantic and text diff between specs","Git comparison with baseline branches","OpenAPI 3.1 specification export"]}],u=[{name:"Create New Spec",description:"Interactive wizard to create specs"},{name:"Validate Current Spec",description:"Validate the currently open spec"},{name:"Build/Scaffold from Current Spec",description:"Generate handler/component"},{name:"Toggle Watch Mode",description:"Auto-rebuild on changes"},{name:"Sync All Specs",description:"Build all specs in workspace"},{name:"Analyze Spec Dependencies",description:"Visualize spec dependencies"},{name:"Compare Specs",description:"Semantic or text diff between specs"},{name:"Export to OpenAPI",description:"Generate OpenAPI specification"}];return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-2",children:[e("h1",{className:"font-bold text-4xl",children:"VS Code Extension"}),e("p",{className:"text-lg text-muted-foreground",children:"Spec-first development directly in VS Code. Validate, scaffold, and explore your contract specifications with real-time feedback."})]}),t("div",{className:"flex flex-wrap gap-3",children:[t("a",{href:"https://marketplace.visualstudio.com/items?itemName=lssm.vscode-contractspec",target:"_blank",rel:"noopener noreferrer",className:"btn-primary inline-flex items-center gap-2",children:["Install Extension ",e(de,{size:16})]}),e("a",{href:"vscode:extension/lssm.vscode-contractspec",className:"btn-ghost inline-flex items-center gap-2",children:"Open in VS Code"})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),t("div",{className:"space-y-2",children:[t("p",{className:"text-muted-foreground text-sm",children:[e("strong",{children:"Option 1:"})," Install from VS Code Marketplace"]}),e(le,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"}),t("p",{className:"mt-4 text-muted-foreground text-sm",children:[e("strong",{children:"Option 2:"}),' Search for "ContractSpec" in VS Code Extensions (Ctrl/Cmd+Shift+X)']})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Features"}),e("div",{className:"grid gap-4 md:grid-cols-3",children:S.map((y)=>t("div",{className:"card-subtle space-y-3 p-4",children:[e("h3",{className:"font-bold text-violet-400",children:y.category}),e("ul",{className:"space-y-2",children:y.items.map((N)=>t("li",{className:"flex items-start gap-2 text-muted-foreground text-sm",children:[e("span",{className:"mt-1 text-violet-400",children:"-"}),e("span",{children:N})]},N))})]},y.category))})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Commands"}),t("p",{className:"text-muted-foreground",children:["Access commands via Command Palette (Ctrl/Cmd+Shift+P) with prefix"," ",e("code",{children:"ContractSpec:"})]}),e("div",{className:"grid gap-3 md:grid-cols-2",children:u.map((y)=>e("div",{className:"card-subtle flex items-center gap-3 p-3",children:t("div",{className:"flex-1",children:[e("p",{className:"font-medium font-mono text-sm",children:y.name}),e("p",{className:"text-muted-foreground text-xs",children:y.description})]})},y.name))})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Sidebar Views"}),e("p",{className:"text-muted-foreground",children:"The extension adds a ContractSpec activity bar (icon in sidebar) with three views:"}),t("div",{className:"grid gap-4 md:grid-cols-3",children:[t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Specs Explorer"}),e("p",{className:"text-muted-foreground text-sm",children:"Browse all specs organized by type. Shows name, version, and stability. Click to open, right-click for actions."})]}),t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Dependencies"}),e("p",{className:"text-muted-foreground text-sm",children:"Visualize spec relationships. Detect circular dependencies. Navigate to referenced specs."})]}),t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Build Results"}),e("p",{className:"text-muted-foreground text-sm",children:"Track build history (last 20). Success/failure indicators. Click to open generated files."})]})]})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Getting Started"}),t("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Install the extension from VS Code Marketplace"}),e("li",{children:"Open a workspace with ContractSpec files (or create one)"}),e("li",{children:"Start the walkthrough: Help - Welcome - ContractSpec"}),t("li",{children:["Create your first spec: Click ",e("strong",{children:"+"})," in Specs Explorer or run ",e("code",{children:"ContractSpec: Create New Spec"})]}),e("li",{children:"Build from it: Click the build icon in the editor title bar"})]})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h3",{className:"font-bold",children:"Configuration"}),e("p",{className:"text-muted-foreground text-sm",children:"Configure the extension in VS Code Settings:"}),e("div",{className:"overflow-x-auto",children:t("table",{className:"w-full text-muted-foreground text-sm",children:[e("thead",{children:t("tr",{className:"border-border border-b",children:[e("th",{className:"p-2 text-left font-medium",children:"Setting"}),e("th",{className:"p-2 text-left font-medium",children:"Description"}),e("th",{className:"p-2 text-left font-medium",children:"Default"})]})}),t("tbody",{children:[t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"validation.onSave"}),e("td",{className:"p-2",children:"Run validation on save"}),e("td",{className:"p-2",children:"true"})]}),t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"validation.onOpen"}),e("td",{className:"p-2",children:"Run validation on open"}),e("td",{className:"p-2",children:"true"})]}),t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"api.baseUrl"}),e("td",{className:"p-2",children:"Base URL for ContractSpec API"}),e("td",{className:"p-2",children:"(empty)"})]})]})]})})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[e(F,{href:"/docs/getting-started/tools/cli",className:"btn-ghost",children:"Back: CLI"}),t(F,{href:"/docs/specs",className:"btn-primary",children:["Next: Core Concepts ",e(se,{size:16})]})]})]})}import{registerDocBlocks as pe}from"@contractspec/lib.contracts-spec/docs";var me=[{id:"docs.getting-started.start-here",title:"Start here",summary:"Fast onboarding path from install to first generated contract.",kind:"usage",visibility:"public",route:"/docs/getting-started/start-here",tags:["getting-started","onboarding"],body:`# Start Here
214
+ contractspec validate src/contracts/mySpec.ts`})]}),d("div",{className:"card-subtle space-y-3 p-6",children:[c("h2",{className:"font-bold text-2xl",children:"Still blocked?"}),d("ul",{className:"space-y-2 text-muted-foreground",children:[c("li",{children:"Confirm compatibility requirements for runtime and framework."}),c("li",{children:"Re-run builds on a clean branch to isolate changes."}),c("li",{children:"Use a new spec and minimal adapter to validate setup."})]})]})]}),d("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[c(D,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),c(D,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"}),d(D,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",c(ce,{size:16})]})]})]})}import{CodeBlock as se}from"@contractspec/lib.design-system";import O from"@contractspec/lib.ui-link";import{ChevronRight as de,ExternalLink as pe}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function it(){let k=[{category:"Core Functionality",items:["Real-time validation with instant feedback on spec errors","Build/Scaffold handlers and components from specs","Interactive spec creation wizard","Watch mode for auto-rebuild on changes","Sync all specs in workspace with one command"]},{category:"Visual Navigation",items:["Specs Explorer sidebar with organized tree view","Dependencies view to visualize spec relationships","Build Results tracking with history","Circular dependency detection"]},{category:"Comparison & Export",items:["Semantic and text diff between specs","Git comparison with baseline branches","OpenAPI 3.1 specification export"]}],u=[{name:"Create New Spec",description:"Interactive wizard to create specs"},{name:"Validate Current Spec",description:"Validate the currently open spec"},{name:"Build/Scaffold from Current Spec",description:"Generate handler/component"},{name:"Toggle Watch Mode",description:"Auto-rebuild on changes"},{name:"Sync All Specs",description:"Build all specs in workspace"},{name:"Analyze Spec Dependencies",description:"Visualize spec dependencies"},{name:"Compare Specs",description:"Semantic or text diff between specs"},{name:"Export to OpenAPI",description:"Generate OpenAPI specification"}];return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-2",children:[e("h1",{className:"font-bold text-4xl",children:"VS Code Extension"}),e("p",{className:"text-lg text-muted-foreground",children:"Spec-first development directly in VS Code. Validate, scaffold, and explore your contract specifications with real-time feedback."})]}),t("div",{className:"flex flex-wrap gap-3",children:[t("a",{href:"https://marketplace.visualstudio.com/items?itemName=lssm.vscode-contractspec",target:"_blank",rel:"noopener noreferrer",className:"btn-primary inline-flex items-center gap-2",children:["Install Extension ",e(pe,{size:16})]}),e("a",{href:"vscode:extension/lssm.vscode-contractspec",className:"btn-ghost inline-flex items-center gap-2",children:"Open in VS Code"})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),t("div",{className:"space-y-2",children:[t("p",{className:"text-muted-foreground text-sm",children:[e("strong",{children:"Option 1:"})," Install from VS Code Marketplace"]}),e(se,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"}),t("p",{className:"mt-4 text-muted-foreground text-sm",children:[e("strong",{children:"Option 2:"}),' Search for "ContractSpec" in VS Code Extensions (Ctrl/Cmd+Shift+X)']})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Features"}),e("div",{className:"grid gap-4 md:grid-cols-3",children:k.map((b)=>t("div",{className:"card-subtle space-y-3 p-4",children:[e("h3",{className:"font-bold text-violet-400",children:b.category}),e("ul",{className:"space-y-2",children:b.items.map((N)=>t("li",{className:"flex items-start gap-2 text-muted-foreground text-sm",children:[e("span",{className:"mt-1 text-violet-400",children:"-"}),e("span",{children:N})]},N))})]},b.category))})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Commands"}),t("p",{className:"text-muted-foreground",children:["Access commands via Command Palette (Ctrl/Cmd+Shift+P) with prefix"," ",e("code",{children:"ContractSpec:"})]}),e("div",{className:"grid gap-3 md:grid-cols-2",children:u.map((b)=>e("div",{className:"card-subtle flex items-center gap-3 p-3",children:t("div",{className:"flex-1",children:[e("p",{className:"font-medium font-mono text-sm",children:b.name}),e("p",{className:"text-muted-foreground text-xs",children:b.description})]})},b.name))})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Sidebar Views"}),e("p",{className:"text-muted-foreground",children:"The extension adds a ContractSpec activity bar (icon in sidebar) with three views:"}),t("div",{className:"grid gap-4 md:grid-cols-3",children:[t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Specs Explorer"}),e("p",{className:"text-muted-foreground text-sm",children:"Browse all specs organized by type. Shows name, version, and stability. Click to open, right-click for actions."})]}),t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Dependencies"}),e("p",{className:"text-muted-foreground text-sm",children:"Visualize spec relationships. Detect circular dependencies. Navigate to referenced specs."})]}),t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Build Results"}),e("p",{className:"text-muted-foreground text-sm",children:"Track build history (last 20). Success/failure indicators. Click to open generated files."})]})]})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Getting Started"}),t("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Install the extension from VS Code Marketplace"}),e("li",{children:"Open a workspace with ContractSpec files (or create one)"}),e("li",{children:"Start the walkthrough: Help - Welcome - ContractSpec"}),t("li",{children:["Create your first spec: Click ",e("strong",{children:"+"})," in Specs Explorer or run ",e("code",{children:"ContractSpec: Create New Spec"})]}),e("li",{children:"Build from it: Click the build icon in the editor title bar"})]})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h3",{className:"font-bold",children:"Configuration"}),e("p",{className:"text-muted-foreground text-sm",children:"Configure the extension in VS Code Settings:"}),e("div",{className:"overflow-x-auto",children:t("table",{className:"w-full text-muted-foreground text-sm",children:[e("thead",{children:t("tr",{className:"border-border border-b",children:[e("th",{className:"p-2 text-left font-medium",children:"Setting"}),e("th",{className:"p-2 text-left font-medium",children:"Description"}),e("th",{className:"p-2 text-left font-medium",children:"Default"})]})}),t("tbody",{children:[t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"validation.onSave"}),e("td",{className:"p-2",children:"Run validation on save"}),e("td",{className:"p-2",children:"true"})]}),t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"validation.onOpen"}),e("td",{className:"p-2",children:"Run validation on open"}),e("td",{className:"p-2",children:"true"})]}),t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"api.baseUrl"}),e("td",{className:"p-2",children:"Base URL for ContractSpec API"}),e("td",{className:"p-2",children:"(empty)"})]})]})]})})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[e(O,{href:"/docs/getting-started/tools/cli",className:"btn-ghost",children:"Back: CLI"}),t(O,{href:"/docs/specs",className:"btn-primary",children:["Next: Core Concepts ",e(de,{size:16})]})]})]})}import{registerDocBlocks as me}from"@contractspec/lib.contracts-spec/docs";var ue=[{id:"docs.getting-started.start-here",title:"Start here",summary:"Fast onboarding path from install to first generated contract.",kind:"usage",visibility:"public",route:"/docs/getting-started/start-here",tags:["getting-started","onboarding"],body:`# Start Here
235
215
 
236
216
  Get ContractSpec running quickly and generate your first contract-backed code.
237
217
 
@@ -330,4 +310,4 @@ ContractSpec supports modern TypeScript stacks with spec-first workflows.
330
310
 
331
311
  - PostgreSQL via Prisma
332
312
  - Bring your own adapter for other databases
333
- `}];pe(me);export{at as VSCodeExtensionPage,ce as TroubleshootingPage,oe as StartHerePage,ae as InstallationPage,j as HelloWorldPage,De as DeveloperToolsPage,U as DataViewTutorialPage,G as CompatibilityPage,M as CLIPage};
313
+ `}];me(ue);export{it as VSCodeExtensionPage,le as TroubleshootingPage,ne as StartHerePage,ae as InstallationPage,j as HelloWorldPage,De as DeveloperToolsPage,Q as DataViewTutorialPage,W as CompatibilityPage,H as CLIPage};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{CodeBlock as c}from"@contractspec/lib.design-system";import a from"@contractspec/lib.ui-link";import{ChevronRight as o}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var s=[".contractspec/connect/context-pack.json",".contractspec/connect/plan-packet.json",".contractspec/connect/patch-verdict.json",".contractspec/connect/audit.ndjson",".contractspec/connect/decisions/<decisionId>/"];function d(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"Use Connect in a repo"}),e("p",{className:"text-lg text-muted-foreground",children:"Put coding-agent edits and shell commands behind task-scoped context, plan compilation, verification, and local review evidence without introducing a second control plane."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll build"}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"A workspace-level Connect config in `.contractsrc.json`."}),e("li",{children:"A context and plan flow for one task."}),e("li",{children:"Verified file and shell mutations with local review/replay evidence."})]})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Enable Connect"}),e("p",{className:"text-muted-foreground text-sm",children:"Start by making the safety policy explicit. Protected paths, generated paths, review thresholds, and command rules live in the workspace config, not in editor-specific hooks."}),e(c,{language:"json",filename:".contractsrc.json",code:`{
2
+ import{CodeBlock as c}from"@contractspec/lib.design-system";import a from"@contractspec/lib.ui-link";import{ChevronRight as o}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var r=[".contractspec/connect/context-pack.json",".contractspec/connect/plan-packet.json",".contractspec/connect/patch-verdict.json",".contractspec/connect/audit.ndjson",".contractspec/connect/decisions/<decisionId>/",".contractspec/adoption/catalog.json",".contractspec/adoption/overrides.json"];function d(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"Use Connect in a repo"}),e("p",{className:"text-lg text-muted-foreground",children:"Put coding-agent edits and shell commands behind task-scoped context, plan compilation, verification, and local review evidence without introducing a second control plane."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll build"}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"A workspace-level Connect config in `.contractsrc.json`."}),e("li",{children:"A reuse-first adoption check before new implementation work."}),e("li",{children:"A context and plan flow for one task."}),e("li",{children:"Verified file and shell mutations with local review/replay evidence."})]})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Enable Connect"}),e("p",{className:"text-muted-foreground text-sm",children:"Start by making the safety policy explicit. Protected paths, generated paths, review thresholds, and command rules live in the workspace config, not in editor-specific hooks."}),e(c,{language:"json",filename:".contractsrc.json",code:`{
3
3
  "connect": {
4
4
  "enabled": true,
5
5
  "storage": {
@@ -24,19 +24,44 @@ import{CodeBlock as c}from"@contractspec/lib.design-system";import a from"@contr
24
24
  "allow": ["bun run typecheck"],
25
25
  "review": ["git push"],
26
26
  "deny": ["git reset --hard", "git push --force", "rm -rf"]
27
+ },
28
+ "adoption": {
29
+ "enabled": true,
30
+ "catalog": {
31
+ "indexPath": ".contractspec/adoption/catalog.json",
32
+ "overrideManifestPath": ".contractspec/adoption/overrides.json"
33
+ },
34
+ "workspaceScan": {
35
+ "include": ["packages/**", "docs/**"],
36
+ "exclude": ["generated/**", "dist/**"]
37
+ },
38
+ "families": {
39
+ "contracts": true,
40
+ "runtime": true,
41
+ "sharedLibs": true
42
+ },
43
+ "thresholds": {
44
+ "workspaceReuse": "permit",
45
+ "contractspecReuse": "permit",
46
+ "ambiguous": "require_review",
47
+ "newImplementation": "require_review"
48
+ }
27
49
  }
28
50
  }
29
- }`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: Connect has enough policy to classify writes, commands, drift, and review thresholds deterministically."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Initialize storage"}),e(c,{language:"bash",filename:"connect-init",code:"contractspec connect init --scope workspace"}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: `.contractsrc.json` is updated if needed and `.contractspec/connect/` is created."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Project context and compile a plan"}),e("p",{className:"text-muted-foreground text-sm",children:"Use the task id as the thread that connects context, plan, verdict, and replay artifacts."}),e(c,{language:"bash",filename:"connect-plan",code:`contractspec connect context \\
51
+ }`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: Connect has enough policy to classify writes, commands, drift, and review thresholds deterministically."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Initialize storage"}),e(c,{language:"bash",filename:"connect-init",code:"contractspec connect init --scope workspace"}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: `.contractsrc.json` is updated if needed and `.contractspec/connect/` is created."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Mirror the adoption catalog and resolve reuse first"}),e("p",{className:"text-muted-foreground text-sm",children:"Connect adoption is the reuse-first layer for authoring. Mirror the local catalog, then resolve the best existing surface for the family you are about to touch before you scaffold or invent anything new."}),e(c,{language:"bash",filename:"connect-adoption",code:`contractspec connect adoption sync --json
52
+
53
+ printf '{"goal":"Prefer an existing release helper before adding a new one"}' | \\
54
+ contractspec connect adoption resolve --family sharedLibs --stdin --json`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: a mirrored local adoption catalog plus a reuse recommendation that can point to an existing workspace package or a ContractSpec surface before the task reaches file mutation."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"4) Project context and compile a plan"}),e("p",{className:"text-muted-foreground text-sm",children:"Use the task id as the thread that connects context, plan, verdict, and replay artifacts."}),e(c,{language:"bash",filename:"connect-plan",code:`contractspec connect context \\
30
55
  --task docs-connect \\
31
56
  --paths packages/libs/contracts-spec/src/control-plane/contracts.ts \\
32
57
  --json
33
58
 
34
59
  printf '{"objective":"Document the control-plane contract surface","commands":["bun run typecheck"]}' | \\
35
- contractspec connect plan --task docs-connect --stdin --json`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `ContextPack` and `PlanPacket` that point back to `controlPlane.intent.submit`, `controlPlane.plan.compile`, and `controlPlane.plan.verify`."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"4) Verify file and shell mutations"}),e(c,{language:"bash",filename:"connect-verify",code:`printf '{"operation":"edit","path":"packages/libs/contracts-spec/src/control-plane/contracts.ts"}' | \\
60
+ contractspec connect plan --task docs-connect --stdin --json`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `ContextPack` and `PlanPacket` that point back to `controlPlane.intent.submit`, `controlPlane.plan.compile`, and `controlPlane.plan.verify`."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"5) Verify file and shell mutations"}),e(c,{language:"bash",filename:"connect-verify",code:`printf '{"operation":"edit","path":"packages/libs/contracts-spec/src/control-plane/contracts.ts"}' | \\
36
61
  contractspec connect verify --task docs-connect --tool acp.fs.access --stdin --json
37
62
 
38
63
  printf 'bun run typecheck' | \\
39
- contractspec connect verify --task docs-connect --tool acp.terminal.exec --stdin --json`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `PatchVerdict` with `permit`, `rewrite`, `require_review`, or `deny`, plus a runtime-linked control-plane state when that linkage is available."})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Artifacts to inspect"}),e("ul",{className:"space-y-2 text-muted-foreground text-sm",children:s.map((n)=>e("li",{children:e("code",{children:n})},n))})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"5) Review, replay, and optional Studio sync"}),e(c,{language:"bash",filename:"connect-review-replay",code:`contractspec connect review list --json
64
+ contractspec connect verify --task docs-connect --tool acp.terminal.exec --stdin --json`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `PatchVerdict` with `permit`, `rewrite`, `require_review`, or `deny`, plus a runtime-linked control-plane state when that linkage is available."})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Artifacts to inspect"}),e("ul",{className:"space-y-2 text-muted-foreground text-sm",children:r.map((n)=>e("li",{children:e("code",{children:n})},n))})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"6) Review, replay, and optional Studio sync"}),e(c,{language:"bash",filename:"connect-review-replay",code:`contractspec connect review list --json
40
65
  contractspec connect replay <decisionId> --json
41
66
  contractspec connect eval <decisionId> --registry ./harness-registry.ts --scenario connect.safe-refactor --json
42
67
 
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{CodeBlock as o}from"@contractspec/lib.design-system";import a from"@contractspec/lib.ui-link";import{ChevronRight as n}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var i=["builder.workspace.bootstrap","builder.channel.receiveInbound","builder.blueprint.generate","builder.plan.compile","builder.preview.create","builder.preview.runHarness","builder.export.prepare","builder.export.approve","builder.export.execute"];function c(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"Host the Builder workbench"}),e("p",{className:"text-lg text-muted-foreground",children:"Use the reusable Builder workbench as the desktop control surface for snapshot loading, guided authoring, preview, readiness, export, and mobile review handoff."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll build"}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"A workspace snapshot fetch path."}),e("li",{children:"A `BuilderWorkbench` host with action callbacks."}),e("li",{children:"Runtime-mode aware preview/export controls plus mobile review links."})]})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Fetch the workspace snapshot"}),e("p",{className:"text-muted-foreground text-sm",children:"The web shell already exposes a query path for the current Builder workspace snapshot. Your host should load it first, then refresh it after each successful command."}),e(o,{language:"typescript",filename:"builder-workbench-controller.ts",code:`export async function fetchBuilderSnapshot(workspaceId: string) {
2
+ import{CodeBlock as o}from"@contractspec/lib.design-system";import r from"@contractspec/lib.ui-link";import{ChevronRight as n}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var i=["builder.workspace.bootstrap","builder.channel.receiveInbound","builder.blueprint.generate","builder.plan.compile","builder.preview.create","builder.preview.runHarness","builder.export.prepare","builder.export.approve","builder.export.execute"],s=["local runtime trust and lease details","channel-action posture for mobile/operator follow-up","comparison posture and export readiness from the shared snapshot"];function c(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"Host the Builder workbench"}),e("p",{className:"text-lg text-muted-foreground",children:"Use the reusable Builder workbench as the desktop control surface for snapshot loading, guided authoring, preview, readiness, export, and mobile review handoff."})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll build"}),t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[e("li",{children:"A workspace snapshot fetch path."}),e("li",{children:"A `BuilderWorkbench` host with action callbacks."}),e("li",{children:"Runtime-mode aware preview/export controls plus mobile review links."})]})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Fetch the workspace snapshot"}),e("p",{className:"text-muted-foreground text-sm",children:"The web shell already exposes a query path for the current Builder workspace snapshot. Your host should load it first, then refresh it after each successful command."}),e(o,{language:"typescript",filename:"builder-workbench-controller.ts",code:`export async function fetchBuilderSnapshot(workspaceId: string) {
3
3
  const response = await fetch(
4
4
  \`/api/operate/builder/queries/builder.workspace.snapshot?workspaceId=\${encodeURIComponent(workspaceId)}\`,
5
5
  { cache: "no-store" }
@@ -15,7 +15,7 @@ import{CodeBlock as o}from"@contractspec/lib.design-system";import a from"@contr
15
15
  throw new Error("Builder workspace snapshot query returned an error.");
16
16
  }
17
17
  return payload.result;
18
- }`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: one `BuilderWorkspaceSnapshot` containing workspace, plan, providers, runtime targets, preview, export, and mobile review state."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Host the workbench and refresh on action"}),e("p",{className:"text-muted-foreground text-sm",children:"The simplest host pattern is local state plus a small action wrapper that executes one Builder command and then refreshes the snapshot."}),e(o,{language:"tsx",filename:"BuilderWorkbenchHost.tsx",code:`import {
18
+ }`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: one `BuilderWorkspaceSnapshot` containing workspace, plan, providers, runtime targets, preview, export, mobile review state, and the operator posture needed for local trust, lease, and comparison status."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Host the workbench and refresh on action"}),e("p",{className:"text-muted-foreground text-sm",children:"The simplest host pattern is local state plus a small action wrapper that executes one Builder command and then refreshes the snapshot."}),e(o,{language:"tsx",filename:"BuilderWorkbenchHost.tsx",code:`import {
19
19
  BuilderWorkbench,
20
20
  useBuilderWorkbenchState,
21
21
  } from "@contractspec/module.builder-workbench/presentation";
@@ -46,14 +46,29 @@ async function runAction(commandKey: string, payload?: Record<string, unknown>)
46
46
  onApproveExport={() => runAction("builder.export.approve")}
47
47
  onExecuteExport={() => runAction("builder.export.execute")}
48
48
  selectedExportRuntimeMode="hybrid"
49
- />;`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: each successful action leaves the host with a fresh snapshot and keeps the workbench tabs aligned with current runtime state."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Bootstrap providers and routing policy explicitly"}),e("p",{className:"text-muted-foreground text-sm",children:"Builder v3 treats provider routing as policy, not heuristic. Use the workspace bootstrap command as the single managed-first setup path instead of orchestrating provider registration in the app shell."}),e(o,{language:"typescript",filename:"builder-bootstrap.ts",code:`await executeBuilderCommand({
49
+ />;`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: each successful action leaves the host with a fresh snapshot and keeps the workbench tabs aligned with current runtime state."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Persist Builder defaults in workspace config"}),e("p",{className:"text-muted-foreground text-sm",children:"The host should agree with the CLI and setup flows on the same control-plane defaults. For local or hybrid setups, keep the Builder API base URL, token env var, and local runtime metadata in `.contractsrc.json`."}),e(o,{language:"json",filename:".contractsrc.json",code:`{
50
+ "builder": {
51
+ "enabled": true,
52
+ "runtimeMode": "local",
53
+ "bootstrapPreset": "local_daemon_mvp",
54
+ "api": {
55
+ "baseUrl": "https://api.contractspec.io",
56
+ "controlPlaneTokenEnvVar": "CONTROL_PLANE_API_TOKEN"
57
+ },
58
+ "localRuntime": {
59
+ "runtimeId": "rt_local_daemon",
60
+ "grantedTo": "local:operator",
61
+ "providerIds": ["provider.codex", "provider.local.model"]
62
+ }
63
+ }
64
+ }`})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"4) Bootstrap providers and routing policy explicitly"}),e("p",{className:"text-muted-foreground text-sm",children:"Builder v3 treats provider routing as policy, not heuristic. Use the workspace bootstrap command as the single managed-first setup path instead of orchestrating provider registration in the app shell."}),e(o,{language:"typescript",filename:"builder-bootstrap.ts",code:`await executeBuilderCommand({
50
65
  commandKey: "builder.workspace.bootstrap",
51
66
  workspaceId,
52
67
  payload: {
53
68
  preset: "managed_mvp",
54
69
  includeLocalHelperProvider: true,
55
70
  },
56
- });`})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Common command keys"}),e("ul",{className:"space-y-2 text-muted-foreground text-sm",children:i.map((r)=>e("li",{children:e("code",{children:r})},r))})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"4) Keep runtime mode explicit"}),e("p",{className:"text-muted-foreground text-sm",children:"Preview and export flows are runtime-mode aware. The host chooses between `managed`, `local`, and `hybrid` and passes that choice into preview or export commands instead of hiding it behind provider selection heuristics."}),e(o,{language:"typescript",filename:"runtime-mode",code:`const [selectedExportRuntimeMode, setSelectedExportRuntimeMode] =
71
+ });`})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Common command keys"}),e("ul",{className:"space-y-2 text-muted-foreground text-sm",children:i.map((a)=>e("li",{children:e("code",{children:a})},a))})]}),t("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"Snapshot-backed operator details"}),e("ul",{className:"space-y-2 text-muted-foreground text-sm",children:s.map((a)=>e("li",{children:a},a))})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"5) Keep runtime mode explicit"}),e("p",{className:"text-muted-foreground text-sm",children:"Preview and export flows are runtime-mode aware. The host chooses between `managed`, `local`, and `hybrid` and passes that choice into preview or export commands instead of hiding it behind provider selection heuristics."}),e(o,{language:"typescript",filename:"runtime-mode",code:`const [selectedExportRuntimeMode, setSelectedExportRuntimeMode] =
57
72
  React.useState(resolveBuilderExportRuntimeMode(initialSnapshot));
58
73
 
59
74
  await executeBuilderCommand({
@@ -62,9 +77,9 @@ await executeBuilderCommand({
62
77
  payload: {
63
78
  runtimeMode: selectedExportRuntimeMode,
64
79
  },
65
- });`})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"5) Link mobile review flows"}),e("p",{className:"text-muted-foreground text-sm",children:"When a patch proposal, approval ticket, or incident needs operator follow-up away from the desktop workbench, deep-link into the mobile review route instead of inventing a separate data model."}),e(o,{language:"typescript",filename:"mobile-review-path.ts",code:`export function buildBuilderMobileReviewPath(
80
+ });`})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"6) Link mobile review flows"}),e("p",{className:"text-muted-foreground text-sm",children:"When a patch proposal, approval ticket, or incident needs operator follow-up away from the desktop workbench, deep-link into the mobile review route instead of inventing a separate data model."}),e(o,{language:"typescript",filename:"mobile-review-path.ts",code:`export function buildBuilderMobileReviewPath(
66
81
  workspaceId: string,
67
82
  cardId: string
68
83
  ) {
69
84
  return \`/operate/builder/workspaces/\${encodeURIComponent(workspaceId)}/mobile-review/\${encodeURIComponent(cardId)}\`;
70
- }`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: the same Builder workspace state stays visible from desktop workbench and mobile review surfaces."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"6) Keep Connect adjacent, not embedded"}),e("p",{className:"text-muted-foreground text-sm",children:"Builder owns the authoring control plane. When Builder delegates into coding repositories, enable Connect in those target workspaces for context packs, mutation verification, replay, and review packets, but do not replace Builder contracts with Connect artifacts."}),e(o,{language:"bash",filename:"connect-init.sh",code:"contractspec connect init --scope workspace"})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[t(a,{href:"/docs/specs/builder-control-plane",className:"btn-primary",children:["Back to Builder control plane ",e(n,{size:16})]}),e(a,{href:"/docs/studio",className:"btn-ghost",children:"Studio overview"})]})]})}export{c as GuideHostBuilderWorkbenchPage};
85
+ }`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: the same Builder workspace state stays visible from desktop workbench and mobile review surfaces."})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"7) Keep Connect adjacent, not embedded"}),e("p",{className:"text-muted-foreground text-sm",children:"Builder owns the authoring control plane. When Builder delegates into coding repositories, enable Connect in those target workspaces for context packs, mutation verification, replay, and review packets, but do not replace Builder contracts with Connect artifacts."}),e(o,{language:"bash",filename:"connect-init.sh",code:"contractspec connect init --scope workspace"})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[t(r,{href:"/docs/specs/builder-control-plane",className:"btn-primary",children:["Back to Builder control plane ",e(n,{size:16})]}),e(r,{href:"/docs/studio",className:"btn-ghost",children:"Studio overview"})]})]})}export{c as GuideHostBuilderWorkbenchPage};
@@ -0,0 +1 @@
1
+ export declare function GuideReleaseCapsulesPage(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ // @bun
2
+ import{CodeBlock as t}from"@contractspec/lib.design-system";import c from"@contractspec/lib.ui-link";import{ChevronRight as r}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";var l=["root `README.md` and generated root `AGENTS.md` inputs when contributor or operator workflow changes","the nearest package `README.md` and `AGENTS.md` for any touched public package surface","website docs and `/llms*` summaries when the release changes how users or contributors should work"];function d(){return a("div",{className:"space-y-8",children:[a("div",{className:"space-y-3",children:[e("h1",{className:"font-bold text-4xl",children:"Author release capsules"}),e("p",{className:"text-lg text-muted-foreground",children:"Pair each publishable changeset with a structured release capsule so changelog, upgrade, and docs surfaces all read from the same release source of truth."})]}),a("div",{className:"card-subtle space-y-4 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"What you'll build"}),a("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[a("li",{children:["A ",e("code",{children:".changeset/<slug>.md"})," file for package/version intent."]}),a("li",{children:["A ",e("code",{children:".changeset/<slug>.release.yaml"})," companion for audiences, migrations, validation, and evidence."]}),e("li",{children:"Generated release artifacts that the website changelog and upgrade flows can consume safely."})]})]}),a("div",{className:"space-y-6",children:[a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"1) Create the paired changeset files"}),e("p",{className:"text-muted-foreground text-sm",children:"The Markdown file states the package bumps and reader-facing change intent. The YAML file carries the structured release metadata."}),e(t,{language:"yaml",filename:".changeset/contract-dx-first-slice.release.yaml",code:`schemaVersion: "1"
3
+ slug: contract-dx-first-slice
4
+ summary: Improve app-config, theme, and feature authoring with explicit validation and shared setup alignment.
5
+ isBreaking: false
6
+ packages:
7
+ - name: "@contractspec/lib.contracts-spec"
8
+ releaseType: minor
9
+ validation:
10
+ commands:
11
+ - "cd packages/libs/contracts-spec && bun run test && bun run typecheck"
12
+ evidence:
13
+ - "Package-level validation entrypoints now back setup, docs, and CLI authoring flows."`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: every publishable slug has both the human-facing changeset and the structured release capsule beside it."})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"2) Use the release authoring commands instead of raw drift-prone edits"}),e(t,{language:"bash",filename:"release-authoring",code:`contractspec release init --summary "Improve app-config, theme, and feature authoring"
14
+
15
+ # Or revise an existing capsule with the guided flow
16
+ contractspec release edit contract-dx-first-slice`}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: the CLI scaffolds or revises the paired files with the current release schema instead of leaving maintainers to hand-roll YAML structure."})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"3) Build the generated release artifacts before consuming them"}),e(t,{language:"bash",filename:"release-build",code:"contractspec release build"}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: `generated/releases/manifest.json`, `generated/releases/upgrade-manifest.json`, and the related customer/maintainer guidance files are refreshed from the release capsules."})]}),a("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"4) Enforce completeness before publishing or building the changelog"}),e(t,{language:"bash",filename:"release-check",code:"contractspec release check --strict"}),e("p",{className:"text-muted-foreground text-sm",children:"Expected output: missing capsules, incomplete migration guidance, or stale generated release artifacts are flagged before the website changelog or publish workflow treats the release data as canonical."})]}),a("div",{className:"card-subtle space-y-3 p-6",children:[e("h3",{className:"font-semibold text-lg",children:"5) Sync the public docs if workflow expectations changed"}),e("ul",{className:"space-y-2 text-muted-foreground text-sm",children:l.map((s)=>e("li",{children:s},s))})]})]}),a("div",{className:"flex items-center gap-4 pt-4",children:[a(c,{href:"/docs/guides/connect-in-a-repo",className:"btn-primary",children:["Connect guide ",e(r,{size:16})]}),e(c,{href:"/changelog",className:"btn-ghost",children:"Website changelog"})]})]})}export{d as GuideReleaseCapsulesPage};
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{CodeBlock as a}from"@contractspec/lib.design-system";import n from"@contractspec/lib.ui-link";import{ArrowRight as o,CheckCircle2 as r,GitBranch as s}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var d=[{title:"Adopt one endpoint in Next.js",description:"Start inside a live app with one operation, one generated surface, and one clearly bounded change.",href:"/docs/guides/nextjs-one-endpoint",time:"25 min"},{title:"Import an existing codebase",description:"Stabilize what already exists instead of treating adoption as a rewrite project.",href:"/docs/guides/import-existing-codebases",time:"20 min"},{title:"Validation and typing",description:"Keep runtime validation and TypeScript behavior aligned from the same source definitions.",href:"/docs/guides/spec-validation-and-typing",time:"20 min"},{title:"Generate docs and clients",description:"Publish stable docs, schemas, and client-facing artifacts from the contract layer.",href:"/docs/guides/generate-docs-clients-schemas",time:"20 min"},{title:"Docs pipeline",description:"Feed generated reference material into the docs site without confusing ownership.",href:"/docs/guides/docs-generation-pipeline",time:"20 min"},{title:"Build a first module bundle",description:"Define one bundle spec, resolve a surface plan, and render it through the React host layer.",href:"/docs/guides/first-module-bundle",time:"20 min"},{title:"Host the Builder workbench",description:"Wire a Builder workspace snapshot, common commands, runtime modes, and mobile review links into the reusable host.",href:"/docs/guides/host-builder-workbench",time:"20 min"},{title:"Use Connect in a repo",description:"Enable Connect, verify agent actions locally, and inspect the resulting review and replay artifacts.",href:"/docs/guides/connect-in-a-repo",time:"15 min"},{title:"CI diff gating",description:"Use deterministic checks to catch drift and risky changes before they ship.",href:"/docs/guides/ci-contract-diff-gating",time:"15 min"}];function p(){return t("div",{className:"space-y-10",children:[t("div",{className:"space-y-3",children:[e("p",{className:"editorial-kicker",children:"Build"}),e("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Adoption guides for teams that want to keep their code."}),e("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"These guides assume you are introducing ContractSpec into a real code base. Start with a narrow surface, verify the generated outputs, and expand only after the contract loop feels trustworthy."})]}),e("div",{className:"grid gap-4 md:grid-cols-2",children:d.map((i)=>t(n,{href:i.href,className:"editorial-panel",children:[t("div",{className:"flex items-start justify-between gap-4",children:[t("div",{children:[e("h2",{className:"font-semibold text-xl",children:i.title}),e("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:i.description})]}),e(o,{className:"mt-1 shrink-0",size:18})]}),t("div",{className:"mt-4 flex items-center gap-2 text-muted-foreground text-xs",children:[e(r,{size:14}),t("span",{children:["Target time: ",i.time]})]})]},i.href))}),t("div",{className:"editorial-panel space-y-4",children:[t("div",{className:"flex items-center gap-2 font-semibold text-[color:var(--rust)] text-sm uppercase tracking-[0.2em]",children:[e(s,{size:16}),"Working style"]}),t("ul",{className:"editorial-list",children:[t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Run each guide in a branch or sandboxed workspace."})]}),t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Prefer one bounded surface at a time: one endpoint, one workflow, one integration, one unsafe module."})]}),t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Use the example and reference outputs to verify what changed, not just the narrative page."})]})]}),e(a,{language:"bash",filename:"guides-quickstart",code:`# list example systems
2
+ import{CodeBlock as a}from"@contractspec/lib.design-system";import n from"@contractspec/lib.ui-link";import{ArrowRight as r,CheckCircle2 as s,GitBranch as o}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var d=[{title:"Adopt one endpoint in Next.js",description:"Start inside a live app with one operation, one generated surface, and one clearly bounded change.",href:"/docs/guides/nextjs-one-endpoint",time:"25 min"},{title:"Import an existing codebase",description:"Stabilize what already exists instead of treating adoption as a rewrite project.",href:"/docs/guides/import-existing-codebases",time:"20 min"},{title:"Validation and typing",description:"Keep runtime validation and TypeScript behavior aligned from the same source definitions.",href:"/docs/guides/spec-validation-and-typing",time:"20 min"},{title:"Generate docs and clients",description:"Publish stable docs, schemas, and client-facing artifacts from the contract layer.",href:"/docs/guides/generate-docs-clients-schemas",time:"20 min"},{title:"Docs pipeline",description:"Feed generated reference material into the docs site without confusing ownership.",href:"/docs/guides/docs-generation-pipeline",time:"20 min"},{title:"Build a first module bundle",description:"Define one bundle spec, resolve a surface plan, and render it through the React host layer.",href:"/docs/guides/first-module-bundle",time:"20 min"},{title:"Host the Builder workbench",description:"Wire a Builder workspace snapshot, common commands, runtime modes, and mobile review links into the reusable host.",href:"/docs/guides/host-builder-workbench",time:"20 min"},{title:"Use Connect in a repo",description:"Enable Connect, verify agent actions locally, and inspect the resulting review and replay artifacts.",href:"/docs/guides/connect-in-a-repo",time:"15 min"},{title:"Author release capsules",description:"Pair changesets with structured release capsules and generate the artifacts that changelog and upgrade flows consume.",href:"/docs/guides/release-capsules",time:"15 min"},{title:"CI diff gating",description:"Use deterministic checks to catch drift and risky changes before they ship.",href:"/docs/guides/ci-contract-diff-gating",time:"15 min"}];function p(){return t("div",{className:"space-y-10",children:[t("div",{className:"space-y-3",children:[e("p",{className:"editorial-kicker",children:"Build"}),e("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Adoption guides for teams that want to keep their code."}),e("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"These guides assume you are introducing ContractSpec into a real code base. Start with a narrow surface, verify the generated outputs, and expand only after the contract loop feels trustworthy."})]}),e("div",{className:"grid gap-4 md:grid-cols-2",children:d.map((i)=>t(n,{href:i.href,className:"editorial-panel",children:[t("div",{className:"flex items-start justify-between gap-4",children:[t("div",{children:[e("h2",{className:"font-semibold text-xl",children:i.title}),e("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:i.description})]}),e(r,{className:"mt-1 shrink-0",size:18})]}),t("div",{className:"mt-4 flex items-center gap-2 text-muted-foreground text-xs",children:[e(s,{size:14}),t("span",{children:["Target time: ",i.time]})]})]},i.href))}),t("div",{className:"editorial-panel space-y-4",children:[t("div",{className:"flex items-center gap-2 font-semibold text-[color:var(--rust)] text-sm uppercase tracking-[0.2em]",children:[e(o,{size:16}),"Working style"]}),t("ul",{className:"editorial-list",children:[t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Run each guide in a branch or sandboxed workspace."})]}),t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Prefer one bounded surface at a time: one endpoint, one workflow, one integration, one unsafe module."})]}),t("li",{children:[e("span",{className:"editorial-list-marker"}),e("span",{children:"Use the example and reference outputs to verify what changed, not just the narrative page."})]})]}),e(a,{language:"bash",filename:"guides-quickstart",code:`# list example systems
3
3
  contractspec examples list
4
4
 
5
5
  # validate the examples in this workspace
@@ -8,5 +8,6 @@ export { GuideGenerateDocsClientsSchemasPage } from './GuideGenerateDocsClientsS
8
8
  export { GuideHostBuilderWorkbenchPage } from './GuideHostBuilderWorkbenchPage';
9
9
  export { GuideImportExistingCodebasesPage } from './GuideImportExistingCodebasesPage';
10
10
  export { GuideNextjsOneEndpointPage } from './GuideNextjsOneEndpointPage';
11
+ export { GuideReleaseCapsulesPage } from './GuideReleaseCapsulesPage';
11
12
  export { GuideSpecValidationTypingPage } from './GuideSpecValidationTypingPage';
12
13
  export { GuidesIndexPage } from './GuidesIndexPage';