// @bun
import{contractFirstApiBrief as D}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as J}from"@contractspec/lib.content-gen/seo";import{CodeBlock as H}from"@contractspec/lib.design-system";import I from"@contractspec/lib.ui-link";import{ChevronRight as K}from"lucide-react";import{jsx as q,jsxs as w}from"react/jsx-runtime";var U=new J().optimize(D);function V(){return w("div",{className:"space-y-8",children:[w("div",{className:"space-y-3",children:[q("h1",{className:"font-bold text-4xl",children:D.title}),q("p",{className:"text-lg text-muted-foreground",children:D.summary})]}),w("div",{className:"card-subtle space-y-4 p-6",children:[q("h2",{className:"font-bold text-2xl",children:"Problems Solved"}),q("ul",{className:"space-y-2 text-muted-foreground text-sm",children:D.problems.map((E,G)=>q("li",{children:E},G))})]}),w("div",{className:"card-subtle space-y-4 p-6",children:[q("h2",{className:"font-bold text-2xl",children:"Solutions"}),q("ul",{className:"space-y-2 text-muted-foreground text-sm",children:D.solutions.map((E,G)=>q("li",{children:E},G))})]}),w("div",{className:"space-y-6",children:[w("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Quick Start"}),q("p",{className:"text-muted-foreground text-sm",children:"Define your first API contract and generate consistent implementations."}),q(H,{language:"typescript",filename:"src/contracts/user-create.operation.ts",code:`import { defineOperation } from '@contractspec/lib.contracts-spec/operations';
import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';

export const CreateUserOperation = defineOperation({
  goal: 'Create a new user account with validation',
  context: 'Used by frontend registration forms and internal admin tools',
  input: new SchemaModel({
    type: 'object',
    properties: {
      email: {
        type: 'string',
        format: 'email',
        required: true,
      },
      password: {
        type: 'string',
        minLength: 8,
        required: true,
      },
    },
  }),
  output: new SchemaModel({
    type: 'object',
    properties: {
      id: { type: 'string', required: true },
      email: { type: 'string', required: true },
      createdAt: { type: 'string', format: 'date-time', required: true },
    },
  }),
  metadata: {
    name: 'createUser',
    tags: ['users', 'auth'],
    description: 'Create a new user account with email and password',
  },
});`})]}),w("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"Generate OpenAPI"}),q("p",{className:"text-muted-foreground text-sm",children:"Export OpenAPI documentation directly from your contracts."}),q(H,{language:"bash",filename:"export-openapi",code:"contractspec openapi export \\\n  --registry ./src/contracts/registry.ts \\\n  --out ./openapi.json"})]})]}),w("div",{className:"flex items-center gap-4 pt-4",children:[w(I,{href:"/docs/guides/nextjs-one-endpoint",className:"btn-primary",children:["Next.js Guide ",q(K,{size:16})]}),q(I,{href:"/docs/intent/spec-driven-development",className:"btn-ghost",children:"Spec-driven Development"})]})]})}export{U as metadata,V as ContractFirstApiPage};
