@contractspec/bundle.library 3.9.2 → 3.9.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  // @bun
2
- var ys=Object.defineProperty;var bs=(e)=>e;function vs(e,t){this[e]=bs.bind(null,t)}var Ns=(e,t)=>{for(var a in t)ys(e,a,{get:t[a],enumerable:!0,configurable:!0,set:vs.bind(t,a)})};var ws=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bc="docs-index.manifest.json";var ur={};Ns(ur,{listGeneratedDocs:()=>hm,getGeneratedDocById:()=>bm,getDocsIndexManifest:()=>ym});import{readFile as Yr}from"fs/promises";import*as Qo from"path";import{fileURLToPath as mm}from"url";function gm(e){if(!e)return"_common";if(e.includes("/")){let[t]=e.split("/");return t||"_common"}return"_common"}async function Jr(){if(!Kr)Kr=Yr(Qo.join(mr,Bc),"utf8").then((e)=>JSON.parse(e));return Kr}function fm(e){let t=e.contentRoot??".";if(t==="../../../../../../../generated/docs")return um;return Qo.join(mr,t)}async function Uc(e){let t=Mc.get(e);if(t)return t;let a=Yr(Qo.join(mr,e),"utf8").then((r)=>JSON.parse(r));return Mc.set(e,a),a}async function hm(){if(!Qr)Qr=(async()=>{let e=await Jr();return(await Promise.all(e.chunks.map((a)=>Uc(a.file)))).flat()})();return Qr}async function ym(){return Jr()}async function bm(e){let t=await Jr(),a=gm(e),r=t.chunks.find((v)=>v.key===a);if(!r)return null;let b=(await Uc(r.file)).find((v)=>v.id===e);if(!b||!b.contentPath)return null;let h=Qo.join(fm(t),b.contentPath);try{let v=await Yr(h,"utf8");return{entry:b,content:v}}catch{return null}}var mr,um,Kr=null,Qr=null,Mc;var gr=ws(()=>{mr=Qo.dirname(mm(import.meta.url)),um=Qo.join(mr,"../../../../../../../generated/docs"),Mc=new Map});import{EventRegistry as ks,OperationSpecRegistry as Ss}from"@contractspec/lib.contracts-spec";import{DataViewRegistry as Cs}from"@contractspec/lib.contracts-spec/data-views";import{ContractReferenceDataView as Is,ContractReferenceQuery as Ps,DocsGenerateCommand as Ts,DocsGeneratedEvent as As,DocsIndexDataView as Rs,DocsIndexQuery as Ls,DocsLayoutPresentation as Es,DocsPublishCommand as Ds,DocsPublishedEvent as Os,DocsReferencePagePresentation as Bs,DocsSearchForm as Ms,ExampleCatalogDataView as Us}from"@contractspec/lib.contracts-spec/docs";import{FormRegistry as Ws}from"@contractspec/lib.contracts-spec/forms";import{PresentationRegistry as _s}from"@contractspec/lib.contracts-spec/presentations";import{serializeDataViewSpec as zs,serializeEventSpec as Gs,serializeFormSpec as Hs,serializeOperationSpec as qs,serializePresentationSpec as Vs}from"@contractspec/lib.contracts-spec/serialization";var rr=null;function $n(){let e=new Ss;return e.register(Ls).register(Ps).register(Ts).register(Ds),e}function Zn(){if(!rr)rr=$n();return rr}function Xn(e,t){return Zn().get(e,t)}var nr=null;function xn(){let e=new ks;return e.register(As).register(Os),e}function jn(){if(!nr)nr=xn();return nr}function ec(e,t){return jn().get(e,t)}var cr=null;function tc(){let e=new _s;return e.register(Es).register(Bs),e}function ac(){if(!cr)cr=tc();return cr}function oc(e,t){return ac().get(e,t)}var lr=null;function ic(){let e=new Cs;return e.register(Rs).register(Is).register(Us),e}function rc(){if(!lr)lr=ic();return lr}function nc(e,t){return rc().get(e,t)}var dr=null;function cc(){let e=new Ws;return e.register(Ms),e}function lc(){if(!dr)dr=cc();return dr}function dc(e,t){return lc().get(e)}function Fs(e,t){let a=Xn(e,t);return qs(a)??void 0}function Ks(e,t){let a=ec(e,t);return Gs(a)??void 0}function Qs(e,t){let a=oc(e,t);return Vs(a)??void 0}function Ys(e,t){let a=nc(e,t);return zs(a)??void 0}function Js(e,t){let a=dc(e,t);return Hs(a)??void 0}function sc(){rr=null}function pc(){nr=null}function mc(){cr=null}function uc(){lr=null}function gc(){dr=null}function $s(){sc(),pc(),mc(),uc(),gc()}import{defineModuleBundle as Zs}from"@contractspec/lib.surface-runtime/spec";var IN=Zs({meta:{key:"bundles.library",version:"1.0.0",title:"Library",description:"ContractSpec package declaration for @contractspec/bundle.library."},routes:[{routeId:"default",path:"/",defaultSurface:"main"}],surfaces:{main:{surfaceId:"main",kind:"workbench",title:"Library",slots:[],layouts:[],data:[],verification:{dimensions:{guidance:"Scaffolded guidance profile for Library.",density:"Scaffolded density profile for Library.",dataDepth:"Scaffolded data-depth profile for Library.",control:"Scaffolded control profile for Library.",media:"Scaffolded media profile for Library.",pace:"Scaffolded pace profile for Library.",narrative:"Scaffolded narrative profile for Library."}}}}});var zr=[{key:"start",title:"Start",description:"Install ContractSpec, wire a first contract, and adopt it into an existing codebase."},{key:"core-model",title:"Core Model",description:"Learn how contracts, generated surfaces, policies, overlays, and safe regeneration fit together."},{key:"build",title:"Build",description:"Use practical guides, libraries, architecture patterns, and examples to ship real surfaces."},{key:"operate",title:"Operate",description:"Run the system safely with governance, auditability, tracing, and operator-grade controls."},{key:"integrations",title:"Integrations",description:"Connect models, messaging, storage, payments, search, and external systems through typed bindings."},{key:"reference",title:"Reference",description:"Search generated contract docs, inspect example packages, and navigate the system as source of truth."},{key:"studio",title:"Studio",description:"Understand what Studio adds on top of the open system and when to adopt it."}],sr=[{href:"/docs",title:"Documentation",description:"OSS-first documentation for ContractSpec, the open spec system for AI-native software.",audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/start-here",title:"Start here",description:"The fastest path from install to your first contract and generated surface.",section:"start",order:10,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/installation",title:"Installation",description:"Install the CLI and core packages, then prepare a workspace for incremental adoption.",section:"start",order:20,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/hello-world",title:"Hello world",description:"Define a first operation, generate the surface, and verify the end-to-end loop.",section:"start",order:30,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/compatibility",title:"Compatibility",description:"Check the supported runtimes, package managers, and adoption assumptions before rollout.",section:"start",order:40,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/tools",title:"Developer tools",description:"Use the CLI, editors, and helper tooling that make the OSS workflow practical day to day.",section:"start",order:50,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/troubleshooting",title:"Troubleshooting",description:"Resolve the common installation, validation, and runtime mistakes you hit during first adoption.",section:"start",order:60,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs",title:"Contracts and specs",description:"Understand the spec model that drives generated surfaces, validation, policy, and safe regeneration.",section:"core-model",order:10,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/capabilities",title:"Capabilities",description:"Model commands, queries, presentations, and events as explicit contract surfaces.",section:"core-model",order:20,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/dataviews",title:"Data views",description:"Define queryable, presentable views that stay aligned with the rest of the system.",section:"core-model",order:30,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/workflows",title:"Workflows",description:"Compose multi-step behavior from typed contracts, policies, and runtime orchestration.",section:"core-model",order:40,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/policy",title:"Policy",description:"Apply consistent governance, access rules, and risk controls across every surface.",section:"core-model",order:50,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/specs/overlays",title:"Overlays",description:"Customize generated surfaces safely without forking the system or breaking regeneration.",section:"core-model",order:60,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/module-bundles",title:"Module bundles",description:"Define AI-native surfaces as typed bundle specs that resolve into personalized, auditable runtime plans.",section:"core-model",order:70,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/connect",title:"ContractSpec Connect",description:"Guard coding-agent edits and shell actions with task-scoped context, plan packets, patch verdicts, and review packets.",section:"core-model",order:80,navTitle:"Connect",primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/specs/builder-control-plane",title:"Builder control plane",description:"Route multimodal authoring work through governed builder contracts, provider policies, readiness gates, and mobile review flows.",section:"core-model",order:90,primaryNav:!0,audience:"studio-bridge",ctaMode:"studio-bridge"},{href:"/docs/guides/contract-types",title:"Contract types",description:"Choose the right contract surface for the behavior you want to make explicit.",section:"core-model",order:100,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides",title:"Guides",description:"Follow concrete adoption paths for existing apps, generated docs, CI gating, and typed surfaces.",section:"build",order:10,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/nextjs-one-endpoint",title:"Adopt one endpoint in Next.js",description:"Start with one endpoint, one contract, and one generated surface in an existing Next.js app.",section:"build",order:20,navTitle:"Next.js endpoint",primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/import-existing-codebases",title:"Import an existing codebase",description:"Stabilize a live codebase incrementally instead of rewriting it from scratch.",section:"build",order:30,navTitle:"Import existing code",primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/spec-validation-and-typing",title:"Validation and typing",description:"Keep runtime validation and TypeScript types aligned from the same source definitions.",section:"build",order:40,navTitle:"Validation and typing",primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/generate-docs-clients-schemas",title:"Generate docs, clients, and schemas",description:"Export stable docs and client-facing artifacts from the same contract layer.",section:"build",order:50,navTitle:"Generate docs and clients",primaryNav:!0,audience:"oss",ctaMode:"reference"},{href:"/docs/guides/docs-generation-pipeline",title:"Docs generation pipeline",description:"Feed generated docs into the public docs site without breaking source-of-truth ownership.",section:"build",order:60,navTitle:"Docs pipeline",primaryNav:!0,audience:"oss",ctaMode:"reference"},{href:"/docs/guides/first-module-bundle",title:"Build a first module bundle",description:"Define one bundle spec, resolve a personalized surface plan, and render it through the React host layer.",section:"build",order:65,navTitle:"First module bundle",primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/host-builder-workbench",title:"Host the Builder workbench",description:"Load a Builder workspace snapshot, wire common commands, and keep runtime mode plus mobile review flows explicit.",section:"build",order:66,navTitle:"Host Builder workbench",primaryNav:!0,audience:"studio-bridge",ctaMode:"studio-bridge"},{href:"/docs/guides/connect-in-a-repo",title:"Use Connect in a repo",description:"Enable Connect in workspace config, verify agent actions, and inspect local review and replay artifacts.",section:"build",order:67,navTitle:"Connect in a repo",primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/libraries",title:"Libraries overview",description:"Navigate the core libraries, runtimes, and system packages that make up the open foundation.",section:"build",order:70,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/libraries/cross-platform-ui",title:"Cross-platform UI",description:"Understand how the presentation runtimes, ui-kit-web, ui-kit, and design-system stay aligned across React and React Native.",section:"build",order:71,audience:"oss",ctaMode:"oss-next"},{href:"/docs/architecture",title:"Architecture",description:"See how the spec layer, runtimes, integrations, and multi-surface outputs fit together.",section:"build",order:80,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/safety",title:"Operate safely",description:"Add auditability, migrations, policy controls, and trustworthy release behavior from the start.",section:"operate",order:10,navTitle:"Safety overview",primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/guides/ci-contract-diff-gating",title:"CI diff gating",description:"Use deterministic checks to block drift and risky changes before they reach production.",section:"operate",order:20,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/guides/release-capsules",title:"Author release capsules",description:"Pair changesets with structured release capsules, generate release artifacts, and keep changelog plus docs surfaces aligned.",section:"operate",order:25,navTitle:"Release capsules",primaryNav:!0,audience:"operator",ctaMode:"reference"},{href:"/docs/safety/security-trust",title:"Security and trust",description:"Understand the trust model, artifact validation expectations, and operational boundaries.",section:"operate",order:30,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/safety/auditing",title:"Audit trails",description:"Track changes, policy decisions, and operational actions with a clear evidence trail.",section:"operate",order:40,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/safety/migrations",title:"Migrations",description:"Evolve schemas and data safely without abandoning the contract layer.",section:"operate",order:50,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/safety/tenant-isolation",title:"Tenant isolation",description:"Keep tenant data, config, policies, and integrations separated at runtime.",section:"operate",order:60,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/knowledge",title:"Knowledge and context",description:"Bind trusted knowledge sources to the system without losing governance or isolation.",section:"operate",order:70,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/advanced/telemetry",title:"Telemetry",description:"Instrument surfaces, collect evidence, and keep observability aligned with the contract model.",section:"operate",order:80,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/advanced/workflow-monitoring",title:"Workflow monitoring",description:"Observe multi-step execution with enough context to understand failures and regressions.",section:"operate",order:90,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/ops/distributed-tracing",title:"Distributed tracing",description:"Trace contract execution across integrations, workflows, and generated surfaces.",section:"operate",order:100,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/integrations",title:"Integrations overview",description:"Understand the binding model for external services, providers, and tenant-owned connections.",section:"integrations",order:10,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/spec-model",title:"Integration spec model",description:"Define what an integration provides before wiring it into an app or runtime.",section:"integrations",order:20,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/openai",title:"OpenAI integration",description:"Connect OpenAI through typed capabilities, explicit provider config, and governed runtime usage.",section:"integrations",order:30,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/mistral",title:"Mistral integration",description:"Use Mistral through the same provider contract model and runtime guardrails.",section:"integrations",order:40,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/qdrant",title:"Qdrant integration",description:"Store and retrieve knowledge embeddings with explicit provider configuration and ownership.",section:"integrations",order:50,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/integrations/stripe",title:"Stripe integration",description:"Bind payments and billing behavior without smearing provider logic across the codebase.",section:"integrations",order:60,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/twilio",title:"Twilio integration",description:"Handle messaging and telephony through typed transport boundaries and explicit configuration.",section:"integrations",order:70,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/github",title:"GitHub integration",description:"Push execution context into GitHub workflows and automation surfaces without hidden glue.",section:"integrations",order:80,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/reference",title:"Contract reference",description:"Browse the generated reference index for public contract surfaces, versions, and examples.",section:"reference",order:10,primaryNav:!0,audience:"reference",ctaMode:"reference"},{href:"/docs/examples",title:"Examples",description:"Explore runnable examples and use them as reference implementations for new systems.",section:"reference",order:20,primaryNav:!0,audience:"reference",ctaMode:"reference"},{href:"/docs/studio",title:"Studio overview",description:"See what Studio adds on top of OSS ContractSpec and when a team should adopt the operating layer.",section:"studio",order:10,primaryNav:!0,audience:"studio-bridge",ctaMode:"studio-bridge"},{href:"/docs/manifesto",title:"Manifesto",description:"Why ContractSpec is built as an open system, how incremental adoption works, and why Studio stays additive.",audience:"secondary"},{href:"/docs/intent/contract-first-api",title:"Contract-first API",description:"Use contracts as the durable source of truth for API behavior and generated surfaces.",audience:"secondary"},{href:"/docs/intent/spec-driven-development",title:"Spec-driven development",description:"See how explicit specs stabilize change across APIs, UI, data, and agent-facing surfaces.",audience:"secondary"},{href:"/docs/intent/deterministic-codegen",title:"Deterministic regeneration",description:"Understand safe regeneration, conflict boundaries, and why teams keep control of the output.",audience:"secondary"},{href:"/docs/intent/schema-validation-typescript",title:"Schema validation and TypeScript",description:"Keep schema, runtime validation, and TypeScript behavior aligned without duplicate work.",audience:"secondary"},{href:"/docs/intent/openapi-alternative",title:"OpenAPI alternative",description:"Compare a multi-surface contract system with API-only description tooling.",audience:"secondary"},{href:"/docs/intent/generate-client-from-schema",title:"Generate client from schema",description:"Generate client-facing artifacts from the same source that drives runtime behavior.",audience:"secondary"},{href:"/docs/comparison",title:"Comparison overview",description:"Compare ContractSpec with workflow engines, internal-tool builders, and enterprise orchestration products.",audience:"secondary"},{href:"/docs/comparison/workflow-engines",title:"Workflow engines",description:"Contrast a contract system with workflow-only orchestration approaches.",audience:"secondary"},{href:"/docs/comparison/internal-tool-builders",title:"Internal-tool builders",description:"Compare ContractSpec with builders that optimize for screens instead of durable system contracts.",audience:"secondary"},{href:"/docs/comparison/automation-platforms",title:"Automation platforms",description:"Compare automation-first tools with a system that owns explicit contracts and generated surfaces.",audience:"secondary"},{href:"/docs/comparison/windmill",title:"Windmill comparison",description:"Understand where Windmill fits and where ContractSpec solves a different class of system problem.",audience:"secondary"},{href:"/docs/comparison/enterprise-platforms",title:"Enterprise orchestrators",description:"Compare ContractSpec with enterprise platforms that centralize execution in a closed operating surface.",audience:"secondary"},{href:"/docs/ecosystem/templates",title:"Templates",description:"Use templates and starter systems as proof points and accelerators for OSS adoption.",audience:"secondary"},{href:"/docs/ecosystem/plugins",title:"Plugins",description:"Explore marketplace and editor integrations that support the OSS workflow.",audience:"secondary"},{href:"/docs/ecosystem/registry",title:"Registry",description:"Inspect registry and manifest concepts that help package reusable capability surfaces.",audience:"secondary"}];function TN(e){return sr.find((t)=>t.href===e)}function Xs(){return zr.map((e)=>({...e,items:sr.filter((t)=>t.section===e.key&&t.primaryNav).sort((t,a)=>(t.order??0)-(a.order??0))}))}function xs(){return sr.filter((e)=>e.primaryNav).sort((e,t)=>zr.findIndex((a)=>a.key===e.section)-zr.findIndex((a)=>a.key===t.section)||(e.order??0)-(t.order??0))}function AN(e){let t=xs(),a=t.findIndex((r)=>r.href===e);if(a<0)return{previous:null,next:null};return{previous:t[a-1]??null,next:t[a+1]??null}}function fc(){return sr.filter((e)=>e.audience==="secondary")}function hc(){return Xs().map((e)=>({...e,featured:e.items.slice(0,3)}))}import{CodeBlock as js}from"@contractspec/lib.design-system";import Vo from"@contractspec/lib.ui-link";import{ArrowRight as Gr,Boxes as yc,FileSearch as ep,ShieldCheck as tp,Waypoints as ap}from"lucide-react";import{jsx as A,jsxs as se}from"react/jsx-runtime";var op=[{title:"One system, many surfaces",body:"Define explicit contracts once, then keep APIs, UI, data, events, and agent-facing surfaces aligned.",icon:yc},{title:"Incremental adoption",body:"Start with one endpoint, one workflow, or one unsafe module. You do not need a rewrite to begin.",icon:ap},{title:"Operator-grade controls",body:"Carry policy, auditability, migrations, tracing, and integration boundaries forward with the same system model.",icon:tp}],ip=[{title:"ContractSpec Connect",body:"Guard coding-agent edits and commands with local-first context, plan packets, patch verdicts, and review packets.",specHref:"/docs/specs/connect",guideHref:"/docs/guides/connect-in-a-repo"},{title:"Module bundles",body:"Define AI-native surfaces as typed bundle specs that resolve into auditable runtime plans.",specHref:"/docs/specs/module-bundles",guideHref:"/docs/guides/first-module-bundle"},{title:"Builder control plane",body:"Coordinate multimodal authoring, provider routing, readiness, export, and mobile review through governed contracts.",specHref:"/docs/specs/builder-control-plane",guideHref:"/docs/guides/host-builder-workbench"}];function rp(){let e=hc(),t=fc().slice(0,6);return se("div",{className:"space-y-12",children:[se("section",{className:"space-y-6",children:[A("p",{className:"editorial-kicker",children:"OSS documentation"}),A("h1",{className:"editorial-title max-w-5xl",children:"Build AI-native systems on explicit contracts, then add Studio when you want the operating layer."}),A("p",{className:"editorial-subtitle",children:"These docs are optimized for OSS adopters first. Learn the contract model, generate and govern surfaces safely, wire integrations, and run the system in production without giving up ownership of your code."}),se("div",{className:"flex flex-wrap gap-3",children:[se(Vo,{href:"/docs/getting-started/start-here",className:"btn-primary text-sm",children:["Start with OSS ",A(Gr,{size:16})]}),A(Vo,{href:"/docs/studio",className:"btn-ghost text-sm",children:"See what Studio adds"})]})]}),A("section",{className:"grid gap-5 md:grid-cols-3",children:op.map((a)=>{let r=a.icon;return se("article",{className:"editorial-panel space-y-3",children:[se("div",{className:"flex items-center gap-3",children:[A("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:A(r,{size:18})}),A("h2",{className:"font-semibold text-xl",children:a.title})]}),A("p",{className:"editorial-copy text-sm",children:a.body})]},a.title)})}),se("section",{className:"space-y-5",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Implemented packs"}),A("h2",{className:"editorial-panel-title",children:"Use the three higher-order systems that are already wired"}),A("p",{className:"editorial-copy text-sm",children:"These pages are the canonical landing points for agent enforcement, AI-native surface composition, and Builder authoring. Each one now has a matching practical guide."})]}),A("div",{className:"grid gap-4 lg:grid-cols-3",children:ip.map((a)=>se("article",{className:"editorial-panel space-y-4",children:[se("div",{children:[A("h3",{className:"font-semibold text-xl",children:a.title}),A("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]}),se("div",{className:"flex flex-wrap gap-3",children:[se(Vo,{href:a.specHref,className:"btn-primary text-sm",children:["Open spec page ",A(Gr,{size:16})]}),A(Vo,{href:a.guideHref,className:"btn-ghost text-sm",children:"Read practical guide"})]})]},a.title))})]}),se("section",{className:"editorial-panel space-y-5",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Quick start"}),A("h2",{className:"editorial-panel-title",children:"Start with one contract"}),A("p",{className:"editorial-copy text-sm",children:"Use the CLI and core libraries to define one explicit capability, generate the surface, and validate the contract boundary before you expand."})]}),A(js,{language:"bash",filename:"docs-quick-start",code:`bun add -D contractspec
2
+ var ys=Object.defineProperty;var bs=(e)=>e;function vs(e,t){this[e]=bs.bind(null,t)}var Ns=(e,t)=>{for(var a in t)ys(e,a,{get:t[a],enumerable:!0,configurable:!0,set:vs.bind(t,a)})};var ws=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bc="docs-index.manifest.json";var ur={};Ns(ur,{listGeneratedDocs:()=>hm,getGeneratedDocById:()=>bm,getDocsIndexManifest:()=>ym});import{readFile as Yr}from"fs/promises";import*as Qo from"path";import{fileURLToPath as mm}from"url";function gm(e){if(!e)return"_common";if(e.includes("/")){let[t]=e.split("/");return t||"_common"}return"_common"}async function Jr(){if(!Kr)Kr=Yr(Qo.join(mr,Bc),"utf8").then((e)=>JSON.parse(e));return Kr}function fm(e){let t=e.contentRoot??".";if(t==="../../../../../../../generated/docs")return um;return Qo.join(mr,t)}async function Uc(e){let t=Mc.get(e);if(t)return t;let a=Yr(Qo.join(mr,e),"utf8").then((r)=>JSON.parse(r));return Mc.set(e,a),a}async function hm(){if(!Qr)Qr=(async()=>{let e=await Jr();return(await Promise.all(e.chunks.map((a)=>Uc(a.file)))).flat()})();return Qr}async function ym(){return Jr()}async function bm(e){let t=await Jr(),a=gm(e),r=t.chunks.find((v)=>v.key===a);if(!r)return null;let b=(await Uc(r.file)).find((v)=>v.id===e);if(!b||!b.contentPath)return null;let h=Qo.join(fm(t),b.contentPath);try{let v=await Yr(h,"utf8");return{entry:b,content:v}}catch{return null}}var mr,um,Kr=null,Qr=null,Mc;var gr=ws(()=>{mr=Qo.dirname(mm(import.meta.url)),um=Qo.join(mr,"../../../../../../../generated/docs"),Mc=new Map});import{EventRegistry as ks,OperationSpecRegistry as Ss}from"@contractspec/lib.contracts-spec";import{DataViewRegistry as Cs}from"@contractspec/lib.contracts-spec/data-views";import{ContractReferenceDataView as Is,ContractReferenceQuery as Ps,DocsGenerateCommand as Ts,DocsGeneratedEvent as As,DocsIndexDataView as Rs,DocsIndexQuery as Ls,DocsLayoutPresentation as Ds,DocsPublishCommand as Es,DocsPublishedEvent as Os,DocsReferencePagePresentation as Bs,DocsSearchForm as Ms,ExampleCatalogDataView as Us}from"@contractspec/lib.contracts-spec/docs";import{FormRegistry as Ws}from"@contractspec/lib.contracts-spec/forms";import{PresentationRegistry as _s}from"@contractspec/lib.contracts-spec/presentations";import{serializeDataViewSpec as zs,serializeEventSpec as Gs,serializeFormSpec as qs,serializeOperationSpec as Hs,serializePresentationSpec as Vs}from"@contractspec/lib.contracts-spec/serialization";var rr=null;function Zn(){let e=new Ss;return e.register(Ls).register(Ps).register(Ts).register(Es),e}function $n(){if(!rr)rr=Zn();return rr}function Xn(e,t){return $n().get(e,t)}var nr=null;function xn(){let e=new ks;return e.register(As).register(Os),e}function jn(){if(!nr)nr=xn();return nr}function ec(e,t){return jn().get(e,t)}var cr=null;function tc(){let e=new _s;return e.register(Ds).register(Bs),e}function ac(){if(!cr)cr=tc();return cr}function oc(e,t){return ac().get(e,t)}var lr=null;function ic(){let e=new Cs;return e.register(Rs).register(Is).register(Us),e}function rc(){if(!lr)lr=ic();return lr}function nc(e,t){return rc().get(e,t)}var dr=null;function cc(){let e=new Ws;return e.register(Ms),e}function lc(){if(!dr)dr=cc();return dr}function dc(e,t){return lc().get(e)}function Fs(e,t){let a=Xn(e,t);return Hs(a)??void 0}function Ks(e,t){let a=ec(e,t);return Gs(a)??void 0}function Qs(e,t){let a=oc(e,t);return Vs(a)??void 0}function Ys(e,t){let a=nc(e,t);return zs(a)??void 0}function Js(e,t){let a=dc(e,t);return qs(a)??void 0}function sc(){rr=null}function pc(){nr=null}function mc(){cr=null}function uc(){lr=null}function gc(){dr=null}function Zs(){sc(),pc(),mc(),uc(),gc()}import{defineModuleBundle as $s}from"@contractspec/lib.surface-runtime/spec";var IN=$s({meta:{key:"bundles.library",version:"1.0.0",title:"Library",description:"ContractSpec package declaration for @contractspec/bundle.library."},routes:[{routeId:"default",path:"/",defaultSurface:"main"}],surfaces:{main:{surfaceId:"main",kind:"workbench",title:"Library",slots:[],layouts:[],data:[],verification:{dimensions:{guidance:"Scaffolded guidance profile for Library.",density:"Scaffolded density profile for Library.",dataDepth:"Scaffolded data-depth profile for Library.",control:"Scaffolded control profile for Library.",media:"Scaffolded media profile for Library.",pace:"Scaffolded pace profile for Library.",narrative:"Scaffolded narrative profile for Library."}}}}});var zr=[{key:"start",title:"Start",description:"Install ContractSpec, wire a first contract, and adopt it into an existing codebase."},{key:"core-model",title:"Core Model",description:"Learn how contracts, generated surfaces, policies, overlays, and safe regeneration fit together."},{key:"build",title:"Build",description:"Use practical guides, libraries, architecture patterns, and examples to ship real surfaces."},{key:"operate",title:"Operate",description:"Run the system safely with governance, auditability, tracing, and operator-grade controls."},{key:"integrations",title:"Integrations",description:"Connect models, messaging, storage, payments, search, and external systems through typed bindings."},{key:"reference",title:"Reference",description:"Search generated contract docs, inspect example packages, and navigate the system as source of truth."},{key:"studio",title:"Studio",description:"Understand what Studio adds on top of the open system and when to adopt it."}],sr=[{href:"/docs",title:"Documentation",description:"OSS-first documentation for ContractSpec, the open spec system for AI-native software.",audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/start-here",title:"Start here",description:"The fastest path from install to your first contract and generated surface.",section:"start",order:10,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/installation",title:"Installation",description:"Install the CLI and core packages, then prepare a workspace for incremental adoption.",section:"start",order:20,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/hello-world",title:"Hello world",description:"Define a first operation, generate the surface, and verify the end-to-end loop.",section:"start",order:30,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/compatibility",title:"Compatibility",description:"Check the supported runtimes, package managers, and adoption assumptions before rollout.",section:"start",order:40,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/tools",title:"Developer tools",description:"Use the CLI, editors, and helper tooling that make the OSS workflow practical day to day.",section:"start",order:50,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/getting-started/troubleshooting",title:"Troubleshooting",description:"Resolve the common installation, validation, and runtime mistakes you hit during first adoption.",section:"start",order:60,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs",title:"Contracts and specs",description:"Understand the spec model that drives generated surfaces, validation, policy, and safe regeneration.",section:"core-model",order:10,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/capabilities",title:"Capabilities",description:"Model commands, queries, presentations, and events as explicit contract surfaces.",section:"core-model",order:20,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/dataviews",title:"Data views",description:"Define queryable, presentable views that stay aligned with the rest of the system.",section:"core-model",order:30,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/workflows",title:"Workflows",description:"Compose multi-step behavior from typed contracts, policies, and runtime orchestration.",section:"core-model",order:40,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/policy",title:"Policy",description:"Apply consistent governance, access rules, and risk controls across every surface.",section:"core-model",order:50,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/specs/overlays",title:"Overlays",description:"Customize generated surfaces safely without forking the system or breaking regeneration.",section:"core-model",order:60,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/module-bundles",title:"Module bundles",description:"Define AI-native surfaces as typed bundle specs that resolve into personalized, auditable runtime plans.",section:"core-model",order:70,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/specs/connect",title:"ContractSpec Connect",description:"Guard coding-agent edits and shell actions with task-scoped context, plan packets, patch verdicts, and review packets.",section:"core-model",order:80,navTitle:"Connect",primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/specs/builder-control-plane",title:"Builder control plane",description:"Route multimodal authoring work through governed builder contracts, provider policies, readiness gates, and mobile review flows.",section:"core-model",order:90,primaryNav:!0,audience:"studio-bridge",ctaMode:"studio-bridge"},{href:"/docs/guides/contract-types",title:"Contract types",description:"Choose the right contract surface for the behavior you want to make explicit.",section:"core-model",order:100,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides",title:"Guides",description:"Follow concrete adoption paths for existing apps, generated docs, CI gating, and typed surfaces.",section:"build",order:10,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/nextjs-one-endpoint",title:"Adopt one endpoint in Next.js",description:"Start with one endpoint, one contract, and one generated surface in an existing Next.js app.",section:"build",order:20,navTitle:"Next.js endpoint",primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/import-existing-codebases",title:"Import an existing codebase",description:"Stabilize a live codebase incrementally instead of rewriting it from scratch.",section:"build",order:30,navTitle:"Import existing code",primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/spec-validation-and-typing",title:"Validation and typing",description:"Keep runtime validation and TypeScript types aligned from the same source definitions.",section:"build",order:40,navTitle:"Validation and typing",primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/generate-docs-clients-schemas",title:"Generate docs, clients, and schemas",description:"Export stable docs and client-facing artifacts from the same contract layer.",section:"build",order:50,navTitle:"Generate docs and clients",primaryNav:!0,audience:"oss",ctaMode:"reference"},{href:"/docs/guides/docs-generation-pipeline",title:"Docs generation pipeline",description:"Feed generated docs into the public docs site without breaking source-of-truth ownership.",section:"build",order:60,navTitle:"Docs pipeline",primaryNav:!0,audience:"oss",ctaMode:"reference"},{href:"/docs/guides/first-module-bundle",title:"Build a first module bundle",description:"Define one bundle spec, resolve a personalized surface plan, and render it through the React host layer.",section:"build",order:65,navTitle:"First module bundle",primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/guides/host-builder-workbench",title:"Host the Builder workbench",description:"Load a Builder workspace snapshot, wire common commands, and keep runtime mode plus mobile review flows explicit.",section:"build",order:66,navTitle:"Host Builder workbench",primaryNav:!0,audience:"studio-bridge",ctaMode:"studio-bridge"},{href:"/docs/guides/connect-in-a-repo",title:"Use Connect in a repo",description:"Enable Connect in workspace config, verify agent actions, and inspect local review and replay artifacts.",section:"build",order:67,navTitle:"Connect in a repo",primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/libraries",title:"Libraries overview",description:"Navigate the core libraries, runtimes, and system packages that make up the open foundation.",section:"build",order:70,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/libraries/cross-platform-ui",title:"Cross-platform UI",description:"Understand how the presentation runtimes, ui-kit-web, ui-kit, and design-system stay aligned across React and React Native.",section:"build",order:71,audience:"oss",ctaMode:"oss-next"},{href:"/docs/architecture",title:"Architecture",description:"See how the spec layer, runtimes, integrations, and multi-surface outputs fit together.",section:"build",order:80,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/safety",title:"Operate safely",description:"Add auditability, migrations, policy controls, and trustworthy release behavior from the start.",section:"operate",order:10,navTitle:"Safety overview",primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/guides/ci-contract-diff-gating",title:"CI diff gating",description:"Use deterministic checks to block drift and risky changes before they reach production.",section:"operate",order:20,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/guides/release-capsules",title:"Author release capsules",description:"Pair changesets with structured release capsules, generate release artifacts, and keep changelog plus docs surfaces aligned.",section:"operate",order:25,navTitle:"Release capsules",primaryNav:!0,audience:"operator",ctaMode:"reference"},{href:"/docs/safety/security-trust",title:"Security and trust",description:"Understand the trust model, artifact validation expectations, and operational boundaries.",section:"operate",order:30,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/safety/auditing",title:"Audit trails",description:"Track changes, policy decisions, and operational actions with a clear evidence trail.",section:"operate",order:40,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/safety/migrations",title:"Migrations",description:"Evolve schemas and data safely without abandoning the contract layer.",section:"operate",order:50,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/safety/tenant-isolation",title:"Tenant isolation",description:"Keep tenant data, config, policies, and integrations separated at runtime.",section:"operate",order:60,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/knowledge",title:"Knowledge and context",description:"Bind trusted knowledge sources to the system without losing governance or isolation.",section:"operate",order:70,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/advanced/telemetry",title:"Telemetry",description:"Instrument surfaces, collect evidence, and keep observability aligned with the contract model.",section:"operate",order:80,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/advanced/workflow-monitoring",title:"Workflow monitoring",description:"Observe multi-step execution with enough context to understand failures and regressions.",section:"operate",order:90,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/ops/distributed-tracing",title:"Distributed tracing",description:"Trace contract execution across integrations, workflows, and generated surfaces.",section:"operate",order:100,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/integrations",title:"Integrations overview",description:"Understand the binding model for external services, providers, and tenant-owned connections.",section:"integrations",order:10,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/spec-model",title:"Integration spec model",description:"Define what an integration provides before wiring it into an app or runtime.",section:"integrations",order:20,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/openai",title:"OpenAI integration",description:"Connect OpenAI through typed capabilities, explicit provider config, and governed runtime usage.",section:"integrations",order:30,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/mistral",title:"Mistral integration",description:"Use Mistral through the same provider contract model and runtime guardrails.",section:"integrations",order:40,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/qdrant",title:"Qdrant integration",description:"Store and retrieve knowledge embeddings with explicit provider configuration and ownership.",section:"integrations",order:50,primaryNav:!0,audience:"operator",ctaMode:"oss-next"},{href:"/docs/integrations/stripe",title:"Stripe integration",description:"Bind payments and billing behavior without smearing provider logic across the codebase.",section:"integrations",order:60,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/twilio",title:"Twilio integration",description:"Handle messaging and telephony through typed transport boundaries and explicit configuration.",section:"integrations",order:70,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/integrations/github",title:"GitHub integration",description:"Push execution context into GitHub workflows and automation surfaces without hidden glue.",section:"integrations",order:80,primaryNav:!0,audience:"oss",ctaMode:"oss-next"},{href:"/docs/reference",title:"Contract reference",description:"Browse the generated reference index for public contract surfaces, versions, and examples.",section:"reference",order:10,primaryNav:!0,audience:"reference",ctaMode:"reference"},{href:"/docs/examples",title:"Examples",description:"Explore runnable examples and use them as reference implementations for new systems.",section:"reference",order:20,primaryNav:!0,audience:"reference",ctaMode:"reference"},{href:"/docs/studio",title:"Studio overview",description:"See what Studio adds on top of OSS ContractSpec and when a team should adopt the operating layer.",section:"studio",order:10,primaryNav:!0,audience:"studio-bridge",ctaMode:"studio-bridge"},{href:"/docs/manifesto",title:"Manifesto",description:"Why ContractSpec is built as an open system, how incremental adoption works, and why Studio stays additive.",audience:"secondary"},{href:"/docs/intent/contract-first-api",title:"Contract-first API",description:"Use contracts as the durable source of truth for API behavior and generated surfaces.",audience:"secondary"},{href:"/docs/intent/spec-driven-development",title:"Spec-driven development",description:"See how explicit specs stabilize change across APIs, UI, data, and agent-facing surfaces.",audience:"secondary"},{href:"/docs/intent/deterministic-codegen",title:"Deterministic regeneration",description:"Understand safe regeneration, conflict boundaries, and why teams keep control of the output.",audience:"secondary"},{href:"/docs/intent/schema-validation-typescript",title:"Schema validation and TypeScript",description:"Keep schema, runtime validation, and TypeScript behavior aligned without duplicate work.",audience:"secondary"},{href:"/docs/intent/openapi-alternative",title:"OpenAPI alternative",description:"Compare a multi-surface contract system with API-only description tooling.",audience:"secondary"},{href:"/docs/intent/generate-client-from-schema",title:"Generate client from schema",description:"Generate client-facing artifacts from the same source that drives runtime behavior.",audience:"secondary"},{href:"/docs/comparison",title:"Comparison overview",description:"Compare ContractSpec with workflow engines, internal-tool builders, and enterprise orchestration products.",audience:"secondary"},{href:"/docs/comparison/workflow-engines",title:"Workflow engines",description:"Contrast a contract system with workflow-only orchestration approaches.",audience:"secondary"},{href:"/docs/comparison/internal-tool-builders",title:"Internal-tool builders",description:"Compare ContractSpec with builders that optimize for screens instead of durable system contracts.",audience:"secondary"},{href:"/docs/comparison/automation-platforms",title:"Automation platforms",description:"Compare automation-first tools with a system that owns explicit contracts and generated surfaces.",audience:"secondary"},{href:"/docs/comparison/windmill",title:"Windmill comparison",description:"Understand where Windmill fits and where ContractSpec solves a different class of system problem.",audience:"secondary"},{href:"/docs/comparison/enterprise-platforms",title:"Enterprise orchestrators",description:"Compare ContractSpec with enterprise platforms that centralize execution in a closed operating surface.",audience:"secondary"},{href:"/docs/ecosystem/templates",title:"Templates",description:"Use templates and starter systems as proof points and accelerators for OSS adoption.",audience:"secondary"},{href:"/docs/ecosystem/plugins",title:"Plugins",description:"Explore marketplace and editor integrations that support the OSS workflow.",audience:"secondary"},{href:"/docs/ecosystem/registry",title:"Registry",description:"Inspect registry and manifest concepts that help package reusable capability surfaces.",audience:"secondary"}];function TN(e){return sr.find((t)=>t.href===e)}function Xs(){return zr.map((e)=>({...e,items:sr.filter((t)=>t.section===e.key&&t.primaryNav).sort((t,a)=>(t.order??0)-(a.order??0))}))}function xs(){return sr.filter((e)=>e.primaryNav).sort((e,t)=>zr.findIndex((a)=>a.key===e.section)-zr.findIndex((a)=>a.key===t.section)||(e.order??0)-(t.order??0))}function AN(e){let t=xs(),a=t.findIndex((r)=>r.href===e);if(a<0)return{previous:null,next:null};return{previous:t[a-1]??null,next:t[a+1]??null}}function fc(){return sr.filter((e)=>e.audience==="secondary")}function hc(){return Xs().map((e)=>({...e,featured:e.items.slice(0,3)}))}import{CodeBlock as js}from"@contractspec/lib.design-system";import Vo from"@contractspec/lib.ui-link";import{ArrowRight as Gr,Boxes as yc,FileSearch as ep,ShieldCheck as tp,Waypoints as ap}from"lucide-react";import{jsx as A,jsxs as se}from"react/jsx-runtime";var op=[{title:"One system, many surfaces",body:"Define explicit contracts once, then keep APIs, UI, data, events, and agent-facing surfaces aligned.",icon:yc},{title:"Incremental adoption",body:"Start with one endpoint, one workflow, or one unsafe module. You do not need a rewrite to begin.",icon:ap},{title:"Operator-grade controls",body:"Carry policy, auditability, migrations, tracing, and integration boundaries forward with the same system model.",icon:tp}],ip=[{title:"ContractSpec Connect",body:"Guard coding-agent edits and commands with local-first context, plan packets, patch verdicts, and review packets.",specHref:"/docs/specs/connect",guideHref:"/docs/guides/connect-in-a-repo"},{title:"Module bundles",body:"Define AI-native surfaces as typed bundle specs that resolve into auditable runtime plans.",specHref:"/docs/specs/module-bundles",guideHref:"/docs/guides/first-module-bundle"},{title:"Builder control plane",body:"Coordinate multimodal authoring, provider routing, readiness, export, and mobile review through governed contracts.",specHref:"/docs/specs/builder-control-plane",guideHref:"/docs/guides/host-builder-workbench"}];function rp(){let e=hc(),t=fc().slice(0,6);return se("div",{className:"space-y-12",children:[se("section",{className:"space-y-6",children:[A("p",{className:"editorial-kicker",children:"OSS documentation"}),A("h1",{className:"editorial-title max-w-5xl",children:"Build AI-native systems on explicit contracts, then add Studio when you want the operating layer."}),A("p",{className:"editorial-subtitle",children:"These docs are optimized for OSS adopters first. Learn the contract model, generate and govern surfaces safely, wire integrations, and run the system in production without giving up ownership of your code."}),se("div",{className:"flex flex-wrap gap-3",children:[se(Vo,{href:"/docs/getting-started/start-here",className:"btn-primary text-sm",children:["Start with OSS ",A(Gr,{size:16})]}),A(Vo,{href:"/docs/studio",className:"btn-ghost text-sm",children:"See what Studio adds"})]})]}),A("section",{className:"grid gap-5 md:grid-cols-3",children:op.map((a)=>{let r=a.icon;return se("article",{className:"editorial-panel space-y-3",children:[se("div",{className:"flex items-center gap-3",children:[A("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:A(r,{size:18})}),A("h2",{className:"font-semibold text-xl",children:a.title})]}),A("p",{className:"editorial-copy text-sm",children:a.body})]},a.title)})}),se("section",{className:"space-y-5",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Implemented packs"}),A("h2",{className:"editorial-panel-title",children:"Use the three higher-order systems that are already wired"}),A("p",{className:"editorial-copy text-sm",children:"These pages are the canonical landing points for agent enforcement, AI-native surface composition, and Builder authoring. Each one now has a matching practical guide."})]}),A("div",{className:"grid gap-4 lg:grid-cols-3",children:ip.map((a)=>se("article",{className:"editorial-panel space-y-4",children:[se("div",{children:[A("h3",{className:"font-semibold text-xl",children:a.title}),A("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]}),se("div",{className:"flex flex-wrap gap-3",children:[se(Vo,{href:a.specHref,className:"btn-primary text-sm",children:["Open spec page ",A(Gr,{size:16})]}),A(Vo,{href:a.guideHref,className:"btn-ghost text-sm",children:"Read practical guide"})]})]},a.title))})]}),se("section",{className:"editorial-panel space-y-5",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Quick start"}),A("h2",{className:"editorial-panel-title",children:"Start with one contract"}),A("p",{className:"editorial-copy text-sm",children:"Use the CLI and core libraries to define one explicit capability, generate the surface, and validate the contract boundary before you expand."})]}),A(js,{language:"bash",filename:"docs-quick-start",code:`bun add -D contractspec
3
3
  bun add @contractspec/lib.contracts-spec @contractspec/lib.schema
4
4
 
5
5
  contractspec init
6
6
  contractspec create --type operation
7
7
  contractspec build src/contracts/mySpec.ts
8
- contractspec validate src/contracts/mySpec.ts`})]}),se("section",{className:"space-y-5",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Primary path"}),A("h2",{className:"editorial-panel-title",children:"Move through the system in the right order"}),A("p",{className:"editorial-copy text-sm",children:"Start with onboarding, then learn the model, then build and operate with confidence. The primary docs path is intentionally shorter than the full route inventory."})]}),A("div",{className:"grid gap-5 lg:grid-cols-2",children:e.map((a)=>se("article",{className:"editorial-panel space-y-4",children:[se("div",{children:[A("p",{className:"editorial-kicker",children:a.title}),A("h3",{className:"mt-2 font-serif text-3xl tracking-[-0.03em]",children:a.title}),A("p",{className:"mt-3 text-muted-foreground text-sm leading-7",children:a.description})]}),A("div",{className:"space-y-3",children:a.featured.map((r)=>se(Vo,{href:r.href,className:"flex items-start justify-between gap-4 rounded-[22px] border border-border/70 bg-background/70 p-4 transition-colors hover:border-[color:rgb(162_79_42_/_0.45)]",children:[se("div",{children:[A("h4",{className:"font-semibold text-base",children:r.title}),A("p",{className:"mt-1 text-muted-foreground text-sm leading-6",children:r.description})]}),A(Gr,{className:"mt-1 shrink-0",size:16})]},r.href))})]},a.key))})]}),se("section",{className:"grid gap-5 lg:grid-cols-[1.2fr_0.8fr]",children:[se("article",{className:"editorial-panel space-y-4",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Reference and evidence"}),A("h2",{className:"editorial-panel-title",children:"Use generated docs and examples as proof, not just narrative copy"}),A("p",{className:"editorial-copy text-sm",children:"The reference index and example catalog stay close to the repo truth. Use them when you need exact public surfaces, not just the explanatory layer."})]}),se("div",{className:"grid gap-4 md:grid-cols-2",children:[se(Vo,{href:"/docs/reference",className:"docs-footer-link",children:[se("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[A(ep,{size:16}),A("span",{children:"Reference index"})]}),A("p",{className:"text-muted-foreground text-sm",children:"Search generated contract docs, versions, tags, and visibility metadata."})]}),se(Vo,{href:"/docs/examples",className:"docs-footer-link",children:[se("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[A(yc,{size:16}),A("span",{children:"Examples"})]}),A("p",{className:"text-muted-foreground text-sm",children:"Browse runnable examples and follow the reference routes back to their source artifacts."})]})]})]}),se("article",{className:"editorial-panel space-y-4",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Secondary reading"}),A("h2",{className:"editorial-panel-title",children:"Why ContractSpec"}),A("p",{className:"editorial-copy text-sm",children:"Positioning, comparisons, and philosophy remain available, but they no longer define the main docs path."})]}),A("div",{className:"flex flex-wrap gap-2",children:t.map((a)=>A(Vo,{href:a.href,className:"docs-chip-link",children:a.title},a.href))})]})]})]})}import Hi from"@contractspec/lib.ui-link";import{ChevronRight as np}from"lucide-react";import{jsx as B,jsxs as ft}from"react/jsx-runtime";function _N(){return ft("div",{className:"space-y-8",children:[ft("div",{className:"space-y-4",children:[B("h1",{className:"font-bold text-4xl",children:"MCP Adapters"}),ft("p",{className:"text-muted-foreground",children:["The ",B("strong",{children:"Model Context Protocol (MCP)"})," is an open standard for connecting AI models to external tools and data sources. ContractSpec provides MCP adapters that allow you to expose your capabilities as MCP tools and consume external MCP servers as capabilities."]})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Why MCP integration matters"}),B("p",{className:"text-muted-foreground",children:"AI agents need access to real-world tools and data to be useful. MCP provides a standardized way to expose these capabilities. By integrating ContractSpec with MCP, you can:"}),ft("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:"Let AI agents invoke your ContractSpec capabilities safely and securely"}),B("li",{children:"Use external MCP servers (databases, APIs, search engines) as capability providers in your workflows"}),B("li",{children:"Build AI-powered features without writing custom integration code"}),B("li",{children:"Enforce policies on AI agent actions just like any other user"})]})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Exposing capabilities as MCP tools"}),ft("p",{className:"text-muted-foreground",children:["Any"," ",B(Hi,{href:"/docs/specs/capabilities",className:"text-violet-400 hover:text-violet-300",children:"CapabilitySpec"})," ","can be automatically exposed as an MCP tool. ContractSpec generates:"]}),ft("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:"A tool schema describing the capability's inputs, outputs, and purpose"}),B("li",{children:"An MCP server endpoint that AI agents can connect to"}),B("li",{children:"Policy enforcement ensuring agents can only invoke capabilities they're authorized to use"}),B("li",{children:"Audit logging of all agent actions for compliance and debugging"})]})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Example: Exposing a capability"}),B("p",{className:"text-muted-foreground",children:"Here's how to expose ContractSpec operations as MCP tools:"}),B("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:B("pre",{children:`import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
8
+ contractspec validate src/contracts/mySpec.ts`})]}),se("section",{className:"space-y-5",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Primary path"}),A("h2",{className:"editorial-panel-title",children:"Move through the system in the right order"}),A("p",{className:"editorial-copy text-sm",children:"Start with onboarding, then learn the model, then build and operate with confidence. The primary docs path is intentionally shorter than the full route inventory."})]}),A("div",{className:"grid gap-5 lg:grid-cols-2",children:e.map((a)=>se("article",{className:"editorial-panel space-y-4",children:[se("div",{children:[A("p",{className:"editorial-kicker",children:a.title}),A("h3",{className:"mt-2 font-serif text-3xl tracking-[-0.03em]",children:a.title}),A("p",{className:"mt-3 text-muted-foreground text-sm leading-7",children:a.description})]}),A("div",{className:"space-y-3",children:a.featured.map((r)=>se(Vo,{href:r.href,className:"flex items-start justify-between gap-4 rounded-[22px] border border-border/70 bg-background/70 p-4 transition-colors hover:border-[color:rgb(162_79_42_/_0.45)]",children:[se("div",{children:[A("h4",{className:"font-semibold text-base",children:r.title}),A("p",{className:"mt-1 text-muted-foreground text-sm leading-6",children:r.description})]}),A(Gr,{className:"mt-1 shrink-0",size:16})]},r.href))})]},a.key))})]}),se("section",{className:"grid gap-5 lg:grid-cols-[1.2fr_0.8fr]",children:[se("article",{className:"editorial-panel space-y-4",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Reference and evidence"}),A("h2",{className:"editorial-panel-title",children:"Use generated docs and examples as proof, not just narrative copy"}),A("p",{className:"editorial-copy text-sm",children:"The reference index and example catalog stay close to the repo truth. Use them when you need exact public surfaces, not just the explanatory layer."})]}),se("div",{className:"grid gap-4 md:grid-cols-2",children:[se(Vo,{href:"/docs/reference",className:"docs-footer-link",children:[se("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[A(ep,{size:16}),A("span",{children:"Reference index"})]}),A("p",{className:"text-muted-foreground text-sm",children:"Search generated contract docs, versions, tags, and visibility metadata."})]}),se(Vo,{href:"/docs/examples",className:"docs-footer-link",children:[se("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[A(yc,{size:16}),A("span",{children:"Examples"})]}),A("p",{className:"text-muted-foreground text-sm",children:"Browse runnable examples and follow the reference routes back to their source artifacts."})]})]})]}),se("article",{className:"editorial-panel space-y-4",children:[se("div",{className:"space-y-2",children:[A("p",{className:"editorial-kicker",children:"Secondary reading"}),A("h2",{className:"editorial-panel-title",children:"Why ContractSpec"}),A("p",{className:"editorial-copy text-sm",children:"Positioning, comparisons, and philosophy remain available, but they no longer define the main docs path."})]}),A("div",{className:"flex flex-wrap gap-2",children:t.map((a)=>A(Vo,{href:a.href,className:"docs-chip-link",children:a.title},a.href))})]})]})]})}import qi from"@contractspec/lib.ui-link";import{ChevronRight as np}from"lucide-react";import{jsx as B,jsxs as ft}from"react/jsx-runtime";function _N(){return ft("div",{className:"space-y-8",children:[ft("div",{className:"space-y-4",children:[B("h1",{className:"font-bold text-4xl",children:"MCP Adapters"}),ft("p",{className:"text-muted-foreground",children:["The ",B("strong",{children:"Model Context Protocol (MCP)"})," is an open standard for connecting AI models to external tools and data sources. ContractSpec provides MCP adapters that allow you to expose your capabilities as MCP tools and consume external MCP servers as capabilities."]})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Why MCP integration matters"}),B("p",{className:"text-muted-foreground",children:"AI agents need access to real-world tools and data to be useful. MCP provides a standardized way to expose these capabilities. By integrating ContractSpec with MCP, you can:"}),ft("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:"Let AI agents invoke your ContractSpec capabilities safely and securely"}),B("li",{children:"Use external MCP servers (databases, APIs, search engines) as capability providers in your workflows"}),B("li",{children:"Build AI-powered features without writing custom integration code"}),B("li",{children:"Enforce policies on AI agent actions just like any other user"})]})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Exposing capabilities as MCP tools"}),ft("p",{className:"text-muted-foreground",children:["Any"," ",B(qi,{href:"/docs/specs/capabilities",className:"text-violet-400 hover:text-violet-300",children:"CapabilitySpec"})," ","can be automatically exposed as an MCP tool. ContractSpec generates:"]}),ft("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:"A tool schema describing the capability's inputs, outputs, and purpose"}),B("li",{children:"An MCP server endpoint that AI agents can connect to"}),B("li",{children:"Policy enforcement ensuring agents can only invoke capabilities they're authorized to use"}),B("li",{children:"Audit logging of all agent actions for compliance and debugging"})]})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Example: Exposing a capability"}),B("p",{className:"text-muted-foreground",children:"Here's how to expose ContractSpec operations as MCP tools:"}),B("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:B("pre",{children:`import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
9
9
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
10
10
  import { createMcpServer } from '@contractspec/lib.contracts-runtime-server-mcp/provider-mcp';
11
11
  import { registry, resources, prompts } from './lib/registry';
@@ -51,7 +51,7 @@ const SearchProductsIntegration = defineIntegration({
51
51
  },
52
52
  }),
53
53
  },
54
- });`})})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Policy enforcement for AI agents"}),ft("p",{className:"text-muted-foreground",children:["AI agents are treated like any other actor in ContractSpec. They must authenticate, and all their actions are subject to"," ",B(Hi,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". You can define specific policies in TypeScript:"]}),B("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:B("pre",{children:`import { definePolicy } from '@contractspec/lib.contracts-spec';
54
+ });`})})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Policy enforcement for AI agents"}),ft("p",{className:"text-muted-foreground",children:["AI agents are treated like any other actor in ContractSpec. They must authenticate, and all their actions are subject to"," ",B(qi,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". You can define specific policies in TypeScript:"]}),B("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:B("pre",{children:`import { definePolicy } from '@contractspec/lib.contracts-spec';
55
55
 
56
56
  export const AIAgentRestrictions = definePolicy({
57
57
  meta: {
@@ -74,7 +74,7 @@ export const AIAgentRestrictions = definePolicy({
74
74
  !ctx.approvalGranted,
75
75
  },
76
76
  ],
77
- });`})})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Human-in-the-loop workflows"}),B("p",{className:"text-muted-foreground",children:"For sensitive operations, you can require human approval before an AI agent can proceed. ContractSpec provides built-in approval workflows:"}),ft("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:"Agent requests permission to invoke a capability"}),B("li",{children:"Request is sent to designated approvers (via email, Slack, etc.)"}),B("li",{children:"Approver reviews the request and approves or denies it"}),B("li",{children:"Agent receives the decision and can proceed if approved"})]}),ft("p",{className:"text-muted-foreground",children:["All approval decisions are logged in the"," ",B(Hi,{href:"/docs/safety/auditing",className:"text-violet-400 hover:text-violet-300",children:"audit log"}),"."]})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Best practices"}),ft("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:"Start with read-only capabilities for AI agents\u2014only grant write access when necessary."}),B("li",{children:"Use human-in-the-loop approval for any capability that modifies critical data or triggers financial transactions."}),B("li",{children:"Set rate limits to prevent runaway agents from overwhelming your system."}),B("li",{children:"Provide clear, detailed descriptions for each capability so agents know when to use them."}),B("li",{children:"Monitor agent actions closely in production and adjust policies as needed."}),B("li",{children:"Test agent integrations thoroughly with realistic scenarios before deploying."})]})]}),ft("div",{className:"flex items-center gap-4 pt-4",children:[B(Hi,{href:"/docs/advanced/renderers",className:"btn-ghost",children:"Previous: Custom Renderers"}),ft(Hi,{href:"/docs/advanced/telemetry",className:"btn-primary",children:["Next: Telemetry ",B(np,{size:16})]})]})]})}import cp from"@contractspec/lib.ui-link";import{jsx as ta,jsxs as Ao}from"react/jsx-runtime";function qN(){return Ao("div",{className:"space-y-8",children:[Ao("div",{className:"space-y-4",children:[ta("h1",{className:"font-bold text-4xl",children:"Overlay Editor"}),ta("p",{className:"text-lg text-muted-foreground",children:"A Next.js app (`@contractspec/app.overlay-editor`) that lets tenant admins tweak field visibility, labels, and ordering, then sign OverlaySpecs."})]}),Ao("div",{className:"space-y-4",children:[ta("h2",{className:"font-bold text-2xl",children:"Features"}),Ao("ul",{className:"list-disc space-y-2 pl-6",children:[ta("li",{children:"Toggle visibility and rename labels without touching code."}),ta("li",{children:"Move fields up/down to define the overlay order."}),ta("li",{children:"Preview JSON output powered by `@contractspec/lib.overlay-engine`."}),ta("li",{children:"Server action for PEM signing (Ed25519/RSA-PSS)."})]}),Ao("p",{children:["Project path: ",ta("code",{children:"packages/apps/overlay-editor"})]})]}),Ao("div",{className:"space-y-4",children:[ta("h2",{className:"font-bold text-2xl",children:"Provisioning flow"}),Ao("ol",{className:"list-decimal space-y-2 pl-6",children:[Ao("li",{children:["Clone the repo and run ",ta("code",{children:"bun dev"})," inside the app."]}),ta("li",{children:"Use the UI to craft the overlay for a tenant."}),ta("li",{children:"Paste the tenant's PEM private key (stored in Vault/KMS)."}),ta("li",{children:"Click \u201CSign overlay\u201D to get the final JSON payload."}),ta("li",{children:"Persist in the `Overlay` table and register with `OverlayRegistry`."})]}),Ao("p",{children:["See also:"," ",ta(cp,{href:"/docs/ops/tenant-customization",className:"text-violet-400 underline",children:"Tenant customization runbook"}),"."]})]})]})}import lp from"@contractspec/lib.ui-link";import{ChevronRight as dp}from"lucide-react";import{jsx as aa,jsxs as mo}from"react/jsx-runtime";function YN(){return mo("div",{className:"space-y-8",children:[mo("div",{className:"space-y-2",children:[aa("h1",{className:"font-bold text-4xl",children:"Custom Renderers"}),aa("p",{className:"text-lg text-muted-foreground",children:"ContractSpec ships with React and React Native renderers. You can build custom renderers for any framework."})]}),mo("div",{className:"space-y-6",children:[mo("div",{className:"space-y-3",children:[aa("h2",{className:"font-bold text-2xl",children:"Overview"}),mo("p",{className:"text-muted-foreground",children:["The presentation runtime libraries (",aa("code",{children:"@contractspec/lib.presentation-runtime-react"})," and",aa("code",{children:"@contractspec/lib.presentation-runtime-react-native"}),") provide hooks and components to render ContractSpec-defined UI like workflows and data views. You can extend these or create custom implementations for other frameworks."]})]}),mo("div",{className:"space-y-3",children:[aa("h2",{className:"font-bold text-2xl",children:"Using the React Renderer"}),aa("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:aa("pre",{children:`import { useWorkflow, WorkflowStepRenderer } from '@contractspec/lib.presentation-runtime-react';
77
+ });`})})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Human-in-the-loop workflows"}),B("p",{className:"text-muted-foreground",children:"For sensitive operations, you can require human approval before an AI agent can proceed. ContractSpec provides built-in approval workflows:"}),ft("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:"Agent requests permission to invoke a capability"}),B("li",{children:"Request is sent to designated approvers (via email, Slack, etc.)"}),B("li",{children:"Approver reviews the request and approves or denies it"}),B("li",{children:"Agent receives the decision and can proceed if approved"})]}),ft("p",{className:"text-muted-foreground",children:["All approval decisions are logged in the"," ",B(qi,{href:"/docs/safety/auditing",className:"text-violet-400 hover:text-violet-300",children:"audit log"}),"."]})]}),ft("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Best practices"}),ft("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:"Start with read-only capabilities for AI agents\u2014only grant write access when necessary."}),B("li",{children:"Use human-in-the-loop approval for any capability that modifies critical data or triggers financial transactions."}),B("li",{children:"Set rate limits to prevent runaway agents from overwhelming your system."}),B("li",{children:"Provide clear, detailed descriptions for each capability so agents know when to use them."}),B("li",{children:"Monitor agent actions closely in production and adjust policies as needed."}),B("li",{children:"Test agent integrations thoroughly with realistic scenarios before deploying."})]})]}),ft("div",{className:"flex items-center gap-4 pt-4",children:[B(qi,{href:"/docs/advanced/renderers",className:"btn-ghost",children:"Previous: Custom Renderers"}),ft(qi,{href:"/docs/advanced/telemetry",className:"btn-primary",children:["Next: Telemetry ",B(np,{size:16})]})]})]})}import cp from"@contractspec/lib.ui-link";import{jsx as ta,jsxs as Ao}from"react/jsx-runtime";function HN(){return Ao("div",{className:"space-y-8",children:[Ao("div",{className:"space-y-4",children:[ta("h1",{className:"font-bold text-4xl",children:"Overlay Editor"}),ta("p",{className:"text-lg text-muted-foreground",children:"A Next.js app (`@contractspec/app.overlay-editor`) that lets tenant admins tweak field visibility, labels, and ordering, then sign OverlaySpecs."})]}),Ao("div",{className:"space-y-4",children:[ta("h2",{className:"font-bold text-2xl",children:"Features"}),Ao("ul",{className:"list-disc space-y-2 pl-6",children:[ta("li",{children:"Toggle visibility and rename labels without touching code."}),ta("li",{children:"Move fields up/down to define the overlay order."}),ta("li",{children:"Preview JSON output powered by `@contractspec/lib.overlay-engine`."}),ta("li",{children:"Server action for PEM signing (Ed25519/RSA-PSS)."})]}),Ao("p",{children:["Project path: ",ta("code",{children:"packages/apps/overlay-editor"})]})]}),Ao("div",{className:"space-y-4",children:[ta("h2",{className:"font-bold text-2xl",children:"Provisioning flow"}),Ao("ol",{className:"list-decimal space-y-2 pl-6",children:[Ao("li",{children:["Clone the repo and run ",ta("code",{children:"bun dev"})," inside the app."]}),ta("li",{children:"Use the UI to craft the overlay for a tenant."}),ta("li",{children:"Paste the tenant's PEM private key (stored in Vault/KMS)."}),ta("li",{children:"Click \u201CSign overlay\u201D to get the final JSON payload."}),ta("li",{children:"Persist in the `Overlay` table and register with `OverlayRegistry`."})]}),Ao("p",{children:["See also:"," ",ta(cp,{href:"/docs/ops/tenant-customization",className:"text-violet-400 underline",children:"Tenant customization runbook"}),"."]})]})]})}import lp from"@contractspec/lib.ui-link";import{ChevronRight as dp}from"lucide-react";import{jsx as aa,jsxs as mo}from"react/jsx-runtime";function YN(){return mo("div",{className:"space-y-8",children:[mo("div",{className:"space-y-2",children:[aa("h1",{className:"font-bold text-4xl",children:"Custom Renderers"}),aa("p",{className:"text-lg text-muted-foreground",children:"ContractSpec ships with React and React Native renderers. You can build custom renderers for any framework."})]}),mo("div",{className:"space-y-6",children:[mo("div",{className:"space-y-3",children:[aa("h2",{className:"font-bold text-2xl",children:"Overview"}),mo("p",{className:"text-muted-foreground",children:["The presentation runtime libraries (",aa("code",{children:"@contractspec/lib.presentation-runtime-react"})," and",aa("code",{children:"@contractspec/lib.presentation-runtime-react-native"}),") provide hooks and components to render ContractSpec-defined UI like workflows and data views. You can extend these or create custom implementations for other frameworks."]})]}),mo("div",{className:"space-y-3",children:[aa("h2",{className:"font-bold text-2xl",children:"Using the React Renderer"}),aa("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:aa("pre",{children:`import { useWorkflow, WorkflowStepRenderer } from '@contractspec/lib.presentation-runtime-react';
78
78
  import { MyWorkflowSpec } from './specs';
79
79
 
80
80
  export function WorkflowPage() {
@@ -89,7 +89,7 @@ export function WorkflowPage() {
89
89
  </button>
90
90
  </div>
91
91
  );
92
- }`})})]}),mo("div",{className:"space-y-3",children:[aa("h2",{className:"font-bold text-2xl",children:"Custom Platform Support"}),aa("p",{className:"text-muted-foreground",children:"To support a new platform (e.g., Vue, Svelte), you would:"}),mo("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[mo("li",{children:["Implement the core workflow state machine (from"," ",aa("code",{children:"@contractspec/lib.presentation-runtime-core"}),")"]}),aa("li",{children:"Create framework-specific hooks/components for step rendering"}),aa("li",{children:"Handle validation and submission via the ContractSpec I/O schemas"})]})]}),aa("div",{className:"flex items-center gap-4 pt-4",children:mo(lp,{href:"/docs",className:"btn-primary",children:["Back to docs ",aa(dp,{size:16})]})})]})]})}import{jsx as eo,jsxs as Si}from"react/jsx-runtime";function ZN(){return Si("div",{className:"space-y-8",children:[Si("div",{className:"space-y-4",children:[eo("h1",{className:"font-bold text-4xl",children:"Spec Experiments"}),eo("p",{className:"text-lg text-muted-foreground",children:"Run controlled experiments on ContractSpec operations, gradually shift traffic, and roll back automatically when guardrails trip."})]}),Si("div",{className:"space-y-3",children:[eo("h2",{className:"font-bold text-2xl",children:"Define control + variants"}),eo("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { SpecExperimentRegistry } from '@contractspec/lib.growth/spec-experiments';
92
+ }`})})]}),mo("div",{className:"space-y-3",children:[aa("h2",{className:"font-bold text-2xl",children:"Custom Platform Support"}),aa("p",{className:"text-muted-foreground",children:"To support a new platform (e.g., Vue, Svelte), you would:"}),mo("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[mo("li",{children:["Implement the core workflow state machine (from"," ",aa("code",{children:"@contractspec/lib.presentation-runtime-core"}),")"]}),aa("li",{children:"Create framework-specific hooks/components for step rendering"}),aa("li",{children:"Handle validation and submission via the ContractSpec I/O schemas"})]})]}),aa("div",{className:"flex items-center gap-4 pt-4",children:mo(lp,{href:"/docs",className:"btn-primary",children:["Back to docs ",aa(dp,{size:16})]})})]})]})}import{jsx as eo,jsxs as Si}from"react/jsx-runtime";function $N(){return Si("div",{className:"space-y-8",children:[Si("div",{className:"space-y-4",children:[eo("h1",{className:"font-bold text-4xl",children:"Spec Experiments"}),eo("p",{className:"text-lg text-muted-foreground",children:"Run controlled experiments on ContractSpec operations, gradually shift traffic, and roll back automatically when guardrails trip."})]}),Si("div",{className:"space-y-3",children:[eo("h2",{className:"font-bold text-2xl",children:"Define control + variants"}),eo("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { SpecExperimentRegistry } from '@contractspec/lib.growth/spec-experiments';
93
93
 
94
94
  const registry = new SpecExperimentRegistry().register({
95
95
  target: { name: 'billing.createInvoice', version: 4 },
@@ -179,7 +179,7 @@ const monitor = new SLAMonitor((event, payload) => {
179
179
  });
180
180
 
181
181
  // Check periodically
182
- monitor.check(currentState, workflowSpec);`})]}),Fo("div",{className:"space-y-4",children:[Na("h2",{className:"font-bold text-2xl",children:"Telemetry & Tracing"}),Na("p",{children:"Workflows automatically generate OpenTelemetry spans for:"}),Fo("ul",{className:"list-disc space-y-2 pl-6",children:[Na("li",{children:"Overall workflow execution"}),Na("li",{children:"Individual steps"}),Na("li",{children:"Retries and compensation"})]}),Na("p",{children:"Configure your OpenTelemetry exporter to send traces to Jaeger, Datadog, or Honeycomb."})]}),Fo("div",{className:"space-y-4",children:[Na("h2",{className:"font-bold text-2xl",children:"Dashboarding"}),Fo("p",{children:["You can build a custom dashboard using ",Na("code",{children:"DataViews"})," over your workflow state database. See the DataViews tutorial for how to visualize ",Na("code",{children:"WorkflowState"})," records."]})]})]})}import{CodeBlock as qi}from"@contractspec/lib.design-system";import vc from"@contractspec/lib.ui-link";import{ChevronRight as pp}from"lucide-react";import{jsx as ie,jsxs as at}from"react/jsx-runtime";function mp(){return at("div",{className:"space-y-8",children:[at("div",{className:"space-y-4",children:[ie("h1",{className:"font-bold text-4xl",children:"App Configuration"}),ie("p",{className:"text-muted-foreground",children:"ContractSpec uses a three-tier configuration model that separates global app definitions from tenant-specific settings and runtime resolution."})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"AppBlueprintSpec"}),at("p",{className:"text-muted-foreground",children:["The ",ie("strong",{children:"AppBlueprintSpec"})," is the global, versioned definition of your application. It contains no tenant-specific information and is stored in version control."]}),ie(qi,{language:"typescript",code:`type AppBlueprintSpec = {
182
+ monitor.check(currentState, workflowSpec);`})]}),Fo("div",{className:"space-y-4",children:[Na("h2",{className:"font-bold text-2xl",children:"Telemetry & Tracing"}),Na("p",{children:"Workflows automatically generate OpenTelemetry spans for:"}),Fo("ul",{className:"list-disc space-y-2 pl-6",children:[Na("li",{children:"Overall workflow execution"}),Na("li",{children:"Individual steps"}),Na("li",{children:"Retries and compensation"})]}),Na("p",{children:"Configure your OpenTelemetry exporter to send traces to Jaeger, Datadog, or Honeycomb."})]}),Fo("div",{className:"space-y-4",children:[Na("h2",{className:"font-bold text-2xl",children:"Dashboarding"}),Fo("p",{children:["You can build a custom dashboard using ",Na("code",{children:"DataViews"})," over your workflow state database. See the DataViews tutorial for how to visualize ",Na("code",{children:"WorkflowState"})," records."]})]})]})}import{CodeBlock as Hi}from"@contractspec/lib.design-system";import vc from"@contractspec/lib.ui-link";import{ChevronRight as pp}from"lucide-react";import{jsx as ie,jsxs as at}from"react/jsx-runtime";function mp(){return at("div",{className:"space-y-8",children:[at("div",{className:"space-y-4",children:[ie("h1",{className:"font-bold text-4xl",children:"App Configuration"}),ie("p",{className:"text-muted-foreground",children:"ContractSpec uses a three-tier configuration model that separates global app definitions from tenant-specific settings and runtime resolution."})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"AppBlueprintSpec"}),at("p",{className:"text-muted-foreground",children:["The ",ie("strong",{children:"AppBlueprintSpec"})," is the global, versioned definition of your application. It contains no tenant-specific information and is stored in version control."]}),ie(Hi,{language:"typescript",code:`type AppBlueprintSpec = {
183
183
  id: string;
184
184
  version: string;
185
185
  name: string;
@@ -216,7 +216,7 @@ monitor.check(currentState, workflowSpec);`})]}),Fo("div",{className:"space-y-4"
216
216
 
217
217
  // Schema evolution
218
218
  migrations: MigrationSpec[];
219
- };`})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"TenantAppConfig"}),at("p",{className:"text-muted-foreground",children:["The ",ie("strong",{children:"TenantAppConfig"})," is the per-tenant, per-environment configuration that customizes how a specific tenant uses the app."]}),ie(qi,{language:"typescript",code:`type TenantAppConfig = {
219
+ };`})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"TenantAppConfig"}),at("p",{className:"text-muted-foreground",children:["The ",ie("strong",{children:"TenantAppConfig"})," is the per-tenant, per-environment configuration that customizes how a specific tenant uses the app."]}),ie(Hi,{language:"typescript",code:`type TenantAppConfig = {
220
220
  tenantId: string;
221
221
  blueprintId: string;
222
222
  blueprintVersion: string;
@@ -247,7 +247,7 @@ monitor.check(currentState, workflowSpec);`})]}),Fo("div",{className:"space-y-4"
247
247
  metadata: Record<string, unknown>;
248
248
  createdAt: string;
249
249
  updatedAt: string;
250
- };`})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"AppIntegrationBinding"}),ie("p",{className:"text-muted-foreground",children:"Defines how a tenant connects specific integration instances to satisfy capabilities and workflows."}),ie(qi,{language:"typescript",code:`type AppIntegrationBinding = {
250
+ };`})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"AppIntegrationBinding"}),ie("p",{className:"text-muted-foreground",children:"Defines how a tenant connects specific integration instances to satisfy capabilities and workflows."}),ie(Hi,{language:"typescript",code:`type AppIntegrationBinding = {
251
251
  slotId: string; // References AppIntegrationSlot.slotId
252
252
  connectionId: string; // References IntegrationConnection.meta.id
253
253
  scope?: {
@@ -267,7 +267,7 @@ monitor.check(currentState, workflowSpec);`})]}),Fo("div",{className:"space-y-4"
267
267
  operations: ["payments.stripe.*"]
268
268
  },
269
269
  priority: 1
270
- }`})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"AppKnowledgeBinding"}),ie("p",{className:"text-muted-foreground",children:"Defines which knowledge spaces a tenant's app can access and how."}),ie(qi,{language:"typescript",code:`type AppKnowledgeBinding = {
270
+ }`})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"AppKnowledgeBinding"}),ie("p",{className:"text-muted-foreground",children:"Defines which knowledge spaces a tenant's app can access and how."}),ie(Hi,{language:"typescript",code:`type AppKnowledgeBinding = {
271
271
  spaceId: string;
272
272
  enabled: boolean;
273
273
 
@@ -297,7 +297,7 @@ monitor.check(currentState, workflowSpec);`})]}),Fo("div",{className:"space-y-4"
297
297
  },
298
298
  allowedCategories: ["canonical", "operational"],
299
299
  sources: ["src_notion_product_docs", "src_database_schema"]
300
- }`})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"ResolvedAppConfig"}),at("p",{className:"text-muted-foreground",children:["The ",ie("strong",{children:"ResolvedAppConfig"})," is the runtime result of merging AppBlueprintSpec with TenantAppConfig. It's computed on-demand and never persisted."]}),ie(qi,{language:"typescript",code:`type ResolvedAppConfig = {
300
+ }`})]}),at("div",{className:"space-y-4",children:[ie("h2",{className:"font-bold text-2xl",children:"ResolvedAppConfig"}),at("p",{className:"text-muted-foreground",children:["The ",ie("strong",{children:"ResolvedAppConfig"})," is the runtime result of merging AppBlueprintSpec with TenantAppConfig. It's computed on-demand and never persisted."]}),ie(Hi,{language:"typescript",code:`type ResolvedAppConfig = {
301
301
  appId: string;
302
302
  tenantId: string;
303
303
  blueprintName: string;
@@ -668,10 +668,10 @@ steps:
668
668
  integrationBindings: AppIntegrationBinding[];
669
669
  knowledgeBindings: AppKnowledgeBinding[];
670
670
  featureFlags: Record<string, boolean>;
671
- };`}),ht("p",{className:"mt-2 text-muted-foreground",children:"This allows you to customize feature flags, integration connections, and knowledge sources per tenant without changing the application code."})]}),Gt("div",{className:"flex items-center gap-4 pt-4",children:[ht(Sc,{href:"/docs/architecture",className:"btn-ghost",children:"Back to Architecture"}),Gt(Sc,{href:"/docs/libraries/multi-tenancy",className:"btn-primary",children:["Multi-Tenancy Library ",ht(Np,{size:16})]})]})]})}import Ii from"@contractspec/lib.ui-link";import{jsx as Ye,jsxs as oa}from"react/jsx-runtime";var kp=[{title:"Contracts and schemas",body:"Explicit specs define the durable boundary for behavior, data, and governance."},{title:"Bindings and configuration",body:"Apps, tenants, integrations, and knowledge sources are wired through explicit configuration instead of hidden glue."},{title:"Runtimes and generators",body:"Serve or generate aligned surfaces for API, UI, workflows, docs, and agent-facing interfaces."},{title:"Operate and observe",body:"Carry auditability, policy, tracing, migrations, and tenant isolation through the same model."}];function Sp(){return oa("div",{className:"space-y-10",children:[oa("div",{className:"space-y-3",children:[Ye("p",{className:"editorial-kicker",children:"Build"}),Ye("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"The architecture keeps contracts, runtime behavior, and operations in the same system."}),Ye("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is not a single runtime. It is a layered system that lets you define explicit boundaries, bind real-world configuration, and then serve or generate aligned surfaces without losing control of the output."})]}),Ye("div",{className:"grid gap-4 md:grid-cols-2",children:kp.map((e)=>oa("article",{className:"editorial-panel space-y-3",children:[Ye("h2",{className:"font-semibold text-xl",children:e.title}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),oa("section",{className:"editorial-panel space-y-5",children:[oa("div",{className:"space-y-2",children:[Ye("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"UI composition belongs in the bundle runtime layer"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"When the system needs adaptive layouts, entity workbenches, assistant slots, and safe overlays, use module bundles as the layer between the contract model and the rendered surface."})]}),oa("div",{className:"grid gap-4 md:grid-cols-2",children:[oa(Ii,{href:"/docs/specs/module-bundles",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Module bundles spec"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"See the typed bundle contract, resolved surface plan model, and bounded AI/runtime behavior."})]}),oa(Ii,{href:"/docs/guides/first-module-bundle",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Build a first module bundle"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"Follow the route-to-plan-to-render path with one practical host example."})]})]})]}),oa("section",{className:"editorial-panel space-y-5",children:[oa("div",{className:"space-y-2",children:[Ye("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Follow the architecture by responsibility"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"Use the architecture pages when you need to understand how the pieces snap together in a real deployment."})]}),oa("div",{className:"grid gap-4 md:grid-cols-2",children:[oa(Ii,{href:"/docs/architecture/app-config",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"App configuration"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"How blueprint-level and tenant-level config stay explicit and merge safely."})]}),oa(Ii,{href:"/docs/architecture/integration-binding",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Integration binding"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"How apps connect to tenant-owned integrations without leaking provider logic everywhere."})]}),oa(Ii,{href:"/docs/architecture/knowledge-binding",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Knowledge binding"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"How trusted knowledge enters the system and stays isolated by context and tenant."})]}),oa(Ii,{href:"/docs/architecture/control-plane",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Control plane runtime"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"How intent, policy, planning, and execution flow through the system runtime."})]})]})]})]})}import{jsx as U,jsxs as Ot}from"react/jsx-runtime";function Cp(){return Ot("div",{className:"space-y-8",children:[Ot("div",{className:"space-y-4",children:[U("h1",{className:"font-bold text-4xl",children:"Automation platforms"}),U("p",{className:"text-muted-foreground",children:"Automation platforms connect apps and automate tasks through triggers and actions. They serve operations and non-technical users well but stop short of generating full applications or enforcing fine-grained policies."})]}),Ot("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"Feature comparison"}),U("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Ot("table",{className:"w-full text-left text-sm",children:[U("thead",{className:"bg-card/50",children:Ot("tr",{className:"border-border/50 border-b",children:[U("th",{className:"px-4 py-3 font-semibold",children:"Feature"}),U("th",{className:"px-4 py-3 font-semibold",children:"Zapier"}),U("th",{className:"px-4 py-3 font-semibold",children:"Make (Integromat)"}),U("th",{className:"px-4 py-3 font-semibold",children:"n8n"}),U("th",{className:"px-4 py-3 font-semibold",children:"Pipedream"})]})}),Ot("tbody",{className:"divide-y divide-border/50",children:[Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Workflow model"}),U("td",{className:"px-4 py-3 align-top",children:"Zaps: trigger + one or more actions"}),U("td",{className:"px-4 py-3 align-top",children:"Real-time visual orchestration for AI agents and automations"}),U("td",{className:"px-4 py-3 align-top",children:"Node-based workflow builder with drag-and-drop and code; build multi-step AI agents"}),U("td",{className:"px-4 py-3 align-top",children:"Workflows connect any API; Pipedream Connect SDK adds integrations quickly"})]}),Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Visual builder?"}),U("td",{className:"px-4 py-3 align-top",children:"Yes (simple; web-based)."}),U("td",{className:"px-4 py-3 align-top",children:"Yes; AI-assisted editor"}),U("td",{className:"px-4 py-3 align-top",children:"Yes; visual canvas."}),U("td",{className:"px-4 py-3 align-top",children:"Code-centric editor; no visual UI builder"})]}),Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Self-host?"}),U("td",{className:"px-4 py-3 align-top",children:"No (cloud only)."}),U("td",{className:"px-4 py-3 align-top",children:"Cloud only."}),U("td",{className:"px-4 py-3 align-top",children:"Yes (Docker, self-host)"}),U("td",{className:"px-4 py-3 align-top",children:"Cloud only (hosted)."})]}),Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Integrations & AI"}),U("td",{className:"px-4 py-3 align-top",children:"Connects almost 8 000 apps; limited AI features."}),U("td",{className:"px-4 py-3 align-top",children:"3 000+ pre-built apps; supports GenAI tools; GDPR/SOC2 and SSO"}),U("td",{className:"px-4 py-3 align-top",children:"Integrates LLMs; allows JS or Python code and library imports; chatbots with Slack/Teams"}),U("td",{className:"px-4 py-3 align-top",children:"MCP servers add 3 000+ APIs and 10 000+ tools to agents; AI agent builder prompts and deploys agents; SOC 2/ HIPAA/GDPR compliant"})]}),Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Policy & UI generation"}),U("td",{className:"px-4 py-3 align-top",children:"No policy engine; does not generate user interfaces."}),U("td",{className:"px-4 py-3 align-top",children:"No policy engine; does not generate UIs beyond a workflow dashboard."}),U("td",{className:"px-4 py-3 align-top",children:"No policy engine; no UI builder"}),U("td",{className:"px-4 py-3 align-top",children:"No policy engine; does not generate UI."})]})]})]})})]}),Ot("div",{className:"space-y-3",children:[U("h2",{className:"font-bold text-2xl",children:"Why ContractSpec differs"}),Ot("ul",{className:"space-y-2 text-muted-foreground",children:[Ot("li",{children:[U("strong",{children:"Full application generation"})," \u2013 ContractSpec compiles specs into back-end, events and user interfaces for both web and mobile."]}),Ot("li",{children:[U("strong",{children:"Policy enforcement"})," \u2013 A built-in policy engine governs PII access and mutations across the UI."]}),Ot("li",{children:[U("strong",{children:"Customisation via overlays"})," \u2013 Non-technical users can safely personalise layouts while respecting policies."]}),Ot("li",{children:[U("strong",{children:"Extensible capabilities"})," \u2013 Connect to external APIs and services via capability providers while maintaining type safety."]})]}),U("p",{className:"text-muted-foreground",children:"Automation tools simplify integrations and tasks; ContractSpec goes further by generating a complete, policy-safe application around your data and processes."})]})]})}import Ip from"@contractspec/lib.ui-link";import{jsx as Y,jsxs as yt}from"react/jsx-runtime";function Pp(){return yt("div",{className:"space-y-8",children:[yt("div",{className:"space-y-4",children:[Y("h1",{className:"font-bold text-4xl",children:"Enterprise orchestration platforms"}),Y("p",{className:"text-muted-foreground",children:"Enterprise orchestration platforms manage mission-critical workloads and integrate deeply with ERP systems. They prioritise governance, reliability and compliance, but they do not provide spec-driven app generation or per-user customisation."})]}),yt("div",{className:"space-y-4",children:[Y("h2",{className:"font-bold text-2xl",children:"Redwood RunMyJobs"}),yt("p",{className:"text-muted-foreground",children:[Y(Ip,{href:"https://www.redwood.com/workload-automation/",className:"underline decoration-dotted underline-offset-4 hover:text-foreground",target:"_blank",rel:"noreferrer",children:"RunMyJobs by Redwood"})," ","is a cloud-native service orchestration and automation platform. Key attributes include:"]}),yt("ul",{className:"space-y-2 text-muted-foreground",children:[yt("li",{children:[Y("strong",{children:"Self-service portal."})," Business users can run and customise workloads while IT ensures governance and compliance"]}),yt("li",{children:[Y("strong",{children:"Full-stack orchestration."})," Integrates with both SAP and non-SAP systems; Redwood is recognised as a Leader in Gartner\u2019s Magic Quadrant for service orchestration"]}),yt("li",{children:[Y("strong",{children:"Observability and AI insights."})," Dashboards and AI-enhanced analytics identify bottlenecks and forecast issues"]}),yt("li",{children:[Y("strong",{children:"Deep SAP integration."})," Supports SAP\u2019s latest technologies and orchestrates mission-critical business processes"]}),yt("li",{children:[Y("strong",{children:"Connectors & wizard."})," Provides pre-built connectors and a wizard to link on-prem and cloud systems"]})]})]}),yt("div",{className:"space-y-4",children:[Y("h3",{className:"font-semibold text-xl",children:"Comparison with ContractSpec"}),Y("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:yt("table",{className:"w-full text-left text-sm",children:[Y("thead",{className:"bg-card/50",children:yt("tr",{className:"border-border/50 border-b",children:[Y("th",{className:"px-4 py-3 font-semibold",children:"Aspect"}),Y("th",{className:"px-4 py-3 font-semibold",children:"RunMyJobs"}),Y("th",{className:"px-4 py-3 font-semibold",children:"ContractSpec"})]})}),yt("tbody",{className:"divide-y divide-border/50",children:[yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"Target user"})}),Y("td",{className:"px-4 py-3 align-top",children:"Enterprise IT and operations teams automating SAP and mission-critical workflows."}),Y("td",{className:"px-4 py-3 align-top",children:"Developers, product teams and SMBs wanting to generate policy-safe apps with customisable UIs."})]}),yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"Workload focus"})}),Y("td",{className:"px-4 py-3 align-top",children:"Service orchestration and job scheduling across ERP/legacy systems"}),Y("td",{className:"px-4 py-3 align-top",children:"End-to-end application generation with back-end, UI and policies."})]}),yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"User interface"})}),Y("td",{className:"px-4 py-3 align-top",children:"Self-service portal to run/monitor jobs; no custom UI generation for new apps."}),Y("td",{className:"px-4 py-3 align-top",children:"Generates React/React-Native UIs from specs; users can personalise layout via overlays."})]}),yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"Open source"})}),Y("td",{className:"px-4 py-3 align-top",children:"Proprietary SaaS; enterprise agreements."}),Y("td",{className:"px-4 py-3 align-top",children:"Core compiler is proprietary; SDK and certain modules may be open-source; offers hosted and on-prem options."})]}),yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"Policy & personalisation"})}),Y("td",{className:"px-4 py-3 align-top",children:"IT controls governance; no per-user overlay concept."}),Y("td",{className:"px-4 py-3 align-top",children:"Built-in policy engine and per-user overlays for safe personalisation."})]})]})]})}),Y("p",{className:"text-muted-foreground",children:"Redwood RunMyJobs is designed for orchestrating enterprise workloads and SAP processes. ContractSpec targets a different problem: generating complete applications from typed specs and letting end users adapt them safely."})]})]})}import{jsx as W,jsxs as Bt}from"react/jsx-runtime";function Tp(){return Bt("div",{className:"space-y-8",children:[Bt("div",{className:"space-y-4",children:[W("h1",{className:"font-bold text-4xl",children:"Internal-tool builders"}),W("p",{className:"text-muted-foreground",children:"Internal-tool builders let teams quickly assemble dashboards and admin panels. These platforms often provide drag-and-drop UIs and connectors to databases and APIs, but they rely on developers to write custom code for business logic and seldom enforce policies across surfaces."})]}),Bt("div",{className:"space-y-4",children:[W("h2",{className:"font-bold text-2xl",children:"Feature comparison"}),W("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Bt("table",{className:"w-full text-left text-sm",children:[W("thead",{className:"bg-card/50",children:Bt("tr",{className:"border-border/50 border-b",children:[W("th",{className:"px-4 py-3 font-semibold",children:"Feature"}),W("th",{className:"px-4 py-3 font-semibold",children:"Retool"}),W("th",{className:"px-4 py-3 font-semibold",children:"Appsmith"}),W("th",{className:"px-4 py-3 font-semibold",children:"ToolJet"}),W("th",{className:"px-4 py-3 font-semibold",children:"Budibase"})]})}),Bt("tbody",{className:"divide-y divide-border/50",children:[Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"UI builder"}),W("td",{className:"px-4 py-3 align-top",children:"Drag-and-drop canvas; shape UI components easily"}),W("td",{className:"px-4 py-3 align-top",children:"Visual builder with drag-and-drop widgets"}),W("td",{className:"px-4 py-3 align-top",children:"Drag-and-drop UI widgets (tables, charts, forms)"}),W("td",{className:"px-4 py-3 align-top",children:"Pre-built components and templates for mobile/desktop"})]}),Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"Custom code & logic"}),W("td",{className:"px-4 py-3 align-top",children:"Full code insertion anywhere via IDE"}),W("td",{className:"px-4 py-3 align-top",children:"Logic via JavaScript or natural-language prompts in a central IDE"}),W("td",{className:"px-4 py-3 align-top",children:"Supports business logic in JavaScript or Python queries"}),W("td",{className:"px-4 py-3 align-top",children:"Custom logic via JavaScript; plugins and external embeds"})]}),Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"Data connectors"}),W("td",{className:"px-4 py-3 align-top",children:"Wide support for databases and APIs (PostgreSQL, MongoDB, GraphQL, etc.)."}),W("td",{className:"px-4 py-3 align-top",children:"Connects to LLMs and databases"}),W("td",{className:"px-4 py-3 align-top",children:"Built-in database; connects to PostgreSQL, MongoDB, APIs, GraphQL, SaaS"}),W("td",{className:"px-4 py-3 align-top",children:"Connects to external databases, REST, CSV or built-in DB"})]}),Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"Open source & self-host"}),W("td",{className:"px-4 py-3 align-top",children:"Proprietary; cloud or on-prem subscription."}),W("td",{className:"px-4 py-3 align-top",children:"Open source (Apache-2.0); self-host or cloud."}),W("td",{className:"px-4 py-3 align-top",children:"Open source; self-host via Docker or cloud."}),W("td",{className:"px-4 py-3 align-top",children:"Open source; self-host via Docker/Kubernetes"})]}),Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"Policy & personalisation"}),W("td",{className:"px-4 py-3 align-top",children:"No built-in policy engine; personalisation limited to user roles."}),W("td",{className:"px-4 py-3 align-top",children:"No typed policy engine; customisation depends on user roles."}),W("td",{className:"px-4 py-3 align-top",children:"No policy engine; personalisation via user roles."}),W("td",{className:"px-4 py-3 align-top",children:"No policy engine; personalisation via RBAC & SSO"})]})]})]})})]}),Bt("div",{className:"space-y-3",children:[W("h2",{className:"font-bold text-2xl",children:"ContractSpec\u2019s differences"}),Bt("ul",{className:"space-y-2 text-muted-foreground",children:[Bt("li",{children:[W("strong",{children:"Typed specifications"})," produce both the API and UI. You define capabilities, data views and workflows, and the compiler generates code, forms and screens\u2014no manual widget wiring."]}),Bt("li",{children:[W("strong",{children:"Policy enforcement"})," at run time ensures PII and ABAC rules across the entire app."]}),Bt("li",{children:[W("strong",{children:"Overlay personalisation"})," allows tenants and users to change layouts safely without code."]}),Bt("li",{children:[W("strong",{children:"Unified mobile/web runtime"})," means you don\u2019t need separate builders for React Native vs web."]})]}),W("p",{className:"text-muted-foreground",children:"Internal-tool builders are useful for quick dashboards. ContractSpec extends this by generating the whole stack from specs and enforcing policies throughout."})]})]})}import{jsx as Q,jsxs as to}from"react/jsx-runtime";function Ap(){return to("div",{className:"space-y-8",children:[to("div",{className:"space-y-4",children:[Q("h1",{className:"font-bold text-4xl",children:"Comparison overview"}),Q("p",{className:"text-muted-foreground",children:"ContractSpec sits at the intersection of several tool categories. To appreciate its unique offering\u2014typed specifications for back-end, front-end, workflows and policies with a unified web/mobile runtime\u2014this section compares it to related products."}),to("p",{className:"text-muted-foreground",children:["ContractSpec uses ",Q("strong",{children:"runtime adapters"})," to serve typed"," ",Q("strong",{children:"Operations"})," (Commands/Queries),"," ",Q("strong",{children:"DataViews"}),", ",Q("strong",{children:"Workflows"}),", and"," ",Q("strong",{children:"Policies"})," as REST/GraphQL/MCP endpoints. A"," ",Q("strong",{children:"policy decision point"})," governs every operation, and"," ",Q("strong",{children:"OverlaySpecs"})," allow non-technical users to personalise screens safely. Few competitors offer this combination of runtime type safety, policy enforcement, and end-user customisation."]})]}),to("div",{className:"space-y-4",children:[Q("h2",{className:"font-bold text-2xl",children:"Tool categories"}),Q("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:to("table",{className:"w-full text-left text-sm",children:[Q("thead",{className:"bg-card/50",children:to("tr",{className:"border-border/50 border-b",children:[Q("th",{className:"px-4 py-3 font-semibold",children:"Category"}),Q("th",{className:"px-4 py-3 font-semibold",children:"Examples"}),Q("th",{className:"px-4 py-3 font-semibold",children:"What they do"}),Q("th",{className:"px-4 py-3 font-semibold",children:"Limitations"})]})}),to("tbody",{className:"divide-y divide-border/50",children:[to("tr",{children:[Q("td",{className:"px-4 py-3 align-top",children:Q("strong",{children:"Workflow engines"})}),Q("td",{className:"px-4 py-3 align-top",children:"Prefect, Kestra, Temporal, Airflow, Dagster, Hatchet, Windmill"}),Q("td",{className:"px-4 py-3 align-top",children:"Orchestrate code or data pipelines; handle retries, scheduling and observability"}),Q("td",{className:"px-4 py-3 align-top",children:"Require writing code; no automatic UI generation or policy enforcement."})]}),to("tr",{children:[Q("td",{className:"px-4 py-3 align-top",children:Q("strong",{children:"Internal-tool builders"})}),Q("td",{className:"px-4 py-3 align-top",children:"Retool, Appsmith, ToolJet, Budibase"}),Q("td",{className:"px-4 py-3 align-top",children:"Drag-and-drop dashboards and admin panels; connect to databases/APIs"}),Q("td",{className:"px-4 py-3 align-top",children:"No typed back-end spec; limited enforcement of policies; custom code glues logic."})]}),to("tr",{children:[Q("td",{className:"px-4 py-3 align-top",children:Q("strong",{children:"Automation platforms"})}),Q("td",{className:"px-4 py-3 align-top",children:"Zapier, Make, n8n, Pipedream"}),Q("td",{className:"px-4 py-3 align-top",children:"Connect apps via triggers and actions; visual or low-code interfaces"}),Q("td",{className:"px-4 py-3 align-top",children:"Automate tasks but do not generate full apps or enforce per-field policies."})]}),to("tr",{children:[Q("td",{className:"px-4 py-3 align-top",children:Q("strong",{children:"Enterprise orchestrators"})}),Q("td",{className:"px-4 py-3 align-top",children:"Redwood RunMyJobs"}),Q("td",{className:"px-4 py-3 align-top",children:"Automate mission-critical workloads with self-service portals and SAP integrations"}),Q("td",{className:"px-4 py-3 align-top",children:"Focus on IT workloads; not built for custom app creation or per-user customisation."})]})]})]})}),Q("p",{className:"text-muted-foreground",children:"Use the pages below to explore each group in detail and see how ContractSpec compares."})]})]})}import{jsx as z,jsxs as Je}from"react/jsx-runtime";function Rp(){return Je("div",{className:"space-y-8",children:[Je("div",{className:"space-y-4",children:[z("h1",{className:"font-bold text-4xl",children:"Windmill"}),Je("p",{className:"text-muted-foreground",children:["Windmill is an open-source platform that turns"," ",z("strong",{children:"scripts"})," into endpoints, workflows and UIs. It seeks to remove boilerplate by generating interfaces and workflows around existing code"]})]}),Je("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Platform features"}),Je("ul",{className:"space-y-3 text-muted-foreground",children:[Je("li",{children:[z("strong",{children:"Script-driven model."})," Write scripts in TypeScript, Python, Go, PHP, Bash, C#, SQL or Rust; Windmill infers dependencies, creates lockfiles and JSON schemas, then serves minimal UIs automatically"]}),Je("li",{children:[z("strong",{children:"Visual flow editor."})," Compose scripts into workflows with retries, error handling, loops, branching, suspending flows and approval steps"]}),Je("li",{children:[z("strong",{children:"Low-code UI builder."})," Build dashboards and admin panels using inline scripts and trigger flows from the UI"]}),Je("li",{children:[z("strong",{children:"Enterprise readiness."})," Features include RBAC permissions, secret management, OAuth handling, CLI/git sync, scheduling and webhooks"]}),Je("li",{children:[z("strong",{children:"Use cases."})," Deploy scripts as webhooks or cron jobs; create \u201Capplicative workflows\u201D combining external APIs; build ETLs and interactive dashboards"]}),Je("li",{children:[z("strong",{children:"Open source & self-hosting."})," Windmill emphasises an open-source codebase and self-hosting options"]})]})]}),Je("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Comparison with ContractSpec"}),z("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Je("table",{className:"w-full text-left text-sm",children:[z("thead",{className:"bg-card/50",children:Je("tr",{className:"border-border/50 border-b",children:[z("th",{className:"px-4 py-3 font-semibold",children:"Feature"}),z("th",{className:"px-4 py-3 font-semibold",children:"Windmill"}),z("th",{className:"px-4 py-3 font-semibold",children:"ContractSpec"})]})}),Je("tbody",{className:"divide-y divide-border/50",children:[Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Entry model"})}),z("td",{className:"px-4 py-3 align-top",children:"Write scripts; platform auto-generates UI and workflows"}),z("td",{className:"px-4 py-3 align-top",children:"Define typed specs (Capabilities, DataViews, Workflows, Policies); compiler outputs back-end, front-end and forms."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Language support"})}),z("td",{className:"px-4 py-3 align-top",children:"20+ languages via embedded runtimes"}),z("td",{className:"px-4 py-3 align-top",children:"Uses TypeScript/JavaScript for providers; supports other back-ends through capability providers."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"UI generation"})}),z("td",{className:"px-4 py-3 align-top",children:"Minimal UI forms from script parameters; low-code app builder"}),z("td",{className:"px-4 py-3 align-top",children:"Generates full web and mobile UIs from specs; user layouts can be customised via signed overlays."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Policy & personalization"})}),z("td",{className:"px-4 py-3 align-top",children:"RBAC and secret management; no per-user overlay concept"}),z("td",{className:"px-4 py-3 align-top",children:"Built-in policy engine enforcing ABAC/PII on every render/mutate; overlays allow safe per-user customisation."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Open source"})}),z("td",{className:"px-4 py-3 align-top",children:"Fully open source and self-hostable"}),z("td",{className:"px-4 py-3 align-top",children:"Closed-source core (SDK is open); offers hosted and on-prem modes."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Ideal for"})}),z("td",{className:"px-4 py-3 align-top",children:"Teams wanting to expose scripts as APIs, workflows or dashboards without heavy infrastructure."}),z("td",{className:"px-4 py-3 align-top",children:"Teams needing a spec-driven platform that generates code and UI, enforces policies and lets non-technical users tailor the experience."})]})]})]})}),Je("p",{className:"text-muted-foreground",children:["Windmill excels at converting scripts into workflows and admin panels. ContractSpec takes a ",z("strong",{children:"spec-first"})," approach, generating the entire stack and enforcing policies, making it suitable for long-lived applications that must evolve safely."]})]})]})}import{jsx as u,jsxs as bt}from"react/jsx-runtime";function Lp(){return bt("div",{className:"space-y-8",children:[bt("div",{className:"space-y-4",children:[u("h1",{className:"font-bold text-4xl",children:"Workflow engines"}),u("p",{className:"text-muted-foreground",children:"Workflow engines orchestrate long-running tasks and data pipelines. They provide retries, scheduling and visibility, but most expect developers to write code and do not generate user interfaces. Here\u2019s how the major engines compare to ContractSpec."})]}),bt("div",{className:"space-y-4",children:[u("h2",{className:"font-bold text-2xl",children:"Key differences summary"}),u("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:bt("table",{className:"w-full text-left text-sm",children:[u("thead",{className:"bg-card/50",children:bt("tr",{className:"border-border/50 border-b",children:[u("th",{className:"px-4 py-3 font-semibold",children:"Engine"}),u("th",{className:"px-4 py-3 font-semibold",children:"Core strengths"}),u("th",{className:"px-4 py-3 font-semibold",children:"UI generation?"}),u("th",{className:"px-4 py-3 font-semibold",children:"Policy/PII enforcement?"}),u("th",{className:"px-4 py-3 font-semibold",children:"Self-host?"}),u("th",{className:"px-4 py-3 font-semibold",children:"Primary use"})]})}),bt("tbody",{className:"divide-y divide-border/50",children:[bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Prefect"})}),u("td",{className:"px-4 py-3 align-top",children:"Python-native; dynamic DAGs adapt to change; annotate code without rewriting; strong observability and audit logs"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Data pipelines and dynamic workflows."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Kestra"})}),u("td",{className:"px-4 py-3 align-top",children:"Declarative YAML; event-driven triggers; mix of code and no-code; write logic in Python/R/Java/Julia/Ruby; deploy anywhere"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Data pipelines and hybrid orchestration."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Temporal"})}),u("td",{className:"px-4 py-3 align-top",children:"Durable execution; workflows never lose state; multi-language SDKs; automatic retries"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Durable microservice and business workflows."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Airflow"})}),u("td",{className:"px-4 py-3 align-top",children:"Open-source; define workflows as Python code; schedule and monitor via UI; extensible via custom operators"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Data ETL pipelines."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Dagster"})}),u("td",{className:"px-4 py-3 align-top",children:"Data-asset model; local testing and reusable components; built-in data quality and catalog; orchestrates AI/data pipelines across multiple tools"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Data/AI pipelines with strong observability."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Hatchet"})}),u("td",{className:"px-4 py-3 align-top",children:"Modern engine focused on performance and durability; tasks and workflows as code; durable functions with guardrails and retries"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"High-throughput background jobs and microservices."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Windmill"})}),u("td",{className:"px-4 py-3 align-top",children:"Multi-language scripts; auto-generates UI; integrated flow editor"}),u("td",{className:"px-4 py-3 align-top",children:"Yes (basic)"}),u("td",{className:"px-4 py-3 align-top",children:"RBAC & secrets only"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Scripts into workflows and dashboards."})]})]})]})})]}),bt("div",{className:"space-y-3",children:[u("h2",{className:"font-bold text-2xl",children:"Why ContractSpec differs"}),bt("ul",{className:"space-y-2 text-muted-foreground",children:[bt("li",{children:[u("strong",{children:"Spec-first generation"})," \u2013 Instead of writing code, you define typed specs for capabilities, data views and workflows; the compiler outputs both back-end and front-end."]}),bt("li",{children:[u("strong",{children:"Policy engine"})," \u2013 Every render and mutate passes through an ABAC/PII policy decision point."]}),bt("li",{children:[u("strong",{children:"Personalisation"})," \u2013 Signed OverlaySpecs allow tenant/user-specific UI changes without touching code."]}),bt("li",{children:[u("strong",{children:"Unified runtime"})," \u2013 React/React-Native rendering ensures consistent experiences across web and mobile."]})]}),u("p",{className:"text-muted-foreground",children:"Workflow engines are excellent for orchestrating back-end tasks. ContractSpec builds on this by serving complete applications with runtime policy enforcement and user personalisation via TypeScript specs."})]})]})}import{CodeBlock as Ep}from"@contractspec/lib.design-system";import Cc from"@contractspec/lib.ui-link";import{ChevronRight as Dp}from"lucide-react";import{jsx as ia,jsxs as ni}from"react/jsx-runtime";function Op(){return ni("div",{className:"space-y-8",children:[ni("div",{className:"space-y-3",children:[ia("h1",{className:"font-bold text-4xl",children:"Integrations"}),ia("p",{className:"text-lg text-muted-foreground",children:"Reference integrations show how to extend ContractSpec with real-world adapters and generators."})]}),ni("div",{className:"card-subtle space-y-4 p-6",children:[ia("h2",{className:"font-bold text-2xl",children:"Reference plugin"}),ia("p",{className:"text-muted-foreground text-sm",children:"The example markdown generator plugin ships as a working reference implementation."}),ia(Ep,{language:"bash",filename:"install-example",code:`bun add @contractspec/lib.plugin.example-generator
671
+ };`}),ht("p",{className:"mt-2 text-muted-foreground",children:"This allows you to customize feature flags, integration connections, and knowledge sources per tenant without changing the application code."})]}),Gt("div",{className:"flex items-center gap-4 pt-4",children:[ht(Sc,{href:"/docs/architecture",className:"btn-ghost",children:"Back to Architecture"}),Gt(Sc,{href:"/docs/libraries/multi-tenancy",className:"btn-primary",children:["Multi-Tenancy Library ",ht(Np,{size:16})]})]})]})}import Ii from"@contractspec/lib.ui-link";import{jsx as Ye,jsxs as oa}from"react/jsx-runtime";var kp=[{title:"Contracts and schemas",body:"Explicit specs define the durable boundary for behavior, data, and governance."},{title:"Bindings and configuration",body:"Apps, tenants, integrations, and knowledge sources are wired through explicit configuration instead of hidden glue."},{title:"Runtimes and generators",body:"Serve or generate aligned surfaces for API, UI, workflows, docs, and agent-facing interfaces."},{title:"Operate and observe",body:"Carry auditability, policy, tracing, migrations, and tenant isolation through the same model."}];function Sp(){return oa("div",{className:"space-y-10",children:[oa("div",{className:"space-y-3",children:[Ye("p",{className:"editorial-kicker",children:"Build"}),Ye("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"The architecture keeps contracts, runtime behavior, and operations in the same system."}),Ye("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is not a single runtime. It is a layered system that lets you define explicit boundaries, bind real-world configuration, and then serve or generate aligned surfaces without losing control of the output."})]}),Ye("div",{className:"grid gap-4 md:grid-cols-2",children:kp.map((e)=>oa("article",{className:"editorial-panel space-y-3",children:[Ye("h2",{className:"font-semibold text-xl",children:e.title}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),oa("section",{className:"editorial-panel space-y-5",children:[oa("div",{className:"space-y-2",children:[Ye("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"UI composition belongs in the bundle runtime layer"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"When the system needs adaptive layouts, entity workbenches, assistant slots, and safe overlays, use module bundles as the layer between the contract model and the rendered surface."})]}),oa("div",{className:"grid gap-4 md:grid-cols-2",children:[oa(Ii,{href:"/docs/specs/module-bundles",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Module bundles spec"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"See the typed bundle contract, resolved surface plan model, and bounded AI/runtime behavior."})]}),oa(Ii,{href:"/docs/guides/first-module-bundle",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Build a first module bundle"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"Follow the route-to-plan-to-render path with one practical host example."})]})]})]}),oa("section",{className:"editorial-panel space-y-5",children:[oa("div",{className:"space-y-2",children:[Ye("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Follow the architecture by responsibility"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"Use the architecture pages when you need to understand how the pieces snap together in a real deployment."})]}),oa("div",{className:"grid gap-4 md:grid-cols-2",children:[oa(Ii,{href:"/docs/architecture/app-config",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"App configuration"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"How blueprint-level and tenant-level config stay explicit and merge safely."})]}),oa(Ii,{href:"/docs/architecture/integration-binding",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Integration binding"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"How apps connect to tenant-owned integrations without leaking provider logic everywhere."})]}),oa(Ii,{href:"/docs/architecture/knowledge-binding",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Knowledge binding"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"How trusted knowledge enters the system and stays isolated by context and tenant."})]}),oa(Ii,{href:"/docs/architecture/control-plane",className:"docs-footer-link",children:[Ye("h3",{className:"font-semibold text-lg",children:"Control plane runtime"}),Ye("p",{className:"text-muted-foreground text-sm leading-7",children:"How intent, policy, planning, and execution flow through the system runtime."})]})]})]})]})}import{jsx as U,jsxs as Ot}from"react/jsx-runtime";function Cp(){return Ot("div",{className:"space-y-8",children:[Ot("div",{className:"space-y-4",children:[U("h1",{className:"font-bold text-4xl",children:"Automation platforms"}),U("p",{className:"text-muted-foreground",children:"Automation platforms connect apps and automate tasks through triggers and actions. They serve operations and non-technical users well but stop short of generating full applications or enforcing fine-grained policies."})]}),Ot("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"Feature comparison"}),U("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Ot("table",{className:"w-full text-left text-sm",children:[U("thead",{className:"bg-card/50",children:Ot("tr",{className:"border-border/50 border-b",children:[U("th",{className:"px-4 py-3 font-semibold",children:"Feature"}),U("th",{className:"px-4 py-3 font-semibold",children:"Zapier"}),U("th",{className:"px-4 py-3 font-semibold",children:"Make (Integromat)"}),U("th",{className:"px-4 py-3 font-semibold",children:"n8n"}),U("th",{className:"px-4 py-3 font-semibold",children:"Pipedream"})]})}),Ot("tbody",{className:"divide-y divide-border/50",children:[Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Workflow model"}),U("td",{className:"px-4 py-3 align-top",children:"Zaps: trigger + one or more actions"}),U("td",{className:"px-4 py-3 align-top",children:"Real-time visual orchestration for AI agents and automations"}),U("td",{className:"px-4 py-3 align-top",children:"Node-based workflow builder with drag-and-drop and code; build multi-step AI agents"}),U("td",{className:"px-4 py-3 align-top",children:"Workflows connect any API; Pipedream Connect SDK adds integrations quickly"})]}),Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Visual builder?"}),U("td",{className:"px-4 py-3 align-top",children:"Yes (simple; web-based)."}),U("td",{className:"px-4 py-3 align-top",children:"Yes; AI-assisted editor"}),U("td",{className:"px-4 py-3 align-top",children:"Yes; visual canvas."}),U("td",{className:"px-4 py-3 align-top",children:"Code-centric editor; no visual UI builder"})]}),Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Self-host?"}),U("td",{className:"px-4 py-3 align-top",children:"No (cloud only)."}),U("td",{className:"px-4 py-3 align-top",children:"Cloud only."}),U("td",{className:"px-4 py-3 align-top",children:"Yes (Docker, self-host)"}),U("td",{className:"px-4 py-3 align-top",children:"Cloud only (hosted)."})]}),Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Integrations & AI"}),U("td",{className:"px-4 py-3 align-top",children:"Connects almost 8 000 apps; limited AI features."}),U("td",{className:"px-4 py-3 align-top",children:"3 000+ pre-built apps; supports GenAI tools; GDPR/SOC2 and SSO"}),U("td",{className:"px-4 py-3 align-top",children:"Integrates LLMs; allows JS or Python code and library imports; chatbots with Slack/Teams"}),U("td",{className:"px-4 py-3 align-top",children:"MCP servers add 3 000+ APIs and 10 000+ tools to agents; AI agent builder prompts and deploys agents; SOC 2/ HIPAA/GDPR compliant"})]}),Ot("tr",{children:[U("td",{className:"px-4 py-3 align-top font-semibold",children:"Policy & UI generation"}),U("td",{className:"px-4 py-3 align-top",children:"No policy engine; does not generate user interfaces."}),U("td",{className:"px-4 py-3 align-top",children:"No policy engine; does not generate UIs beyond a workflow dashboard."}),U("td",{className:"px-4 py-3 align-top",children:"No policy engine; no UI builder"}),U("td",{className:"px-4 py-3 align-top",children:"No policy engine; does not generate UI."})]})]})]})})]}),Ot("div",{className:"space-y-3",children:[U("h2",{className:"font-bold text-2xl",children:"Why ContractSpec differs"}),Ot("ul",{className:"space-y-2 text-muted-foreground",children:[Ot("li",{children:[U("strong",{children:"Full application generation"})," \u2013 ContractSpec compiles specs into back-end, events and user interfaces for both web and mobile."]}),Ot("li",{children:[U("strong",{children:"Policy enforcement"})," \u2013 A built-in policy engine governs PII access and mutations across the UI."]}),Ot("li",{children:[U("strong",{children:"Customisation via overlays"})," \u2013 Non-technical users can safely personalise layouts while respecting policies."]}),Ot("li",{children:[U("strong",{children:"Extensible capabilities"})," \u2013 Connect to external APIs and services via capability providers while maintaining type safety."]})]}),U("p",{className:"text-muted-foreground",children:"Automation tools simplify integrations and tasks; ContractSpec goes further by generating a complete, policy-safe application around your data and processes."})]})]})}import Ip from"@contractspec/lib.ui-link";import{jsx as Y,jsxs as yt}from"react/jsx-runtime";function Pp(){return yt("div",{className:"space-y-8",children:[yt("div",{className:"space-y-4",children:[Y("h1",{className:"font-bold text-4xl",children:"Enterprise orchestration platforms"}),Y("p",{className:"text-muted-foreground",children:"Enterprise orchestration platforms manage mission-critical workloads and integrate deeply with ERP systems. They prioritise governance, reliability and compliance, but they do not provide spec-driven app generation or per-user customisation."})]}),yt("div",{className:"space-y-4",children:[Y("h2",{className:"font-bold text-2xl",children:"Redwood RunMyJobs"}),yt("p",{className:"text-muted-foreground",children:[Y(Ip,{href:"https://www.redwood.com/workload-automation/",className:"underline decoration-dotted underline-offset-4 hover:text-foreground",target:"_blank",rel:"noreferrer",children:"RunMyJobs by Redwood"})," ","is a cloud-native service orchestration and automation platform. Key attributes include:"]}),yt("ul",{className:"space-y-2 text-muted-foreground",children:[yt("li",{children:[Y("strong",{children:"Self-service portal."})," Business users can run and customise workloads while IT ensures governance and compliance"]}),yt("li",{children:[Y("strong",{children:"Full-stack orchestration."})," Integrates with both SAP and non-SAP systems; Redwood is recognised as a Leader in Gartner\u2019s Magic Quadrant for service orchestration"]}),yt("li",{children:[Y("strong",{children:"Observability and AI insights."})," Dashboards and AI-enhanced analytics identify bottlenecks and forecast issues"]}),yt("li",{children:[Y("strong",{children:"Deep SAP integration."})," Supports SAP\u2019s latest technologies and orchestrates mission-critical business processes"]}),yt("li",{children:[Y("strong",{children:"Connectors & wizard."})," Provides pre-built connectors and a wizard to link on-prem and cloud systems"]})]})]}),yt("div",{className:"space-y-4",children:[Y("h3",{className:"font-semibold text-xl",children:"Comparison with ContractSpec"}),Y("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:yt("table",{className:"w-full text-left text-sm",children:[Y("thead",{className:"bg-card/50",children:yt("tr",{className:"border-border/50 border-b",children:[Y("th",{className:"px-4 py-3 font-semibold",children:"Aspect"}),Y("th",{className:"px-4 py-3 font-semibold",children:"RunMyJobs"}),Y("th",{className:"px-4 py-3 font-semibold",children:"ContractSpec"})]})}),yt("tbody",{className:"divide-y divide-border/50",children:[yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"Target user"})}),Y("td",{className:"px-4 py-3 align-top",children:"Enterprise IT and operations teams automating SAP and mission-critical workflows."}),Y("td",{className:"px-4 py-3 align-top",children:"Developers, product teams and SMBs wanting to generate policy-safe apps with customisable UIs."})]}),yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"Workload focus"})}),Y("td",{className:"px-4 py-3 align-top",children:"Service orchestration and job scheduling across ERP/legacy systems"}),Y("td",{className:"px-4 py-3 align-top",children:"End-to-end application generation with back-end, UI and policies."})]}),yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"User interface"})}),Y("td",{className:"px-4 py-3 align-top",children:"Self-service portal to run/monitor jobs; no custom UI generation for new apps."}),Y("td",{className:"px-4 py-3 align-top",children:"Generates React/React-Native UIs from specs; users can personalise layout via overlays."})]}),yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"Open source"})}),Y("td",{className:"px-4 py-3 align-top",children:"Proprietary SaaS; enterprise agreements."}),Y("td",{className:"px-4 py-3 align-top",children:"Core compiler is proprietary; SDK and certain modules may be open-source; offers hosted and on-prem options."})]}),yt("tr",{children:[Y("td",{className:"px-4 py-3 align-top",children:Y("strong",{children:"Policy & personalisation"})}),Y("td",{className:"px-4 py-3 align-top",children:"IT controls governance; no per-user overlay concept."}),Y("td",{className:"px-4 py-3 align-top",children:"Built-in policy engine and per-user overlays for safe personalisation."})]})]})]})}),Y("p",{className:"text-muted-foreground",children:"Redwood RunMyJobs is designed for orchestrating enterprise workloads and SAP processes. ContractSpec targets a different problem: generating complete applications from typed specs and letting end users adapt them safely."})]})]})}import{jsx as W,jsxs as Bt}from"react/jsx-runtime";function Tp(){return Bt("div",{className:"space-y-8",children:[Bt("div",{className:"space-y-4",children:[W("h1",{className:"font-bold text-4xl",children:"Internal-tool builders"}),W("p",{className:"text-muted-foreground",children:"Internal-tool builders let teams quickly assemble dashboards and admin panels. These platforms often provide drag-and-drop UIs and connectors to databases and APIs, but they rely on developers to write custom code for business logic and seldom enforce policies across surfaces."})]}),Bt("div",{className:"space-y-4",children:[W("h2",{className:"font-bold text-2xl",children:"Feature comparison"}),W("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Bt("table",{className:"w-full text-left text-sm",children:[W("thead",{className:"bg-card/50",children:Bt("tr",{className:"border-border/50 border-b",children:[W("th",{className:"px-4 py-3 font-semibold",children:"Feature"}),W("th",{className:"px-4 py-3 font-semibold",children:"Retool"}),W("th",{className:"px-4 py-3 font-semibold",children:"Appsmith"}),W("th",{className:"px-4 py-3 font-semibold",children:"ToolJet"}),W("th",{className:"px-4 py-3 font-semibold",children:"Budibase"})]})}),Bt("tbody",{className:"divide-y divide-border/50",children:[Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"UI builder"}),W("td",{className:"px-4 py-3 align-top",children:"Drag-and-drop canvas; shape UI components easily"}),W("td",{className:"px-4 py-3 align-top",children:"Visual builder with drag-and-drop widgets"}),W("td",{className:"px-4 py-3 align-top",children:"Drag-and-drop UI widgets (tables, charts, forms)"}),W("td",{className:"px-4 py-3 align-top",children:"Pre-built components and templates for mobile/desktop"})]}),Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"Custom code & logic"}),W("td",{className:"px-4 py-3 align-top",children:"Full code insertion anywhere via IDE"}),W("td",{className:"px-4 py-3 align-top",children:"Logic via JavaScript or natural-language prompts in a central IDE"}),W("td",{className:"px-4 py-3 align-top",children:"Supports business logic in JavaScript or Python queries"}),W("td",{className:"px-4 py-3 align-top",children:"Custom logic via JavaScript; plugins and external embeds"})]}),Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"Data connectors"}),W("td",{className:"px-4 py-3 align-top",children:"Wide support for databases and APIs (PostgreSQL, MongoDB, GraphQL, etc.)."}),W("td",{className:"px-4 py-3 align-top",children:"Connects to LLMs and databases"}),W("td",{className:"px-4 py-3 align-top",children:"Built-in database; connects to PostgreSQL, MongoDB, APIs, GraphQL, SaaS"}),W("td",{className:"px-4 py-3 align-top",children:"Connects to external databases, REST, CSV or built-in DB"})]}),Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"Open source & self-host"}),W("td",{className:"px-4 py-3 align-top",children:"Proprietary; cloud or on-prem subscription."}),W("td",{className:"px-4 py-3 align-top",children:"Open source (Apache-2.0); self-host or cloud."}),W("td",{className:"px-4 py-3 align-top",children:"Open source; self-host via Docker or cloud."}),W("td",{className:"px-4 py-3 align-top",children:"Open source; self-host via Docker/Kubernetes"})]}),Bt("tr",{children:[W("td",{className:"px-4 py-3 align-top font-semibold",children:"Policy & personalisation"}),W("td",{className:"px-4 py-3 align-top",children:"No built-in policy engine; personalisation limited to user roles."}),W("td",{className:"px-4 py-3 align-top",children:"No typed policy engine; customisation depends on user roles."}),W("td",{className:"px-4 py-3 align-top",children:"No policy engine; personalisation via user roles."}),W("td",{className:"px-4 py-3 align-top",children:"No policy engine; personalisation via RBAC & SSO"})]})]})]})})]}),Bt("div",{className:"space-y-3",children:[W("h2",{className:"font-bold text-2xl",children:"ContractSpec\u2019s differences"}),Bt("ul",{className:"space-y-2 text-muted-foreground",children:[Bt("li",{children:[W("strong",{children:"Typed specifications"})," produce both the API and UI. You define capabilities, data views and workflows, and the compiler generates code, forms and screens\u2014no manual widget wiring."]}),Bt("li",{children:[W("strong",{children:"Policy enforcement"})," at run time ensures PII and ABAC rules across the entire app."]}),Bt("li",{children:[W("strong",{children:"Overlay personalisation"})," allows tenants and users to change layouts safely without code."]}),Bt("li",{children:[W("strong",{children:"Unified mobile/web runtime"})," means you don\u2019t need separate builders for React Native vs web."]})]}),W("p",{className:"text-muted-foreground",children:"Internal-tool builders are useful for quick dashboards. ContractSpec extends this by generating the whole stack from specs and enforcing policies throughout."})]})]})}import{jsx as Q,jsxs as to}from"react/jsx-runtime";function Ap(){return to("div",{className:"space-y-8",children:[to("div",{className:"space-y-4",children:[Q("h1",{className:"font-bold text-4xl",children:"Comparison overview"}),Q("p",{className:"text-muted-foreground",children:"ContractSpec sits at the intersection of several tool categories. To appreciate its unique offering\u2014typed specifications for back-end, front-end, workflows and policies with a unified web/mobile runtime\u2014this section compares it to related products."}),to("p",{className:"text-muted-foreground",children:["ContractSpec uses ",Q("strong",{children:"runtime adapters"})," to serve typed"," ",Q("strong",{children:"Operations"})," (Commands/Queries),"," ",Q("strong",{children:"DataViews"}),", ",Q("strong",{children:"Workflows"}),", and"," ",Q("strong",{children:"Policies"})," as REST/GraphQL/MCP endpoints. A"," ",Q("strong",{children:"policy decision point"})," governs every operation, and"," ",Q("strong",{children:"OverlaySpecs"})," allow non-technical users to personalise screens safely. Few competitors offer this combination of runtime type safety, policy enforcement, and end-user customisation."]})]}),to("div",{className:"space-y-4",children:[Q("h2",{className:"font-bold text-2xl",children:"Tool categories"}),Q("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:to("table",{className:"w-full text-left text-sm",children:[Q("thead",{className:"bg-card/50",children:to("tr",{className:"border-border/50 border-b",children:[Q("th",{className:"px-4 py-3 font-semibold",children:"Category"}),Q("th",{className:"px-4 py-3 font-semibold",children:"Examples"}),Q("th",{className:"px-4 py-3 font-semibold",children:"What they do"}),Q("th",{className:"px-4 py-3 font-semibold",children:"Limitations"})]})}),to("tbody",{className:"divide-y divide-border/50",children:[to("tr",{children:[Q("td",{className:"px-4 py-3 align-top",children:Q("strong",{children:"Workflow engines"})}),Q("td",{className:"px-4 py-3 align-top",children:"Prefect, Kestra, Temporal, Airflow, Dagster, Hatchet, Windmill"}),Q("td",{className:"px-4 py-3 align-top",children:"Orchestrate code or data pipelines; handle retries, scheduling and observability"}),Q("td",{className:"px-4 py-3 align-top",children:"Require writing code; no automatic UI generation or policy enforcement."})]}),to("tr",{children:[Q("td",{className:"px-4 py-3 align-top",children:Q("strong",{children:"Internal-tool builders"})}),Q("td",{className:"px-4 py-3 align-top",children:"Retool, Appsmith, ToolJet, Budibase"}),Q("td",{className:"px-4 py-3 align-top",children:"Drag-and-drop dashboards and admin panels; connect to databases/APIs"}),Q("td",{className:"px-4 py-3 align-top",children:"No typed back-end spec; limited enforcement of policies; custom code glues logic."})]}),to("tr",{children:[Q("td",{className:"px-4 py-3 align-top",children:Q("strong",{children:"Automation platforms"})}),Q("td",{className:"px-4 py-3 align-top",children:"Zapier, Make, n8n, Pipedream"}),Q("td",{className:"px-4 py-3 align-top",children:"Connect apps via triggers and actions; visual or low-code interfaces"}),Q("td",{className:"px-4 py-3 align-top",children:"Automate tasks but do not generate full apps or enforce per-field policies."})]}),to("tr",{children:[Q("td",{className:"px-4 py-3 align-top",children:Q("strong",{children:"Enterprise orchestrators"})}),Q("td",{className:"px-4 py-3 align-top",children:"Redwood RunMyJobs"}),Q("td",{className:"px-4 py-3 align-top",children:"Automate mission-critical workloads with self-service portals and SAP integrations"}),Q("td",{className:"px-4 py-3 align-top",children:"Focus on IT workloads; not built for custom app creation or per-user customisation."})]})]})]})}),Q("p",{className:"text-muted-foreground",children:"Use the pages below to explore each group in detail and see how ContractSpec compares."})]})]})}import{jsx as z,jsxs as Je}from"react/jsx-runtime";function Rp(){return Je("div",{className:"space-y-8",children:[Je("div",{className:"space-y-4",children:[z("h1",{className:"font-bold text-4xl",children:"Windmill"}),Je("p",{className:"text-muted-foreground",children:["Windmill is an open-source platform that turns"," ",z("strong",{children:"scripts"})," into endpoints, workflows and UIs. It seeks to remove boilerplate by generating interfaces and workflows around existing code"]})]}),Je("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Platform features"}),Je("ul",{className:"space-y-3 text-muted-foreground",children:[Je("li",{children:[z("strong",{children:"Script-driven model."})," Write scripts in TypeScript, Python, Go, PHP, Bash, C#, SQL or Rust; Windmill infers dependencies, creates lockfiles and JSON schemas, then serves minimal UIs automatically"]}),Je("li",{children:[z("strong",{children:"Visual flow editor."})," Compose scripts into workflows with retries, error handling, loops, branching, suspending flows and approval steps"]}),Je("li",{children:[z("strong",{children:"Low-code UI builder."})," Build dashboards and admin panels using inline scripts and trigger flows from the UI"]}),Je("li",{children:[z("strong",{children:"Enterprise readiness."})," Features include RBAC permissions, secret management, OAuth handling, CLI/git sync, scheduling and webhooks"]}),Je("li",{children:[z("strong",{children:"Use cases."})," Deploy scripts as webhooks or cron jobs; create \u201Capplicative workflows\u201D combining external APIs; build ETLs and interactive dashboards"]}),Je("li",{children:[z("strong",{children:"Open source & self-hosting."})," Windmill emphasises an open-source codebase and self-hosting options"]})]})]}),Je("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Comparison with ContractSpec"}),z("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Je("table",{className:"w-full text-left text-sm",children:[z("thead",{className:"bg-card/50",children:Je("tr",{className:"border-border/50 border-b",children:[z("th",{className:"px-4 py-3 font-semibold",children:"Feature"}),z("th",{className:"px-4 py-3 font-semibold",children:"Windmill"}),z("th",{className:"px-4 py-3 font-semibold",children:"ContractSpec"})]})}),Je("tbody",{className:"divide-y divide-border/50",children:[Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Entry model"})}),z("td",{className:"px-4 py-3 align-top",children:"Write scripts; platform auto-generates UI and workflows"}),z("td",{className:"px-4 py-3 align-top",children:"Define typed specs (Capabilities, DataViews, Workflows, Policies); compiler outputs back-end, front-end and forms."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Language support"})}),z("td",{className:"px-4 py-3 align-top",children:"20+ languages via embedded runtimes"}),z("td",{className:"px-4 py-3 align-top",children:"Uses TypeScript/JavaScript for providers; supports other back-ends through capability providers."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"UI generation"})}),z("td",{className:"px-4 py-3 align-top",children:"Minimal UI forms from script parameters; low-code app builder"}),z("td",{className:"px-4 py-3 align-top",children:"Generates full web and mobile UIs from specs; user layouts can be customised via signed overlays."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Policy & personalization"})}),z("td",{className:"px-4 py-3 align-top",children:"RBAC and secret management; no per-user overlay concept"}),z("td",{className:"px-4 py-3 align-top",children:"Built-in policy engine enforcing ABAC/PII on every render/mutate; overlays allow safe per-user customisation."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Open source"})}),z("td",{className:"px-4 py-3 align-top",children:"Fully open source and self-hostable"}),z("td",{className:"px-4 py-3 align-top",children:"Closed-source core (SDK is open); offers hosted and on-prem modes."})]}),Je("tr",{children:[z("td",{className:"px-4 py-3 align-top",children:z("strong",{children:"Ideal for"})}),z("td",{className:"px-4 py-3 align-top",children:"Teams wanting to expose scripts as APIs, workflows or dashboards without heavy infrastructure."}),z("td",{className:"px-4 py-3 align-top",children:"Teams needing a spec-driven platform that generates code and UI, enforces policies and lets non-technical users tailor the experience."})]})]})]})}),Je("p",{className:"text-muted-foreground",children:["Windmill excels at converting scripts into workflows and admin panels. ContractSpec takes a ",z("strong",{children:"spec-first"})," approach, generating the entire stack and enforcing policies, making it suitable for long-lived applications that must evolve safely."]})]})]})}import{jsx as u,jsxs as bt}from"react/jsx-runtime";function Lp(){return bt("div",{className:"space-y-8",children:[bt("div",{className:"space-y-4",children:[u("h1",{className:"font-bold text-4xl",children:"Workflow engines"}),u("p",{className:"text-muted-foreground",children:"Workflow engines orchestrate long-running tasks and data pipelines. They provide retries, scheduling and visibility, but most expect developers to write code and do not generate user interfaces. Here\u2019s how the major engines compare to ContractSpec."})]}),bt("div",{className:"space-y-4",children:[u("h2",{className:"font-bold text-2xl",children:"Key differences summary"}),u("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:bt("table",{className:"w-full text-left text-sm",children:[u("thead",{className:"bg-card/50",children:bt("tr",{className:"border-border/50 border-b",children:[u("th",{className:"px-4 py-3 font-semibold",children:"Engine"}),u("th",{className:"px-4 py-3 font-semibold",children:"Core strengths"}),u("th",{className:"px-4 py-3 font-semibold",children:"UI generation?"}),u("th",{className:"px-4 py-3 font-semibold",children:"Policy/PII enforcement?"}),u("th",{className:"px-4 py-3 font-semibold",children:"Self-host?"}),u("th",{className:"px-4 py-3 font-semibold",children:"Primary use"})]})}),bt("tbody",{className:"divide-y divide-border/50",children:[bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Prefect"})}),u("td",{className:"px-4 py-3 align-top",children:"Python-native; dynamic DAGs adapt to change; annotate code without rewriting; strong observability and audit logs"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Data pipelines and dynamic workflows."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Kestra"})}),u("td",{className:"px-4 py-3 align-top",children:"Declarative YAML; event-driven triggers; mix of code and no-code; write logic in Python/R/Java/Julia/Ruby; deploy anywhere"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Data pipelines and hybrid orchestration."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Temporal"})}),u("td",{className:"px-4 py-3 align-top",children:"Durable execution; workflows never lose state; multi-language SDKs; automatic retries"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Durable microservice and business workflows."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Airflow"})}),u("td",{className:"px-4 py-3 align-top",children:"Open-source; define workflows as Python code; schedule and monitor via UI; extensible via custom operators"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Data ETL pipelines."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Dagster"})}),u("td",{className:"px-4 py-3 align-top",children:"Data-asset model; local testing and reusable components; built-in data quality and catalog; orchestrates AI/data pipelines across multiple tools"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Data/AI pipelines with strong observability."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Hatchet"})}),u("td",{className:"px-4 py-3 align-top",children:"Modern engine focused on performance and durability; tasks and workflows as code; durable functions with guardrails and retries"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"No"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"High-throughput background jobs and microservices."})]}),bt("tr",{children:[u("td",{className:"px-4 py-3 align-top",children:u("strong",{children:"Windmill"})}),u("td",{className:"px-4 py-3 align-top",children:"Multi-language scripts; auto-generates UI; integrated flow editor"}),u("td",{className:"px-4 py-3 align-top",children:"Yes (basic)"}),u("td",{className:"px-4 py-3 align-top",children:"RBAC & secrets only"}),u("td",{className:"px-4 py-3 align-top",children:"Yes"}),u("td",{className:"px-4 py-3 align-top",children:"Scripts into workflows and dashboards."})]})]})]})})]}),bt("div",{className:"space-y-3",children:[u("h2",{className:"font-bold text-2xl",children:"Why ContractSpec differs"}),bt("ul",{className:"space-y-2 text-muted-foreground",children:[bt("li",{children:[u("strong",{children:"Spec-first generation"})," \u2013 Instead of writing code, you define typed specs for capabilities, data views and workflows; the compiler outputs both back-end and front-end."]}),bt("li",{children:[u("strong",{children:"Policy engine"})," \u2013 Every render and mutate passes through an ABAC/PII policy decision point."]}),bt("li",{children:[u("strong",{children:"Personalisation"})," \u2013 Signed OverlaySpecs allow tenant/user-specific UI changes without touching code."]}),bt("li",{children:[u("strong",{children:"Unified runtime"})," \u2013 React/React-Native rendering ensures consistent experiences across web and mobile."]})]}),u("p",{className:"text-muted-foreground",children:"Workflow engines are excellent for orchestrating back-end tasks. ContractSpec builds on this by serving complete applications with runtime policy enforcement and user personalisation via TypeScript specs."})]})]})}import{CodeBlock as Dp}from"@contractspec/lib.design-system";import Cc from"@contractspec/lib.ui-link";import{ChevronRight as Ep}from"lucide-react";import{jsx as ia,jsxs as ni}from"react/jsx-runtime";function Op(){return ni("div",{className:"space-y-8",children:[ni("div",{className:"space-y-3",children:[ia("h1",{className:"font-bold text-4xl",children:"Integrations"}),ia("p",{className:"text-lg text-muted-foreground",children:"Reference integrations show how to extend ContractSpec with real-world adapters and generators."})]}),ni("div",{className:"card-subtle space-y-4 p-6",children:[ia("h2",{className:"font-bold text-2xl",children:"Reference plugin"}),ia("p",{className:"text-muted-foreground text-sm",children:"The example markdown generator plugin ships as a working reference implementation."}),ia(Dp,{language:"bash",filename:"install-example",code:`bun add @contractspec/lib.plugin.example-generator
672
672
 
673
673
  # Or in a workspace
674
- bun add -D @contractspec/lib.plugin.example-generator`})]}),ni("div",{className:"card-subtle space-y-4 p-6",children:[ia("h2",{className:"font-bold text-2xl",children:"Providers and adapters"}),ni("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[ia("li",{children:"Payments: Stripe"}),ia("li",{children:"Email: Postmark, Gmail"}),ia("li",{children:"AI: OpenAI, Mistral"}),ia("li",{children:"Voice: ElevenLabs, Mistral"}),ia("li",{children:"Vector DB: Qdrant"}),ia("li",{children:"Storage: GCS"})]}),ia("p",{className:"text-muted-foreground text-sm",children:"Use provider modules as inspiration for adapter plugins."})]}),ni("div",{className:"flex items-center gap-4 pt-4",children:[ni(Cc,{href:"/docs/ecosystem/registry",className:"btn-primary",children:["Marketplace manifest ",ia(Dp,{size:16})]}),ia(Cc,{href:"/docs/ecosystem/templates",className:"btn-ghost",children:"Authoring templates"})]})]})}import{CodeBlock as Hr}from"@contractspec/lib.design-system";import Ic from"@contractspec/lib.ui-link";import{ChevronRight as Bp}from"lucide-react";import{jsx as _e,jsxs as ra}from"react/jsx-runtime";function Mp(){return ra("div",{className:"space-y-8",children:[ra("div",{className:"space-y-3",children:[_e("h1",{className:"font-bold text-4xl",children:"Cursor marketplace plugins"}),_e("p",{className:"text-lg text-muted-foreground",children:"ContractSpec ships a focused Cursor marketplace catalog for the product and key libraries."})]}),ra("div",{className:"card-subtle space-y-4 p-6",children:[_e("h2",{className:"font-bold text-2xl",children:"Catalog at a glance"}),ra("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[ra("li",{children:[_e("code",{children:"contractspec"})," - Product-level workflow and release guardrails."]}),ra("li",{children:[_e("code",{children:"contractspec-contracts-spec"})," -",_e("code",{children:"@contractspec/lib.contracts-spec"})," governance."]}),ra("li",{children:[_e("code",{children:"contractspec-contracts-integrations"})," -",_e("code",{children:"@contractspec/lib.contracts-integrations"})," governance."]}),ra("li",{children:[_e("code",{children:"contractspec-ai-agent"})," -",_e("code",{children:"@contractspec/lib.ai-agent"})," orchestration guardrails."]})]})]}),ra("div",{className:"space-y-6",children:[ra("div",{className:"space-y-3",children:[_e("h2",{className:"font-bold text-2xl",children:"Where plugin sources live"}),_e("p",{className:"text-muted-foreground text-sm",children:"Marketplace plugin artifacts are kept in a dedicated package, while the canonical reusable source lives in agentpacks under `packs/`."}),_e(Hr,{language:"text",filename:"catalog-layout",code:`packages/apps-registry/cursor-marketplace/
674
+ bun add -D @contractspec/lib.plugin.example-generator`})]}),ni("div",{className:"card-subtle space-y-4 p-6",children:[ia("h2",{className:"font-bold text-2xl",children:"Providers and adapters"}),ni("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[ia("li",{children:"Payments: Stripe"}),ia("li",{children:"Email: Postmark, Gmail"}),ia("li",{children:"AI: OpenAI, Mistral"}),ia("li",{children:"Voice: ElevenLabs, Mistral"}),ia("li",{children:"Vector DB: Qdrant"}),ia("li",{children:"Storage: GCS"})]}),ia("p",{className:"text-muted-foreground text-sm",children:"Use provider modules as inspiration for adapter plugins."})]}),ni("div",{className:"flex items-center gap-4 pt-4",children:[ni(Cc,{href:"/docs/ecosystem/registry",className:"btn-primary",children:["Marketplace manifest ",ia(Ep,{size:16})]}),ia(Cc,{href:"/docs/ecosystem/templates",className:"btn-ghost",children:"Authoring templates"})]})]})}import{CodeBlock as qr}from"@contractspec/lib.design-system";import Ic from"@contractspec/lib.ui-link";import{ChevronRight as Bp}from"lucide-react";import{jsx as _e,jsxs as ra}from"react/jsx-runtime";function Mp(){return ra("div",{className:"space-y-8",children:[ra("div",{className:"space-y-3",children:[_e("h1",{className:"font-bold text-4xl",children:"Cursor marketplace plugins"}),_e("p",{className:"text-lg text-muted-foreground",children:"ContractSpec ships a focused Cursor marketplace catalog for the product and key libraries."})]}),ra("div",{className:"card-subtle space-y-4 p-6",children:[_e("h2",{className:"font-bold text-2xl",children:"Catalog at a glance"}),ra("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[ra("li",{children:[_e("code",{children:"contractspec"})," - Product-level workflow and release guardrails."]}),ra("li",{children:[_e("code",{children:"contractspec-contracts-spec"})," -",_e("code",{children:"@contractspec/lib.contracts-spec"})," governance."]}),ra("li",{children:[_e("code",{children:"contractspec-contracts-integrations"})," -",_e("code",{children:"@contractspec/lib.contracts-integrations"})," governance."]}),ra("li",{children:[_e("code",{children:"contractspec-ai-agent"})," -",_e("code",{children:"@contractspec/lib.ai-agent"})," orchestration guardrails."]})]})]}),ra("div",{className:"space-y-6",children:[ra("div",{className:"space-y-3",children:[_e("h2",{className:"font-bold text-2xl",children:"Where plugin sources live"}),_e("p",{className:"text-muted-foreground text-sm",children:"Marketplace plugin artifacts are kept in a dedicated package, while the canonical reusable source lives in agentpacks under `packs/`."}),_e(qr,{language:"text",filename:"catalog-layout",code:`packages/apps-registry/cursor-marketplace/
675
675
  .cursor-plugin/marketplace.json
676
676
  plugins/
677
677
  contractspec/
@@ -680,7 +680,7 @@ bun add -D @contractspec/lib.plugin.example-generator`})]}),ni("div",{className:
680
680
  contractspec-ai-agent/
681
681
 
682
682
  packs/
683
- contractspec-contracts-spec/`})]}),ra("div",{className:"space-y-3",children:[_e("h2",{className:"font-bold text-2xl",children:"Root marketplace manifest"}),_e("p",{className:"text-muted-foreground text-sm",children:"Cursor submission reads the catalog manifest inside the marketplace package and resolves plugin paths relative to that package."}),_e(Hr,{language:"json",filename:"packages/apps-registry/cursor-marketplace/.cursor-plugin/marketplace.json",code:`{
683
+ contractspec-contracts-spec/`})]}),ra("div",{className:"space-y-3",children:[_e("h2",{className:"font-bold text-2xl",children:"Root marketplace manifest"}),_e("p",{className:"text-muted-foreground text-sm",children:"Cursor submission reads the catalog manifest inside the marketplace package and resolves plugin paths relative to that package."}),_e(qr,{language:"json",filename:"packages/apps-registry/cursor-marketplace/.cursor-plugin/marketplace.json",code:`{
684
684
  "name": "contractspec-marketplace",
685
685
  "owner": { "name": "ContractSpec Team" },
686
686
  "plugins": [
@@ -701,10 +701,10 @@ packs/
701
701
  "source": "plugins/contractspec-ai-agent"
702
702
  }
703
703
  ]
704
- }`})]}),ra("div",{className:"space-y-3",children:[_e("h2",{className:"font-bold text-2xl",children:"Generated multi-host system"}),_e("p",{className:"text-muted-foreground text-sm",children:"The Cursor plugin is publishable metadata only. Customer-facing Cursor, Claude Code, and Codex outputs are generated from the same pack source with hook and MCP delivery."})]}),ra("div",{className:"space-y-3",children:[_e("h2",{className:"font-bold text-2xl",children:"Validation gate"}),_e("p",{className:"text-muted-foreground text-sm",children:"Validate all marketplace plugins before publishing."}),_e(Hr,{language:"bash",filename:"validate-marketplace",code:`bun run plugin:contractspec:validate
704
+ }`})]}),ra("div",{className:"space-y-3",children:[_e("h2",{className:"font-bold text-2xl",children:"Generated multi-host system"}),_e("p",{className:"text-muted-foreground text-sm",children:"The Cursor plugin is publishable metadata only. Customer-facing Cursor, Claude Code, and Codex outputs are generated from the same pack source with hook and MCP delivery."})]}),ra("div",{className:"space-y-3",children:[_e("h2",{className:"font-bold text-2xl",children:"Validation gate"}),_e("p",{className:"text-muted-foreground text-sm",children:"Validate all marketplace plugins before publishing."}),_e(qr,{language:"bash",filename:"validate-marketplace",code:`bun run plugin:contractspec:validate
705
705
 
706
706
  # Optional when offline
707
- SKIP_PLUGIN_NETWORK_CHECK=1 bun run plugin:contractspec:validate`})]})]}),ra("div",{className:"flex items-center gap-4 pt-4",children:[ra(Ic,{href:"/docs/ecosystem/templates",className:"btn-primary",children:["Author a plugin ",_e(Bp,{size:16})]}),_e(Ic,{href:"/docs/ecosystem/registry",className:"btn-ghost",children:"Manifest details"})]})]})}import{CodeBlock as qr}from"@contractspec/lib.design-system";import Pc from"@contractspec/lib.ui-link";import{ChevronRight as Up}from"lucide-react";import{jsx as ao,jsxs as ci}from"react/jsx-runtime";function Wp(){return ci("div",{className:"space-y-8",children:[ci("div",{className:"space-y-3",children:[ao("h1",{className:"font-bold text-4xl",children:"Marketplace manifest"}),ao("p",{className:"text-lg text-muted-foreground",children:"ContractSpec publishes a multi-plugin Cursor marketplace catalog from a single root manifest."})]}),ci("div",{className:"card-subtle space-y-4 p-6",children:[ao("h2",{className:"font-bold text-2xl",children:"Root manifest shape"}),ci("p",{className:"text-muted-foreground text-sm",children:["Cursor reads"," ",ao("code",{children:"packages/apps-registry/cursor-marketplace/.cursor-plugin/marketplace.json"})," ","for the catalog and resolves each plugin source path from there."]}),ao(qr,{language:"json",filename:"packages/apps-registry/cursor-marketplace/.cursor-plugin/marketplace.json",code:`{
707
+ SKIP_PLUGIN_NETWORK_CHECK=1 bun run plugin:contractspec:validate`})]})]}),ra("div",{className:"flex items-center gap-4 pt-4",children:[ra(Ic,{href:"/docs/ecosystem/templates",className:"btn-primary",children:["Author a plugin ",_e(Bp,{size:16})]}),_e(Ic,{href:"/docs/ecosystem/registry",className:"btn-ghost",children:"Manifest details"})]})]})}import{CodeBlock as Hr}from"@contractspec/lib.design-system";import Pc from"@contractspec/lib.ui-link";import{ChevronRight as Up}from"lucide-react";import{jsx as ao,jsxs as ci}from"react/jsx-runtime";function Wp(){return ci("div",{className:"space-y-8",children:[ci("div",{className:"space-y-3",children:[ao("h1",{className:"font-bold text-4xl",children:"Marketplace manifest"}),ao("p",{className:"text-lg text-muted-foreground",children:"ContractSpec publishes a multi-plugin Cursor marketplace catalog from a single root manifest."})]}),ci("div",{className:"card-subtle space-y-4 p-6",children:[ao("h2",{className:"font-bold text-2xl",children:"Root manifest shape"}),ci("p",{className:"text-muted-foreground text-sm",children:["Cursor reads"," ",ao("code",{children:"packages/apps-registry/cursor-marketplace/.cursor-plugin/marketplace.json"})," ","for the catalog and resolves each plugin source path from there."]}),ao(Hr,{language:"json",filename:"packages/apps-registry/cursor-marketplace/.cursor-plugin/marketplace.json",code:`{
708
708
  "name": "contractspec-marketplace",
709
709
  "owner": { "name": "ContractSpec Team" },
710
710
  "plugins": [
@@ -717,16 +717,16 @@ SKIP_PLUGIN_NETWORK_CHECK=1 bun run plugin:contractspec:validate`})]})]}),ra("di
717
717
  "source": "plugins/contractspec-contracts-spec"
718
718
  }
719
719
  ]
720
- }`})]}),ci("div",{className:"card-subtle space-y-4 p-6",children:[ao("h2",{className:"font-bold text-2xl",children:"Per-plugin contract"}),ao("p",{className:"text-muted-foreground text-sm",children:"Each plugin source must include a Cursor plugin manifest and composable assets. The publishable plugin is derived from a reusable pack and then validated here."}),ao(qr,{language:"text",filename:"plugin-layout",code:`plugins/<plugin-name>/
720
+ }`})]}),ci("div",{className:"card-subtle space-y-4 p-6",children:[ao("h2",{className:"font-bold text-2xl",children:"Per-plugin contract"}),ao("p",{className:"text-muted-foreground text-sm",children:"Each plugin source must include a Cursor plugin manifest and composable assets. The publishable plugin is derived from a reusable pack and then validated here."}),ao(Hr,{language:"text",filename:"plugin-layout",code:`plugins/<plugin-name>/
721
721
  .cursor-plugin/plugin.json
722
722
  rules/
723
723
  commands/
724
724
  agents/
725
725
  skills/
726
- .mcp.json`}),ao(qr,{language:"bash",filename:"validate-catalog",code:`bun run plugin:contractspec:validate
726
+ .mcp.json`}),ao(Hr,{language:"bash",filename:"validate-catalog",code:`bun run plugin:contractspec:validate
727
727
 
728
728
  # Optional in offline environments
729
- SKIP_PLUGIN_NETWORK_CHECK=1 bun run plugin:contractspec:validate`})]}),ci("div",{className:"flex items-center gap-4 pt-4",children:[ci(Pc,{href:"/docs/ecosystem/integrations",className:"btn-primary",children:["Integrations ",ao(Up,{size:16})]}),ao(Pc,{href:"/docs/ecosystem/templates",className:"btn-ghost",children:"Plugin authoring templates"})]})]})}import _p from"@contractspec/lib.ui-link";import{jsx as Vr,jsxs as zp}from"react/jsx-runtime";function Ht({title:e="Need the operating layer on top of OSS ContractSpec?",body:t="ContractSpec Studio helps teams turn evidence into proposed spec changes, governed delivery loops, and execution-ready task packs while keeping the open contract system as the source of truth.",ctaLabel:a="See what Studio adds",href:r="https://www.contractspec.studio/docs"}){return zp("div",{className:"card-subtle space-y-3 p-6",children:[Vr("h3",{className:"font-semibold text-lg",children:e}),Vr("p",{className:"text-muted-foreground text-sm",children:t}),Vr(_p,{href:r,className:"btn-primary",children:a})]})}import{CodeBlock as Tc}from"@contractspec/lib.design-system";import Ac from"@contractspec/lib.ui-link";import{ChevronRight as Gp}from"lucide-react";import{jsx as na,jsxs as Ko}from"react/jsx-runtime";function Hp(){return Ko("div",{className:"space-y-8",children:[Ko("div",{className:"space-y-3",children:[na("h1",{className:"font-bold text-4xl",children:"Plugin authoring templates"}),na("p",{className:"text-lg text-muted-foreground",children:"Scaffold focused Cursor plugins for ContractSpec product and core libraries."})]}),Ko("div",{className:"card-subtle space-y-4 p-6",children:[na("h2",{className:"font-bold text-2xl",children:"Create a focused plugin"}),na("p",{className:"text-muted-foreground text-sm",children:"Start from a scoped domain and keep each plugin aligned to one product or library surface."}),na(Tc,{language:"bash",filename:"catalog-authoring-layout",code:`packages/apps-registry/cursor-marketplace/
729
+ SKIP_PLUGIN_NETWORK_CHECK=1 bun run plugin:contractspec:validate`})]}),ci("div",{className:"flex items-center gap-4 pt-4",children:[ci(Pc,{href:"/docs/ecosystem/integrations",className:"btn-primary",children:["Integrations ",ao(Up,{size:16})]}),ao(Pc,{href:"/docs/ecosystem/templates",className:"btn-ghost",children:"Plugin authoring templates"})]})]})}import _p from"@contractspec/lib.ui-link";import{jsx as Vr,jsxs as zp}from"react/jsx-runtime";function qt({title:e="Need the operating layer on top of OSS ContractSpec?",body:t="ContractSpec Studio helps teams turn evidence into proposed spec changes, governed delivery loops, and execution-ready task packs while keeping the open contract system as the source of truth.",ctaLabel:a="See what Studio adds",href:r="https://www.contractspec.studio/docs"}){return zp("div",{className:"card-subtle space-y-3 p-6",children:[Vr("h3",{className:"font-semibold text-lg",children:e}),Vr("p",{className:"text-muted-foreground text-sm",children:t}),Vr(_p,{href:r,className:"btn-primary",children:a})]})}import{CodeBlock as Tc}from"@contractspec/lib.design-system";import Ac from"@contractspec/lib.ui-link";import{ChevronRight as Gp}from"lucide-react";import{jsx as na,jsxs as Ko}from"react/jsx-runtime";function qp(){return Ko("div",{className:"space-y-8",children:[Ko("div",{className:"space-y-3",children:[na("h1",{className:"font-bold text-4xl",children:"Plugin authoring templates"}),na("p",{className:"text-lg text-muted-foreground",children:"Scaffold focused Cursor plugins for ContractSpec product and core libraries."})]}),Ko("div",{className:"card-subtle space-y-4 p-6",children:[na("h2",{className:"font-bold text-2xl",children:"Create a focused plugin"}),na("p",{className:"text-muted-foreground text-sm",children:"Start from a scoped domain and keep each plugin aligned to one product or library surface."}),na(Tc,{language:"bash",filename:"catalog-authoring-layout",code:`packages/apps-registry/cursor-marketplace/
730
730
  plugins/
731
731
  <plugin-name>/
732
732
  .cursor-plugin/plugin.json
@@ -738,10 +738,10 @@ SKIP_PLUGIN_NETWORK_CHECK=1 bun run plugin:contractspec:validate`})]}),ci("div",
738
738
  bun run plugin:contractspec:validate
739
739
 
740
740
  # Optional in offline environments
741
- SKIP_PLUGIN_NETWORK_CHECK=1 bun run plugin:contractspec:validate`})]}),na(Ht,{title:"Need evidence-backed template iteration?",body:"Studio helps teams prioritize template changes from real product signals and export implementation-ready task packs."}),Ko("div",{className:"flex items-center gap-4 pt-4",children:[Ko(Ac,{href:"/docs/ecosystem/plugins",className:"btn-primary",children:["Marketplace plugins ",na(Gp,{size:16})]}),na(Ac,{href:"/docs/ecosystem/registry",className:"btn-ghost",children:"Marketplace manifest"})]})]})}import{registerDocBlocks as qp}from"@contractspec/lib.contracts-spec/docs";var Vp=[{id:"docs.ecosystem.plugins",title:"Marketplace plugins",summary:"Focused Cursor marketplace plugins for product and core libraries.",kind:"usage",visibility:"public",route:"/docs/ecosystem/plugins",tags:["ecosystem","plugins","extensions"],body:"# Marketplace plugins\n\nContractSpec ships a focused Cursor marketplace catalog with plugins for the product and key libraries. Plugin sources live in `packages/apps-registry/cursor-marketplace/plugins/*`, while the root manifest at `.cursor-plugin/marketplace.json` drives submission."},{id:"docs.ecosystem.integrations",title:"Integrations",summary:"Reference plugins and integrations you can extend.",kind:"usage",visibility:"public",route:"/docs/ecosystem/integrations",tags:["ecosystem","integrations"],body:`# Integrations
741
+ SKIP_PLUGIN_NETWORK_CHECK=1 bun run plugin:contractspec:validate`})]}),na(qt,{title:"Need evidence-backed template iteration?",body:"Studio helps teams prioritize template changes from real product signals and export implementation-ready task packs."}),Ko("div",{className:"flex items-center gap-4 pt-4",children:[Ko(Ac,{href:"/docs/ecosystem/plugins",className:"btn-primary",children:["Marketplace plugins ",na(Gp,{size:16})]}),na(Ac,{href:"/docs/ecosystem/registry",className:"btn-ghost",children:"Marketplace manifest"})]})]})}import{registerDocBlocks as Hp}from"@contractspec/lib.contracts-spec/docs";var Vp=[{id:"docs.ecosystem.plugins",title:"Marketplace plugins",summary:"Focused Cursor marketplace plugins for product and core libraries.",kind:"usage",visibility:"public",route:"/docs/ecosystem/plugins",tags:["ecosystem","plugins","extensions"],body:"# Marketplace plugins\n\nContractSpec ships a focused Cursor marketplace catalog with plugins for the product and key libraries. Plugin sources live in `packages/apps-registry/cursor-marketplace/plugins/*`, while the root manifest at `.cursor-plugin/marketplace.json` drives submission."},{id:"docs.ecosystem.integrations",title:"Integrations",summary:"Reference plugins and integrations you can extend.",kind:"usage",visibility:"public",route:"/docs/ecosystem/integrations",tags:["ecosystem","integrations"],body:`# Integrations
742
742
 
743
- Reference integrations demonstrate how to extend ContractSpec with real-world plugins. Use them as starting points for your own adapters and generators.`},{id:"docs.ecosystem.templates",title:"Plugin authoring templates",summary:"Author focused plugins with a consistent marketplace-ready layout.",kind:"usage",visibility:"public",route:"/docs/ecosystem/templates",tags:["ecosystem","templates"],body:"# Plugin authoring templates\n\nCreate each plugin under `packages/apps-registry/cursor-marketplace/plugins/<plugin-name>/` and include `.cursor-plugin/plugin.json`, `rules/`, `commands/`, `agents/`, `skills/`, and `.mcp.json`."},{id:"docs.ecosystem.registry",title:"Marketplace manifest",summary:"Manage and validate root marketplace entries for all plugins.",kind:"usage",visibility:"public",route:"/docs/ecosystem/registry",tags:["ecosystem","registry"],body:"# Marketplace manifest\n\nKeep all plugin entries in `.cursor-plugin/marketplace.json` and validate them with `bun run plugin:contractspec:validate` before submission."}];qp(Vp);import{ExampleCatalogDataView as Rc}from"@contractspec/lib.contracts-spec/docs";import{ButtonLink as Lc,DataViewList as Fp,StatusChip as Kp}from"@contractspec/lib.design-system";import{HStack as Qp,VStack as Ec}from"@contractspec/lib.ui-kit-web/ui/stack";import{H1 as Yp,Muted as Dc}from"@contractspec/lib.ui-kit-web/ui/typography";import{buildExampleDocsHref as Jp,listDiscoverableExamples as $p}from"@contractspec/module.examples";import{jsx as li,jsxs as Fr}from"react/jsx-runtime";function Zp(){let e=$p().map((a)=>{let r=a.meta.title??a.meta.key;return{id:a.meta.key,title:r,summary:a.meta.summary??a.meta.description,route:Jp(a.meta.key),tags:a.meta.tags,sandboxEnabled:a.surfaces.sandbox.enabled}}).sort((a,r)=>a.title.localeCompare(r.title)),t={...Rc,view:{...Rc.view,kind:"list"}};return Fr(Ec,{gap:"xl",children:[Fr(Ec,{gap:"sm",children:[li(Yp,{children:"Examples"}),li(Dc,{children:"Reference implementations for real ContractSpec surfaces. Use them to study adoption patterns, inspect generated artifacts, and validate the OSS workflow against runnable systems."})]}),li(Fp,{spec:t,items:e,emptyState:li(Dc,{children:"No examples available."}),renderActions:(a)=>{return Fr(Qp,{gap:"xs",justify:"end",children:[a.sandboxEnabled?li(Lc,{href:`/sandbox?template=${a.id}`,size:"sm",variant:"outline",children:"Sandbox"}):null,li(Lc,{href:a.route,size:"sm",children:"Reference"}),a.tags?.[0]?li(Kp,{size:"sm",label:a.tags[0]}):null]})}})]})}import{buildExampleDocsHref as Xp,buildExampleReferenceHref as xp,getDiscoverableExample as jp,getExamplePreviewHref as em}from"@contractspec/module.examples";var tm={"agent-console":"Primary meetup path for autonomous agents: typed tools, agent configs, run history, and execution logs in one regenerable surface.","ai-chat-assistant":"Secondary meetup path for MCP-aware assistants: reasoning, sources, suggestions, and a minimal contract-backed search tool.","data-grid-showcase":"Canonical table example for the full ContractSpec stack: declarative DataView contract, shared controller, raw web primitive, native-first primitive, and the composed design-system wrapper.","messaging-agent-actions":"Live messaging lane for the meetup: inbound Slack, WhatsApp, or Telegram messages route through fixed intents, allowlisted actions, and deterministic confirmations."},am={"agent-console":"/docs/reference/agent-console/agent-console","ai-chat-assistant":"/docs/reference/ai-chat-assistant/assistant.search","data-grid-showcase":"/docs/reference/data-grid-showcase/data-grid-showcase","messaging-agent-actions":"/docs/reference/messaging-agent-actions/messaging.agentActions.process"};function Oc(e){let t=jp(e);if(!t)return;let a=t.entrypoints.packageName.replace("@contractspec/example.",""),r=Xp(e),l=em(e);return{key:e,lead:tm[e]??t.meta.summary??t.meta.description??"Public ContractSpec reference example.",sandboxHref:l,referenceHref:am[e]??xp(e),llmsHref:`/llms/${t.entrypoints.packageName.replace("@contractspec/","")}`,repoHref:`https://github.com/lssm-tech/contractspec/tree/main/packages/examples/${a}`,localCommands:om(a,r,l)}}function om(e,t,a){let r=[`bun run --cwd packages/examples/${e} build`,"bun run --cwd packages/apps/web-landing dev","","# Open in the browser",`# http://localhost:3000${t}`];if(a)r.push(`# http://localhost:3000${a}`);return r.join(`
744
- `)}import{ButtonLink as Pi,CodeBlock as im}from"@contractspec/lib.design-system";import rm from"@contractspec/lib.ui-link";import{getExample as nm}from"@contractspec/module.examples";import{FileCode2 as cm,Play as lm,TerminalSquare as dm}from"lucide-react";import{jsx as Ne,jsxs as ka}from"react/jsx-runtime";function sm({exampleKey:e}){let t=Oc(e),a=nm(e);if(!t||!a)return null;let r=a.meta.title??a.meta.key,l=a.meta.summary??a.meta.description??"",b=a.entrypoints.packageName;return ka("div",{className:"space-y-10",children:[ka("section",{className:"space-y-5",children:[Ne("p",{className:"editorial-kicker",children:"Meetup-ready example"}),Ne("h1",{className:"editorial-title max-w-5xl",children:r}),Ne("p",{className:"editorial-subtitle",children:t.lead}),Ne("p",{className:"editorial-copy max-w-4xl",children:l}),ka("div",{className:"flex flex-wrap gap-3",children:[t.sandboxHref?Ne(Pi,{href:t.sandboxHref,children:"Open sandbox"}):null,Ne(Pi,{href:t.referenceHref,variant:"outline",children:"Generated reference"})]})]}),ka("section",{className:"grid gap-5 lg:grid-cols-3",children:[t.sandboxHref?ka("article",{className:"editorial-panel space-y-4",children:[ka("div",{className:"flex items-center gap-3",children:[Ne("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:Ne(lm,{size:18})}),Ne("h2",{className:"font-semibold text-xl",children:"Sandbox preview"})]}),Ne("p",{className:"editorial-copy text-sm",children:"Load the same public browser surface used for the prepared live demo."}),Ne(Pi,{href:t.sandboxHref,size:"sm",children:"Open preview"})]}):null,ka("article",{className:"editorial-panel space-y-4",children:[ka("div",{className:"flex items-center gap-3",children:[Ne("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:Ne(cm,{size:18})}),Ne("h2",{className:"font-semibold text-xl",children:"Reference docs"})]}),Ne("p",{className:"editorial-copy text-sm",children:"Inspect the generated contract-facing material instead of relying on marketing summaries."}),Ne(Pi,{href:t.referenceHref,size:"sm",variant:"outline",children:"Open reference"})]}),ka("article",{className:"editorial-panel space-y-4",children:[ka("div",{className:"flex items-center gap-3",children:[Ne("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:Ne(dm,{size:18})}),Ne("h2",{className:"font-semibold text-xl",children:"Package context"})]}),Ne("p",{className:"editorial-copy text-sm",children:"Use the agent-facing package page for fast repo orientation, then jump to the source directory."}),Ne("p",{className:"rounded-[18px] border border-border/70 bg-background/75 px-4 py-3 font-mono text-sm",children:b}),ka("div",{className:"flex flex-wrap gap-2",children:[Ne(Pi,{href:t.llmsHref,size:"sm",variant:"outline",children:"LLMS page"}),Ne(Pi,{href:t.repoHref,size:"sm",variant:"outline",children:"GitHub source"})]})]})]}),ka("section",{className:"editorial-panel space-y-5",children:[ka("div",{className:"space-y-2",children:[Ne("p",{className:"editorial-kicker",children:"Talk commands"}),Ne("h2",{className:"editorial-panel-title",children:"Exact local commands for the meetup lane"}),Ne("p",{className:"editorial-copy text-sm",children:"Build the example package, then launch the web shell and open the prepared docs or sandbox route."})]}),Ne(im,{language:"bash",filename:`${e}-meetup-runbook`,code:t.localCommands}),ka("p",{className:"text-muted-foreground text-sm",children:["For the full fallback order and safe live-edit workflow, use"," ",Ne(rm,{href:"https://github.com/lssm-tech/contractspec/blob/main/docs/meetup-agent-examples-runbook.md",children:"the meetup runbook"}),"."]})]})]})}async function f2(){let{getDocsIndexManifest:e}=await Promise.resolve().then(() => (gr(),ur));return e()}async function Wc(){let{listGeneratedDocs:e}=await Promise.resolve().then(() => (gr(),ur));return e()}async function h2(e){let{getGeneratedDocById:t}=await Promise.resolve().then(() => (gr(),ur));return t(e)}import{CodeBlock as fr,InstallCommand as vm}from"@contractspec/lib.design-system";import _c from"@contractspec/lib.ui-link";import{ChevronRight as Nm}from"lucide-react";import{jsx as ge,jsxs as St}from"react/jsx-runtime";function wm(){return St("div",{className:"space-y-8",children:[St("div",{className:"space-y-2",children:[ge("h1",{className:"font-bold text-4xl",children:"ContractSpec CLI"}),ge("p",{className:"text-lg text-muted-foreground",children:"Command-line interface for creating, building, and validating contract specifications with AI-powered code generation."})]}),St("div",{className:"space-y-6",children:[St("div",{className:"space-y-3",children:[ge("h2",{className:"font-bold text-2xl",children:"Installation"}),ge(vm,{package:"contractspec",dev:!0})]}),St("div",{className:"space-y-3",children:[ge("h2",{className:"font-bold text-2xl",children:"Quick Start"}),ge(fr,{language:"bash",code:`# Initialize project
743
+ Reference integrations demonstrate how to extend ContractSpec with real-world plugins. Use them as starting points for your own adapters and generators.`},{id:"docs.ecosystem.templates",title:"Plugin authoring templates",summary:"Author focused plugins with a consistent marketplace-ready layout.",kind:"usage",visibility:"public",route:"/docs/ecosystem/templates",tags:["ecosystem","templates"],body:"# Plugin authoring templates\n\nCreate each plugin under `packages/apps-registry/cursor-marketplace/plugins/<plugin-name>/` and include `.cursor-plugin/plugin.json`, `rules/`, `commands/`, `agents/`, `skills/`, and `.mcp.json`."},{id:"docs.ecosystem.registry",title:"Marketplace manifest",summary:"Manage and validate root marketplace entries for all plugins.",kind:"usage",visibility:"public",route:"/docs/ecosystem/registry",tags:["ecosystem","registry"],body:"# Marketplace manifest\n\nKeep all plugin entries in `.cursor-plugin/marketplace.json` and validate them with `bun run plugin:contractspec:validate` before submission."}];Hp(Vp);import{ExampleCatalogDataView as Rc}from"@contractspec/lib.contracts-spec/docs";import{ButtonLink as Lc,DataViewList as Fp,StatusChip as Kp}from"@contractspec/lib.design-system";import{HStack as Qp,VStack as Dc}from"@contractspec/lib.ui-kit-web/ui/stack";import{H1 as Yp,Muted as Ec}from"@contractspec/lib.ui-kit-web/ui/typography";import{buildExampleDocsHref as Jp,listDiscoverableExamples as Zp}from"@contractspec/module.examples/catalog";import{jsx as li,jsxs as Fr}from"react/jsx-runtime";function $p(){let e=Zp().map((a)=>{let r=a.meta.title??a.meta.key;return{id:a.meta.key,title:r,summary:a.meta.summary??a.meta.description,route:Jp(a.meta.key),tags:a.meta.tags,sandboxEnabled:a.surfaces.sandbox.enabled}}).sort((a,r)=>a.title.localeCompare(r.title)),t={...Rc,view:{...Rc.view,kind:"list"}};return Fr(Dc,{gap:"xl",children:[Fr(Dc,{gap:"sm",children:[li(Yp,{children:"Examples"}),li(Ec,{children:"Reference implementations for real ContractSpec surfaces. Use them to study adoption patterns, inspect generated artifacts, and validate the OSS workflow against runnable systems."})]}),li(Fp,{spec:t,items:e,emptyState:li(Ec,{children:"No examples available."}),renderActions:(a)=>{return Fr(Qp,{gap:"xs",justify:"end",children:[a.sandboxEnabled?li(Lc,{href:`/sandbox?template=${a.id}`,size:"sm",variant:"outline",children:"Sandbox"}):null,li(Lc,{href:a.route,size:"sm",children:"Reference"}),a.tags?.[0]?li(Kp,{size:"sm",label:a.tags[0]}):null]})}})]})}import{buildExampleDocsHref as Xp,buildExampleReferenceHref as xp,getDiscoverableExample as jp,getExamplePreviewHref as em}from"@contractspec/module.examples/catalog";var tm={"agent-console":"Primary meetup path for autonomous agents: typed tools, agent configs, run history, and execution logs in one regenerable surface.","ai-chat-assistant":"Secondary meetup path for MCP-aware assistants: reasoning, sources, suggestions, and a minimal contract-backed search tool.","data-grid-showcase":"Canonical table example for the full ContractSpec stack: declarative DataView contract, shared controller, raw web primitive, native-first primitive, and the composed design-system wrapper.","messaging-agent-actions":"Live messaging lane for the meetup: inbound Slack, WhatsApp, or Telegram messages route through fixed intents, allowlisted actions, and deterministic confirmations."},am={"agent-console":"/docs/reference/agent-console/agent-console","ai-chat-assistant":"/docs/reference/ai-chat-assistant/assistant.search","data-grid-showcase":"/docs/reference/data-grid-showcase/data-grid-showcase","messaging-agent-actions":"/docs/reference/messaging-agent-actions/messaging.agentActions.process"};function Oc(e){let t=jp(e);if(!t)return;let a=t.entrypoints.packageName.replace("@contractspec/example.",""),r=Xp(e),l=em(e);return{key:e,lead:tm[e]??t.meta.summary??t.meta.description??"Public ContractSpec reference example.",sandboxHref:l,referenceHref:am[e]??xp(e),llmsHref:`/llms/${t.entrypoints.packageName.replace("@contractspec/","")}`,repoHref:`https://github.com/lssm-tech/contractspec/tree/main/packages/examples/${a}`,localCommands:om(a,r,l)}}function om(e,t,a){let r=[`bun run --cwd packages/examples/${e} build`,"bun run --cwd packages/apps/web-landing dev","","# Open in the browser",`# http://localhost:3000${t}`];if(a)r.push(`# http://localhost:3000${a}`);return r.join(`
744
+ `)}import{ButtonLink as Pi,CodeBlock as im}from"@contractspec/lib.design-system";import rm from"@contractspec/lib.ui-link";import{getExample as nm}from"@contractspec/module.examples/catalog";import{FileCode2 as cm,Play as lm,TerminalSquare as dm}from"lucide-react";import{jsx as Ne,jsxs as ka}from"react/jsx-runtime";function sm({exampleKey:e}){let t=Oc(e),a=nm(e);if(!t||!a)return null;let r=a.meta.title??a.meta.key,l=a.meta.summary??a.meta.description??"",b=a.entrypoints.packageName;return ka("div",{className:"space-y-10",children:[ka("section",{className:"space-y-5",children:[Ne("p",{className:"editorial-kicker",children:"Meetup-ready example"}),Ne("h1",{className:"editorial-title max-w-5xl",children:r}),Ne("p",{className:"editorial-subtitle",children:t.lead}),Ne("p",{className:"editorial-copy max-w-4xl",children:l}),ka("div",{className:"flex flex-wrap gap-3",children:[t.sandboxHref?Ne(Pi,{href:t.sandboxHref,children:"Open sandbox"}):null,Ne(Pi,{href:t.referenceHref,variant:"outline",children:"Generated reference"})]})]}),ka("section",{className:"grid gap-5 lg:grid-cols-3",children:[t.sandboxHref?ka("article",{className:"editorial-panel space-y-4",children:[ka("div",{className:"flex items-center gap-3",children:[Ne("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:Ne(lm,{size:18})}),Ne("h2",{className:"font-semibold text-xl",children:"Sandbox preview"})]}),Ne("p",{className:"editorial-copy text-sm",children:"Load the same public browser surface used for the prepared live demo."}),Ne(Pi,{href:t.sandboxHref,size:"sm",children:"Open preview"})]}):null,ka("article",{className:"editorial-panel space-y-4",children:[ka("div",{className:"flex items-center gap-3",children:[Ne("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:Ne(cm,{size:18})}),Ne("h2",{className:"font-semibold text-xl",children:"Reference docs"})]}),Ne("p",{className:"editorial-copy text-sm",children:"Inspect the generated contract-facing material instead of relying on marketing summaries."}),Ne(Pi,{href:t.referenceHref,size:"sm",variant:"outline",children:"Open reference"})]}),ka("article",{className:"editorial-panel space-y-4",children:[ka("div",{className:"flex items-center gap-3",children:[Ne("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:Ne(dm,{size:18})}),Ne("h2",{className:"font-semibold text-xl",children:"Package context"})]}),Ne("p",{className:"editorial-copy text-sm",children:"Use the agent-facing package page for fast repo orientation, then jump to the source directory."}),Ne("p",{className:"rounded-[18px] border border-border/70 bg-background/75 px-4 py-3 font-mono text-sm",children:b}),ka("div",{className:"flex flex-wrap gap-2",children:[Ne(Pi,{href:t.llmsHref,size:"sm",variant:"outline",children:"LLMS page"}),Ne(Pi,{href:t.repoHref,size:"sm",variant:"outline",children:"GitHub source"})]})]})]}),ka("section",{className:"editorial-panel space-y-5",children:[ka("div",{className:"space-y-2",children:[Ne("p",{className:"editorial-kicker",children:"Talk commands"}),Ne("h2",{className:"editorial-panel-title",children:"Exact local commands for the meetup lane"}),Ne("p",{className:"editorial-copy text-sm",children:"Build the example package, then launch the web shell and open the prepared docs or sandbox route."})]}),Ne(im,{language:"bash",filename:`${e}-meetup-runbook`,code:t.localCommands}),ka("p",{className:"text-muted-foreground text-sm",children:["For the full fallback order and safe live-edit workflow, use"," ",Ne(rm,{href:"https://github.com/lssm-tech/contractspec/blob/main/docs/meetup-agent-examples-runbook.md",children:"the meetup runbook"}),"."]})]})]})}async function f2(){let{getDocsIndexManifest:e}=await Promise.resolve().then(() => (gr(),ur));return e()}async function Wc(){let{listGeneratedDocs:e}=await Promise.resolve().then(() => (gr(),ur));return e()}async function h2(e){let{getGeneratedDocById:t}=await Promise.resolve().then(() => (gr(),ur));return t(e)}import{CodeBlock as fr,InstallCommand as vm}from"@contractspec/lib.design-system";import _c from"@contractspec/lib.ui-link";import{ChevronRight as Nm}from"lucide-react";import{jsx as ge,jsxs as St}from"react/jsx-runtime";function wm(){return St("div",{className:"space-y-8",children:[St("div",{className:"space-y-2",children:[ge("h1",{className:"font-bold text-4xl",children:"ContractSpec CLI"}),ge("p",{className:"text-lg text-muted-foreground",children:"Command-line interface for creating, building, and validating contract specifications with AI-powered code generation."})]}),St("div",{className:"space-y-6",children:[St("div",{className:"space-y-3",children:[ge("h2",{className:"font-bold text-2xl",children:"Installation"}),ge(vm,{package:"contractspec",dev:!0})]}),St("div",{className:"space-y-3",children:[ge("h2",{className:"font-bold text-2xl",children:"Quick Start"}),ge(fr,{language:"bash",code:`# Initialize project
745
745
  contractspec onboard
746
746
  bunx contractspec init
747
747
 
@@ -766,7 +766,7 @@ contractspec validate`})]}),St("div",{className:"space-y-4",children:[ge("h2",{c
766
766
  "operations": "interactions/commands|queries",
767
767
  "events": "events"
768
768
  }
769
- }`})]})]}),St("div",{className:"flex items-center gap-4 pt-4",children:[St(_c,{href:"/docs/getting-started/tools/vscode",className:"btn-primary",children:["Next: VS Code Extension ",ge(Nm,{size:16})]}),ge(_c,{href:"/docs/getting-started/tools",className:"btn-ghost",children:"Back to Tools"})]})]})}import hr from"@contractspec/lib.ui-link";import{ChevronRight as km}from"lucide-react";import{jsx as Ce,jsxs as Mt}from"react/jsx-runtime";function Sm(){return Mt("div",{className:"space-y-8",children:[Mt("div",{className:"space-y-2",children:[Ce("h1",{className:"font-bold text-4xl",children:"Compatibility"}),Ce("p",{className:"text-lg text-muted-foreground",children:"Supported runtimes, frameworks, and agent modes for ContractSpec."})]}),Mt("div",{className:"space-y-6",children:[Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Runtimes"}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"Node.js 20+"}),Ce("li",{children:"Bun 1.0+"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Frameworks"}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"Next.js 14+ (App Router preferred)"}),Ce("li",{children:"Bun + Elysia or compatible HTTP servers"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Package managers"}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"bun (recommended)"}),Ce("li",{children:"npm"}),Ce("li",{children:"pnpm"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"AI agent modes"}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"claude-code"}),Ce("li",{children:"openai-codex"}),Ce("li",{children:"cursor"}),Ce("li",{children:"opencode"}),Ce("li",{children:"simple (direct LLM)"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Datastores"}),Ce("p",{className:"text-muted-foreground",children:"ContractSpec ships with Prisma-friendly defaults and can integrate with custom adapters for other databases."}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"PostgreSQL via Prisma"}),Ce("li",{children:"Custom adapters for other SQL/NoSQL stores"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Cross-platform UI architecture"}),Mt("p",{className:"text-muted-foreground",children:["Need the React and React Native component compatibility story? Read"," ",Ce(hr,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the runtime and UI-layer split."]})]})]}),Mt("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[Ce(hr,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),Ce(hr,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),Mt(hr,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",Ce(km,{size:16})]})]})]})}import{CodeBlock as $r}from"@contractspec/lib.design-system";import Zr from"@contractspec/lib.ui-link";import{ChevronRight as Cm}from"lucide-react";import{jsx as it,jsxs as uo}from"react/jsx-runtime";var Im=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
769
+ }`})]})]}),St("div",{className:"flex items-center gap-4 pt-4",children:[St(_c,{href:"/docs/getting-started/tools/vscode",className:"btn-primary",children:["Next: VS Code Extension ",ge(Nm,{size:16})]}),ge(_c,{href:"/docs/getting-started/tools",className:"btn-ghost",children:"Back to Tools"})]})]})}import hr from"@contractspec/lib.ui-link";import{ChevronRight as km}from"lucide-react";import{jsx as Ce,jsxs as Mt}from"react/jsx-runtime";function Sm(){return Mt("div",{className:"space-y-8",children:[Mt("div",{className:"space-y-2",children:[Ce("h1",{className:"font-bold text-4xl",children:"Compatibility"}),Ce("p",{className:"text-lg text-muted-foreground",children:"Supported runtimes, frameworks, and agent modes for ContractSpec."})]}),Mt("div",{className:"space-y-6",children:[Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Runtimes"}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"Node.js 20+"}),Ce("li",{children:"Bun 1.0+"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Frameworks"}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"Next.js 14+ (App Router preferred)"}),Ce("li",{children:"Bun + Elysia or compatible HTTP servers"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Package managers"}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"bun (recommended)"}),Ce("li",{children:"npm"}),Ce("li",{children:"pnpm"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"AI agent modes"}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"claude-code"}),Ce("li",{children:"openai-codex"}),Ce("li",{children:"cursor"}),Ce("li",{children:"opencode"}),Ce("li",{children:"simple (direct LLM)"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Datastores"}),Ce("p",{className:"text-muted-foreground",children:"ContractSpec ships with Prisma-friendly defaults and can integrate with custom adapters for other databases."}),Mt("ul",{className:"space-y-2 text-muted-foreground",children:[Ce("li",{children:"PostgreSQL via Prisma"}),Ce("li",{children:"Custom adapters for other SQL/NoSQL stores"})]})]}),Mt("div",{className:"card-subtle space-y-3 p-6",children:[Ce("h2",{className:"font-bold text-2xl",children:"Cross-platform UI architecture"}),Mt("p",{className:"text-muted-foreground",children:["Need the React and React Native component compatibility story? Read"," ",Ce(hr,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the runtime and UI-layer split."]})]})]}),Mt("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[Ce(hr,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),Ce(hr,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),Mt(hr,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",Ce(km,{size:16})]})]})]})}import{CodeBlock as Zr}from"@contractspec/lib.design-system";import $r from"@contractspec/lib.ui-link";import{ChevronRight as Cm}from"lucide-react";import{jsx as it,jsxs as uo}from"react/jsx-runtime";var Im=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
770
770
  import { ListTransactions } from './list-transactions';
771
771
 
772
772
  export const TransactionHistory = defineDataView({
@@ -812,7 +812,7 @@ export const TransactionHistory = defineDataView({
812
812
  { key: 'notes', label: 'Notes', dataPath: 'notes' },
813
813
  ],
814
814
  },
815
- });`;function Pm(){return uo("div",{className:"space-y-8",children:[uo("div",{className:"space-y-4",children:[it("h1",{className:"font-bold text-4xl",children:"Display Data with DataViews"}),it("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."})]}),uo("div",{className:"space-y-4",children:[it("h2",{className:"font-bold text-2xl",children:"1. Define the underlying query"}),it("p",{className:"text-muted-foreground",children:"First, create a query operation to fetch the data:"}),it($r,{language:"typescript",filename:"lib/specs/billing/list-transactions.ts",code:`import { defineQuery } from '@contractspec/lib.contracts-spec';
815
+ });`;function Pm(){return uo("div",{className:"space-y-8",children:[uo("div",{className:"space-y-4",children:[it("h1",{className:"font-bold text-4xl",children:"Display Data with DataViews"}),it("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."})]}),uo("div",{className:"space-y-4",children:[it("h2",{className:"font-bold text-2xl",children:"1. Define the underlying query"}),it("p",{className:"text-muted-foreground",children:"First, create a query operation to fetch the data:"}),it(Zr,{language:"typescript",filename:"lib/specs/billing/list-transactions.ts",code:`import { defineQuery } from '@contractspec/lib.contracts-spec';
816
816
 
817
817
  export const ListTransactions = defineQuery({
818
818
  meta: {
@@ -825,7 +825,7 @@ export const ListTransactions = defineQuery({
825
825
  output: /* array of transactions */,
826
826
  },
827
827
  policy: { auth: 'user' },
828
- });`})]}),uo("div",{className:"space-y-4",children:[it("h2",{className:"font-bold text-2xl",children:"2. Define the DataView spec"}),it("p",{className:"text-muted-foreground",children:"Wrap your query with presentation metadata:"}),it($r,{language:"typescript",filename:"lib/specs/billing/transaction-history.data-view.ts",code:Im}),uo("p",{className:"text-muted-foreground text-sm",children:["The live version of this pattern is available in the canonical"," ",it(Zr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),"."]})]}),uo("div",{className:"space-y-4",children:[it("h2",{className:"font-bold text-2xl",children:"3. Render on the frontend"}),it("p",{className:"text-muted-foreground",children:"Use the runtime renderer in your React or React Native app:"}),it($r,{language:"tsx",filename:"app/dashboard/transactions/page.tsx",code:`'use client';
828
+ });`})]}),uo("div",{className:"space-y-4",children:[it("h2",{className:"font-bold text-2xl",children:"2. Define the DataView spec"}),it("p",{className:"text-muted-foreground",children:"Wrap your query with presentation metadata:"}),it(Zr,{language:"typescript",filename:"lib/specs/billing/transaction-history.data-view.ts",code:Im}),uo("p",{className:"text-muted-foreground text-sm",children:["The live version of this pattern is available in the canonical"," ",it($r,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),"."]})]}),uo("div",{className:"space-y-4",children:[it("h2",{className:"font-bold text-2xl",children:"3. Render on the frontend"}),it("p",{className:"text-muted-foreground",children:"Use the runtime renderer in your React or React Native app:"}),it(Zr,{language:"tsx",filename:"app/dashboard/transactions/page.tsx",code:`'use client';
829
829
 
830
830
  import { DataViewRenderer } from '@contractspec/lib.design-system';
831
831
  import { TransactionHistory } from '@/lib/specs/billing/transaction-history.data-view';
@@ -850,7 +850,7 @@ export function TransactionsPage() {
850
850
  />
851
851
  </div>
852
852
  );
853
- }`})]}),uo("div",{className:"card-subtle space-y-4 p-6",children:[it("h3",{className:"font-bold",children:"Why DataViews?"}),uo("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[it("li",{children:"Same spec renders on web (React) and mobile (React Native)"}),it("li",{children:"Filters, sorting, and pagination handled automatically"}),it("li",{children:"Column visibility, pinning, resizing, and row expansion stay contract-driven"}),it("li",{children:"Format rules (currency, dates, badges) applied consistently"}),it("li",{children:"Export to CSV/PDF using the same spec"}),it("li",{children:"A/B test different layouts without touching the backend"})]})]}),uo("div",{className:"flex items-center gap-4 pt-4",children:[uo(Zr,{href:"/docs/libraries/data-views",className:"btn-primary",children:["DataView API Reference ",it(Cm,{size:16})]}),it(Zr,{href:"/docs/specs/workflows",className:"btn-ghost",children:"Next: Workflows"})]})]})}import{CodeBlock as Tm,InstallCommand as Am}from"@contractspec/lib.design-system";import Xr from"@contractspec/lib.ui-link";import{ChevronRight as zc,Code2 as Rm,Cpu as Lm,Layers as Em,Terminal as Dm}from"lucide-react";import{jsx as Ct,jsxs as Ga}from"react/jsx-runtime";function M2(){return Ga("div",{className:"space-y-8",children:[Ga("div",{className:"space-y-2",children:[Ct("h1",{className:"font-bold text-4xl",children:"Developer Tools"}),Ct("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."})]}),Ct("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:Dm,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:Rm,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:Em,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:Lm,status:"coming-soon",highlights:["Code navigation","Inline validation","Refactoring support"]}].map((t)=>{let a=t.icon,r=t.status==="coming-soon";return Ga("div",{className:`card-subtle relative space-y-4 p-6 ${r?"opacity-75":""}`,children:[r&&Ct("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"}),Ga("div",{className:"flex items-center gap-3",children:[Ct("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-violet-500/10",children:Ct(a,{className:"h-5 w-5 text-violet-400"})}),Ct("h3",{className:"font-bold text-lg",children:t.name})]}),Ct("p",{className:"text-muted-foreground text-sm",children:t.description}),Ct("ul",{className:"space-y-1",children:t.highlights.map((l)=>Ga("li",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[Ct("span",{className:"text-violet-400",children:"-"}),l]},l))}),!r&&Ga(Xr,{href:t.href,className:"btn-ghost inline-flex items-center gap-1 text-sm",children:["Learn more ",Ct(zc,{size:14})]})]},t.name)})}),Ga("div",{className:"card-subtle space-y-4 p-6",children:[Ct("h3",{className:"font-bold",children:"Quick Install"}),Ga("div",{className:"space-y-3",children:[Ga("div",{children:[Ct("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"CLI"}),Ct(Am,{package:"contractspec",dev:!0})]}),Ga("div",{children:[Ct("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"VS Code Extension"}),Ct(Tm,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"})]})]})]}),Ga("div",{className:"flex items-center gap-4 pt-4",children:[Ga(Xr,{href:"/docs/getting-started/tools/cli",className:"btn-primary",children:["Get Started with CLI ",Ct(zc,{size:16})]}),Ct(Xr,{href:"/docs/getting-started/tools/vscode",className:"btn-ghost",children:"VS Code Extension"})]})]})}import{CodeBlock as yr}from"@contractspec/lib.design-system";import Om from"@contractspec/lib.ui-link";import{ChevronRight as Bm}from"lucide-react";import{jsx as Ee,jsxs as Sa}from"react/jsx-runtime";function Mm(){return Sa("div",{className:"space-y-8",children:[Sa("div",{className:"space-y-2",children:[Ee("h1",{className:"font-bold text-4xl",children:"Your First Operation"}),Ee("p",{className:"text-lg text-muted-foreground",children:"Build a payment capture operation with policy enforcement in under 10 minutes."})]}),Sa("div",{className:"space-y-6",children:[Sa("div",{className:"space-y-3",children:[Ee("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Ee("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."})]}),Sa("div",{className:"space-y-3",children:[Ee("h2",{className:"font-bold text-2xl",children:"1. Define the operation spec"}),Sa("p",{className:"text-muted-foreground",children:["Create ",Ee("code",{children:"lib/specs/billing/capture-payment.ts"}),":"]}),Ee(yr,{language:"typescript",filename:"lib/specs/billing/capture-payment.ts",code:`import { defineCommand } from '@contractspec/lib.contracts-spec';
853
+ }`})]}),uo("div",{className:"card-subtle space-y-4 p-6",children:[it("h3",{className:"font-bold",children:"Why DataViews?"}),uo("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[it("li",{children:"Same spec renders on web (React) and mobile (React Native)"}),it("li",{children:"Filters, sorting, and pagination handled automatically"}),it("li",{children:"Column visibility, pinning, resizing, and row expansion stay contract-driven"}),it("li",{children:"Format rules (currency, dates, badges) applied consistently"}),it("li",{children:"Export to CSV/PDF using the same spec"}),it("li",{children:"A/B test different layouts without touching the backend"})]})]}),uo("div",{className:"flex items-center gap-4 pt-4",children:[uo($r,{href:"/docs/libraries/data-views",className:"btn-primary",children:["DataView API Reference ",it(Cm,{size:16})]}),it($r,{href:"/docs/specs/workflows",className:"btn-ghost",children:"Next: Workflows"})]})]})}import{CodeBlock as Tm,InstallCommand as Am}from"@contractspec/lib.design-system";import Xr from"@contractspec/lib.ui-link";import{ChevronRight as zc,Code2 as Rm,Cpu as Lm,Layers as Dm,Terminal as Em}from"lucide-react";import{jsx as Ct,jsxs as Ga}from"react/jsx-runtime";function M2(){return Ga("div",{className:"space-y-8",children:[Ga("div",{className:"space-y-2",children:[Ct("h1",{className:"font-bold text-4xl",children:"Developer Tools"}),Ct("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."})]}),Ct("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:Em,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:Rm,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:Dm,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:Lm,status:"coming-soon",highlights:["Code navigation","Inline validation","Refactoring support"]}].map((t)=>{let a=t.icon,r=t.status==="coming-soon";return Ga("div",{className:`card-subtle relative space-y-4 p-6 ${r?"opacity-75":""}`,children:[r&&Ct("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"}),Ga("div",{className:"flex items-center gap-3",children:[Ct("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-violet-500/10",children:Ct(a,{className:"h-5 w-5 text-violet-400"})}),Ct("h3",{className:"font-bold text-lg",children:t.name})]}),Ct("p",{className:"text-muted-foreground text-sm",children:t.description}),Ct("ul",{className:"space-y-1",children:t.highlights.map((l)=>Ga("li",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[Ct("span",{className:"text-violet-400",children:"-"}),l]},l))}),!r&&Ga(Xr,{href:t.href,className:"btn-ghost inline-flex items-center gap-1 text-sm",children:["Learn more ",Ct(zc,{size:14})]})]},t.name)})}),Ga("div",{className:"card-subtle space-y-4 p-6",children:[Ct("h3",{className:"font-bold",children:"Quick Install"}),Ga("div",{className:"space-y-3",children:[Ga("div",{children:[Ct("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"CLI"}),Ct(Am,{package:"contractspec",dev:!0})]}),Ga("div",{children:[Ct("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"VS Code Extension"}),Ct(Tm,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"})]})]})]}),Ga("div",{className:"flex items-center gap-4 pt-4",children:[Ga(Xr,{href:"/docs/getting-started/tools/cli",className:"btn-primary",children:["Get Started with CLI ",Ct(zc,{size:16})]}),Ct(Xr,{href:"/docs/getting-started/tools/vscode",className:"btn-ghost",children:"VS Code Extension"})]})]})}import{CodeBlock as yr}from"@contractspec/lib.design-system";import Om from"@contractspec/lib.ui-link";import{ChevronRight as Bm}from"lucide-react";import{jsx as De,jsxs as Sa}from"react/jsx-runtime";function Mm(){return Sa("div",{className:"space-y-8",children:[Sa("div",{className:"space-y-2",children:[De("h1",{className:"font-bold text-4xl",children:"Your First Operation"}),De("p",{className:"text-lg text-muted-foreground",children:"Build a payment capture operation with policy enforcement in under 10 minutes."})]}),Sa("div",{className:"space-y-6",children:[Sa("div",{className:"space-y-3",children:[De("h2",{className:"font-bold text-2xl",children:"What you'll build"}),De("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."})]}),Sa("div",{className:"space-y-3",children:[De("h2",{className:"font-bold text-2xl",children:"1. Define the operation spec"}),Sa("p",{className:"text-muted-foreground",children:["Create ",De("code",{children:"lib/specs/billing/capture-payment.ts"}),":"]}),De(yr,{language:"typescript",filename:"lib/specs/billing/capture-payment.ts",code:`import { defineCommand } from '@contractspec/lib.contracts-spec';
854
854
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
855
855
 
856
856
  const CapturePaymentInput = new SchemaModel({
@@ -893,7 +893,7 @@ export const CapturePayment = defineCommand({
893
893
  { resource: 'invoice', action: 'pay', condition: 'owner' },
894
894
  ],
895
895
  },
896
- });`})]}),Sa("div",{className:"space-y-3",children:[Ee("h2",{className:"font-bold text-2xl",children:"2. Implement the handler"}),Sa("p",{className:"text-muted-foreground",children:["Create ",Ee("code",{children:"lib/handlers/billing/capture-payment.ts"}),":"]}),Ee(yr,{language:"typescript",filename:"lib/handlers/billing/capture-payment.ts",code:`import { CapturePayment } from '@/lib/specs/billing/capture-payment';
896
+ });`})]}),Sa("div",{className:"space-y-3",children:[De("h2",{className:"font-bold text-2xl",children:"2. Implement the handler"}),Sa("p",{className:"text-muted-foreground",children:["Create ",De("code",{children:"lib/handlers/billing/capture-payment.ts"}),":"]}),De(yr,{language:"typescript",filename:"lib/handlers/billing/capture-payment.ts",code:`import { CapturePayment } from '@/lib/specs/billing/capture-payment';
897
897
  import { stripe } from '@/lib/integrations/stripe';
898
898
  import { db } from '@/lib/db';
899
899
 
@@ -930,12 +930,12 @@ export async function handleCapturePayment(input, ctx) {
930
930
  status: paymentIntent.status,
931
931
  receiptUrl: paymentIntent.charges.data[0]?.receipt_url,
932
932
  };
933
- }`})]}),Sa("div",{className:"space-y-3",children:[Ee("h2",{className:"font-bold text-2xl",children:"3. Register and serve"}),Sa("p",{className:"text-muted-foreground",children:["Wire it up in ",Ee("code",{children:"lib/registry.ts"})," and"," ",Ee("code",{children:"app/api/ops/[...route]/route.ts"}),":"]}),Ee(yr,{language:"typescript",filename:"lib/registry.ts",code:`import { OperationSpecRegistry, installOp } from '@contractspec/lib.contracts-spec';
933
+ }`})]}),Sa("div",{className:"space-y-3",children:[De("h2",{className:"font-bold text-2xl",children:"3. Register and serve"}),Sa("p",{className:"text-muted-foreground",children:["Wire it up in ",De("code",{children:"lib/registry.ts"})," and"," ",De("code",{children:"app/api/ops/[...route]/route.ts"}),":"]}),De(yr,{language:"typescript",filename:"lib/registry.ts",code:`import { OperationSpecRegistry, installOp } from '@contractspec/lib.contracts-spec';
934
934
  import { CapturePayment } from './specs/billing/capture-payment';
935
935
  import { handleCapturePayment } from './handlers/billing/capture-payment';
936
936
 
937
937
  export const registry = new OperationSpecRegistry();
938
- installOp(registry, CapturePayment, handleCapturePayment);`}),Ee(yr,{language:"typescript",filename:"app/api/ops/[...route]/route.ts",code:`import { makeNextAppHandler } from '@contractspec/lib.contracts-runtime-server-rest/rest-next-app';
938
+ installOp(registry, CapturePayment, handleCapturePayment);`}),De(yr,{language:"typescript",filename:"app/api/ops/[...route]/route.ts",code:`import { makeNextAppHandler } from '@contractspec/lib.contracts-runtime-server-rest/rest-next-app';
939
939
  import { registry } from '@/lib/registry';
940
940
  import { auth } from '@/lib/auth';
941
941
 
@@ -944,16 +944,16 @@ const handler = makeNextAppHandler(registry, async (req) => {
944
944
  return { actor: 'user', userId: session.userId, tenantId: session.tenantId };
945
945
  });
946
946
 
947
- export { handler as GET, handler as POST };`})]}),Sa("div",{className:"card-subtle space-y-4 p-6",children:[Ee("h3",{className:"font-bold",children:"What you just built:"}),Sa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Sa("li",{children:["Type-safe API endpoint at"," ",Ee("code",{children:"/api/ops/billing.capturePayment"})]}),Ee("li",{children:"Automatic input validation (amount must be positive, IDs required)"}),Ee("li",{children:"Policy enforcement\u2014only invoice owner can pay"}),Ee("li",{children:"Stripe integration with error handling"}),Ee("li",{children:"Database transaction with audit trail"}),Ee("li",{children:"Same spec works with GraphQL, MCP, or webhooks"})]})]}),Ee("div",{className:"flex items-center gap-4 pt-4",children:Sa(Om,{href:"/docs/getting-started/dataviews",className:"btn-primary",children:["Next: Display Data with DataViews ",Ee(Bm,{size:16})]})})]})]})}import{CodeBlock as Gc,InstallCommand as xr}from"@contractspec/lib.design-system";import Um from"@contractspec/lib.ui-link";import{ChevronRight as Wm}from"lucide-react";import{jsx as rt,jsxs as oo}from"react/jsx-runtime";function _m(){return oo("div",{className:"space-y-8",children:[oo("div",{className:"space-y-2",children:[rt("h1",{className:"font-bold text-4xl",children:"Installation"}),rt("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec to your existing Next.js or Bun project, or start fresh."})]}),oo("div",{className:"space-y-6",children:[oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"Prerequisites"}),oo("ul",{className:"space-y-2 text-muted-foreground",children:[rt("li",{children:"Node.js 20+ (or Bun 1.0+)"}),rt("li",{children:"Existing Next.js app or Bun HTTP server"}),rt("li",{children:"PostgreSQL database (for persistence)"})]})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"Install Core Libraries"}),rt("p",{className:"text-muted-foreground",children:"Add the contracts runtime and your choice of adapter:"}),rt(xr,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.schema"]})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"For Next.js projects"}),rt(xr,{package:"@contractspec/lib.contracts-spec"})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"For database models"}),rt(xr,{package:["@contractspec/app.cli-database","prisma","@prisma/client"]})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"Set up your project"}),rt("p",{className:"text-muted-foreground",children:"Initialize a new ContractSpec project structure:"}),rt(Gc,{language:"bash",filename:"installation-init",code:`bunx contractspec init
947
+ export { handler as GET, handler as POST };`})]}),Sa("div",{className:"card-subtle space-y-4 p-6",children:[De("h3",{className:"font-bold",children:"What you just built:"}),Sa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Sa("li",{children:["Type-safe API endpoint at"," ",De("code",{children:"/api/ops/billing.capturePayment"})]}),De("li",{children:"Automatic input validation (amount must be positive, IDs required)"}),De("li",{children:"Policy enforcement\u2014only invoice owner can pay"}),De("li",{children:"Stripe integration with error handling"}),De("li",{children:"Database transaction with audit trail"}),De("li",{children:"Same spec works with GraphQL, MCP, or webhooks"})]})]}),De("div",{className:"flex items-center gap-4 pt-4",children:Sa(Om,{href:"/docs/getting-started/dataviews",className:"btn-primary",children:["Next: Display Data with DataViews ",De(Bm,{size:16})]})})]})]})}import{CodeBlock as Gc,InstallCommand as xr}from"@contractspec/lib.design-system";import Um from"@contractspec/lib.ui-link";import{ChevronRight as Wm}from"lucide-react";import{jsx as rt,jsxs as oo}from"react/jsx-runtime";function _m(){return oo("div",{className:"space-y-8",children:[oo("div",{className:"space-y-2",children:[rt("h1",{className:"font-bold text-4xl",children:"Installation"}),rt("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec to your existing Next.js or Bun project, or start fresh."})]}),oo("div",{className:"space-y-6",children:[oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"Prerequisites"}),oo("ul",{className:"space-y-2 text-muted-foreground",children:[rt("li",{children:"Node.js 20+ (or Bun 1.0+)"}),rt("li",{children:"Existing Next.js app or Bun HTTP server"}),rt("li",{children:"PostgreSQL database (for persistence)"})]})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"Install Core Libraries"}),rt("p",{className:"text-muted-foreground",children:"Add the contracts runtime and your choice of adapter:"}),rt(xr,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.schema"]})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"For Next.js projects"}),rt(xr,{package:"@contractspec/lib.contracts-spec"})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"For database models"}),rt(xr,{package:["@contractspec/app.cli-database","prisma","@prisma/client"]})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"Set up your project"}),rt("p",{className:"text-muted-foreground",children:"Initialize a new ContractSpec project structure:"}),rt(Gc,{language:"bash",filename:"installation-init",code:`bunx contractspec init
948
948
  # Follow the interactive prompts to configure your project`})]}),oo("div",{className:"space-y-3",children:[rt("h2",{className:"font-bold text-2xl",children:"Initialize the database"}),rt("p",{className:"text-muted-foreground",children:"If using Prisma, set up your schema and generate the client:"}),rt(Gc,{language:"bash",filename:"installation-prisma",code:`bunx prisma init
949
949
  # Edit prisma/schema.prisma with your models
950
950
  bunx prisma generate
951
- bunx prisma migrate dev --name init`})]}),rt("div",{className:"flex items-center gap-4 pt-4",children:oo(Um,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: First Operation ",rt(Wm,{size:16})]})})]})]})}import{CodeBlock as br,InstallCommand as zm}from"@contractspec/lib.design-system";import jr from"@contractspec/lib.ui-link";import{ChevronRight as Gm}from"lucide-react";import{jsx as ca,jsxs as go}from"react/jsx-runtime";function Hm(){return go("div",{className:"space-y-8",children:[go("div",{className:"space-y-2",children:[ca("h1",{className:"font-bold text-4xl",children:"Start here"}),ca("p",{className:"text-lg text-muted-foreground",children:"A fast onboarding path from install to your first generated contract."})]}),go("div",{className:"space-y-6",children:[go("div",{className:"space-y-3",children:[ca("h2",{className:"font-bold text-2xl",children:"Install the CLI"}),ca(zm,{package:"contractspec",dev:!0})]}),go("div",{className:"space-y-3",children:[ca("h2",{className:"font-bold text-2xl",children:"Generate repo-local guidance"}),ca(br,{language:"bash",filename:"start-here-onboard",code:`contractspec onboard
951
+ bunx prisma migrate dev --name init`})]}),rt("div",{className:"flex items-center gap-4 pt-4",children:oo(Um,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: First Operation ",rt(Wm,{size:16})]})})]})]})}import{CodeBlock as br,InstallCommand as zm}from"@contractspec/lib.design-system";import jr from"@contractspec/lib.ui-link";import{ChevronRight as Gm}from"lucide-react";import{jsx as ca,jsxs as go}from"react/jsx-runtime";function qm(){return go("div",{className:"space-y-8",children:[go("div",{className:"space-y-2",children:[ca("h1",{className:"font-bold text-4xl",children:"Start here"}),ca("p",{className:"text-lg text-muted-foreground",children:"A fast onboarding path from install to your first generated contract."})]}),go("div",{className:"space-y-6",children:[go("div",{className:"space-y-3",children:[ca("h2",{className:"font-bold text-2xl",children:"Install the CLI"}),ca(zm,{package:"contractspec",dev:!0})]}),go("div",{className:"space-y-3",children:[ca("h2",{className:"font-bold text-2xl",children:"Generate repo-local guidance"}),ca(br,{language:"bash",filename:"start-here-onboard",code:`contractspec onboard
952
952
  # optional focused track
953
953
  contractspec onboard knowledge --example knowledge-canon`})]}),go("div",{className:"space-y-3",children:[ca("h2",{className:"font-bold text-2xl",children:"Initialize your project"}),ca(br,{language:"bash",filename:"start-here-init",code:"bunx contractspec init"})]}),go("div",{className:"space-y-3",children:[ca("h2",{className:"font-bold text-2xl",children:"Author your first contract"}),ca(br,{language:"bash",filename:"start-here-create",code:"contractspec create --type operation"})]}),go("div",{className:"space-y-3",children:[ca("h2",{className:"font-bold text-2xl",children:"Generate implementation"}),ca(br,{language:"bash",filename:"start-here-build",code:`contractspec generate
954
- contractspec validate`})]})]}),go("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[go(jr,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: Hello World ",ca(Gm,{size:16})]}),ca(jr,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),ca(jr,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"})]})]})}import{CodeBlock as qm}from"@contractspec/lib.design-system";import en from"@contractspec/lib.ui-link";import{ChevronRight as Vm}from"lucide-react";import{jsx as st,jsxs as qt}from"react/jsx-runtime";function Fm(){return qt("div",{className:"space-y-8",children:[qt("div",{className:"space-y-2",children:[st("h1",{className:"font-bold text-4xl",children:"Troubleshooting"}),st("p",{className:"text-lg text-muted-foreground",children:"Common issues and fixes when installing or generating with ContractSpec."})]}),qt("div",{className:"space-y-6",children:[qt("div",{className:"card-subtle space-y-3 p-6",children:[st("h2",{className:"font-bold text-2xl",children:"Command not found"}),qt("ul",{className:"space-y-2 text-muted-foreground",children:[st("li",{children:"Reinstall the CLI and ensure it is in your PATH."}),st("li",{children:"Confirm Node.js 20+ or Bun 1.0+ is installed."})]})]}),qt("div",{className:"card-subtle space-y-3 p-6",children:[st("h2",{className:"font-bold text-2xl",children:"Specs not discovered"}),qt("ul",{className:"space-y-2 text-muted-foreground",children:[qt("li",{children:["Run ",st("code",{children:"contractspec list"})," to see discovered specs."]}),st("li",{children:"Verify your spec path conventions in .contractsrc.json."})]})]}),qt("div",{className:"card-subtle space-y-3 p-6",children:[st("h2",{className:"font-bold text-2xl",children:"Build or validate fails"}),qt("ul",{className:"space-y-2 text-muted-foreground",children:[qt("li",{children:["Run ",st("code",{children:"contractspec validate"})," to surface schema errors."]}),st("li",{children:"Check that generated files were not manually edited."})]})]}),qt("div",{className:"space-y-3",children:[st("h2",{className:"font-bold text-2xl",children:"Diagnostics"}),st(qm,{language:"bash",filename:"troubleshooting-diagnostics",code:`contractspec --version
954
+ contractspec validate`})]})]}),go("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[go(jr,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: Hello World ",ca(Gm,{size:16})]}),ca(jr,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),ca(jr,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"})]})]})}import{CodeBlock as Hm}from"@contractspec/lib.design-system";import en from"@contractspec/lib.ui-link";import{ChevronRight as Vm}from"lucide-react";import{jsx as st,jsxs as Ht}from"react/jsx-runtime";function Fm(){return Ht("div",{className:"space-y-8",children:[Ht("div",{className:"space-y-2",children:[st("h1",{className:"font-bold text-4xl",children:"Troubleshooting"}),st("p",{className:"text-lg text-muted-foreground",children:"Common issues and fixes when installing or generating with ContractSpec."})]}),Ht("div",{className:"space-y-6",children:[Ht("div",{className:"card-subtle space-y-3 p-6",children:[st("h2",{className:"font-bold text-2xl",children:"Command not found"}),Ht("ul",{className:"space-y-2 text-muted-foreground",children:[st("li",{children:"Reinstall the CLI and ensure it is in your PATH."}),st("li",{children:"Confirm Node.js 20+ or Bun 1.0+ is installed."})]})]}),Ht("div",{className:"card-subtle space-y-3 p-6",children:[st("h2",{className:"font-bold text-2xl",children:"Specs not discovered"}),Ht("ul",{className:"space-y-2 text-muted-foreground",children:[Ht("li",{children:["Run ",st("code",{children:"contractspec list"})," to see discovered specs."]}),st("li",{children:"Verify your spec path conventions in .contractsrc.json."})]})]}),Ht("div",{className:"card-subtle space-y-3 p-6",children:[st("h2",{className:"font-bold text-2xl",children:"Build or validate fails"}),Ht("ul",{className:"space-y-2 text-muted-foreground",children:[Ht("li",{children:["Run ",st("code",{children:"contractspec validate"})," to surface schema errors."]}),st("li",{children:"Check that generated files were not manually edited."})]})]}),Ht("div",{className:"space-y-3",children:[st("h2",{className:"font-bold text-2xl",children:"Diagnostics"}),st(Hm,{language:"bash",filename:"troubleshooting-diagnostics",code:`contractspec --version
955
955
  contractspec list
956
- contractspec validate src/contracts/mySpec.ts`})]}),qt("div",{className:"card-subtle space-y-3 p-6",children:[st("h2",{className:"font-bold text-2xl",children:"Still blocked?"}),qt("ul",{className:"space-y-2 text-muted-foreground",children:[st("li",{children:"Confirm compatibility requirements for runtime and framework."}),st("li",{children:"Re-run builds on a clean branch to isolate changes."}),st("li",{children:"Use a new spec and minimal adapter to validate setup."})]})]})]}),qt("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[st(en,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),st(en,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"}),qt(en,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",st(Vm,{size:16})]})]})]})}import{CodeBlock as Km}from"@contractspec/lib.design-system";import Hc from"@contractspec/lib.ui-link";import{ChevronRight as Qm,ExternalLink as Ym}from"lucide-react";import{jsx as k,jsxs as re}from"react/jsx-runtime";function cS(){let e=[{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"]}],t=[{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 re("div",{className:"space-y-8",children:[re("div",{className:"space-y-2",children:[k("h1",{className:"font-bold text-4xl",children:"VS Code Extension"}),k("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."})]}),re("div",{className:"flex flex-wrap gap-3",children:[re("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 ",k(Ym,{size:16})]}),k("a",{href:"vscode:extension/lssm.vscode-contractspec",className:"btn-ghost inline-flex items-center gap-2",children:"Open in VS Code"})]}),re("div",{className:"space-y-6",children:[re("div",{className:"space-y-3",children:[k("h2",{className:"font-bold text-2xl",children:"Installation"}),re("div",{className:"space-y-2",children:[re("p",{className:"text-muted-foreground text-sm",children:[k("strong",{children:"Option 1:"})," Install from VS Code Marketplace"]}),k(Km,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"}),re("p",{className:"mt-4 text-muted-foreground text-sm",children:[k("strong",{children:"Option 2:"}),' Search for "ContractSpec" in VS Code Extensions (Ctrl/Cmd+Shift+X)']})]})]}),re("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Features"}),k("div",{className:"grid gap-4 md:grid-cols-3",children:e.map((a)=>re("div",{className:"card-subtle space-y-3 p-4",children:[k("h3",{className:"font-bold text-violet-400",children:a.category}),k("ul",{className:"space-y-2",children:a.items.map((r)=>re("li",{className:"flex items-start gap-2 text-muted-foreground text-sm",children:[k("span",{className:"mt-1 text-violet-400",children:"-"}),k("span",{children:r})]},r))})]},a.category))})]}),re("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Commands"}),re("p",{className:"text-muted-foreground",children:["Access commands via Command Palette (Ctrl/Cmd+Shift+P) with prefix"," ",k("code",{children:"ContractSpec:"})]}),k("div",{className:"grid gap-3 md:grid-cols-2",children:t.map((a)=>k("div",{className:"card-subtle flex items-center gap-3 p-3",children:re("div",{className:"flex-1",children:[k("p",{className:"font-medium font-mono text-sm",children:a.name}),k("p",{className:"text-muted-foreground text-xs",children:a.description})]})},a.name))})]}),re("div",{className:"space-y-3",children:[k("h2",{className:"font-bold text-2xl",children:"Sidebar Views"}),k("p",{className:"text-muted-foreground",children:"The extension adds a ContractSpec activity bar (icon in sidebar) with three views:"}),re("div",{className:"grid gap-4 md:grid-cols-3",children:[re("div",{className:"card-subtle space-y-2 p-4",children:[k("h4",{className:"font-bold",children:"Specs Explorer"}),k("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."})]}),re("div",{className:"card-subtle space-y-2 p-4",children:[k("h4",{className:"font-bold",children:"Dependencies"}),k("p",{className:"text-muted-foreground text-sm",children:"Visualize spec relationships. Detect circular dependencies. Navigate to referenced specs."})]}),re("div",{className:"card-subtle space-y-2 p-4",children:[k("h4",{className:"font-bold",children:"Build Results"}),k("p",{className:"text-muted-foreground text-sm",children:"Track build history (last 20). Success/failure indicators. Click to open generated files."})]})]})]}),re("div",{className:"space-y-3",children:[k("h2",{className:"font-bold text-2xl",children:"Getting Started"}),re("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[k("li",{children:"Install the extension from VS Code Marketplace"}),k("li",{children:"Open a workspace with ContractSpec files (or create one)"}),k("li",{children:"Start the walkthrough: Help - Welcome - ContractSpec"}),re("li",{children:["Create your first spec: Click ",k("strong",{children:"+"})," in Specs Explorer or run ",k("code",{children:"ContractSpec: Create New Spec"})]}),k("li",{children:"Build from it: Click the build icon in the editor title bar"})]})]}),re("div",{className:"card-subtle space-y-4 p-6",children:[k("h3",{className:"font-bold",children:"Configuration"}),k("p",{className:"text-muted-foreground text-sm",children:"Configure the extension in VS Code Settings:"}),k("div",{className:"overflow-x-auto",children:re("table",{className:"w-full text-muted-foreground text-sm",children:[k("thead",{children:re("tr",{className:"border-border border-b",children:[k("th",{className:"p-2 text-left font-medium",children:"Setting"}),k("th",{className:"p-2 text-left font-medium",children:"Description"}),k("th",{className:"p-2 text-left font-medium",children:"Default"})]})}),re("tbody",{children:[re("tr",{className:"border-border border-b",children:[k("td",{className:"p-2 font-mono text-xs",children:"validation.onSave"}),k("td",{className:"p-2",children:"Run validation on save"}),k("td",{className:"p-2",children:"true"})]}),re("tr",{className:"border-border border-b",children:[k("td",{className:"p-2 font-mono text-xs",children:"validation.onOpen"}),k("td",{className:"p-2",children:"Run validation on open"}),k("td",{className:"p-2",children:"true"})]}),re("tr",{className:"border-border border-b",children:[k("td",{className:"p-2 font-mono text-xs",children:"api.baseUrl"}),k("td",{className:"p-2",children:"Base URL for ContractSpec API"}),k("td",{className:"p-2",children:"(empty)"})]})]})]})})]})]}),re("div",{className:"flex items-center gap-4 pt-4",children:[k(Hc,{href:"/docs/getting-started/tools/cli",className:"btn-ghost",children:"Back: CLI"}),re(Hc,{href:"/docs/specs",className:"btn-primary",children:["Next: Core Concepts ",k(Qm,{size:16})]})]})]})}import{registerDocBlocks as Jm}from"@contractspec/lib.contracts-spec/docs";var $m=[{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
956
+ contractspec validate src/contracts/mySpec.ts`})]}),Ht("div",{className:"card-subtle space-y-3 p-6",children:[st("h2",{className:"font-bold text-2xl",children:"Still blocked?"}),Ht("ul",{className:"space-y-2 text-muted-foreground",children:[st("li",{children:"Confirm compatibility requirements for runtime and framework."}),st("li",{children:"Re-run builds on a clean branch to isolate changes."}),st("li",{children:"Use a new spec and minimal adapter to validate setup."})]})]})]}),Ht("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[st(en,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),st(en,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"}),Ht(en,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",st(Vm,{size:16})]})]})]})}import{CodeBlock as Km}from"@contractspec/lib.design-system";import qc from"@contractspec/lib.ui-link";import{ChevronRight as Qm,ExternalLink as Ym}from"lucide-react";import{jsx as k,jsxs as re}from"react/jsx-runtime";function cS(){let e=[{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"]}],t=[{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 re("div",{className:"space-y-8",children:[re("div",{className:"space-y-2",children:[k("h1",{className:"font-bold text-4xl",children:"VS Code Extension"}),k("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."})]}),re("div",{className:"flex flex-wrap gap-3",children:[re("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 ",k(Ym,{size:16})]}),k("a",{href:"vscode:extension/lssm.vscode-contractspec",className:"btn-ghost inline-flex items-center gap-2",children:"Open in VS Code"})]}),re("div",{className:"space-y-6",children:[re("div",{className:"space-y-3",children:[k("h2",{className:"font-bold text-2xl",children:"Installation"}),re("div",{className:"space-y-2",children:[re("p",{className:"text-muted-foreground text-sm",children:[k("strong",{children:"Option 1:"})," Install from VS Code Marketplace"]}),k(Km,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"}),re("p",{className:"mt-4 text-muted-foreground text-sm",children:[k("strong",{children:"Option 2:"}),' Search for "ContractSpec" in VS Code Extensions (Ctrl/Cmd+Shift+X)']})]})]}),re("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Features"}),k("div",{className:"grid gap-4 md:grid-cols-3",children:e.map((a)=>re("div",{className:"card-subtle space-y-3 p-4",children:[k("h3",{className:"font-bold text-violet-400",children:a.category}),k("ul",{className:"space-y-2",children:a.items.map((r)=>re("li",{className:"flex items-start gap-2 text-muted-foreground text-sm",children:[k("span",{className:"mt-1 text-violet-400",children:"-"}),k("span",{children:r})]},r))})]},a.category))})]}),re("div",{className:"space-y-4",children:[k("h2",{className:"font-bold text-2xl",children:"Commands"}),re("p",{className:"text-muted-foreground",children:["Access commands via Command Palette (Ctrl/Cmd+Shift+P) with prefix"," ",k("code",{children:"ContractSpec:"})]}),k("div",{className:"grid gap-3 md:grid-cols-2",children:t.map((a)=>k("div",{className:"card-subtle flex items-center gap-3 p-3",children:re("div",{className:"flex-1",children:[k("p",{className:"font-medium font-mono text-sm",children:a.name}),k("p",{className:"text-muted-foreground text-xs",children:a.description})]})},a.name))})]}),re("div",{className:"space-y-3",children:[k("h2",{className:"font-bold text-2xl",children:"Sidebar Views"}),k("p",{className:"text-muted-foreground",children:"The extension adds a ContractSpec activity bar (icon in sidebar) with three views:"}),re("div",{className:"grid gap-4 md:grid-cols-3",children:[re("div",{className:"card-subtle space-y-2 p-4",children:[k("h4",{className:"font-bold",children:"Specs Explorer"}),k("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."})]}),re("div",{className:"card-subtle space-y-2 p-4",children:[k("h4",{className:"font-bold",children:"Dependencies"}),k("p",{className:"text-muted-foreground text-sm",children:"Visualize spec relationships. Detect circular dependencies. Navigate to referenced specs."})]}),re("div",{className:"card-subtle space-y-2 p-4",children:[k("h4",{className:"font-bold",children:"Build Results"}),k("p",{className:"text-muted-foreground text-sm",children:"Track build history (last 20). Success/failure indicators. Click to open generated files."})]})]})]}),re("div",{className:"space-y-3",children:[k("h2",{className:"font-bold text-2xl",children:"Getting Started"}),re("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[k("li",{children:"Install the extension from VS Code Marketplace"}),k("li",{children:"Open a workspace with ContractSpec files (or create one)"}),k("li",{children:"Start the walkthrough: Help - Welcome - ContractSpec"}),re("li",{children:["Create your first spec: Click ",k("strong",{children:"+"})," in Specs Explorer or run ",k("code",{children:"ContractSpec: Create New Spec"})]}),k("li",{children:"Build from it: Click the build icon in the editor title bar"})]})]}),re("div",{className:"card-subtle space-y-4 p-6",children:[k("h3",{className:"font-bold",children:"Configuration"}),k("p",{className:"text-muted-foreground text-sm",children:"Configure the extension in VS Code Settings:"}),k("div",{className:"overflow-x-auto",children:re("table",{className:"w-full text-muted-foreground text-sm",children:[k("thead",{children:re("tr",{className:"border-border border-b",children:[k("th",{className:"p-2 text-left font-medium",children:"Setting"}),k("th",{className:"p-2 text-left font-medium",children:"Description"}),k("th",{className:"p-2 text-left font-medium",children:"Default"})]})}),re("tbody",{children:[re("tr",{className:"border-border border-b",children:[k("td",{className:"p-2 font-mono text-xs",children:"validation.onSave"}),k("td",{className:"p-2",children:"Run validation on save"}),k("td",{className:"p-2",children:"true"})]}),re("tr",{className:"border-border border-b",children:[k("td",{className:"p-2 font-mono text-xs",children:"validation.onOpen"}),k("td",{className:"p-2",children:"Run validation on open"}),k("td",{className:"p-2",children:"true"})]}),re("tr",{className:"border-border border-b",children:[k("td",{className:"p-2 font-mono text-xs",children:"api.baseUrl"}),k("td",{className:"p-2",children:"Base URL for ContractSpec API"}),k("td",{className:"p-2",children:"(empty)"})]})]})]})})]})]}),re("div",{className:"flex items-center gap-4 pt-4",children:[k(qc,{href:"/docs/getting-started/tools/cli",className:"btn-ghost",children:"Back: CLI"}),re(qc,{href:"/docs/specs",className:"btn-primary",children:["Next: Core Concepts ",k(Qm,{size:16})]})]})]})}import{registerDocBlocks as Jm}from"@contractspec/lib.contracts-spec/docs";var Zm=[{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
957
957
 
958
958
  Get ContractSpec running quickly and generate your first contract-backed code.
959
959
 
@@ -1052,9 +1052,9 @@ ContractSpec supports modern TypeScript stacks with spec-first workflows.
1052
1052
 
1053
1053
  - PostgreSQL via Prisma
1054
1054
  - Bring your own adapter for other databases
1055
- `}];Jm($m);import{CodeBlock as vr}from"@contractspec/lib.design-system";import qc from"@contractspec/lib.ui-link";import{ChevronRight as Zm}from"lucide-react";import{jsx as ze,jsxs as Ha}from"react/jsx-runtime";function Xm(){return Ha("div",{className:"space-y-8",children:[Ha("div",{className:"space-y-3",children:[ze("h1",{className:"font-bold text-4xl",children:"CI gating with deterministic diffs"}),ze("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec CI checks that validate specs, detect drift, and gate breaking changes before merge."})]}),Ha("div",{className:"card-subtle space-y-4 p-6",children:[ze("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Ha("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[ze("li",{children:"CI workflow running ContractSpec validation and drift checks."}),ze("li",{children:"Machine-readable output for PR annotations."}),ze("li",{children:"Deterministic contract diffs in review."})]})]}),Ha("div",{className:"space-y-6",children:[Ha("div",{className:"space-y-3",children:[ze("h2",{className:"font-bold text-2xl",children:"1) Add the CI workflow"}),ze("p",{className:"text-muted-foreground text-sm",children:"Copy the template from the CLI package."}),ze(vr,{language:"bash",filename:"ci-copy",code:"cp node_modules/@contractspec/app.cli-contractspec/templates/github-action.yml .github/workflows/contractspec.yml"}),Ha("p",{className:"text-muted-foreground text-sm",children:["Expected output: new workflow file in ",ze("code",{children:".github/workflows"}),"."]})]}),Ha("div",{className:"space-y-3",children:[ze("h2",{className:"font-bold text-2xl",children:"2) Run CI locally"}),ze(vr,{language:"bash",filename:"ci-local",code:"contractspec ci --format json --check-drift"}),ze("p",{className:"text-muted-foreground text-sm",children:"Expected output: JSON summary including pass/fail counts and drift status (if configured)."})]}),Ha("div",{className:"space-y-3",children:[ze("h2",{className:"font-bold text-2xl",children:"3) Add a diff check"}),ze("p",{className:"text-muted-foreground text-sm",children:"Use the diff command to inspect breaking changes in PRs."}),ze(vr,{language:"bash",filename:"ci-diff",code:"contractspec diff src/contracts/spec-v1.ts src/contracts/spec-v2.ts --breaking"}),ze("p",{className:"text-muted-foreground text-sm",children:"Expected output: deterministic diff with breaking change hints."})]}),Ha("div",{className:"card-subtle space-y-3 p-6",children:[ze("h3",{className:"font-semibold text-lg",children:"Example package"}),ze("p",{className:"text-muted-foreground text-sm",children:"The CRM pipeline example is already wired in the quickstart smoke test. Use it as a CI-ready template."}),ze(vr,{language:"bash",filename:"crm-ci",code:`cd packages/examples/crm-pipeline
1055
+ `}];Jm(Zm);import{CodeBlock as vr}from"@contractspec/lib.design-system";import Hc from"@contractspec/lib.ui-link";import{ChevronRight as $m}from"lucide-react";import{jsx as ze,jsxs as qa}from"react/jsx-runtime";function Xm(){return qa("div",{className:"space-y-8",children:[qa("div",{className:"space-y-3",children:[ze("h1",{className:"font-bold text-4xl",children:"CI gating with deterministic diffs"}),ze("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec CI checks that validate specs, detect drift, and gate breaking changes before merge."})]}),qa("div",{className:"card-subtle space-y-4 p-6",children:[ze("h2",{className:"font-bold text-2xl",children:"What you'll build"}),qa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[ze("li",{children:"CI workflow running ContractSpec validation and drift checks."}),ze("li",{children:"Machine-readable output for PR annotations."}),ze("li",{children:"Deterministic contract diffs in review."})]})]}),qa("div",{className:"space-y-6",children:[qa("div",{className:"space-y-3",children:[ze("h2",{className:"font-bold text-2xl",children:"1) Add the CI workflow"}),ze("p",{className:"text-muted-foreground text-sm",children:"Copy the template from the CLI package."}),ze(vr,{language:"bash",filename:"ci-copy",code:"cp node_modules/@contractspec/app.cli-contractspec/templates/github-action.yml .github/workflows/contractspec.yml"}),qa("p",{className:"text-muted-foreground text-sm",children:["Expected output: new workflow file in ",ze("code",{children:".github/workflows"}),"."]})]}),qa("div",{className:"space-y-3",children:[ze("h2",{className:"font-bold text-2xl",children:"2) Run CI locally"}),ze(vr,{language:"bash",filename:"ci-local",code:"contractspec ci --format json --check-drift"}),ze("p",{className:"text-muted-foreground text-sm",children:"Expected output: JSON summary including pass/fail counts and drift status (if configured)."})]}),qa("div",{className:"space-y-3",children:[ze("h2",{className:"font-bold text-2xl",children:"3) Add a diff check"}),ze("p",{className:"text-muted-foreground text-sm",children:"Use the diff command to inspect breaking changes in PRs."}),ze(vr,{language:"bash",filename:"ci-diff",code:"contractspec diff src/contracts/spec-v1.ts src/contracts/spec-v2.ts --breaking"}),ze("p",{className:"text-muted-foreground text-sm",children:"Expected output: deterministic diff with breaking change hints."})]}),qa("div",{className:"card-subtle space-y-3 p-6",children:[ze("h3",{className:"font-semibold text-lg",children:"Example package"}),ze("p",{className:"text-muted-foreground text-sm",children:"The CRM pipeline example is already wired in the quickstart smoke test. Use it as a CI-ready template."}),ze(vr,{language:"bash",filename:"crm-ci",code:`cd packages/examples/crm-pipeline
1056
1056
  bun run build
1057
- bun run validate`})]}),ze(Ht,{title:"Need continuous checks tied to outcomes?",body:"Studio closes the loop with post-change verification and learning dividends that improve future decisions."})]}),Ha("div",{className:"flex items-center gap-4 pt-4",children:[Ha(qc,{href:"/docs/guides",className:"btn-primary",children:["Back to guides ",ze(Zm,{size:16})]}),ze(qc,{href:"/docs",className:"btn-ghost",children:"Docs home"})]})]})}import{CodeBlock as Ti}from"@contractspec/lib.design-system";import Vc from"@contractspec/lib.ui-link";import{ChevronRight as xm}from"lucide-react";import{jsx as x,jsxs as Ca}from"react/jsx-runtime";var jm=[".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 eu(){return Ca("div",{className:"space-y-8",children:[Ca("div",{className:"space-y-3",children:[x("h1",{className:"font-bold text-4xl",children:"Use Connect in a repo"}),x("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."})]}),Ca("div",{className:"card-subtle space-y-4 p-6",children:[x("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Ca("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[x("li",{children:"A workspace-level Connect config in `.contractsrc.json`."}),x("li",{children:"A reuse-first adoption check before new implementation work."}),x("li",{children:"A context and plan flow for one task."}),x("li",{children:"Verified file and shell mutations with local review/replay evidence."})]})]}),Ca("div",{className:"space-y-6",children:[Ca("div",{className:"space-y-3",children:[x("h2",{className:"font-bold text-2xl",children:"1) Enable Connect"}),x("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."}),x(Ti,{language:"json",filename:".contractsrc.json",code:`{
1057
+ bun run validate`})]}),ze(qt,{title:"Need continuous checks tied to outcomes?",body:"Studio closes the loop with post-change verification and learning dividends that improve future decisions."})]}),qa("div",{className:"flex items-center gap-4 pt-4",children:[qa(Hc,{href:"/docs/guides",className:"btn-primary",children:["Back to guides ",ze($m,{size:16})]}),ze(Hc,{href:"/docs",className:"btn-ghost",children:"Docs home"})]})]})}import{CodeBlock as Ti}from"@contractspec/lib.design-system";import Vc from"@contractspec/lib.ui-link";import{ChevronRight as xm}from"lucide-react";import{jsx as x,jsxs as Ca}from"react/jsx-runtime";var jm=[".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 eu(){return Ca("div",{className:"space-y-8",children:[Ca("div",{className:"space-y-3",children:[x("h1",{className:"font-bold text-4xl",children:"Use Connect in a repo"}),x("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."})]}),Ca("div",{className:"card-subtle space-y-4 p-6",children:[x("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Ca("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[x("li",{children:"A workspace-level Connect config in `.contractsrc.json`."}),x("li",{children:"A reuse-first adoption check before new implementation work."}),x("li",{children:"A context and plan flow for one task."}),x("li",{children:"Verified file and shell mutations with local review/replay evidence."})]})]}),Ca("div",{className:"space-y-6",children:[Ca("div",{className:"space-y-3",children:[x("h2",{className:"font-bold text-2xl",children:"1) Enable Connect"}),x("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."}),x(Ti,{language:"json",filename:".contractsrc.json",code:`{
1058
1058
  "connect": {
1059
1059
  "enabled": true,
1060
1060
  "storage": {
@@ -1323,7 +1323,7 @@ installOp(operationRegistry, GetUserQuery, async (input) => {
1323
1323
 
1324
1324
  // Register events and capabilities
1325
1325
  eventRegistry.register(UserCreatedEvent);
1326
- capabilityRegistry.register(UserManagementCapability);`})]}),j("div",{className:"card-subtle space-y-3 p-6",children:[s("h3",{className:"font-semibold text-lg",children:"Contract Type Decision Guide"}),j("table",{className:"w-full text-sm",children:[s("thead",{children:j("tr",{className:"border-white/10 border-b",children:[s("th",{className:"py-2 text-left",children:"When you need..."}),s("th",{className:"py-2 text-left",children:"Use this contract"})]})}),j("tbody",{className:"text-muted-foreground",children:[j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"An API endpoint that changes data"}),s("td",{className:"py-2",children:s("code",{children:"defineCommand"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"An API endpoint that reads data"}),s("td",{className:"py-2",children:s("code",{children:"defineQuery"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"Async notification of something that happened"}),s("td",{className:"py-2",children:s("code",{children:"defineEvent"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"Group related specs under a feature"}),s("td",{className:"py-2",children:s("code",{children:"defineCapability"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"Define UI rendering specifications"}),s("td",{className:"py-2",children:s("code",{children:"definePresentation"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"Access control and rate limiting"}),s("td",{className:"py-2",children:s("code",{children:"definePolicy"})})]}),j("tr",{children:[s("td",{className:"py-2",children:"Multi-step business processes"}),s("td",{className:"py-2",children:s("code",{children:"defineWorkflow"})})]})]})]})]}),s(Ht,{title:"Need to decide which contract should change next?",body:"Studio uses evidence and focus constraints to generate decision briefs, patch intents, and execution-ready task packs."})]}),j("div",{className:"flex items-center gap-4 pt-4",children:[j(Fc,{href:"/docs/guides/nextjs-one-endpoint",className:"btn-primary",children:["Next: Add your first endpoint ",s(tu,{size:16})]}),s(Fc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as tn}from"@contractspec/lib.design-system";import Kc from"@contractspec/lib.ui-link";import{ChevronRight as lu}from"lucide-react";import{jsx as nt,jsxs as la}from"react/jsx-runtime";function du(){return la("div",{className:"space-y-8",children:[la("div",{className:"space-y-3",children:[nt("h1",{className:"font-bold text-4xl",children:"Build the docs pipeline"}),nt("p",{className:"text-lg text-muted-foreground",children:"Generate reference docs, chunk the index, and wire the docs pages the same way this repo does."})]}),la("div",{className:"card-subtle space-y-4 p-6",children:[nt("h2",{className:"font-bold text-2xl",children:"What you'll build"}),la("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[nt("li",{children:"Generated Markdown and a chunked index manifest."}),nt("li",{children:"Reference routes powered by the docs loader."}),nt("li",{children:"Versioned outputs you can publish per release."})]})]}),la("div",{className:"space-y-6",children:[la("div",{className:"space-y-3",children:[nt("h2",{className:"font-bold text-2xl",children:"1) Generate contract docs"}),nt(tn,{language:"bash",filename:"generate-contract-docs",code:"contractspec generate"}),la("p",{className:"text-muted-foreground text-sm",children:["Expected output: Markdown in ",nt("code",{children:"generated/docs"}),"."]})]}),la("div",{className:"space-y-3",children:[nt("h2",{className:"font-bold text-2xl",children:"2) Build the docs index"}),nt(tn,{language:"bash",filename:"docs-generate",code:`bun docs:generate
1326
+ capabilityRegistry.register(UserManagementCapability);`})]}),j("div",{className:"card-subtle space-y-3 p-6",children:[s("h3",{className:"font-semibold text-lg",children:"Contract Type Decision Guide"}),j("table",{className:"w-full text-sm",children:[s("thead",{children:j("tr",{className:"border-white/10 border-b",children:[s("th",{className:"py-2 text-left",children:"When you need..."}),s("th",{className:"py-2 text-left",children:"Use this contract"})]})}),j("tbody",{className:"text-muted-foreground",children:[j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"An API endpoint that changes data"}),s("td",{className:"py-2",children:s("code",{children:"defineCommand"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"An API endpoint that reads data"}),s("td",{className:"py-2",children:s("code",{children:"defineQuery"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"Async notification of something that happened"}),s("td",{className:"py-2",children:s("code",{children:"defineEvent"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"Group related specs under a feature"}),s("td",{className:"py-2",children:s("code",{children:"defineCapability"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"Define UI rendering specifications"}),s("td",{className:"py-2",children:s("code",{children:"definePresentation"})})]}),j("tr",{className:"border-white/5 border-b",children:[s("td",{className:"py-2",children:"Access control and rate limiting"}),s("td",{className:"py-2",children:s("code",{children:"definePolicy"})})]}),j("tr",{children:[s("td",{className:"py-2",children:"Multi-step business processes"}),s("td",{className:"py-2",children:s("code",{children:"defineWorkflow"})})]})]})]})]}),s(qt,{title:"Need to decide which contract should change next?",body:"Studio uses evidence and focus constraints to generate decision briefs, patch intents, and execution-ready task packs."})]}),j("div",{className:"flex items-center gap-4 pt-4",children:[j(Fc,{href:"/docs/guides/nextjs-one-endpoint",className:"btn-primary",children:["Next: Add your first endpoint ",s(tu,{size:16})]}),s(Fc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as tn}from"@contractspec/lib.design-system";import Kc from"@contractspec/lib.ui-link";import{ChevronRight as lu}from"lucide-react";import{jsx as nt,jsxs as la}from"react/jsx-runtime";function du(){return la("div",{className:"space-y-8",children:[la("div",{className:"space-y-3",children:[nt("h1",{className:"font-bold text-4xl",children:"Build the docs pipeline"}),nt("p",{className:"text-lg text-muted-foreground",children:"Generate reference docs, chunk the index, and wire the docs pages the same way this repo does."})]}),la("div",{className:"card-subtle space-y-4 p-6",children:[nt("h2",{className:"font-bold text-2xl",children:"What you'll build"}),la("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[nt("li",{children:"Generated Markdown and a chunked index manifest."}),nt("li",{children:"Reference routes powered by the docs loader."}),nt("li",{children:"Versioned outputs you can publish per release."})]})]}),la("div",{className:"space-y-6",children:[la("div",{className:"space-y-3",children:[nt("h2",{className:"font-bold text-2xl",children:"1) Generate contract docs"}),nt(tn,{language:"bash",filename:"generate-contract-docs",code:"contractspec generate"}),la("p",{className:"text-muted-foreground text-sm",children:["Expected output: Markdown in ",nt("code",{children:"generated/docs"}),"."]})]}),la("div",{className:"space-y-3",children:[nt("h2",{className:"font-bold text-2xl",children:"2) Build the docs index"}),nt(tn,{language:"bash",filename:"docs-generate",code:`bun docs:generate
1327
1327
  # versioned output
1328
1328
  bun docs:generate -- --version v1.0.0`}),la("p",{className:"text-muted-foreground text-sm",children:["This writes ",nt("code",{children:"docs-index.manifest.json"})," and chunked",nt("code",{children:"docs-index.*.json"})," files in the generated docs bundle."]})]}),la("div",{className:"space-y-3",children:[nt("h2",{className:"font-bold text-2xl",children:"3) Wire reference routes"}),nt(tn,{language:"tsx",filename:"docs-reference-route",code:`import { notFound } from "next/navigation";
1329
1329
  import {
@@ -1343,7 +1343,7 @@ export default async function Page({ params }: { params: { slug?: string[] } })
1343
1343
  const doc = await getGeneratedDocById(slug);
1344
1344
  if (!doc) notFound();
1345
1345
  return <DocsReferencePage entry={doc.entry} content={doc.content} />;
1346
- }`}),la("p",{className:"text-muted-foreground text-sm",children:["Use the index page on ",nt("code",{children:"/docs/reference"})," to render the searchable list."]})]}),la("div",{className:"card-subtle space-y-3 p-6",children:[nt("h3",{className:"font-semibold text-lg",children:"Repo reference"}),la("p",{className:"text-muted-foreground text-sm",children:["This repo wires docs under"," ",nt("code",{children:"packages/apps/web-landing/src/app/docs/reference"}),"."]})]}),nt(Ht,{title:"Need decision-to-export automation?",body:"Studio exports evidence-backed spec changes and task packs to Linear, Jira, Notion, and GitHub."})]}),la("div",{className:"flex items-center gap-4 pt-4",children:[la(Kc,{href:"/docs/guides/ci-contract-diff-gating",className:"btn-primary",children:["Next: CI gating ",nt(lu,{size:16})]}),nt(Kc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as an}from"@contractspec/lib.design-system";import Qc from"@contractspec/lib.ui-link";import{ChevronRight as su}from"lucide-react";import{jsx as Te,jsxs as qa}from"react/jsx-runtime";function pu(){return qa("div",{className:"space-y-8",children:[qa("div",{className:"space-y-3",children:[Te("h1",{className:"font-bold text-4xl",children:"Build a first module bundle"}),Te("p",{className:"text-lg text-muted-foreground",children:"Define one bundle spec, resolve it for a real route and preference profile, then render the resulting surface plan through the React host layer."})]}),qa("div",{className:"card-subtle space-y-4 p-6",children:[Te("h2",{className:"font-bold text-2xl",children:"What you'll build"}),qa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Te("li",{children:"One `ModuleBundleSpec` with a route and workbench surface."}),Te("li",{children:"One `ResolvedSurfacePlan` from `resolveBundle`."}),Te("li",{children:"One React host using `BundleProvider` and `BundleRenderer`."})]})]}),qa("div",{className:"space-y-6",children:[qa("div",{className:"space-y-3",children:[Te("h2",{className:"font-bold text-2xl",children:"1) Define the bundle spec"}),Te("p",{className:"text-muted-foreground text-sm",children:"The bundle spec is the durable contract. It owns route selection, surface shape, layouts, data recipes, and verification coverage for all seven preference dimensions."}),Te(an,{language:"typescript",filename:"src/bundles/support.workbench.bundle.ts",code:`import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec/define-module-bundle";
1346
+ }`}),la("p",{className:"text-muted-foreground text-sm",children:["Use the index page on ",nt("code",{children:"/docs/reference"})," to render the searchable list."]})]}),la("div",{className:"card-subtle space-y-3 p-6",children:[nt("h3",{className:"font-semibold text-lg",children:"Repo reference"}),la("p",{className:"text-muted-foreground text-sm",children:["This repo wires docs under"," ",nt("code",{children:"packages/apps/web-landing/src/app/docs/reference"}),"."]})]}),nt(qt,{title:"Need decision-to-export automation?",body:"Studio exports evidence-backed spec changes and task packs to Linear, Jira, Notion, and GitHub."})]}),la("div",{className:"flex items-center gap-4 pt-4",children:[la(Kc,{href:"/docs/guides/ci-contract-diff-gating",className:"btn-primary",children:["Next: CI gating ",nt(lu,{size:16})]}),nt(Kc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as an}from"@contractspec/lib.design-system";import Qc from"@contractspec/lib.ui-link";import{ChevronRight as su}from"lucide-react";import{jsx as Te,jsxs as Ha}from"react/jsx-runtime";function pu(){return Ha("div",{className:"space-y-8",children:[Ha("div",{className:"space-y-3",children:[Te("h1",{className:"font-bold text-4xl",children:"Build a first module bundle"}),Te("p",{className:"text-lg text-muted-foreground",children:"Define one bundle spec, resolve it for a real route and preference profile, then render the resulting surface plan through the React host layer."})]}),Ha("div",{className:"card-subtle space-y-4 p-6",children:[Te("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Ha("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Te("li",{children:"One `ModuleBundleSpec` with a route and workbench surface."}),Te("li",{children:"One `ResolvedSurfacePlan` from `resolveBundle`."}),Te("li",{children:"One React host using `BundleProvider` and `BundleRenderer`."})]})]}),Ha("div",{className:"space-y-6",children:[Ha("div",{className:"space-y-3",children:[Te("h2",{className:"font-bold text-2xl",children:"1) Define the bundle spec"}),Te("p",{className:"text-muted-foreground text-sm",children:"The bundle spec is the durable contract. It owns route selection, surface shape, layouts, data recipes, and verification coverage for all seven preference dimensions."}),Te(an,{language:"typescript",filename:"src/bundles/support.workbench.bundle.ts",code:`import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec/define-module-bundle";
1347
1347
 
1348
1348
  export const SupportWorkbenchBundle = defineModuleBundle({
1349
1349
  meta: {
@@ -1385,7 +1385,7 @@ export const SupportWorkbenchBundle = defineModuleBundle({
1385
1385
  },
1386
1386
  },
1387
1387
  },
1388
- });`}),Te("p",{className:"text-muted-foreground text-sm",children:"Expected output: `defineModuleBundle` validates the route, surface, and verification dimensions at runtime."})]}),qa("div",{className:"space-y-3",children:[Te("h2",{className:"font-bold text-2xl",children:"2) Resolve the plan"}),Te("p",{className:"text-muted-foreground text-sm",children:"Resolve against a real route, device, and preference profile. This is where the runtime chooses the surface, layout, bindings, and audit reasons."}),Te(an,{language:"typescript",filename:"src/runtime/resolve-support-workbench.ts",code:`import { resolveBundle } from "@contractspec/lib.surface-runtime/runtime/resolve-bundle";
1388
+ });`}),Te("p",{className:"text-muted-foreground text-sm",children:"Expected output: `defineModuleBundle` validates the route, surface, and verification dimensions at runtime."})]}),Ha("div",{className:"space-y-3",children:[Te("h2",{className:"font-bold text-2xl",children:"2) Resolve the plan"}),Te("p",{className:"text-muted-foreground text-sm",children:"Resolve against a real route, device, and preference profile. This is where the runtime chooses the surface, layout, bindings, and audit reasons."}),Te(an,{language:"typescript",filename:"src/runtime/resolve-support-workbench.ts",code:`import { resolveBundle } from "@contractspec/lib.surface-runtime/runtime/resolve-bundle";
1389
1389
 
1390
1390
  export const supportWorkbenchPlan = await resolveBundle(
1391
1391
  SupportWorkbenchBundle,
@@ -1409,7 +1409,7 @@ export const supportWorkbenchPlan = await resolveBundle(
1409
1409
  },
1410
1410
  capabilities: ["tickets.read", "tickets.update"],
1411
1411
  }
1412
- );`}),Te("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `ResolvedSurfacePlan` with `bundleKey`, `surfaceId`, `layoutId`, `bindings`, `adaptation`, and audit reasons."})]}),qa("div",{className:"space-y-3",children:[Te("h2",{className:"font-bold text-2xl",children:"3) Render the plan"}),Te("p",{className:"text-muted-foreground text-sm",children:"The host app renders the resolved plan, not the raw spec. That keeps layout selection, overlays, and AI proposals downstream of the declared bundle contract."}),Te(an,{language:"tsx",filename:"src/app/support/SurfaceHost.tsx",code:`import { BundleProvider, BundleRenderer } from "@contractspec/lib.surface-runtime/react";
1412
+ );`}),Te("p",{className:"text-muted-foreground text-sm",children:"Expected output: a `ResolvedSurfacePlan` with `bundleKey`, `surfaceId`, `layoutId`, `bindings`, `adaptation`, and audit reasons."})]}),Ha("div",{className:"space-y-3",children:[Te("h2",{className:"font-bold text-2xl",children:"3) Render the plan"}),Te("p",{className:"text-muted-foreground text-sm",children:"The host app renders the resolved plan, not the raw spec. That keeps layout selection, overlays, and AI proposals downstream of the declared bundle contract."}),Te(an,{language:"tsx",filename:"src/app/support/SurfaceHost.tsx",code:`import { BundleProvider, BundleRenderer } from "@contractspec/lib.surface-runtime/react";
1413
1413
 
1414
1414
  export function SurfaceHost() {
1415
1415
  return (
@@ -1417,10 +1417,10 @@ export function SurfaceHost() {
1417
1417
  <BundleRenderer assistantSlotId="assistant" />
1418
1418
  </BundleProvider>
1419
1419
  );
1420
- }`}),Te("p",{className:"text-muted-foreground text-sm",children:"Expected output: the route renders according to the resolved layout root and slot plan instead of bespoke page assembly."})]}),qa("div",{className:"card-subtle space-y-3 p-6",children:[Te("h3",{className:"font-semibold text-lg",children:"Verification checks"}),qa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Te("li",{children:"The resolved `surfaceId` matches the route you expected."}),Te("li",{children:"The `layoutId` is stable for the active view and preferences."}),Te("li",{children:"The plan carries audit reasons and all seven adaptation dimensions."}),Te("li",{children:"Assistant or overlay work stays within declared slots."})]})]})]}),qa("div",{className:"flex items-center gap-4 pt-4",children:[qa(Qc,{href:"/docs/specs/module-bundles",className:"btn-primary",children:["Back to module bundles ",Te(su,{size:16})]}),Te(Qc,{href:"/docs/specs/overlays",className:"btn-ghost",children:"Next: overlays"})]})]})}import{CodeBlock as Nr}from"@contractspec/lib.design-system";import Yc from"@contractspec/lib.ui-link";import{ChevronRight as mu}from"lucide-react";import{jsx as Ge,jsxs as Ia}from"react/jsx-runtime";function uu(){return Ia("div",{className:"space-y-8",children:[Ia("div",{className:"space-y-3",children:[Ge("h1",{className:"font-bold text-4xl",children:"Generate docs + client schemas"}),Ge("p",{className:"text-lg text-muted-foreground",children:"Generate docs and OpenAPI output from ContractSpec operations to power SDKs, docs sites, and tooling."})]}),Ia("div",{className:"card-subtle space-y-4 p-6",children:[Ge("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Ia("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Ge("li",{children:"Export docs from your specs."}),Ge("li",{children:"Emit OpenAPI 3.1 for client SDK generation."}),Ge("li",{children:"Keep outputs deterministic with CI validation."})]})]}),Ia("div",{className:"space-y-6",children:[Ia("div",{className:"space-y-3",children:[Ge("h2",{className:"font-bold text-2xl",children:"1) Generate docs"}),Ge("p",{className:"text-muted-foreground text-sm",children:"Use the generator to emit docs from your contracts."}),Ge(Nr,{language:"bash",filename:"generate-docs",code:"contractspec generate"}),Ia("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",Ge("code",{children:"Generate X doc files in generated/docs"}),"."]})]}),Ia("div",{className:"space-y-3",children:[Ge("h2",{className:"font-bold text-2xl",children:"2) Export OpenAPI"}),Ge("p",{className:"text-muted-foreground text-sm",children:"Export an OpenAPI document from your registry module."}),Ge(Nr,{language:"bash",filename:"openapi-export",code:"contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json"}),Ia("p",{className:"text-muted-foreground text-sm",children:["Expected output:"," ",Ge("code",{children:"OpenAPI written to .../generated/openapi.json"}),"."]})]}),Ia("div",{className:"space-y-3",children:[Ge("h2",{className:"font-bold text-2xl",children:"3) Validate specs"}),Ge(Nr,{language:"bash",filename:"validate-specs",code:"contractspec validate"}),Ia("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",Ge("code",{children:"Validation passed"}),"."]})]}),Ia("div",{className:"card-subtle space-y-3 p-6",children:[Ge("h3",{className:"font-semibold text-lg",children:"Example package"}),Ge("p",{className:"text-muted-foreground text-sm",children:"The Integration Hub example provides a full registry of operations and is a good source for OpenAPI exports."}),Ge(Nr,{language:"bash",filename:"integration-hub-example",code:`contractspec examples show integration-hub
1420
+ }`}),Te("p",{className:"text-muted-foreground text-sm",children:"Expected output: the route renders according to the resolved layout root and slot plan instead of bespoke page assembly."})]}),Ha("div",{className:"card-subtle space-y-3 p-6",children:[Te("h3",{className:"font-semibold text-lg",children:"Verification checks"}),Ha("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Te("li",{children:"The resolved `surfaceId` matches the route you expected."}),Te("li",{children:"The `layoutId` is stable for the active view and preferences."}),Te("li",{children:"The plan carries audit reasons and all seven adaptation dimensions."}),Te("li",{children:"Assistant or overlay work stays within declared slots."})]})]})]}),Ha("div",{className:"flex items-center gap-4 pt-4",children:[Ha(Qc,{href:"/docs/specs/module-bundles",className:"btn-primary",children:["Back to module bundles ",Te(su,{size:16})]}),Te(Qc,{href:"/docs/specs/overlays",className:"btn-ghost",children:"Next: overlays"})]})]})}import{CodeBlock as Nr}from"@contractspec/lib.design-system";import Yc from"@contractspec/lib.ui-link";import{ChevronRight as mu}from"lucide-react";import{jsx as Ge,jsxs as Ia}from"react/jsx-runtime";function uu(){return Ia("div",{className:"space-y-8",children:[Ia("div",{className:"space-y-3",children:[Ge("h1",{className:"font-bold text-4xl",children:"Generate docs + client schemas"}),Ge("p",{className:"text-lg text-muted-foreground",children:"Generate docs and OpenAPI output from ContractSpec operations to power SDKs, docs sites, and tooling."})]}),Ia("div",{className:"card-subtle space-y-4 p-6",children:[Ge("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Ia("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Ge("li",{children:"Export docs from your specs."}),Ge("li",{children:"Emit OpenAPI 3.1 for client SDK generation."}),Ge("li",{children:"Keep outputs deterministic with CI validation."})]})]}),Ia("div",{className:"space-y-6",children:[Ia("div",{className:"space-y-3",children:[Ge("h2",{className:"font-bold text-2xl",children:"1) Generate docs"}),Ge("p",{className:"text-muted-foreground text-sm",children:"Use the generator to emit docs from your contracts."}),Ge(Nr,{language:"bash",filename:"generate-docs",code:"contractspec generate"}),Ia("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",Ge("code",{children:"Generate X doc files in generated/docs"}),"."]})]}),Ia("div",{className:"space-y-3",children:[Ge("h2",{className:"font-bold text-2xl",children:"2) Export OpenAPI"}),Ge("p",{className:"text-muted-foreground text-sm",children:"Export an OpenAPI document from your registry module."}),Ge(Nr,{language:"bash",filename:"openapi-export",code:"contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json"}),Ia("p",{className:"text-muted-foreground text-sm",children:["Expected output:"," ",Ge("code",{children:"OpenAPI written to .../generated/openapi.json"}),"."]})]}),Ia("div",{className:"space-y-3",children:[Ge("h2",{className:"font-bold text-2xl",children:"3) Validate specs"}),Ge(Nr,{language:"bash",filename:"validate-specs",code:"contractspec validate"}),Ia("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",Ge("code",{children:"Validation passed"}),"."]})]}),Ia("div",{className:"card-subtle space-y-3 p-6",children:[Ge("h3",{className:"font-semibold text-lg",children:"Example package"}),Ge("p",{className:"text-muted-foreground text-sm",children:"The Integration Hub example provides a full registry of operations and is a good source for OpenAPI exports."}),Ge(Nr,{language:"bash",filename:"integration-hub-example",code:`contractspec examples show integration-hub
1421
1421
 
1422
1422
  # openapi export against your registry module
1423
- contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json`})]}),Ge(Ht,{title:"Want exports tied to product decisions?",body:"Studio compiles approved changes into deliverables and pushes them to your execution stack with full evidence context."})]}),Ia("div",{className:"flex items-center gap-4 pt-4",children:[Ia(Yc,{href:"/docs/guides/docs-generation-pipeline",className:"btn-primary",children:["Next: Docs pipeline ",Ge(mu,{size:16})]}),Ge(Yc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as di}from"@contractspec/lib.design-system";import Jc from"@contractspec/lib.ui-link";import{ChevronRight as gu}from"lucide-react";import{jsx as H,jsxs as Vt}from"react/jsx-runtime";var fu=["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"],hu=["local runtime trust and lease details","channel-action posture for mobile/operator follow-up","comparison posture and export readiness from the shared snapshot"];function yu(){return Vt("div",{className:"space-y-8",children:[Vt("div",{className:"space-y-3",children:[H("h1",{className:"font-bold text-4xl",children:"Host the Builder workbench"}),H("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."})]}),Vt("div",{className:"card-subtle space-y-4 p-6",children:[H("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Vt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[H("li",{children:"A workspace snapshot fetch path."}),H("li",{children:"A `BuilderWorkbench` host with action callbacks."}),H("li",{children:"Runtime-mode aware preview/export controls plus mobile review links."})]})]}),Vt("div",{className:"space-y-6",children:[Vt("div",{className:"space-y-3",children:[H("h2",{className:"font-bold text-2xl",children:"1) Fetch the workspace snapshot"}),H("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."}),H(di,{language:"typescript",filename:"builder-workbench-controller.ts",code:`export async function fetchBuilderSnapshot(workspaceId: string) {
1423
+ contractspec openapi export --registry ./src/contracts/registry.ts --out ./generated/openapi.json`})]}),Ge(qt,{title:"Want exports tied to product decisions?",body:"Studio compiles approved changes into deliverables and pushes them to your execution stack with full evidence context."})]}),Ia("div",{className:"flex items-center gap-4 pt-4",children:[Ia(Yc,{href:"/docs/guides/docs-generation-pipeline",className:"btn-primary",children:["Next: Docs pipeline ",Ge(mu,{size:16})]}),Ge(Yc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as di}from"@contractspec/lib.design-system";import Jc from"@contractspec/lib.ui-link";import{ChevronRight as gu}from"lucide-react";import{jsx as q,jsxs as Vt}from"react/jsx-runtime";var fu=["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"],hu=["local runtime trust and lease details","channel-action posture for mobile/operator follow-up","comparison posture and export readiness from the shared snapshot"];function yu(){return Vt("div",{className:"space-y-8",children:[Vt("div",{className:"space-y-3",children:[q("h1",{className:"font-bold text-4xl",children:"Host the Builder workbench"}),q("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."})]}),Vt("div",{className:"card-subtle space-y-4 p-6",children:[q("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Vt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[q("li",{children:"A workspace snapshot fetch path."}),q("li",{children:"A `BuilderWorkbench` host with action callbacks."}),q("li",{children:"Runtime-mode aware preview/export controls plus mobile review links."})]})]}),Vt("div",{className:"space-y-6",children:[Vt("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"1) Fetch the workspace snapshot"}),q("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."}),q(di,{language:"typescript",filename:"builder-workbench-controller.ts",code:`export async function fetchBuilderSnapshot(workspaceId: string) {
1424
1424
  const response = await fetch(
1425
1425
  \`/api/operate/builder/queries/builder.workspace.snapshot?workspaceId=\${encodeURIComponent(workspaceId)}\`,
1426
1426
  { cache: "no-store" }
@@ -1436,7 +1436,7 @@ contractspec openapi export --registry ./src/contracts/registry.ts --out ./gener
1436
1436
  throw new Error("Builder workspace snapshot query returned an error.");
1437
1437
  }
1438
1438
  return payload.result;
1439
- }`}),H("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."})]}),Vt("div",{className:"space-y-3",children:[H("h2",{className:"font-bold text-2xl",children:"2) Host the workbench and refresh on action"}),H("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."}),H(di,{language:"tsx",filename:"BuilderWorkbenchHost.tsx",code:`import {
1439
+ }`}),q("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."})]}),Vt("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"2) Host the workbench and refresh on action"}),q("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."}),q(di,{language:"tsx",filename:"BuilderWorkbenchHost.tsx",code:`import {
1440
1440
  BuilderWorkbench,
1441
1441
  useBuilderWorkbenchState,
1442
1442
  } from "@contractspec/module.builder-workbench/presentation";
@@ -1467,7 +1467,7 @@ async function runAction(commandKey: string, payload?: Record<string, unknown>)
1467
1467
  onApproveExport={() => runAction("builder.export.approve")}
1468
1468
  onExecuteExport={() => runAction("builder.export.execute")}
1469
1469
  selectedExportRuntimeMode="hybrid"
1470
- />;`}),H("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."})]}),Vt("div",{className:"space-y-3",children:[H("h2",{className:"font-bold text-2xl",children:"3) Persist Builder defaults in workspace config"}),H("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`."}),H(di,{language:"json",filename:".contractsrc.json",code:`{
1470
+ />;`}),q("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."})]}),Vt("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"3) Persist Builder defaults in workspace config"}),q("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`."}),q(di,{language:"json",filename:".contractsrc.json",code:`{
1471
1471
  "builder": {
1472
1472
  "enabled": true,
1473
1473
  "runtimeMode": "local",
@@ -1482,14 +1482,14 @@ async function runAction(commandKey: string, payload?: Record<string, unknown>)
1482
1482
  "providerIds": ["provider.codex", "provider.local.model"]
1483
1483
  }
1484
1484
  }
1485
- }`})]}),Vt("div",{className:"space-y-3",children:[H("h2",{className:"font-bold text-2xl",children:"4) Bootstrap providers and routing policy explicitly"}),H("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."}),H(di,{language:"typescript",filename:"builder-bootstrap.ts",code:`await executeBuilderCommand({
1485
+ }`})]}),Vt("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"4) Bootstrap providers and routing policy explicitly"}),q("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."}),q(di,{language:"typescript",filename:"builder-bootstrap.ts",code:`await executeBuilderCommand({
1486
1486
  commandKey: "builder.workspace.bootstrap",
1487
1487
  workspaceId,
1488
1488
  payload: {
1489
1489
  preset: "managed_mvp",
1490
1490
  includeLocalHelperProvider: true,
1491
1491
  },
1492
- });`})]}),Vt("div",{className:"card-subtle space-y-3 p-6",children:[H("h3",{className:"font-semibold text-lg",children:"Common command keys"}),H("ul",{className:"space-y-2 text-muted-foreground text-sm",children:fu.map((e)=>H("li",{children:H("code",{children:e})},e))})]}),Vt("div",{className:"card-subtle space-y-3 p-6",children:[H("h3",{className:"font-semibold text-lg",children:"Snapshot-backed operator details"}),H("ul",{className:"space-y-2 text-muted-foreground text-sm",children:hu.map((e)=>H("li",{children:e},e))})]}),Vt("div",{className:"space-y-3",children:[H("h2",{className:"font-bold text-2xl",children:"5) Keep runtime mode explicit"}),H("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."}),H(di,{language:"typescript",filename:"runtime-mode",code:`const [selectedExportRuntimeMode, setSelectedExportRuntimeMode] =
1492
+ });`})]}),Vt("div",{className:"card-subtle space-y-3 p-6",children:[q("h3",{className:"font-semibold text-lg",children:"Common command keys"}),q("ul",{className:"space-y-2 text-muted-foreground text-sm",children:fu.map((e)=>q("li",{children:q("code",{children:e})},e))})]}),Vt("div",{className:"card-subtle space-y-3 p-6",children:[q("h3",{className:"font-semibold text-lg",children:"Snapshot-backed operator details"}),q("ul",{className:"space-y-2 text-muted-foreground text-sm",children:hu.map((e)=>q("li",{children:e},e))})]}),Vt("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"5) Keep runtime mode explicit"}),q("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."}),q(di,{language:"typescript",filename:"runtime-mode",code:`const [selectedExportRuntimeMode, setSelectedExportRuntimeMode] =
1493
1493
  React.useState(resolveBuilderExportRuntimeMode(initialSnapshot));
1494
1494
 
1495
1495
  await executeBuilderCommand({
@@ -1498,12 +1498,12 @@ await executeBuilderCommand({
1498
1498
  payload: {
1499
1499
  runtimeMode: selectedExportRuntimeMode,
1500
1500
  },
1501
- });`})]}),Vt("div",{className:"space-y-3",children:[H("h2",{className:"font-bold text-2xl",children:"6) Link mobile review flows"}),H("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."}),H(di,{language:"typescript",filename:"mobile-review-path.ts",code:`export function buildBuilderMobileReviewPath(
1501
+ });`})]}),Vt("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"6) Link mobile review flows"}),q("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."}),q(di,{language:"typescript",filename:"mobile-review-path.ts",code:`export function buildBuilderMobileReviewPath(
1502
1502
  workspaceId: string,
1503
1503
  cardId: string
1504
1504
  ) {
1505
1505
  return \`/operate/builder/workspaces/\${encodeURIComponent(workspaceId)}/mobile-review/\${encodeURIComponent(cardId)}\`;
1506
- }`}),H("p",{className:"text-muted-foreground text-sm",children:"Expected output: the same Builder workspace state stays visible from desktop workbench and mobile review surfaces."})]}),Vt("div",{className:"space-y-3",children:[H("h2",{className:"font-bold text-2xl",children:"7) Keep Connect adjacent, not embedded"}),H("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."}),H(di,{language:"bash",filename:"connect-init.sh",code:"contractspec connect init --scope workspace"})]})]}),Vt("div",{className:"flex items-center gap-4 pt-4",children:[Vt(Jc,{href:"/docs/specs/builder-control-plane",className:"btn-primary",children:["Back to Builder control plane ",H(gu,{size:16})]}),H(Jc,{href:"/docs/studio",className:"btn-ghost",children:"Studio overview"})]})]})}import{CodeBlock as si}from"@contractspec/lib.design-system";import $c from"@contractspec/lib.ui-link";import{AlertCircle as bu,ChevronRight as vu,FileCode as Nu,Scan as on,Settings as wu}from"lucide-react";import{jsx as c,jsxs as S}from"react/jsx-runtime";var ku=[{name:"NestJS",flag:"nestjs",description:"Controllers, decorators, DTOs"},{name:"Express",flag:"express",description:"Router methods, middleware"},{name:"Fastify",flag:"fastify",description:"Route definitions, schemas"},{name:"Hono",flag:"hono",description:"Route handlers, validators"},{name:"Elysia",flag:"elysia",description:"Type-safe routes, schemas"},{name:"tRPC",flag:"trpc",description:"Procedure definitions"},{name:"Next.js",flag:"next-api",description:"API routes (app/api, pages/api)"}];function Su(){return S("div",{className:"space-y-8",children:[S("div",{className:"space-y-3",children:[c("h1",{className:"font-bold text-4xl",children:"Import Existing Codebases"}),c("p",{className:"text-lg text-muted-foreground",children:"Convert your existing API endpoints into ContractSpec contracts. Auto-detect frameworks, extract schemas, and generate explicit contract definitions from your code."})]}),S("div",{className:"card-subtle space-y-4 p-6",children:[c("h2",{className:"font-bold text-2xl",children:"What you'll learn"}),S("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[c("li",{children:"How to import existing API endpoints as ContractSpec contracts."}),c("li",{children:"Framework-specific patterns and auto-detection."}),c("li",{children:"Customizing imports with scopes, dry-run, and output options."}),c("li",{children:"Registering imported contracts and adding handlers."})]})]}),S("div",{className:"space-y-6",children:[S("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"Why import existing code?"}),c("p",{className:"text-muted-foreground text-sm",children:"Instead of writing contracts from scratch, the import command extracts endpoint patterns from your existing codebase. This gives you:"}),S("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground text-sm",children:[c("li",{children:"Instant spec coverage for existing APIs"}),c("li",{children:"Type-safe schemas derived from your existing types"}),c("li",{children:"A foundation to iterate and refine contracts"}),c("li",{children:"Gradual adoption without rewriting code"})]})]}),S("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"Supported frameworks"}),c("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:ku.map((e)=>S("div",{className:"flex items-start gap-3 rounded-lg border border-white/10 p-4",children:[c(Nu,{className:"text-violet-400",size:18}),S("div",{className:"space-y-1",children:[c("h3",{className:"font-semibold",children:e.name}),c("p",{className:"text-muted-foreground text-xs",children:e.description}),S("code",{className:"text-violet-400 text-xs",children:["--framework ",e.flag]})]})]},e.flag))})]}),S("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"1) Quick start"}),c("p",{className:"text-muted-foreground text-sm",children:"Run the import command to auto-detect your framework and extract endpoints:"}),c(si,{language:"bash",filename:"import-quickstart",code:`# Auto-detect framework and import all endpoints
1506
+ }`}),q("p",{className:"text-muted-foreground text-sm",children:"Expected output: the same Builder workspace state stays visible from desktop workbench and mobile review surfaces."})]}),Vt("div",{className:"space-y-3",children:[q("h2",{className:"font-bold text-2xl",children:"7) Keep Connect adjacent, not embedded"}),q("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."}),q(di,{language:"bash",filename:"connect-init.sh",code:"contractspec connect init --scope workspace"})]})]}),Vt("div",{className:"flex items-center gap-4 pt-4",children:[Vt(Jc,{href:"/docs/specs/builder-control-plane",className:"btn-primary",children:["Back to Builder control plane ",q(gu,{size:16})]}),q(Jc,{href:"/docs/studio",className:"btn-ghost",children:"Studio overview"})]})]})}import{CodeBlock as si}from"@contractspec/lib.design-system";import Zc from"@contractspec/lib.ui-link";import{AlertCircle as bu,ChevronRight as vu,FileCode as Nu,Scan as on,Settings as wu}from"lucide-react";import{jsx as c,jsxs as S}from"react/jsx-runtime";var ku=[{name:"NestJS",flag:"nestjs",description:"Controllers, decorators, DTOs"},{name:"Express",flag:"express",description:"Router methods, middleware"},{name:"Fastify",flag:"fastify",description:"Route definitions, schemas"},{name:"Hono",flag:"hono",description:"Route handlers, validators"},{name:"Elysia",flag:"elysia",description:"Type-safe routes, schemas"},{name:"tRPC",flag:"trpc",description:"Procedure definitions"},{name:"Next.js",flag:"next-api",description:"API routes (app/api, pages/api)"}];function Su(){return S("div",{className:"space-y-8",children:[S("div",{className:"space-y-3",children:[c("h1",{className:"font-bold text-4xl",children:"Import Existing Codebases"}),c("p",{className:"text-lg text-muted-foreground",children:"Convert your existing API endpoints into ContractSpec contracts. Auto-detect frameworks, extract schemas, and generate explicit contract definitions from your code."})]}),S("div",{className:"card-subtle space-y-4 p-6",children:[c("h2",{className:"font-bold text-2xl",children:"What you'll learn"}),S("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[c("li",{children:"How to import existing API endpoints as ContractSpec contracts."}),c("li",{children:"Framework-specific patterns and auto-detection."}),c("li",{children:"Customizing imports with scopes, dry-run, and output options."}),c("li",{children:"Registering imported contracts and adding handlers."})]})]}),S("div",{className:"space-y-6",children:[S("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"Why import existing code?"}),c("p",{className:"text-muted-foreground text-sm",children:"Instead of writing contracts from scratch, the import command extracts endpoint patterns from your existing codebase. This gives you:"}),S("ul",{className:"list-disc space-y-1 pl-5 text-muted-foreground text-sm",children:[c("li",{children:"Instant spec coverage for existing APIs"}),c("li",{children:"Type-safe schemas derived from your existing types"}),c("li",{children:"A foundation to iterate and refine contracts"}),c("li",{children:"Gradual adoption without rewriting code"})]})]}),S("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"Supported frameworks"}),c("div",{className:"grid gap-3 md:grid-cols-2 lg:grid-cols-3",children:ku.map((e)=>S("div",{className:"flex items-start gap-3 rounded-lg border border-white/10 p-4",children:[c(Nu,{className:"text-violet-400",size:18}),S("div",{className:"space-y-1",children:[c("h3",{className:"font-semibold",children:e.name}),c("p",{className:"text-muted-foreground text-xs",children:e.description}),S("code",{className:"text-violet-400 text-xs",children:["--framework ",e.flag]})]})]},e.flag))})]}),S("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"1) Quick start"}),c("p",{className:"text-muted-foreground text-sm",children:"Run the import command to auto-detect your framework and extract endpoints:"}),c(si,{language:"bash",filename:"import-quickstart",code:`# Auto-detect framework and import all endpoints
1507
1507
  contractspec import ./src
1508
1508
 
1509
1509
  # Preview what would be imported (dry-run)
@@ -1634,7 +1634,7 @@ installOp(registry, GetUserQuery, async (input) => {
1634
1634
  installOp(registry, CreateUserCommand, async (input) => {
1635
1635
  const user = await db.user.create({ data: input });
1636
1636
  return { id: user.id };
1637
- });`})]}),S("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"6) After importing"}),S("ol",{className:"list-decimal space-y-2 pl-5 text-muted-foreground text-sm",children:[S("li",{children:[c("strong",{children:"Review generated contracts"})," \u2014 Check the TODO placeholders and fill in descriptions, owners, and tags."]}),S("li",{children:[c("strong",{children:"Refine schemas"})," \u2014 Add proper types, validation rules, and error definitions."]}),S("li",{children:[c("strong",{children:"Run validation"})," \u2014"," ",c("code",{children:"contractspec validate"})," to ensure contracts are valid."]}),S("li",{children:[c("strong",{children:"Register and wire handlers"})," \u2014 Connect contracts to your existing business logic."]}),S("li",{children:[c("strong",{children:"Iterate"})," \u2014 The imported contracts are a starting point. Refine them as your spec matures."]})]})]}),S("div",{className:"space-y-3",children:[S("h2",{className:"flex items-center gap-2 font-bold text-2xl",children:[c(bu,{size:20,className:"text-yellow-400"}),"Troubleshooting"]}),S("div",{className:"space-y-4",children:[S("div",{className:"card-subtle space-y-2 p-4",children:[c("h3",{className:"font-semibold",children:"Framework not detected"}),S("p",{className:"text-muted-foreground text-sm",children:["Use ",c("code",{children:"--framework <name>"})," to force a specific framework. Check that your entry files follow standard patterns."]})]}),S("div",{className:"card-subtle space-y-2 p-4",children:[c("h3",{className:"font-semibold",children:"Missing schemas"}),S("p",{className:"text-muted-foreground text-sm",children:["Schema inference works best with explicit types. If using"," ",c("code",{children:"any"})," or dynamic types, you'll see TODO placeholders. Fill them in manually."]})]}),S("div",{className:"card-subtle space-y-2 p-4",children:[c("h3",{className:"font-semibold",children:"Partial imports"}),S("p",{className:"text-muted-foreground text-sm",children:["Some endpoints may not be detected if they use unconventional patterns. Use ",c("code",{children:"--analyze"})," to see what was found, then add missing contracts manually."]})]})]})]}),c(Ht,{title:"Want evidence-driven migration priorities?",body:"Studio clusters product signals into scored patterns, then proposes contract changes and execution-ready work for the highest-impact areas."})]}),S("div",{className:"flex items-center gap-4 pt-4",children:[S($c,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Next: Spec validation + typing ",c(vu,{size:16})]}),c($c,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as Ai}from"@contractspec/lib.design-system";import Zc from"@contractspec/lib.ui-link";import{ChevronRight as Cu}from"lucide-react";import{jsx as we,jsxs as pt}from"react/jsx-runtime";function Iu(){return pt("div",{className:"space-y-8",children:[pt("div",{className:"space-y-3",children:[we("h1",{className:"font-bold text-4xl",children:"Next.js: add one endpoint"}),we("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec to an existing Next.js App Router project by wiring a single operation end-to-end with validation and types."})]}),pt("div",{className:"card-subtle space-y-4 p-6",children:[we("h2",{className:"font-bold text-2xl",children:"What you'll build"}),pt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[we("li",{children:"One OperationSpec with SchemaModel validation."}),we("li",{children:"A registry wiring the operation to its handler."}),we("li",{children:"A Next.js route handler that exposes the operation."})]})]}),pt("div",{className:"space-y-6",children:[pt("div",{className:"space-y-3",children:[we("h2",{className:"font-bold text-2xl",children:"1) Install core packages"}),we(Ai,{language:"bash",filename:"nextjs-install",code:`bun add -D contractspec
1637
+ });`})]}),S("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"6) After importing"}),S("ol",{className:"list-decimal space-y-2 pl-5 text-muted-foreground text-sm",children:[S("li",{children:[c("strong",{children:"Review generated contracts"})," \u2014 Check the TODO placeholders and fill in descriptions, owners, and tags."]}),S("li",{children:[c("strong",{children:"Refine schemas"})," \u2014 Add proper types, validation rules, and error definitions."]}),S("li",{children:[c("strong",{children:"Run validation"})," \u2014"," ",c("code",{children:"contractspec validate"})," to ensure contracts are valid."]}),S("li",{children:[c("strong",{children:"Register and wire handlers"})," \u2014 Connect contracts to your existing business logic."]}),S("li",{children:[c("strong",{children:"Iterate"})," \u2014 The imported contracts are a starting point. Refine them as your spec matures."]})]})]}),S("div",{className:"space-y-3",children:[S("h2",{className:"flex items-center gap-2 font-bold text-2xl",children:[c(bu,{size:20,className:"text-yellow-400"}),"Troubleshooting"]}),S("div",{className:"space-y-4",children:[S("div",{className:"card-subtle space-y-2 p-4",children:[c("h3",{className:"font-semibold",children:"Framework not detected"}),S("p",{className:"text-muted-foreground text-sm",children:["Use ",c("code",{children:"--framework <name>"})," to force a specific framework. Check that your entry files follow standard patterns."]})]}),S("div",{className:"card-subtle space-y-2 p-4",children:[c("h3",{className:"font-semibold",children:"Missing schemas"}),S("p",{className:"text-muted-foreground text-sm",children:["Schema inference works best with explicit types. If using"," ",c("code",{children:"any"})," or dynamic types, you'll see TODO placeholders. Fill them in manually."]})]}),S("div",{className:"card-subtle space-y-2 p-4",children:[c("h3",{className:"font-semibold",children:"Partial imports"}),S("p",{className:"text-muted-foreground text-sm",children:["Some endpoints may not be detected if they use unconventional patterns. Use ",c("code",{children:"--analyze"})," to see what was found, then add missing contracts manually."]})]})]})]}),c(qt,{title:"Want evidence-driven migration priorities?",body:"Studio clusters product signals into scored patterns, then proposes contract changes and execution-ready work for the highest-impact areas."})]}),S("div",{className:"flex items-center gap-4 pt-4",children:[S(Zc,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Next: Spec validation + typing ",c(vu,{size:16})]}),c(Zc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as Ai}from"@contractspec/lib.design-system";import $c from"@contractspec/lib.ui-link";import{ChevronRight as Cu}from"lucide-react";import{jsx as we,jsxs as pt}from"react/jsx-runtime";function Iu(){return pt("div",{className:"space-y-8",children:[pt("div",{className:"space-y-3",children:[we("h1",{className:"font-bold text-4xl",children:"Next.js: add one endpoint"}),we("p",{className:"text-lg text-muted-foreground",children:"Add ContractSpec to an existing Next.js App Router project by wiring a single operation end-to-end with validation and types."})]}),pt("div",{className:"card-subtle space-y-4 p-6",children:[we("h2",{className:"font-bold text-2xl",children:"What you'll build"}),pt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[we("li",{children:"One OperationSpec with SchemaModel validation."}),we("li",{children:"A registry wiring the operation to its handler."}),we("li",{children:"A Next.js route handler that exposes the operation."})]})]}),pt("div",{className:"space-y-6",children:[pt("div",{className:"space-y-3",children:[we("h2",{className:"font-bold text-2xl",children:"1) Install core packages"}),we(Ai,{language:"bash",filename:"nextjs-install",code:`bun add -D contractspec
1638
1638
  bun add @contractspec/lib.contracts-spec @contractspec/lib.contracts-runtime-server-rest @contractspec/lib.schema`}),pt("p",{className:"text-muted-foreground text-sm",children:["Expected output: ",we("code",{children:"added 3 packages"})," and a lockfile update."]})]}),pt("div",{className:"space-y-3",children:[we("h2",{className:"font-bold text-2xl",children:"2) Define the operation spec"}),pt("p",{className:"text-muted-foreground text-sm",children:["Create ",we("code",{children:"src/contracts/healthcheck.operation.ts"}),":"]}),we(Ai,{language:"typescript",filename:"src/contracts/healthcheck.operation.ts",code:`import { defineQuery } from "@contractspec/lib.contracts-spec/operations";
1639
1639
  import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
1640
1640
 
@@ -1689,7 +1689,7 @@ export { handler as GET, handler as POST };`}),pt("p",{className:"text-muted-for
1689
1689
  contractspec examples show lifecycle-dashboard
1690
1690
 
1691
1691
  # Validate all example manifests in this repo
1692
- contractspec examples validate --repo-root .`})]}),we(Ht,{title:"Want real product evidence behind endpoint changes?",body:"Studio correlates meetings, support, analytics, and code signals before compiling endpoint decisions into spec diffs."})]}),pt("div",{className:"flex items-center gap-4 pt-4",children:[pt(Zc,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Next: Spec validation + typing ",we(Cu,{size:16})]}),we(Zc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as wr}from"@contractspec/lib.design-system";import Xc from"@contractspec/lib.ui-link";import{ChevronRight as Pu}from"lucide-react";import{jsx as De,jsxs as Pa}from"react/jsx-runtime";var Tu=["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 Au(){return Pa("div",{className:"space-y-8",children:[Pa("div",{className:"space-y-3",children:[De("h1",{className:"font-bold text-4xl",children:"Author release capsules"}),De("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."})]}),Pa("div",{className:"card-subtle space-y-4 p-6",children:[De("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Pa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Pa("li",{children:["A ",De("code",{children:".changeset/<slug>.md"})," file for package/version intent."]}),Pa("li",{children:["A ",De("code",{children:".changeset/<slug>.release.yaml"})," companion for audiences, migrations, validation, and evidence."]}),De("li",{children:"Generated release artifacts that the website changelog and upgrade flows can consume safely."})]})]}),Pa("div",{className:"space-y-6",children:[Pa("div",{className:"space-y-3",children:[De("h2",{className:"font-bold text-2xl",children:"1) Create the paired changeset files"}),De("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."}),De(wr,{language:"yaml",filename:".changeset/contract-dx-first-slice.release.yaml",code:`schemaVersion: "1"
1692
+ contractspec examples validate --repo-root .`})]}),we(qt,{title:"Want real product evidence behind endpoint changes?",body:"Studio correlates meetings, support, analytics, and code signals before compiling endpoint decisions into spec diffs."})]}),pt("div",{className:"flex items-center gap-4 pt-4",children:[pt($c,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Next: Spec validation + typing ",we(Cu,{size:16})]}),we($c,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as wr}from"@contractspec/lib.design-system";import Xc from"@contractspec/lib.ui-link";import{ChevronRight as Pu}from"lucide-react";import{jsx as Ee,jsxs as Pa}from"react/jsx-runtime";var Tu=["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 Au(){return Pa("div",{className:"space-y-8",children:[Pa("div",{className:"space-y-3",children:[Ee("h1",{className:"font-bold text-4xl",children:"Author release capsules"}),Ee("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."})]}),Pa("div",{className:"card-subtle space-y-4 p-6",children:[Ee("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Pa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[Pa("li",{children:["A ",Ee("code",{children:".changeset/<slug>.md"})," file for package/version intent."]}),Pa("li",{children:["A ",Ee("code",{children:".changeset/<slug>.release.yaml"})," companion for audiences, migrations, validation, and evidence."]}),Ee("li",{children:"Generated release artifacts that the website changelog and upgrade flows can consume safely."})]})]}),Pa("div",{className:"space-y-6",children:[Pa("div",{className:"space-y-3",children:[Ee("h2",{className:"font-bold text-2xl",children:"1) Create the paired changeset files"}),Ee("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."}),Ee(wr,{language:"yaml",filename:".changeset/contract-dx-first-slice.release.yaml",code:`schemaVersion: "1"
1693
1693
  slug: contract-dx-first-slice
1694
1694
  summary: Improve app-config, theme, and feature authoring with explicit validation and shared setup alignment.
1695
1695
  isBreaking: false
@@ -1700,10 +1700,10 @@ validation:
1700
1700
  commands:
1701
1701
  - "cd packages/libs/contracts-spec && bun run test && bun run typecheck"
1702
1702
  evidence:
1703
- - "Package-level validation entrypoints now back setup, docs, and CLI authoring flows."`}),De("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."})]}),Pa("div",{className:"space-y-3",children:[De("h2",{className:"font-bold text-2xl",children:"2) Use the release authoring commands instead of raw drift-prone edits"}),De(wr,{language:"bash",filename:"release-authoring",code:`contractspec release init --summary "Improve app-config, theme, and feature authoring"
1703
+ - "Package-level validation entrypoints now back setup, docs, and CLI authoring flows."`}),Ee("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."})]}),Pa("div",{className:"space-y-3",children:[Ee("h2",{className:"font-bold text-2xl",children:"2) Use the release authoring commands instead of raw drift-prone edits"}),Ee(wr,{language:"bash",filename:"release-authoring",code:`contractspec release init --summary "Improve app-config, theme, and feature authoring"
1704
1704
 
1705
1705
  # Or revise an existing capsule with the guided flow
1706
- contractspec release edit contract-dx-first-slice`}),De("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."})]}),Pa("div",{className:"space-y-3",children:[De("h2",{className:"font-bold text-2xl",children:"3) Build the generated release artifacts before consuming them"}),De(wr,{language:"bash",filename:"release-build",code:"contractspec release build"}),De("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."})]}),Pa("div",{className:"space-y-3",children:[De("h2",{className:"font-bold text-2xl",children:"4) Enforce completeness before publishing or building the changelog"}),De(wr,{language:"bash",filename:"release-check",code:"contractspec release check --strict"}),De("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."})]}),Pa("div",{className:"card-subtle space-y-3 p-6",children:[De("h3",{className:"font-semibold text-lg",children:"5) Sync the public docs if workflow expectations changed"}),De("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Tu.map((e)=>De("li",{children:e},e))})]})]}),Pa("div",{className:"flex items-center gap-4 pt-4",children:[Pa(Xc,{href:"/docs/guides/connect-in-a-repo",className:"btn-primary",children:["Connect guide ",De(Pu,{size:16})]}),De(Xc,{href:"/changelog",className:"btn-ghost",children:"Website changelog"})]})]})}import{CodeBlock as kr}from"@contractspec/lib.design-system";import xc from"@contractspec/lib.ui-link";import{ChevronRight as Ru}from"lucide-react";import{jsx as ct,jsxs as Oa}from"react/jsx-runtime";function Lu(){return Oa("div",{className:"space-y-8",children:[Oa("div",{className:"space-y-3",children:[ct("h1",{className:"font-bold text-4xl",children:"Spec-driven validation + typing"}),ct("p",{className:"text-lg text-muted-foreground",children:"Define a single operation with SchemaModel, generate validation, and keep your existing handler logic."})]}),Oa("div",{className:"card-subtle space-y-4 p-6",children:[ct("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Oa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[ct("li",{children:"One command spec with explicit input/output models."}),ct("li",{children:"Validation + typing without rewriting your service layer."}),ct("li",{children:"Clear acceptance scenarios for regression safety."})]})]}),Oa("div",{className:"space-y-6",children:[Oa("div",{className:"space-y-3",children:[ct("h2",{className:"font-bold text-2xl",children:"1) Define the spec"}),Oa("p",{className:"text-muted-foreground text-sm",children:["Create ",ct("code",{children:"src/contracts/contact-create.operation.ts"}),":"]}),ct(kr,{language:"typescript",filename:"src/contracts/contact-create.operation.ts",code:`import { defineCommand } from "@contractspec/lib.contracts-spec/operations";
1706
+ contractspec release edit contract-dx-first-slice`}),Ee("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."})]}),Pa("div",{className:"space-y-3",children:[Ee("h2",{className:"font-bold text-2xl",children:"3) Build the generated release artifacts before consuming them"}),Ee(wr,{language:"bash",filename:"release-build",code:"contractspec release build"}),Ee("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."})]}),Pa("div",{className:"space-y-3",children:[Ee("h2",{className:"font-bold text-2xl",children:"4) Enforce completeness before publishing or building the changelog"}),Ee(wr,{language:"bash",filename:"release-check",code:"contractspec release check --strict"}),Ee("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."})]}),Pa("div",{className:"card-subtle space-y-3 p-6",children:[Ee("h3",{className:"font-semibold text-lg",children:"5) Sync the public docs if workflow expectations changed"}),Ee("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Tu.map((e)=>Ee("li",{children:e},e))})]})]}),Pa("div",{className:"flex items-center gap-4 pt-4",children:[Pa(Xc,{href:"/docs/guides/connect-in-a-repo",className:"btn-primary",children:["Connect guide ",Ee(Pu,{size:16})]}),Ee(Xc,{href:"/changelog",className:"btn-ghost",children:"Website changelog"})]})]})}import{CodeBlock as kr}from"@contractspec/lib.design-system";import xc from"@contractspec/lib.ui-link";import{ChevronRight as Ru}from"lucide-react";import{jsx as ct,jsxs as Oa}from"react/jsx-runtime";function Lu(){return Oa("div",{className:"space-y-8",children:[Oa("div",{className:"space-y-3",children:[ct("h1",{className:"font-bold text-4xl",children:"Spec-driven validation + typing"}),ct("p",{className:"text-lg text-muted-foreground",children:"Define a single operation with SchemaModel, generate validation, and keep your existing handler logic."})]}),Oa("div",{className:"card-subtle space-y-4 p-6",children:[ct("h2",{className:"font-bold text-2xl",children:"What you'll build"}),Oa("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[ct("li",{children:"One command spec with explicit input/output models."}),ct("li",{children:"Validation + typing without rewriting your service layer."}),ct("li",{children:"Clear acceptance scenarios for regression safety."})]})]}),Oa("div",{className:"space-y-6",children:[Oa("div",{className:"space-y-3",children:[ct("h2",{className:"font-bold text-2xl",children:"1) Define the spec"}),Oa("p",{className:"text-muted-foreground text-sm",children:["Create ",ct("code",{children:"src/contracts/contact-create.operation.ts"}),":"]}),ct(kr,{language:"typescript",filename:"src/contracts/contact-create.operation.ts",code:`import { defineCommand } from "@contractspec/lib.contracts-spec/operations";
1707
1707
  import { SchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
1708
1708
 
1709
1709
  const ContactInput = new SchemaModel({
@@ -1765,7 +1765,7 @@ export const ContactCreateCommand = defineCommand({
1765
1765
  cd packages/examples/crm-pipeline
1766
1766
  bun install
1767
1767
  bun run build
1768
- bun run validate`})]}),ct(Ht,{title:"Need validation tied to real outcomes?",body:"Studio links checks to evidence, focus decisions, and post-release verification so specs evolve with product truth."})]}),Oa("div",{className:"flex items-center gap-4 pt-4",children:[Oa(xc,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Next: Generate docs + clients ",ct(Ru,{size:16})]}),ct(xc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as Eu}from"@contractspec/lib.design-system";import Du from"@contractspec/lib.ui-link";import{ArrowRight as Ou,CheckCircle2 as Bu,GitBranch as Mu}from"lucide-react";import{jsx as Ft,jsxs as Ba}from"react/jsx-runtime";var Uu=[{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 Wu(){return Ba("div",{className:"space-y-10",children:[Ba("div",{className:"space-y-3",children:[Ft("p",{className:"editorial-kicker",children:"Build"}),Ft("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Adoption guides for teams that want to keep their code."}),Ft("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."})]}),Ft("div",{className:"grid gap-4 md:grid-cols-2",children:Uu.map((e)=>Ba(Du,{href:e.href,className:"editorial-panel",children:[Ba("div",{className:"flex items-start justify-between gap-4",children:[Ba("div",{children:[Ft("h2",{className:"font-semibold text-xl",children:e.title}),Ft("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.description})]}),Ft(Ou,{className:"mt-1 shrink-0",size:18})]}),Ba("div",{className:"mt-4 flex items-center gap-2 text-muted-foreground text-xs",children:[Ft(Bu,{size:14}),Ba("span",{children:["Target time: ",e.time]})]})]},e.href))}),Ba("div",{className:"editorial-panel space-y-4",children:[Ba("div",{className:"flex items-center gap-2 font-semibold text-[color:var(--rust)] text-sm uppercase tracking-[0.2em]",children:[Ft(Mu,{size:16}),"Working style"]}),Ba("ul",{className:"editorial-list",children:[Ba("li",{children:[Ft("span",{className:"editorial-list-marker"}),Ft("span",{children:"Run each guide in a branch or sandboxed workspace."})]}),Ba("li",{children:[Ft("span",{className:"editorial-list-marker"}),Ft("span",{children:"Prefer one bounded surface at a time: one endpoint, one workflow, one integration, one unsafe module."})]}),Ba("li",{children:[Ft("span",{className:"editorial-list-marker"}),Ft("span",{children:"Use the example and reference outputs to verify what changed, not just the narrative page."})]})]}),Ft(Eu,{language:"bash",filename:"guides-quickstart",code:`# list example systems
1768
+ bun run validate`})]}),ct(qt,{title:"Need validation tied to real outcomes?",body:"Studio links checks to evidence, focus decisions, and post-release verification so specs evolve with product truth."})]}),Oa("div",{className:"flex items-center gap-4 pt-4",children:[Oa(xc,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Next: Generate docs + clients ",ct(Ru,{size:16})]}),ct(xc,{href:"/docs/guides",className:"btn-ghost",children:"Back to guides"})]})]})}import{CodeBlock as Du}from"@contractspec/lib.design-system";import Eu from"@contractspec/lib.ui-link";import{ArrowRight as Ou,CheckCircle2 as Bu,GitBranch as Mu}from"lucide-react";import{jsx as Ft,jsxs as Ba}from"react/jsx-runtime";var Uu=[{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 Wu(){return Ba("div",{className:"space-y-10",children:[Ba("div",{className:"space-y-3",children:[Ft("p",{className:"editorial-kicker",children:"Build"}),Ft("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Adoption guides for teams that want to keep their code."}),Ft("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."})]}),Ft("div",{className:"grid gap-4 md:grid-cols-2",children:Uu.map((e)=>Ba(Eu,{href:e.href,className:"editorial-panel",children:[Ba("div",{className:"flex items-start justify-between gap-4",children:[Ba("div",{children:[Ft("h2",{className:"font-semibold text-xl",children:e.title}),Ft("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.description})]}),Ft(Ou,{className:"mt-1 shrink-0",size:18})]}),Ba("div",{className:"mt-4 flex items-center gap-2 text-muted-foreground text-xs",children:[Ft(Bu,{size:14}),Ba("span",{children:["Target time: ",e.time]})]})]},e.href))}),Ba("div",{className:"editorial-panel space-y-4",children:[Ba("div",{className:"flex items-center gap-2 font-semibold text-[color:var(--rust)] text-sm uppercase tracking-[0.2em]",children:[Ft(Mu,{size:16}),"Working style"]}),Ba("ul",{className:"editorial-list",children:[Ba("li",{children:[Ft("span",{className:"editorial-list-marker"}),Ft("span",{children:"Run each guide in a branch or sandboxed workspace."})]}),Ba("li",{children:[Ft("span",{className:"editorial-list-marker"}),Ft("span",{children:"Prefer one bounded surface at a time: one endpoint, one workflow, one integration, one unsafe module."})]}),Ba("li",{children:[Ft("span",{className:"editorial-list-marker"}),Ft("span",{children:"Use the example and reference outputs to verify what changed, not just the narrative page."})]})]}),Ft(Du,{language:"bash",filename:"guides-quickstart",code:`# list example systems
1769
1769
  contractspec examples list
1770
1770
 
1771
1771
  # validate the examples in this workspace
@@ -1825,7 +1825,7 @@ const stripeBreaker = new CircuitBreaker({
1825
1825
 
1826
1826
  export async function createCharge(amount: number) {
1827
1827
  return stripeBreaker.execute(() => stripe.charges.create({ amount }));
1828
- }`})]})]})}import jc from"@contractspec/lib.ui-link";import{ChevronRight as Hu}from"lucide-react";import{jsx as da,jsxs as Yo}from"react/jsx-runtime";function qu(){return Yo("div",{className:"space-y-8",children:[Yo("div",{className:"space-y-4",children:[da("h1",{className:"font-bold text-4xl",children:"ElevenLabs"}),da("p",{className:"text-muted-foreground",children:"ElevenLabs provides state-of-the-art text-to-speech and voice cloning technology. Create natural-sounding voiceovers, audiobooks, and voice assistants."})]}),Yo("div",{className:"space-y-4",children:[da("h2",{className:"font-bold text-2xl",children:"Setup"}),da("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:da("pre",{children:`# .env
1828
+ }`})]})]})}import jc from"@contractspec/lib.ui-link";import{ChevronRight as qu}from"lucide-react";import{jsx as da,jsxs as Yo}from"react/jsx-runtime";function Hu(){return Yo("div",{className:"space-y-8",children:[Yo("div",{className:"space-y-4",children:[da("h1",{className:"font-bold text-4xl",children:"ElevenLabs"}),da("p",{className:"text-muted-foreground",children:"ElevenLabs provides state-of-the-art text-to-speech and voice cloning technology. Create natural-sounding voiceovers, audiobooks, and voice assistants."})]}),Yo("div",{className:"space-y-4",children:[da("h2",{className:"font-bold text-2xl",children:"Setup"}),da("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:da("pre",{children:`# .env
1829
1829
  ELEVENLABS_API_KEY=...`})})]}),Yo("div",{className:"space-y-4",children:[da("h2",{className:"font-bold text-2xl",children:"Text-to-Speech"}),da("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:da("pre",{children:`capabilityId: elevenlabs-tts
1830
1830
  provider:
1831
1831
  type: elevenlabs
@@ -1845,7 +1845,7 @@ outputs:
1845
1845
  audioUrl:
1846
1846
  type: string
1847
1847
  audioData:
1848
- type: buffer`})})]}),Yo("div",{className:"space-y-4",children:[da("h2",{className:"font-bold text-2xl",children:"Use cases"}),Yo("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[da("li",{children:"Generate voiceovers for videos"}),da("li",{children:"Create audio versions of articles"}),da("li",{children:"Build voice assistants"}),da("li",{children:"Produce audiobooks"})]})]}),Yo("div",{className:"flex items-center gap-4 pt-4",children:[da(jc,{href:"/docs/integrations/mistral",className:"btn-ghost",children:"Previous: Mistral"}),Yo(jc,{href:"/docs/integrations/qdrant",className:"btn-primary",children:["Next: Qdrant ",da(Hu,{size:16})]})]})]})}import el from"@contractspec/lib.ui-link";import{ChevronRight as Vu}from"lucide-react";import{jsx as It,jsxs as Va}from"react/jsx-runtime";function Fu(){return Va("div",{className:"space-y-8",children:[Va("div",{className:"space-y-4",children:[It("h1",{className:"font-bold text-4xl",children:"GitHub Messaging"}),It("p",{className:"text-muted-foreground",children:"Use GitHub issue and pull request comments as an AI-native messaging channel with webhook verification, policy checks, and reliable outbound dispatch."})]}),Va("div",{className:"space-y-4",children:[It("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),It("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:It("pre",{children:`// secret payload
1848
+ type: buffer`})})]}),Yo("div",{className:"space-y-4",children:[da("h2",{className:"font-bold text-2xl",children:"Use cases"}),Yo("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[da("li",{children:"Generate voiceovers for videos"}),da("li",{children:"Create audio versions of articles"}),da("li",{children:"Build voice assistants"}),da("li",{children:"Produce audiobooks"})]})]}),Yo("div",{className:"flex items-center gap-4 pt-4",children:[da(jc,{href:"/docs/integrations/mistral",className:"btn-ghost",children:"Previous: Mistral"}),Yo(jc,{href:"/docs/integrations/qdrant",className:"btn-primary",children:["Next: Qdrant ",da(qu,{size:16})]})]})]})}import el from"@contractspec/lib.ui-link";import{ChevronRight as Vu}from"lucide-react";import{jsx as It,jsxs as Va}from"react/jsx-runtime";function Fu(){return Va("div",{className:"space-y-8",children:[Va("div",{className:"space-y-4",children:[It("h1",{className:"font-bold text-4xl",children:"GitHub Messaging"}),It("p",{className:"text-muted-foreground",children:"Use GitHub issue and pull request comments as an AI-native messaging channel with webhook verification, policy checks, and reliable outbound dispatch."})]}),Va("div",{className:"space-y-4",children:[It("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),It("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:It("pre",{children:`// secret payload
1849
1849
  {
1850
1850
  "token": "ghp_...",
1851
1851
  "webhookSecret": "..."
@@ -1910,7 +1910,7 @@ outputs:
1910
1910
  eventId:
1911
1911
  type: string
1912
1912
  htmlLink:
1913
- type: string`})})]}),Ri("div",{className:"flex items-center gap-4 pt-4",children:[fo(al,{href:"/docs/integrations/gmail",className:"btn-ghost",children:"Previous: Gmail API"}),Ri(al,{href:"/docs/integrations/openai",className:"btn-primary",children:["Next: OpenAI ",fo(Yu,{size:16})]})]})]})}import ol from"@contractspec/lib.ui-link";import{jsx as mt,jsxs as Fa}from"react/jsx-runtime";function $u(){return Fa("div",{className:"space-y-8",children:[Fa("div",{className:"space-y-4",children:[mt("h1",{className:"font-bold text-4xl",children:"Health Routing Strategy"}),mt("p",{className:"text-muted-foreground",children:"Health integrations resolve providers through deterministic transport strategy order with explicit capability gating and unofficial-route controls."})]}),Fa("div",{className:"space-y-4",children:[mt("h2",{className:"font-bold text-2xl",children:"Connection config fields"}),mt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:mt("pre",{children:`{
1913
+ type: string`})})]}),Ri("div",{className:"flex items-center gap-4 pt-4",children:[fo(al,{href:"/docs/integrations/gmail",className:"btn-ghost",children:"Previous: Gmail API"}),Ri(al,{href:"/docs/integrations/openai",className:"btn-primary",children:["Next: OpenAI ",fo(Yu,{size:16})]})]})]})}import ol from"@contractspec/lib.ui-link";import{jsx as mt,jsxs as Fa}from"react/jsx-runtime";function Zu(){return Fa("div",{className:"space-y-8",children:[Fa("div",{className:"space-y-4",children:[mt("h1",{className:"font-bold text-4xl",children:"Health Routing Strategy"}),mt("p",{className:"text-muted-foreground",children:"Health integrations resolve providers through deterministic transport strategy order with explicit capability gating and unofficial-route controls."})]}),Fa("div",{className:"space-y-4",children:[mt("h2",{className:"font-bold text-2xl",children:"Connection config fields"}),mt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:mt("pre",{children:`{
1914
1914
  "defaultTransport": "official-api",
1915
1915
  "strategyOrder": [
1916
1916
  "official-api",
@@ -1933,8 +1933,8 @@ outputs:
1933
1933
  "tokenExpiresAt": "2026-02-01T00:00:00.000Z",
1934
1934
  "mcpAccessToken": "...",
1935
1935
  "webhookSecret": "..."
1936
- }`})})]}),Fa("div",{className:"space-y-4",children:[mt("h2",{className:"font-bold text-2xl",children:"Routing behavior"}),Fa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[mt("li",{children:"Unsupported strategies are skipped per provider capability matrix."}),mt("li",{children:"Missing credentials fail closed and fall through only when a later strategy is valid."}),Fa("li",{children:["Unofficial routes are disabled unless",mt("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"allowUnofficial"}),"is true."]}),Fa("li",{children:["When",mt("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"unofficialAllowList"}),"is set, only listed provider keys can route unofficially."]}),Fa("li",{children:["OAuth refresh uses",mt("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"oauthTokenUrl"}),"with refresh/client credentials when APIs return 401."]})]})]}),Fa("div",{className:"space-y-4",children:[mt("h2",{className:"font-bold text-2xl",children:"Provider guidance"}),Fa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[mt("li",{children:"Use official APIs when available (Whoop, Oura, Strava, Fitbit)."}),mt("li",{children:"Use aggregator routing for providers without stable official APIs (Garmin, MyFitnessPal, Eight Sleep, Peloton)."}),mt("li",{children:"Keep unofficial automation opt-in and auditable for production."})]})]}),Fa("div",{className:"flex items-center gap-4 pt-4",children:[mt(ol,{href:"/docs/integrations/whatsapp-twilio",className:"btn-ghost",children:"Previous: WhatsApp Twilio"}),mt(ol,{href:"/docs/integrations",className:"btn-primary",children:"Back to Integrations"})]})]})}import il from"@contractspec/lib.ui-link";import{ChevronRight as Zu}from"lucide-react";import{jsx as He,jsxs as io}from"react/jsx-runtime";function Xu(){return io("div",{className:"space-y-8",children:[io("div",{className:"space-y-4",children:[He("h1",{className:"font-bold text-4xl",children:"Mistral"}),He("p",{className:"text-muted-foreground",children:"Integrate Mistral models for chat, reasoning, embeddings, speech-to-text, and conversational voice workflows. ContractSpec ships first-class Mistral support across contracts, provider runtime wiring, and CLI provider selection."})]}),io("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"Setup"}),He("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:He("pre",{children:`# .env
1937
- MISTRAL_API_KEY=...`})})]}),io("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"Chat and reasoning"}),He("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:He("pre",{children:`capabilityId: mistral-chat
1936
+ }`})})]}),Fa("div",{className:"space-y-4",children:[mt("h2",{className:"font-bold text-2xl",children:"Routing behavior"}),Fa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[mt("li",{children:"Unsupported strategies are skipped per provider capability matrix."}),mt("li",{children:"Missing credentials fail closed and fall through only when a later strategy is valid."}),Fa("li",{children:["Unofficial routes are disabled unless",mt("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"allowUnofficial"}),"is true."]}),Fa("li",{children:["When",mt("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"unofficialAllowList"}),"is set, only listed provider keys can route unofficially."]}),Fa("li",{children:["OAuth refresh uses",mt("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"oauthTokenUrl"}),"with refresh/client credentials when APIs return 401."]})]})]}),Fa("div",{className:"space-y-4",children:[mt("h2",{className:"font-bold text-2xl",children:"Provider guidance"}),Fa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[mt("li",{children:"Use official APIs when available (Whoop, Oura, Strava, Fitbit)."}),mt("li",{children:"Use aggregator routing for providers without stable official APIs (Garmin, MyFitnessPal, Eight Sleep, Peloton)."}),mt("li",{children:"Keep unofficial automation opt-in and auditable for production."})]})]}),Fa("div",{className:"flex items-center gap-4 pt-4",children:[mt(ol,{href:"/docs/integrations/whatsapp-twilio",className:"btn-ghost",children:"Previous: WhatsApp Twilio"}),mt(ol,{href:"/docs/integrations",className:"btn-primary",children:"Back to Integrations"})]})]})}import il from"@contractspec/lib.ui-link";import{ChevronRight as $u}from"lucide-react";import{jsx as qe,jsxs as io}from"react/jsx-runtime";function Xu(){return io("div",{className:"space-y-8",children:[io("div",{className:"space-y-4",children:[qe("h1",{className:"font-bold text-4xl",children:"Mistral"}),qe("p",{className:"text-muted-foreground",children:"Integrate Mistral models for chat, reasoning, embeddings, speech-to-text, and conversational voice workflows. ContractSpec ships first-class Mistral support across contracts, provider runtime wiring, and CLI provider selection."})]}),io("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"Setup"}),qe("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:qe("pre",{children:`# .env
1937
+ MISTRAL_API_KEY=...`})})]}),io("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"Chat and reasoning"}),qe("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:qe("pre",{children:`capabilityId: mistral-chat
1938
1938
  provider:
1939
1939
  type: mistral
1940
1940
  operation: chatCompletion
@@ -1953,7 +1953,7 @@ outputs:
1953
1953
  content:
1954
1954
  type: string
1955
1955
  usage:
1956
- type: object`})})]}),io("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"Embeddings"}),He("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:He("pre",{children:`capabilityId: mistral-embeddings
1956
+ type: object`})})]}),io("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"Embeddings"}),qe("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:qe("pre",{children:`capabilityId: mistral-embeddings
1957
1957
  provider:
1958
1958
  type: mistral
1959
1959
  operation: createEmbedding
@@ -1969,7 +1969,7 @@ outputs:
1969
1969
  embedding:
1970
1970
  type: array
1971
1971
  items:
1972
- type: number`})})]}),io("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"Speech-to-Text (Voxtral)"}),He("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:He("pre",{children:`capabilityId: mistral-stt
1972
+ type: number`})})]}),io("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"Speech-to-Text (Voxtral)"}),qe("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:qe("pre",{children:`capabilityId: mistral-stt
1973
1973
  provider:
1974
1974
  type: mistral
1975
1975
  operation: transcribe
@@ -1989,9 +1989,9 @@ outputs:
1989
1989
  segments:
1990
1990
  type: array
1991
1991
  language:
1992
- type: string`})})]}),io("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"Conversational voice sessions"}),He("p",{className:"text-muted-foreground",children:"Use the conversational provider for session-based realtime voice flows (turn handling, events, and interruption-safe streaming)."})]}),io("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"Best practices"}),io("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[He("li",{children:"Choose model families by workload: coding, reasoning, or speech"}),He("li",{children:"Persist session IDs for conversational continuity across turns"}),He("li",{children:"Capture token and latency telemetry for provider-level tuning"}),He("li",{children:"Set explicit fallbacks for network and rate-limit failures"})]})]}),io("div",{className:"flex items-center gap-4 pt-4",children:[He(il,{href:"/docs/integrations/openai",className:"btn-ghost",children:"Previous: OpenAI"}),io(il,{href:"/docs/integrations/elevenlabs",className:"btn-primary",children:["Next: ElevenLabs ",He(Zu,{size:16})]})]})]})}import rl from"@contractspec/lib.ui-link";import{ChevronRight as xu}from"lucide-react";import{jsx as $e,jsxs as ho}from"react/jsx-runtime";function ju(){return ho("div",{className:"space-y-8",children:[ho("div",{className:"space-y-4",children:[$e("h1",{className:"font-bold text-4xl",children:"OpenAI"}),$e("p",{className:"text-muted-foreground",children:"Integrate OpenAI's powerful AI models for chat completion, embeddings, and speech-to-text. Build intelligent features with GPT-4, generate embeddings for semantic search, and transcribe audio with Whisper."})]}),ho("div",{className:"space-y-4",children:[$e("h2",{className:"font-bold text-2xl",children:"Setup"}),$e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:$e("pre",{children:`# .env
1992
+ type: string`})})]}),io("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"Conversational voice sessions"}),qe("p",{className:"text-muted-foreground",children:"Use the conversational provider for session-based realtime voice flows (turn handling, events, and interruption-safe streaming)."})]}),io("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"Best practices"}),io("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[qe("li",{children:"Choose model families by workload: coding, reasoning, or speech"}),qe("li",{children:"Persist session IDs for conversational continuity across turns"}),qe("li",{children:"Capture token and latency telemetry for provider-level tuning"}),qe("li",{children:"Set explicit fallbacks for network and rate-limit failures"})]})]}),io("div",{className:"flex items-center gap-4 pt-4",children:[qe(il,{href:"/docs/integrations/openai",className:"btn-ghost",children:"Previous: OpenAI"}),io(il,{href:"/docs/integrations/elevenlabs",className:"btn-primary",children:["Next: ElevenLabs ",qe($u,{size:16})]})]})]})}import rl from"@contractspec/lib.ui-link";import{ChevronRight as xu}from"lucide-react";import{jsx as Ze,jsxs as ho}from"react/jsx-runtime";function ju(){return ho("div",{className:"space-y-8",children:[ho("div",{className:"space-y-4",children:[Ze("h1",{className:"font-bold text-4xl",children:"OpenAI"}),Ze("p",{className:"text-muted-foreground",children:"Integrate OpenAI's powerful AI models for chat completion, embeddings, and speech-to-text. Build intelligent features with GPT-4, generate embeddings for semantic search, and transcribe audio with Whisper."})]}),ho("div",{className:"space-y-4",children:[Ze("h2",{className:"font-bold text-2xl",children:"Setup"}),Ze("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Ze("pre",{children:`# .env
1993
1993
  OPENAI_API_KEY=sk-...
1994
- OPENAI_ORGANIZATION=org-...`})})]}),ho("div",{className:"space-y-4",children:[$e("h2",{className:"font-bold text-2xl",children:"Chat completions"}),$e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:$e("pre",{children:`capabilityId: openai-chat
1994
+ OPENAI_ORGANIZATION=org-...`})})]}),ho("div",{className:"space-y-4",children:[Ze("h2",{className:"font-bold text-2xl",children:"Chat completions"}),Ze("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Ze("pre",{children:`capabilityId: openai-chat
1995
1995
  provider:
1996
1996
  type: openai
1997
1997
  operation: chatCompletion
@@ -2016,7 +2016,7 @@ outputs:
2016
2016
  content:
2017
2017
  type: string
2018
2018
  usage:
2019
- type: object`})})]}),ho("div",{className:"space-y-4",children:[$e("h2",{className:"font-bold text-2xl",children:"Embeddings"}),$e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:$e("pre",{children:`capabilityId: openai-embeddings
2019
+ type: object`})})]}),ho("div",{className:"space-y-4",children:[Ze("h2",{className:"font-bold text-2xl",children:"Embeddings"}),Ze("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Ze("pre",{children:`capabilityId: openai-embeddings
2020
2020
  provider:
2021
2021
  type: openai
2022
2022
  operation: createEmbedding
@@ -2032,7 +2032,7 @@ outputs:
2032
2032
  embedding:
2033
2033
  type: array
2034
2034
  items:
2035
- type: number`})})]}),ho("div",{className:"space-y-4",children:[$e("h2",{className:"font-bold text-2xl",children:"Whisper (Speech-to-Text)"}),$e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:$e("pre",{children:`capabilityId: openai-transcribe
2035
+ type: number`})})]}),ho("div",{className:"space-y-4",children:[Ze("h2",{className:"font-bold text-2xl",children:"Whisper (Speech-to-Text)"}),Ze("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Ze("pre",{children:`capabilityId: openai-transcribe
2036
2036
  provider:
2037
2037
  type: openai
2038
2038
  operation: transcribe
@@ -2048,7 +2048,7 @@ outputs:
2048
2048
  text:
2049
2049
  type: string
2050
2050
  language:
2051
- type: string`})})]}),ho("div",{className:"space-y-4",children:[$e("h2",{className:"font-bold text-2xl",children:"Best practices"}),ho("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[$e("li",{children:"Use streaming for real-time chat responses"}),$e("li",{children:"Cache embeddings to reduce API costs"}),$e("li",{children:"Implement rate limiting to avoid quota issues"}),$e("li",{children:"Store conversation history for context"}),$e("li",{children:"Monitor token usage and costs"})]})]}),ho("div",{className:"flex items-center gap-4 pt-4",children:[$e(rl,{href:"/docs/integrations/google-calendar",className:"btn-ghost",children:"Previous: Google Calendar"}),ho(rl,{href:"/docs/integrations/mistral",className:"btn-primary",children:["Next: Mistral ",$e(xu,{size:16})]})]})]})}import nn from"@contractspec/lib.ui-link";import{jsx as Qt,jsxs as Ro}from"react/jsx-runtime";var eg=[{title:"Models and voice",items:[{title:"OpenAI",href:"/docs/integrations/openai"},{title:"Mistral",href:"/docs/integrations/mistral"},{title:"ElevenLabs",href:"/docs/integrations/elevenlabs"}]},{title:"Messaging and product operations",items:[{title:"GitHub",href:"/docs/integrations/github"},{title:"Slack",href:"/docs/integrations/slack"},{title:"Twilio",href:"/docs/integrations/twilio"},{title:"Postmark",href:"/docs/integrations/postmark"}]},{title:"Data, storage, and retrieval",items:[{title:"Qdrant",href:"/docs/integrations/qdrant"},{title:"S3 storage",href:"/docs/integrations/s3"},{title:"Gmail",href:"/docs/integrations/gmail"},{title:"Google Calendar",href:"/docs/integrations/google-calendar"}]},{title:"Payments and external workflows",items:[{title:"Stripe",href:"/docs/integrations/stripe"},{title:"Powens",href:"/docs/integrations/powens"},{title:"Circuit breakers",href:"/docs/integrations/circuit-breakers"},{title:"Health routing",href:"/docs/integrations/health-routing"}]}];function tg(){return Ro("div",{className:"space-y-10",children:[Ro("div",{className:"space-y-3",children:[Qt("p",{className:"editorial-kicker",children:"Integrations"}),Qt("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Integrations stay explicit: spec what a provider offers, then bind it per tenant and per app."}),Qt("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"The integration model keeps provider behavior out of ad hoc glue code. Define the capability contract first, configure the provider connection explicitly, then bind the integration into app workflows and runtime surfaces with clear ownership."})]}),Ro("div",{className:"editorial-proof-strip",children:[Ro("div",{className:"editorial-stat",children:[Qt("span",{className:"editorial-label",children:"Binding model"}),Qt("span",{className:"editorial-stat-value",children:"Integration spec \u2192 tenant connection \u2192 app binding"})]}),Qt("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"That separation is what makes reuse, tenant isolation, and provider swaps practical without rewriting every surface."})]}),Qt("section",{className:"editorial-panel space-y-5",children:Ro("div",{className:"space-y-2",children:[Qt("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Start with the model, then pick a provider"}),Ro("div",{className:"grid gap-4 md:grid-cols-2",children:[Ro(nn,{href:"/docs/integrations/spec-model",className:"docs-footer-link",children:[Qt("h3",{className:"font-semibold text-lg",children:"Integration spec model"}),Qt("p",{className:"text-muted-foreground text-sm leading-7",children:"Define what the provider offers, what configuration it needs, and how the runtime should treat it."})]}),Ro(nn,{href:"/docs/architecture/integration-binding",className:"docs-footer-link",children:[Qt("h3",{className:"font-semibold text-lg",children:"Integration binding"}),Qt("p",{className:"text-muted-foreground text-sm leading-7",children:"Understand how tenant connections get mapped into concrete app surfaces and workflows."})]})]})]})}),Qt("div",{className:"grid gap-5 md:grid-cols-2",children:eg.map((e)=>Ro("section",{className:"editorial-panel space-y-4",children:[Qt("h2",{className:"font-serif text-2xl tracking-[-0.03em]",children:e.title}),Qt("div",{className:"space-y-3",children:e.items.map((t)=>Qt(nn,{href:t.href,className:"docs-chip-link",children:t.title},t.href))})]},e.title))})]})}import nl from"@contractspec/lib.ui-link";import{ChevronRight as ag}from"lucide-react";import{jsx as ae,jsxs as Ut}from"react/jsx-runtime";function og(){return Ut("div",{className:"space-y-8",children:[Ut("div",{className:"space-y-4",children:[ae("h1",{className:"font-bold text-4xl",children:"Postmark"}),ae("p",{className:"text-muted-foreground",children:"Postmark is a transactional email service with industry-leading deliverability. Use it to send order confirmations, password resets, notifications, and other critical emails."})]}),Ut("div",{className:"space-y-4",children:[ae("h2",{className:"font-bold text-2xl",children:"Setup"}),ae("p",{className:"text-muted-foreground",children:"Add your Postmark credentials to your environment variables:"}),ae("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:ae("pre",{children:`# .env
2051
+ type: string`})})]}),ho("div",{className:"space-y-4",children:[Ze("h2",{className:"font-bold text-2xl",children:"Best practices"}),ho("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Ze("li",{children:"Use streaming for real-time chat responses"}),Ze("li",{children:"Cache embeddings to reduce API costs"}),Ze("li",{children:"Implement rate limiting to avoid quota issues"}),Ze("li",{children:"Store conversation history for context"}),Ze("li",{children:"Monitor token usage and costs"})]})]}),ho("div",{className:"flex items-center gap-4 pt-4",children:[Ze(rl,{href:"/docs/integrations/google-calendar",className:"btn-ghost",children:"Previous: Google Calendar"}),ho(rl,{href:"/docs/integrations/mistral",className:"btn-primary",children:["Next: Mistral ",Ze(xu,{size:16})]})]})]})}import nn from"@contractspec/lib.ui-link";import{jsx as Qt,jsxs as Ro}from"react/jsx-runtime";var eg=[{title:"Models and voice",items:[{title:"OpenAI",href:"/docs/integrations/openai"},{title:"Mistral",href:"/docs/integrations/mistral"},{title:"ElevenLabs",href:"/docs/integrations/elevenlabs"}]},{title:"Messaging and product operations",items:[{title:"GitHub",href:"/docs/integrations/github"},{title:"Slack",href:"/docs/integrations/slack"},{title:"Twilio",href:"/docs/integrations/twilio"},{title:"Postmark",href:"/docs/integrations/postmark"}]},{title:"Data, storage, and retrieval",items:[{title:"Qdrant",href:"/docs/integrations/qdrant"},{title:"S3 storage",href:"/docs/integrations/s3"},{title:"Gmail",href:"/docs/integrations/gmail"},{title:"Google Calendar",href:"/docs/integrations/google-calendar"}]},{title:"Payments and external workflows",items:[{title:"Stripe",href:"/docs/integrations/stripe"},{title:"Powens",href:"/docs/integrations/powens"},{title:"Circuit breakers",href:"/docs/integrations/circuit-breakers"},{title:"Health routing",href:"/docs/integrations/health-routing"}]}];function tg(){return Ro("div",{className:"space-y-10",children:[Ro("div",{className:"space-y-3",children:[Qt("p",{className:"editorial-kicker",children:"Integrations"}),Qt("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Integrations stay explicit: spec what a provider offers, then bind it per tenant and per app."}),Qt("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"The integration model keeps provider behavior out of ad hoc glue code. Define the capability contract first, configure the provider connection explicitly, then bind the integration into app workflows and runtime surfaces with clear ownership."})]}),Ro("div",{className:"editorial-proof-strip",children:[Ro("div",{className:"editorial-stat",children:[Qt("span",{className:"editorial-label",children:"Binding model"}),Qt("span",{className:"editorial-stat-value",children:"Integration spec \u2192 tenant connection \u2192 app binding"})]}),Qt("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"That separation is what makes reuse, tenant isolation, and provider swaps practical without rewriting every surface."})]}),Qt("section",{className:"editorial-panel space-y-5",children:Ro("div",{className:"space-y-2",children:[Qt("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Start with the model, then pick a provider"}),Ro("div",{className:"grid gap-4 md:grid-cols-2",children:[Ro(nn,{href:"/docs/integrations/spec-model",className:"docs-footer-link",children:[Qt("h3",{className:"font-semibold text-lg",children:"Integration spec model"}),Qt("p",{className:"text-muted-foreground text-sm leading-7",children:"Define what the provider offers, what configuration it needs, and how the runtime should treat it."})]}),Ro(nn,{href:"/docs/architecture/integration-binding",className:"docs-footer-link",children:[Qt("h3",{className:"font-semibold text-lg",children:"Integration binding"}),Qt("p",{className:"text-muted-foreground text-sm leading-7",children:"Understand how tenant connections get mapped into concrete app surfaces and workflows."})]})]})]})}),Qt("div",{className:"grid gap-5 md:grid-cols-2",children:eg.map((e)=>Ro("section",{className:"editorial-panel space-y-4",children:[Qt("h2",{className:"font-serif text-2xl tracking-[-0.03em]",children:e.title}),Qt("div",{className:"space-y-3",children:e.items.map((t)=>Qt(nn,{href:t.href,className:"docs-chip-link",children:t.title},t.href))})]},e.title))})]})}import nl from"@contractspec/lib.ui-link";import{ChevronRight as ag}from"lucide-react";import{jsx as ae,jsxs as Ut}from"react/jsx-runtime";function og(){return Ut("div",{className:"space-y-8",children:[Ut("div",{className:"space-y-4",children:[ae("h1",{className:"font-bold text-4xl",children:"Postmark"}),ae("p",{className:"text-muted-foreground",children:"Postmark is a transactional email service with industry-leading deliverability. Use it to send order confirmations, password resets, notifications, and other critical emails."})]}),Ut("div",{className:"space-y-4",children:[ae("h2",{className:"font-bold text-2xl",children:"Setup"}),ae("p",{className:"text-muted-foreground",children:"Add your Postmark credentials to your environment variables:"}),ae("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:ae("pre",{children:`# .env
2052
2052
  POSTMARK_API_TOKEN=...
2053
2053
  POSTMARK_FROM_EMAIL=noreply@example.com
2054
2054
  POSTMARK_FROM_NAME="Your App Name"`})}),Ut("p",{className:"text-muted-foreground text-sm",children:["Get your API token from the"," ",ae("a",{href:"https://account.postmarkapp.com/servers",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Postmark Dashboard"}),"."]})]}),Ut("div",{className:"space-y-4",children:[ae("h2",{className:"font-bold text-2xl",children:"Sending emails"}),ae("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:ae("pre",{children:`capabilityId: send-email
@@ -2149,10 +2149,10 @@ inputs:
2149
2149
  outputs:
2150
2150
  balances:
2151
2151
  type: AccountBalanceRecord[]
2152
- description: "Current/available balances with timestamps"`})})]}),Oe("div",{className:"space-y-4",children:[J("h2",{className:"font-bold text-2xl",children:"Primary workflows"}),Oe("div",{className:"space-y-3",children:[J("h3",{className:"font-semibold text-lg",children:"Account sync"}),Oe("p",{className:"text-muted-foreground",children:["The workflow"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.sync-openbanking-accounts"})," ","refreshes account metadata, then surfaces canonical records to other automations."]})]}),Oe("div",{className:"space-y-3",children:[J("h3",{className:"font-semibold text-lg",children:"Transaction sync"}),Oe("p",{className:"text-muted-foreground",children:[J("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.sync-openbanking-transactions"})," ","ingests incremental transactions for each linked account and stores them in the canonical ledger."]})]}),Oe("div",{className:"space-y-3",children:[J("h3",{className:"font-semibold text-lg",children:"Balance refresh"}),Oe("p",{className:"text-muted-foreground",children:[J("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.refresh-openbanking-balances"})," ","retrieves current and available balances to power dashboards and anomaly detection."]})]}),Oe("div",{className:"space-y-3",children:[J("h3",{className:"font-semibold text-lg",children:"Derived financial overview"}),Oe("p",{className:"text-muted-foreground",children:[J("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.generate-openbanking-overview"})," ","aggregates balances, category breakdowns, and cashflow trends into the ",J("code",{children:"knowledge.financial-overview"})," space. Only derived summaries are exposed to LLMs."]})]})]}),Oe("div",{className:"space-y-4",children:[J("h2",{className:"font-bold text-2xl",children:"Telemetry & guardrails"}),Oe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Oe("li",{children:["Telemetry events such as"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.accounts.synced"})," ","and"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.transactions.synced"})," ","are emitted automatically with tenant, slot, and config metadata."]}),Oe("li",{children:["Guard helpers ensure the"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"primaryOpenBanking"})," ","slot is bound and healthy before workflows execute."]}),Oe("li",{children:["PII fields (IBAN, counterparty names, descriptions) are redacted via"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"redactOpenBankingTelemetryPayload"})," ","before logging or sending telemetry."]})]})]}),Oe("div",{className:"space-y-4",children:[J("h2",{className:"font-bold text-2xl",children:"Best practices"}),Oe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[J("li",{children:"Use BYOK credentials per tenant to avoid cross-tenant exposure."}),J("li",{children:"Store only canonical entities (BankAccountRecord, BankTransactionRecord). Never persist raw Powens payloads or customer PII in logs."}),J("li",{children:"Run the transaction sync on a schedule appropriate for banking SLAs (e.g. every 15 minutes for cashflow dashboards)."}),J("li",{children:"Pair ledger updates with derived summaries to feed the knowledge layer instead of exposing raw transactions to agents."}),Oe("li",{children:["Monitor telemetry for"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.*.sync_failed"})," ","events to detect credential issues early."]})]})]}),Oe("div",{className:"flex items-center gap-4 pt-4",children:[J(cl,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),Oe(cl,{href:"/docs/integrations/stripe",className:"btn-primary",children:["Next: Stripe ",J(ig,{size:16})]})]})]})}import ll from"@contractspec/lib.ui-link";import{ChevronRight as ng}from"lucide-react";import{jsx as Yt,jsxs as $o}from"react/jsx-runtime";function cg(){return $o("div",{className:"space-y-8",children:[$o("div",{className:"space-y-4",children:[Yt("h1",{className:"font-bold text-4xl",children:"Qdrant"}),Yt("p",{className:"text-muted-foreground",children:"Qdrant is a high-performance vector database for semantic search, recommendations, and RAG (Retrieval-Augmented Generation) applications."})]}),$o("div",{className:"space-y-4",children:[Yt("h2",{className:"font-bold text-2xl",children:"Setup"}),Yt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Yt("pre",{children:`# .env
2152
+ description: "Current/available balances with timestamps"`})})]}),Oe("div",{className:"space-y-4",children:[J("h2",{className:"font-bold text-2xl",children:"Primary workflows"}),Oe("div",{className:"space-y-3",children:[J("h3",{className:"font-semibold text-lg",children:"Account sync"}),Oe("p",{className:"text-muted-foreground",children:["The workflow"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.sync-openbanking-accounts"})," ","refreshes account metadata, then surfaces canonical records to other automations."]})]}),Oe("div",{className:"space-y-3",children:[J("h3",{className:"font-semibold text-lg",children:"Transaction sync"}),Oe("p",{className:"text-muted-foreground",children:[J("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.sync-openbanking-transactions"})," ","ingests incremental transactions for each linked account and stores them in the canonical ledger."]})]}),Oe("div",{className:"space-y-3",children:[J("h3",{className:"font-semibold text-lg",children:"Balance refresh"}),Oe("p",{className:"text-muted-foreground",children:[J("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.refresh-openbanking-balances"})," ","retrieves current and available balances to power dashboards and anomaly detection."]})]}),Oe("div",{className:"space-y-3",children:[J("h3",{className:"font-semibold text-lg",children:"Derived financial overview"}),Oe("p",{className:"text-muted-foreground",children:[J("code",{className:"rounded bg-background/50 px-2 py-1",children:"pfo.workflow.generate-openbanking-overview"})," ","aggregates balances, category breakdowns, and cashflow trends into the ",J("code",{children:"knowledge.financial-overview"})," space. Only derived summaries are exposed to LLMs."]})]})]}),Oe("div",{className:"space-y-4",children:[J("h2",{className:"font-bold text-2xl",children:"Telemetry & guardrails"}),Oe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Oe("li",{children:["Telemetry events such as"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.accounts.synced"})," ","and"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.transactions.synced"})," ","are emitted automatically with tenant, slot, and config metadata."]}),Oe("li",{children:["Guard helpers ensure the"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"primaryOpenBanking"})," ","slot is bound and healthy before workflows execute."]}),Oe("li",{children:["PII fields (IBAN, counterparty names, descriptions) are redacted via"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"redactOpenBankingTelemetryPayload"})," ","before logging or sending telemetry."]})]})]}),Oe("div",{className:"space-y-4",children:[J("h2",{className:"font-bold text-2xl",children:"Best practices"}),Oe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[J("li",{children:"Use BYOK credentials per tenant to avoid cross-tenant exposure."}),J("li",{children:"Store only canonical entities (BankAccountRecord, BankTransactionRecord). Never persist raw Powens payloads or customer PII in logs."}),J("li",{children:"Run the transaction sync on a schedule appropriate for banking SLAs (e.g. every 15 minutes for cashflow dashboards)."}),J("li",{children:"Pair ledger updates with derived summaries to feed the knowledge layer instead of exposing raw transactions to agents."}),Oe("li",{children:["Monitor telemetry for"," ",J("code",{className:"rounded bg-background/50 px-2 py-1",children:"openbanking.*.sync_failed"})," ","events to detect credential issues early."]})]})]}),Oe("div",{className:"flex items-center gap-4 pt-4",children:[J(cl,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),Oe(cl,{href:"/docs/integrations/stripe",className:"btn-primary",children:["Next: Stripe ",J(ig,{size:16})]})]})]})}import ll from"@contractspec/lib.ui-link";import{ChevronRight as ng}from"lucide-react";import{jsx as Yt,jsxs as Zo}from"react/jsx-runtime";function cg(){return Zo("div",{className:"space-y-8",children:[Zo("div",{className:"space-y-4",children:[Yt("h1",{className:"font-bold text-4xl",children:"Qdrant"}),Yt("p",{className:"text-muted-foreground",children:"Qdrant is a high-performance vector database for semantic search, recommendations, and RAG (Retrieval-Augmented Generation) applications."})]}),Zo("div",{className:"space-y-4",children:[Yt("h2",{className:"font-bold text-2xl",children:"Setup"}),Yt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Yt("pre",{children:`# .env
2153
2153
  QDRANT_URL=https://...
2154
2154
  QDRANT_API_KEY=...
2155
- QDRANT_COLLECTION=documents`})})]}),$o("div",{className:"space-y-4",children:[Yt("h2",{className:"font-bold text-2xl",children:"Storing vectors"}),Yt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Yt("pre",{children:`capabilityId: qdrant-upsert
2155
+ QDRANT_COLLECTION=documents`})})]}),Zo("div",{className:"space-y-4",children:[Yt("h2",{className:"font-bold text-2xl",children:"Storing vectors"}),Yt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Yt("pre",{children:`capabilityId: qdrant-upsert
2156
2156
  provider:
2157
2157
  type: qdrant
2158
2158
  operation: upsert
@@ -2171,7 +2171,7 @@ inputs:
2171
2171
 
2172
2172
  outputs:
2173
2173
  status:
2174
- type: string`})})]}),$o("div",{className:"space-y-4",children:[Yt("h2",{className:"font-bold text-2xl",children:"Semantic search"}),Yt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Yt("pre",{children:`capabilityId: qdrant-search
2174
+ type: string`})})]}),Zo("div",{className:"space-y-4",children:[Yt("h2",{className:"font-bold text-2xl",children:"Semantic search"}),Yt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Yt("pre",{children:`capabilityId: qdrant-search
2175
2175
  provider:
2176
2176
  type: qdrant
2177
2177
  operation: search
@@ -2195,7 +2195,7 @@ outputs:
2195
2195
  properties:
2196
2196
  id: string
2197
2197
  score: number
2198
- payload: object`})})]}),$o("div",{className:"space-y-4",children:[Yt("h2",{className:"font-bold text-2xl",children:"RAG workflow example"}),Yt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Yt("pre",{children:`workflowId: rag-query
2198
+ payload: object`})})]}),Zo("div",{className:"space-y-4",children:[Yt("h2",{className:"font-bold text-2xl",children:"RAG workflow example"}),Yt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Yt("pre",{children:`workflowId: rag-query
2199
2199
  version: '1.0.0'.0.0
2200
2200
 
2201
2201
  steps:
@@ -2220,9 +2220,9 @@ steps:
2220
2220
  - role: "user"
2221
2221
  content: |
2222
2222
  Context: \${steps.search-documents.output.results}
2223
- Question: \${input.query}`})})]}),$o("div",{className:"flex items-center gap-4 pt-4",children:[Yt(ll,{href:"/docs/integrations/elevenlabs",className:"btn-ghost",children:"Previous: ElevenLabs"}),$o(ll,{href:"/docs/integrations/s3",className:"btn-primary",children:["Next: S3 Storage ",Yt(ng,{size:16})]})]})]})}import dl from"@contractspec/lib.ui-link";import{ChevronRight as lg}from"lucide-react";import{jsx as Ta,jsxs as Zo}from"react/jsx-runtime";function dg(){return Zo("div",{className:"space-y-8",children:[Zo("div",{className:"space-y-4",children:[Ta("h1",{className:"font-bold text-4xl",children:"Resend"}),Ta("p",{className:"text-muted-foreground",children:"Resend is a modern email API built for developers. It provides a simple, reliable way to send transactional emails with React Email templates."})]}),Zo("div",{className:"space-y-4",children:[Ta("h2",{className:"font-bold text-2xl",children:"Setup"}),Ta("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Ta("pre",{children:`# .env
2223
+ Question: \${input.query}`})})]}),Zo("div",{className:"flex items-center gap-4 pt-4",children:[Yt(ll,{href:"/docs/integrations/elevenlabs",className:"btn-ghost",children:"Previous: ElevenLabs"}),Zo(ll,{href:"/docs/integrations/s3",className:"btn-primary",children:["Next: S3 Storage ",Yt(ng,{size:16})]})]})]})}import dl from"@contractspec/lib.ui-link";import{ChevronRight as lg}from"lucide-react";import{jsx as Ta,jsxs as $o}from"react/jsx-runtime";function dg(){return $o("div",{className:"space-y-8",children:[$o("div",{className:"space-y-4",children:[Ta("h1",{className:"font-bold text-4xl",children:"Resend"}),Ta("p",{className:"text-muted-foreground",children:"Resend is a modern email API built for developers. It provides a simple, reliable way to send transactional emails with React Email templates."})]}),$o("div",{className:"space-y-4",children:[Ta("h2",{className:"font-bold text-2xl",children:"Setup"}),Ta("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Ta("pre",{children:`# .env
2224
2224
  RESEND_API_KEY=re_...
2225
- RESEND_FROM_EMAIL=onboarding@resend.dev`})})]}),Zo("div",{className:"space-y-4",children:[Ta("h2",{className:"font-bold text-2xl",children:"Sending emails"}),Ta("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Ta("pre",{children:`capabilityId: resend-send-email
2225
+ RESEND_FROM_EMAIL=onboarding@resend.dev`})})]}),$o("div",{className:"space-y-4",children:[Ta("h2",{className:"font-bold text-2xl",children:"Sending emails"}),Ta("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Ta("pre",{children:`capabilityId: resend-send-email
2226
2226
  provider:
2227
2227
  type: resend
2228
2228
  operation: sendEmail
@@ -2243,7 +2243,7 @@ inputs:
2243
2243
 
2244
2244
  outputs:
2245
2245
  id:
2246
- type: string`})})]}),Zo("div",{className:"space-y-4",children:[Ta("h2",{className:"font-bold text-2xl",children:"Best practices"}),Zo("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Ta("li",{children:"Use React Email for type-safe templates"}),Ta("li",{children:"Verify your domain for better deliverability"}),Ta("li",{children:"Monitor email analytics in the Resend dashboard"})]})]}),Zo("div",{className:"flex items-center gap-4 pt-4",children:[Ta(dl,{href:"/docs/integrations/postmark",className:"btn-ghost",children:"Previous: Postmark"}),Zo(dl,{href:"/docs/integrations/gmail",className:"btn-primary",children:["Next: Gmail API ",Ta(lg,{size:16})]})]})]})}import sl from"@contractspec/lib.ui-link";import{ChevronRight as sg}from"lucide-react";import{jsx as vt,jsxs as Lo}from"react/jsx-runtime";function pg(){return Lo("div",{className:"space-y-8",children:[Lo("div",{className:"space-y-4",children:[vt("h1",{className:"font-bold text-4xl",children:"S3-Compatible Storage"}),vt("p",{className:"text-muted-foreground",children:"Store files, images, and documents using any S3-compatible object storage service including AWS S3, Scaleway Object Storage, MinIO, DigitalOcean Spaces, and more."})]}),Lo("div",{className:"space-y-4",children:[vt("h2",{className:"font-bold text-2xl",children:"Setup"}),vt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:vt("pre",{children:`# .env
2246
+ type: string`})})]}),$o("div",{className:"space-y-4",children:[Ta("h2",{className:"font-bold text-2xl",children:"Best practices"}),$o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Ta("li",{children:"Use React Email for type-safe templates"}),Ta("li",{children:"Verify your domain for better deliverability"}),Ta("li",{children:"Monitor email analytics in the Resend dashboard"})]})]}),$o("div",{className:"flex items-center gap-4 pt-4",children:[Ta(dl,{href:"/docs/integrations/postmark",className:"btn-ghost",children:"Previous: Postmark"}),$o(dl,{href:"/docs/integrations/gmail",className:"btn-primary",children:["Next: Gmail API ",Ta(lg,{size:16})]})]})]})}import sl from"@contractspec/lib.ui-link";import{ChevronRight as sg}from"lucide-react";import{jsx as vt,jsxs as Lo}from"react/jsx-runtime";function pg(){return Lo("div",{className:"space-y-8",children:[Lo("div",{className:"space-y-4",children:[vt("h1",{className:"font-bold text-4xl",children:"S3-Compatible Storage"}),vt("p",{className:"text-muted-foreground",children:"Store files, images, and documents using any S3-compatible object storage service including AWS S3, Scaleway Object Storage, MinIO, DigitalOcean Spaces, and more."})]}),Lo("div",{className:"space-y-4",children:[vt("h2",{className:"font-bold text-2xl",children:"Setup"}),vt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:vt("pre",{children:`# .env
2247
2247
  S3_ENDPOINT=https://s3.fr-par.scw.cloud
2248
2248
  S3_ACCESS_KEY_ID=...
2249
2249
  S3_SECRET_ACCESS_KEY=...
@@ -2303,7 +2303,7 @@ CHANNEL_DISPATCH_TOKEN=...
2303
2303
 
2304
2304
  # Optional scheduler
2305
2305
  CHANNEL_DISPATCH_INTERVAL_MS=120000
2306
- CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),Ka("div",{className:"space-y-4",children:[Nt("h2",{className:"font-bold text-2xl",children:"Best practices"}),Ka("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Nt("li",{children:"Keep bot tokens and signing secrets in a managed secret provider."}),Nt("li",{children:"Use workspace mapping to prevent cross-tenant event leakage."}),Nt("li",{children:"Keep dispatch asynchronous so webhook handlers stay fast and reliable."}),Nt("li",{children:"Monitor telemetry for ingest, decision, outbox, and dispatch stages."})]})]}),Ka("div",{className:"flex items-center gap-4 pt-4",children:[Nt(pl,{href:"/docs/integrations/twilio",className:"btn-ghost",children:"Previous: Twilio SMS"}),Ka(pl,{href:"/docs/integrations/github",className:"btn-primary",children:["Next: GitHub Messaging ",Nt(mg,{size:16})]})]})]})}import ml from"@contractspec/lib.ui-link";import{ChevronRight as gg}from"lucide-react";import{jsx as R,jsxs as Ze}from"react/jsx-runtime";function fg(){return Ze("div",{className:"space-y-8",children:[Ze("div",{className:"space-y-4",children:[R("h1",{className:"font-bold text-4xl",children:"Integration Spec Model"}),R("p",{className:"text-muted-foreground",children:"Integrations in ContractSpec are defined through typed specifications that declare capabilities, configuration requirements, and connection details. This page covers IntegrationSpec and IntegrationConnection."})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"IntegrationSpec"}),Ze("p",{className:"text-muted-foreground",children:["The ",R("strong",{children:"IntegrationSpec"})," is a global definition of an integration provider. It declares what the integration provides and what it requires."]}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`type IntegrationSpec = {
2306
+ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),Ka("div",{className:"space-y-4",children:[Nt("h2",{className:"font-bold text-2xl",children:"Best practices"}),Ka("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Nt("li",{children:"Keep bot tokens and signing secrets in a managed secret provider."}),Nt("li",{children:"Use workspace mapping to prevent cross-tenant event leakage."}),Nt("li",{children:"Keep dispatch asynchronous so webhook handlers stay fast and reliable."}),Nt("li",{children:"Monitor telemetry for ingest, decision, outbox, and dispatch stages."})]})]}),Ka("div",{className:"flex items-center gap-4 pt-4",children:[Nt(pl,{href:"/docs/integrations/twilio",className:"btn-ghost",children:"Previous: Twilio SMS"}),Ka(pl,{href:"/docs/integrations/github",className:"btn-primary",children:["Next: GitHub Messaging ",Nt(mg,{size:16})]})]})]})}import ml from"@contractspec/lib.ui-link";import{ChevronRight as gg}from"lucide-react";import{jsx as R,jsxs as $e}from"react/jsx-runtime";function fg(){return $e("div",{className:"space-y-8",children:[$e("div",{className:"space-y-4",children:[R("h1",{className:"font-bold text-4xl",children:"Integration Spec Model"}),R("p",{className:"text-muted-foreground",children:"Integrations in ContractSpec are defined through typed specifications that declare capabilities, configuration requirements, and connection details. This page covers IntegrationSpec and IntegrationConnection."})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"IntegrationSpec"}),$e("p",{className:"text-muted-foreground",children:["The ",R("strong",{children:"IntegrationSpec"})," is a global definition of an integration provider. It declares what the integration provides and what it requires."]}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`type IntegrationSpec = {
2307
2307
  id: string;
2308
2308
  label: string;
2309
2309
  description: string;
@@ -2356,7 +2356,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),Ka("div",{className:"space-y-4",children
2356
2356
  version: string;
2357
2357
  createdAt: string;
2358
2358
  updatedAt: string;
2359
- };`})})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Example: Stripe IntegrationSpec"}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`{
2359
+ };`})})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Example: Stripe IntegrationSpec"}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`{
2360
2360
  id: "stripe",
2361
2361
  label: "Stripe",
2362
2362
  description: "Payment processing and subscription management",
@@ -2421,7 +2421,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),Ka("div",{className:"space-y-4",children
2421
2421
  docsUrl: "https://docs.contractspec.com/integrations/stripe",
2422
2422
  setupGuideUrl: "https://stripe.com/docs/keys",
2423
2423
  version: "1.0.0"
2424
- }`})})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"IntegrationConnection"}),Ze("p",{className:"text-muted-foreground",children:["An ",R("strong",{children:"IntegrationConnection"})," is a per-tenant instance of an integration with configured credentials and environment settings."]}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`type IntegrationConnection = {
2424
+ }`})})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"IntegrationConnection"}),$e("p",{className:"text-muted-foreground",children:["An ",R("strong",{children:"IntegrationConnection"})," is a per-tenant instance of an integration with configured credentials and environment settings."]}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`type IntegrationConnection = {
2425
2425
  id: string;
2426
2426
  tenantId: string;
2427
2427
  integrationId: string;
@@ -2445,7 +2445,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),Ka("div",{className:"space-y-4",children
2445
2445
  createdAt: string;
2446
2446
  updatedAt: string;
2447
2447
  createdBy: string;
2448
- };`})})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Example: Stripe IntegrationConnection"}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`// Production connection
2448
+ };`})})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Example: Stripe IntegrationConnection"}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`// Production connection
2449
2449
  {
2450
2450
  id: "conn_stripe_acme_prod",
2451
2451
  tenantId: "acme-corp",
@@ -2479,7 +2479,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),Ka("div",{className:"space-y-4",children
2479
2479
  createdAt: "2025-01-01T00:00:00Z",
2480
2480
  updatedAt: "2025-01-15T10:25:00Z",
2481
2481
  createdBy: "dev@acme.com"
2482
- }`})})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Example: Messaging IntegrationConnection"}),R("p",{className:"text-muted-foreground",children:"Messaging providers use the same spec + connection model, then route inbound events through the channel runtime for signature validation, idempotent ingestion, policy decisions, and outbox-backed dispatch."}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`{
2482
+ }`})})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Example: Messaging IntegrationConnection"}),R("p",{className:"text-muted-foreground",children:"Messaging providers use the same spec + connection model, then route inbound events through the channel runtime for signature validation, idempotent ingestion, policy decisions, and outbox-backed dispatch."}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`{
2483
2483
  id: "conn_slack_acme_prod",
2484
2484
  tenantId: "acme-corp",
2485
2485
  integrationId: "messaging.slack",
@@ -2496,7 +2496,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),Ka("div",{className:"space-y-4",children
2496
2496
  {
2497
2497
  "botToken": "xoxb-...",
2498
2498
  "signingSecret": "..."
2499
- }`})})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Health transport strategy config"}),R("p",{className:"text-muted-foreground",children:"Health providers support deterministic transport routing and explicit unofficial gating in connection config."}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`{
2499
+ }`})})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Health transport strategy config"}),R("p",{className:"text-muted-foreground",children:"Health providers support deterministic transport routing and explicit unofficial gating in connection config."}),R("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:R("pre",{children:`{
2500
2500
  "defaultTransport": "official-api",
2501
2501
  "strategyOrder": ["official-api", "aggregator-api", "unofficial"],
2502
2502
  "allowUnofficial": false,
@@ -2513,7 +2513,7 @@ CHANNEL_DISPATCH_RUN_ON_START=1`})})]}),Ka("div",{className:"space-y-4",children
2513
2513
  "clientSecret": "...",
2514
2514
  "tokenExpiresAt": "2026-02-01T00:00:00.000Z",
2515
2515
  "mcpAccessToken": "..."
2516
- }`})})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Health checks"}),R("p",{className:"text-muted-foreground",children:"IntegrationConnections are periodically health-checked to ensure they remain valid:"}),Ze("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Ze("li",{children:[R("strong",{children:"API key validation"})," - Test that credentials are still valid"]}),Ze("li",{children:[R("strong",{children:"Connectivity check"})," - Verify network access to the provider"]}),Ze("li",{children:[R("strong",{children:"Permission verification"})," - Ensure required scopes are granted"]}),Ze("li",{children:[R("strong",{children:"Webhook validation"})," - Test webhook endpoint reachability"]})]}),R("p",{className:"text-muted-foreground",children:'Failed health checks update the connection status to "error" and trigger alerts.'})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Secret management"}),R("p",{className:"text-muted-foreground",children:"Secrets (API keys, tokens) are never stored in plaintext:"}),Ze("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[R("li",{children:"User provides secrets through secure UI or API"}),R("li",{children:"Secrets are encrypted using tenant-specific keys"}),R("li",{children:"Encrypted secrets are stored in secure vault (e.g., AWS Secrets Manager)"}),R("li",{children:"IntegrationConnection stores only a reference (secretRef)"}),R("li",{children:"At runtime, secrets are decrypted on-demand and never logged"})]})]}),Ze("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Best practices"}),Ze("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[R("li",{children:"Always maintain separate sandbox and production connections"}),R("li",{children:"Use descriptive connection IDs that include tenant and environment"}),R("li",{children:"Monitor health check status and set up alerts for failures"}),R("li",{children:"Rotate secrets regularly and update secretRef accordingly"}),R("li",{children:"Document the purpose and ownership of each connection"}),R("li",{children:"Test connections in sandbox before enabling in production"})]})]}),Ze("div",{className:"flex items-center gap-4 pt-4",children:[R(ml,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),Ze(ml,{href:"/docs/architecture/integration-binding",className:"btn-primary",children:["Integration Binding ",R(gg,{size:16})]})]})]})}import ul from"@contractspec/lib.ui-link";import{ChevronRight as hg}from"lucide-react";import{jsx as N,jsxs as Xe}from"react/jsx-runtime";function yg(){return Xe("div",{className:"space-y-8",children:[Xe("div",{className:"space-y-4",children:[N("h1",{className:"font-bold text-4xl",children:"Stripe"}),N("p",{className:"text-muted-foreground",children:"The Stripe integration enables payment processing, subscription management, and invoicing in your ContractSpec applications. All Stripe operations are type-safe, policy-enforced, and automatically logged."})]}),Xe("div",{className:"space-y-4",children:[N("h2",{className:"font-bold text-2xl",children:"Setup"}),N("p",{className:"text-muted-foreground",children:"Add your Stripe credentials to your environment variables:"}),N("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:N("pre",{children:`# .env
2516
+ }`})})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Health checks"}),R("p",{className:"text-muted-foreground",children:"IntegrationConnections are periodically health-checked to ensure they remain valid:"}),$e("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[$e("li",{children:[R("strong",{children:"API key validation"})," - Test that credentials are still valid"]}),$e("li",{children:[R("strong",{children:"Connectivity check"})," - Verify network access to the provider"]}),$e("li",{children:[R("strong",{children:"Permission verification"})," - Ensure required scopes are granted"]}),$e("li",{children:[R("strong",{children:"Webhook validation"})," - Test webhook endpoint reachability"]})]}),R("p",{className:"text-muted-foreground",children:'Failed health checks update the connection status to "error" and trigger alerts.'})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Secret management"}),R("p",{className:"text-muted-foreground",children:"Secrets (API keys, tokens) are never stored in plaintext:"}),$e("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[R("li",{children:"User provides secrets through secure UI or API"}),R("li",{children:"Secrets are encrypted using tenant-specific keys"}),R("li",{children:"Encrypted secrets are stored in secure vault (e.g., AWS Secrets Manager)"}),R("li",{children:"IntegrationConnection stores only a reference (secretRef)"}),R("li",{children:"At runtime, secrets are decrypted on-demand and never logged"})]})]}),$e("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Best practices"}),$e("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[R("li",{children:"Always maintain separate sandbox and production connections"}),R("li",{children:"Use descriptive connection IDs that include tenant and environment"}),R("li",{children:"Monitor health check status and set up alerts for failures"}),R("li",{children:"Rotate secrets regularly and update secretRef accordingly"}),R("li",{children:"Document the purpose and ownership of each connection"}),R("li",{children:"Test connections in sandbox before enabling in production"})]})]}),$e("div",{className:"flex items-center gap-4 pt-4",children:[R(ml,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),$e(ml,{href:"/docs/architecture/integration-binding",className:"btn-primary",children:["Integration Binding ",R(gg,{size:16})]})]})]})}import ul from"@contractspec/lib.ui-link";import{ChevronRight as hg}from"lucide-react";import{jsx as N,jsxs as Xe}from"react/jsx-runtime";function yg(){return Xe("div",{className:"space-y-8",children:[Xe("div",{className:"space-y-4",children:[N("h1",{className:"font-bold text-4xl",children:"Stripe"}),N("p",{className:"text-muted-foreground",children:"The Stripe integration enables payment processing, subscription management, and invoicing in your ContractSpec applications. All Stripe operations are type-safe, policy-enforced, and automatically logged."})]}),Xe("div",{className:"space-y-4",children:[N("h2",{className:"font-bold text-2xl",children:"Setup"}),N("p",{className:"text-muted-foreground",children:"Add your Stripe credentials to your environment variables:"}),N("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:N("pre",{children:`# .env
2517
2517
  STRIPE_SECRET_KEY=sk_test_...
2518
2518
  STRIPE_PUBLISHABLE_KEY=pk_test_...
2519
2519
  STRIPE_WEBHOOK_SECRET=whsec_...`})}),Xe("p",{className:"text-muted-foreground text-sm",children:["Get your API keys from the"," ",N("a",{href:"https://dashboard.stripe.com/apikeys",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Stripe Dashboard"}),"."]})]}),Xe("div",{className:"space-y-4",children:[N("h2",{className:"font-bold text-2xl",children:"Available capabilities"}),Xe("div",{className:"space-y-3",children:[N("h3",{className:"font-semibold text-lg",children:"Payment Intents"}),N("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:N("pre",{children:`capabilityId: stripe-create-payment-intent
@@ -2616,10 +2616,10 @@ steps:
2616
2616
  to: "admin@example.com"
2617
2617
  template: "payment-error"
2618
2618
  data:
2619
- error: \${error.message}`})})]}),Xe("div",{className:"space-y-4",children:[N("h2",{className:"font-bold text-2xl",children:"Testing"}),N("p",{className:"text-muted-foreground",children:"Use Stripe's test cards for development:"}),N("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Xe("table",{className:"w-full text-left text-sm",children:[N("thead",{className:"bg-card/50",children:Xe("tr",{className:"border-border/50 border-b",children:[N("th",{className:"px-4 py-3 font-semibold",children:"Card Number"}),N("th",{className:"px-4 py-3 font-semibold",children:"Scenario"})]})}),Xe("tbody",{className:"divide-y divide-border/50",children:[Xe("tr",{children:[N("td",{className:"px-4 py-3 font-mono",children:"4242 4242 4242 4242"}),N("td",{className:"px-4 py-3",children:"Successful payment"})]}),Xe("tr",{children:[N("td",{className:"px-4 py-3 font-mono",children:"4000 0000 0000 9995"}),N("td",{className:"px-4 py-3",children:"Insufficient funds"})]}),Xe("tr",{children:[N("td",{className:"px-4 py-3 font-mono",children:"4000 0000 0000 0002"}),N("td",{className:"px-4 py-3",children:"Card declined"})]})]})]})})]}),Xe("div",{className:"space-y-4",children:[N("h2",{className:"font-bold text-2xl",children:"Best practices"}),Xe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[N("li",{children:"Always use test mode during development"}),N("li",{children:"Verify webhook signatures to prevent fraud"}),N("li",{children:"Handle idempotency for payment operations"}),N("li",{children:"Store customer IDs for recurring payments"}),N("li",{children:"Use metadata to link Stripe objects to your application records"}),N("li",{children:"Monitor failed payments and retry logic"})]})]}),Xe("div",{className:"flex items-center gap-4 pt-4",children:[N(ul,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),Xe(ul,{href:"/docs/integrations/postmark",className:"btn-primary",children:["Next: Postmark ",N(hg,{size:16})]})]})]})}import gl from"@contractspec/lib.ui-link";import{jsx as lt,jsxs as Eo}from"react/jsx-runtime";function bg(){return Eo("div",{className:"space-y-8",children:[Eo("div",{className:"space-y-4",children:[lt("h1",{className:"font-bold text-4xl",children:"Twilio"}),lt("p",{className:"text-muted-foreground",children:"Send SMS notifications, alerts, and two-factor authentication codes using Twilio's reliable messaging platform."})]}),Eo("div",{className:"space-y-4",children:[lt("h2",{className:"font-bold text-2xl",children:"Setup"}),lt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:lt("pre",{children:`# .env
2619
+ error: \${error.message}`})})]}),Xe("div",{className:"space-y-4",children:[N("h2",{className:"font-bold text-2xl",children:"Testing"}),N("p",{className:"text-muted-foreground",children:"Use Stripe's test cards for development:"}),N("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Xe("table",{className:"w-full text-left text-sm",children:[N("thead",{className:"bg-card/50",children:Xe("tr",{className:"border-border/50 border-b",children:[N("th",{className:"px-4 py-3 font-semibold",children:"Card Number"}),N("th",{className:"px-4 py-3 font-semibold",children:"Scenario"})]})}),Xe("tbody",{className:"divide-y divide-border/50",children:[Xe("tr",{children:[N("td",{className:"px-4 py-3 font-mono",children:"4242 4242 4242 4242"}),N("td",{className:"px-4 py-3",children:"Successful payment"})]}),Xe("tr",{children:[N("td",{className:"px-4 py-3 font-mono",children:"4000 0000 0000 9995"}),N("td",{className:"px-4 py-3",children:"Insufficient funds"})]}),Xe("tr",{children:[N("td",{className:"px-4 py-3 font-mono",children:"4000 0000 0000 0002"}),N("td",{className:"px-4 py-3",children:"Card declined"})]})]})]})})]}),Xe("div",{className:"space-y-4",children:[N("h2",{className:"font-bold text-2xl",children:"Best practices"}),Xe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[N("li",{children:"Always use test mode during development"}),N("li",{children:"Verify webhook signatures to prevent fraud"}),N("li",{children:"Handle idempotency for payment operations"}),N("li",{children:"Store customer IDs for recurring payments"}),N("li",{children:"Use metadata to link Stripe objects to your application records"}),N("li",{children:"Monitor failed payments and retry logic"})]})]}),Xe("div",{className:"flex items-center gap-4 pt-4",children:[N(ul,{href:"/docs/integrations",className:"btn-ghost",children:"Back to Integrations"}),Xe(ul,{href:"/docs/integrations/postmark",className:"btn-primary",children:["Next: Postmark ",N(hg,{size:16})]})]})]})}import gl from"@contractspec/lib.ui-link";import{jsx as lt,jsxs as Do}from"react/jsx-runtime";function bg(){return Do("div",{className:"space-y-8",children:[Do("div",{className:"space-y-4",children:[lt("h1",{className:"font-bold text-4xl",children:"Twilio"}),lt("p",{className:"text-muted-foreground",children:"Send SMS notifications, alerts, and two-factor authentication codes using Twilio's reliable messaging platform."})]}),Do("div",{className:"space-y-4",children:[lt("h2",{className:"font-bold text-2xl",children:"Setup"}),lt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:lt("pre",{children:`# .env
2620
2620
  TWILIO_ACCOUNT_SID=...
2621
2621
  TWILIO_AUTH_TOKEN=...
2622
- TWILIO_PHONE_NUMBER=+1234567890`})})]}),Eo("div",{className:"space-y-4",children:[lt("h2",{className:"font-bold text-2xl",children:"Sending SMS"}),lt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:lt("pre",{children:`capabilityId: twilio-send-sms
2622
+ TWILIO_PHONE_NUMBER=+1234567890`})})]}),Do("div",{className:"space-y-4",children:[lt("h2",{className:"font-bold text-2xl",children:"Sending SMS"}),lt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:lt("pre",{children:`capabilityId: twilio-send-sms
2623
2623
  provider:
2624
2624
  type: twilio
2625
2625
  operation: sendSMS
@@ -2636,7 +2636,7 @@ outputs:
2636
2636
  messageSid:
2637
2637
  type: string
2638
2638
  status:
2639
- type: string`})})]}),Eo("div",{className:"space-y-4",children:[lt("h2",{className:"font-bold text-2xl",children:"Use cases"}),Eo("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[lt("li",{children:"Order confirmations and shipping updates"}),lt("li",{children:"Two-factor authentication codes"}),lt("li",{children:"Appointment reminders"}),lt("li",{children:"Alert notifications"})]})]}),Eo("div",{className:"space-y-4",children:[lt("h2",{className:"font-bold text-2xl",children:"Best practices"}),Eo("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[lt("li",{children:"Always use E.164 format for phone numbers (+1234567890)"}),lt("li",{children:"Keep messages under 160 characters to avoid splitting"}),lt("li",{children:"Implement rate limiting to prevent spam"}),lt("li",{children:"Handle delivery failures gracefully"}),lt("li",{children:"Respect opt-out requests"})]})]}),Eo("div",{className:"flex items-center gap-4 pt-4",children:[lt(gl,{href:"/docs/integrations/s3",className:"btn-ghost",children:"Previous: S3 Storage"}),lt(gl,{href:"/docs/integrations/slack",className:"btn-primary",children:"Next: Slack Messaging"})]})]})}import fl from"@contractspec/lib.ui-link";import{ChevronRight as vg}from"lucide-react";import{jsx as Pt,jsxs as Ma}from"react/jsx-runtime";function Ng(){return Ma("div",{className:"space-y-8",children:[Ma("div",{className:"space-y-4",children:[Pt("h1",{className:"font-bold text-4xl",children:"WhatsApp Meta"}),Pt("p",{className:"text-muted-foreground",children:"Meta WhatsApp is the primary WhatsApp channel for ContractSpec's messaging runtime, with signed webhook verification and reliable outbound delivery."})]}),Ma("div",{className:"space-y-4",children:[Pt("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),Pt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Pt("pre",{children:`// secret payload
2639
+ type: string`})})]}),Do("div",{className:"space-y-4",children:[lt("h2",{className:"font-bold text-2xl",children:"Use cases"}),Do("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[lt("li",{children:"Order confirmations and shipping updates"}),lt("li",{children:"Two-factor authentication codes"}),lt("li",{children:"Appointment reminders"}),lt("li",{children:"Alert notifications"})]})]}),Do("div",{className:"space-y-4",children:[lt("h2",{className:"font-bold text-2xl",children:"Best practices"}),Do("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[lt("li",{children:"Always use E.164 format for phone numbers (+1234567890)"}),lt("li",{children:"Keep messages under 160 characters to avoid splitting"}),lt("li",{children:"Implement rate limiting to prevent spam"}),lt("li",{children:"Handle delivery failures gracefully"}),lt("li",{children:"Respect opt-out requests"})]})]}),Do("div",{className:"flex items-center gap-4 pt-4",children:[lt(gl,{href:"/docs/integrations/s3",className:"btn-ghost",children:"Previous: S3 Storage"}),lt(gl,{href:"/docs/integrations/slack",className:"btn-primary",children:"Next: Slack Messaging"})]})]})}import fl from"@contractspec/lib.ui-link";import{ChevronRight as vg}from"lucide-react";import{jsx as Pt,jsxs as Ma}from"react/jsx-runtime";function Ng(){return Ma("div",{className:"space-y-8",children:[Ma("div",{className:"space-y-4",children:[Pt("h1",{className:"font-bold text-4xl",children:"WhatsApp Meta"}),Pt("p",{className:"text-muted-foreground",children:"Meta WhatsApp is the primary WhatsApp channel for ContractSpec's messaging runtime, with signed webhook verification and reliable outbound delivery."})]}),Ma("div",{className:"space-y-4",children:[Pt("h2",{className:"font-bold text-2xl",children:"Required secrets and config"}),Pt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Pt("pre",{children:`// secret payload
2640
2640
  {
2641
2641
  "accessToken": "...",
2642
2642
  "appSecret": "...",
@@ -2656,7 +2656,7 @@ outputs:
2656
2656
  // optional connection config
2657
2657
  {
2658
2658
  "fromNumber": "whatsapp:+15550002"
2659
- }`})})]}),Aa("div",{className:"space-y-4",children:[Tt("h2",{className:"font-bold text-2xl",children:"Webhook ingress"}),Aa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Aa("li",{children:["Inbound Twilio form payloads are accepted on"," ",Tt("code",{className:"rounded bg-background/50 px-2 py-1",children:"/webhooks/whatsapp/twilio"}),"."]}),Aa("li",{children:["Signatures are validated with"," ",Tt("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-twilio-signature"})," ","and the configured auth token."]}),Aa("li",{children:["For deterministic verification, set the exact public webhook URL in"," ",Tt("code",{className:"rounded bg-background/50 px-2 py-1",children:"WHATSAPP_TWILIO_WEBHOOK_URL"}),"."]})]})]}),Aa("div",{className:"space-y-4",children:[Tt("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),Tt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Tt("pre",{children:'CHANNEL_WORKSPACE_MAP_WHATSAPP_TWILIO={"AC123":"workspace-acme"}'})})]}),Aa("div",{className:"space-y-4",children:[Tt("h2",{className:"font-bold text-2xl",children:"Best practices"}),Aa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Tt("li",{children:"Use Twilio as fallback when Meta WhatsApp is your primary route."}),Tt("li",{children:"Keep account SID mapping explicit to avoid tenant misrouting."}),Aa("li",{children:["Protect internal dispatch endpoints with",Tt("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"CHANNEL_DISPATCH_TOKEN"}),"."]})]})]}),Aa("div",{className:"flex items-center gap-4 pt-4",children:[Tt(hl,{href:"/docs/integrations/whatsapp-meta",className:"btn-ghost",children:"Previous: WhatsApp Meta"}),Aa(hl,{href:"/docs/integrations/health-routing",className:"btn-primary",children:["Next: Health Routing ",Tt(wg,{size:16})]})]})]})}var zI={title:"Contract-first API",summary:"Design APIs by writing contracts first, then generate consistent implementations across frameworks.",problems:["API drift between frontend and backend","Inconsistent error handling across endpoints","Documentation becomes outdated quickly","Manual OpenAPI maintenance is error-prone"],solutions:["Single source of truth for API contracts","Generate OpenAPI and SDKs from contracts","Type-safe request/response validation","Always-in-sync documentation"],audience:{role:"API developers",industry:"Software development",maturity:"scaleup"},callToAction:"Start with a simple operation contract",references:[{label:"Next.js One Endpoint Guide",url:"/docs/guides/nextjs-one-endpoint"},{label:"API Reference",url:"/docs/api"}]},GI={title:"Spec-driven development",summary:"Build features by writing specifications first, then generate type-safe implementations.",problems:["Feature requirements are ambiguous","Frontend and backend implementations diverge","Testing lacks clear contract definitions","Code reviews focus on style instead of behavior"],solutions:["Executable specifications as single source of truth","Generate type-safe clients from specs","Automated contract testing","Clear behavior contracts for teams"],audience:{role:"Development teams",industry:"Software engineering",maturity:"enterprise"},callToAction:"Define your first feature spec",references:[{label:"Spec Validation + Typing Guide",url:"/docs/guides/spec-validation-and-typing"},{label:"Core Contracts",url:"/docs/core-contracts"}]},HI={title:"Deterministic codegen",summary:"Regenerate code from contracts without breaking existing functionality or losing customizations.",problems:["Generated code conflicts with manual changes","Regeneration loses custom business logic","Teams avoid regeneration after customization","Code migration between versions is risky"],solutions:["Clear separation of generated vs hand-written code","Incremental regeneration with conflict detection","Protected zones for custom logic","Automatic migration paths"],audience:{role:"Platform engineers",industry:"Developer tools",maturity:"scaleup"},callToAction:"Try deterministic regeneration",references:[{label:"Generate Docs + Clients Guide",url:"/docs/guides/generate-docs-clients-schemas"},{label:"CLI Reference",url:"/docs/getting-started/cli"}]},qI={title:"Schema validation TypeScript",summary:"Generate TypeScript types from contracts and validate data at runtime with zero overhead.",problems:["Runtime type validation is boilerplate-heavy","Type definitions drift from schemas","Validation logic scattered across codebase","Poor error messages for invalid data"],solutions:["Auto-generated TypeScript from contracts","Zod schemas for runtime validation","Type-safe validation with clear errors","Single source of schema truth"],audience:{role:"TypeScript developers",industry:"Web development",maturity:"early"},callToAction:"Generate typed contracts now",references:[{label:"Type Safety Guide",url:"/docs/guides/spec-validation-and-typing"},{label:"Schema Reference",url:"/docs/schemas"}]},VI={title:"OpenAPI alternative",summary:"A spec-first approach that goes beyond OpenAPI with executable contracts and code generation.",problems:["OpenAPI is documentation-only","No type safety from OpenAPI specs","Manual SDK generation is complex","Cannot validate implementations against OpenAPI"],solutions:["Executable contracts with validation","Generate multiple outputs from one spec","Type-safe by default","Built-in testing and validation"],audience:{role:"API architects",industry:"Enterprise software",maturity:"enterprise"},callToAction:"Compare with OpenAPI approach",references:[{label:"Generate OpenAPI from Contracts",url:"/docs/guides/generate-docs-clients-schemas"},{label:"Contract vs OpenAPI",url:"/docs/comparison/openapi"}]},FI={title:"Generate client from schema",summary:"Automatically generate type-safe API clients in any language from your contracts.",problems:["Writing API clients is repetitive","Manual clients have type mismatches","Keeping clients in sync with APIs","Language-specific client maintenance"],solutions:["Generate clients for multiple languages","Type-safe request/response handling","Automatic client updates from contracts","Consistent error handling across languages"],audience:{role:"Full-stack developers",industry:"Software development",maturity:"scaleup"},callToAction:"Generate your first API client",references:[{label:"Client Generation Guide",url:"/docs/guides/generate-docs-clients-schemas"},{label:"Supported Languages",url:"/docs/integrations"}]};import{contractFirstApiBrief as Qi}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Sg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as yl}from"@contractspec/lib.design-system";import bl from"@contractspec/lib.ui-link";import{ChevronRight as Cg}from"lucide-react";import{jsx as Jt,jsxs as Do}from"react/jsx-runtime";var XI=new Sg().optimize(Qi);function Ig(){return Do("div",{className:"space-y-8",children:[Do("div",{className:"space-y-3",children:[Jt("h1",{className:"font-bold text-4xl",children:Qi.title}),Jt("p",{className:"text-lg text-muted-foreground",children:Qi.summary})]}),Do("div",{className:"card-subtle space-y-4 p-6",children:[Jt("h2",{className:"font-bold text-2xl",children:"Problems Solved"}),Jt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Qi.problems.map((e,t)=>Jt("li",{children:e},t))})]}),Do("div",{className:"card-subtle space-y-4 p-6",children:[Jt("h2",{className:"font-bold text-2xl",children:"Solutions"}),Jt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Qi.solutions.map((e,t)=>Jt("li",{children:e},t))})]}),Do("div",{className:"space-y-6",children:[Do("div",{className:"space-y-3",children:[Jt("h2",{className:"font-bold text-2xl",children:"Quick Start"}),Jt("p",{className:"text-muted-foreground text-sm",children:"Define your first API contract and generate consistent implementations."}),Jt(yl,{language:"typescript",filename:"src/contracts/user-create.operation.ts",code:`import { defineOperation } from '@contractspec/lib.contracts-spec/operations';
2659
+ }`})})]}),Aa("div",{className:"space-y-4",children:[Tt("h2",{className:"font-bold text-2xl",children:"Webhook ingress"}),Aa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Aa("li",{children:["Inbound Twilio form payloads are accepted on"," ",Tt("code",{className:"rounded bg-background/50 px-2 py-1",children:"/webhooks/whatsapp/twilio"}),"."]}),Aa("li",{children:["Signatures are validated with"," ",Tt("code",{className:"rounded bg-background/50 px-2 py-1",children:"x-twilio-signature"})," ","and the configured auth token."]}),Aa("li",{children:["For deterministic verification, set the exact public webhook URL in"," ",Tt("code",{className:"rounded bg-background/50 px-2 py-1",children:"WHATSAPP_TWILIO_WEBHOOK_URL"}),"."]})]})]}),Aa("div",{className:"space-y-4",children:[Tt("h2",{className:"font-bold text-2xl",children:"Workspace mapping"}),Tt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Tt("pre",{children:'CHANNEL_WORKSPACE_MAP_WHATSAPP_TWILIO={"AC123":"workspace-acme"}'})})]}),Aa("div",{className:"space-y-4",children:[Tt("h2",{className:"font-bold text-2xl",children:"Best practices"}),Aa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Tt("li",{children:"Use Twilio as fallback when Meta WhatsApp is your primary route."}),Tt("li",{children:"Keep account SID mapping explicit to avoid tenant misrouting."}),Aa("li",{children:["Protect internal dispatch endpoints with",Tt("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"CHANNEL_DISPATCH_TOKEN"}),"."]})]})]}),Aa("div",{className:"flex items-center gap-4 pt-4",children:[Tt(hl,{href:"/docs/integrations/whatsapp-meta",className:"btn-ghost",children:"Previous: WhatsApp Meta"}),Aa(hl,{href:"/docs/integrations/health-routing",className:"btn-primary",children:["Next: Health Routing ",Tt(wg,{size:16})]})]})]})}var zI={title:"Contract-first API",summary:"Design APIs by writing contracts first, then generate consistent implementations across frameworks.",problems:["API drift between frontend and backend","Inconsistent error handling across endpoints","Documentation becomes outdated quickly","Manual OpenAPI maintenance is error-prone"],solutions:["Single source of truth for API contracts","Generate OpenAPI and SDKs from contracts","Type-safe request/response validation","Always-in-sync documentation"],audience:{role:"API developers",industry:"Software development",maturity:"scaleup"},callToAction:"Start with a simple operation contract",references:[{label:"Next.js One Endpoint Guide",url:"/docs/guides/nextjs-one-endpoint"},{label:"API Reference",url:"/docs/api"}]},GI={title:"Spec-driven development",summary:"Build features by writing specifications first, then generate type-safe implementations.",problems:["Feature requirements are ambiguous","Frontend and backend implementations diverge","Testing lacks clear contract definitions","Code reviews focus on style instead of behavior"],solutions:["Executable specifications as single source of truth","Generate type-safe clients from specs","Automated contract testing","Clear behavior contracts for teams"],audience:{role:"Development teams",industry:"Software engineering",maturity:"enterprise"},callToAction:"Define your first feature spec",references:[{label:"Spec Validation + Typing Guide",url:"/docs/guides/spec-validation-and-typing"},{label:"Core Contracts",url:"/docs/core-contracts"}]},qI={title:"Deterministic codegen",summary:"Regenerate code from contracts without breaking existing functionality or losing customizations.",problems:["Generated code conflicts with manual changes","Regeneration loses custom business logic","Teams avoid regeneration after customization","Code migration between versions is risky"],solutions:["Clear separation of generated vs hand-written code","Incremental regeneration with conflict detection","Protected zones for custom logic","Automatic migration paths"],audience:{role:"Platform engineers",industry:"Developer tools",maturity:"scaleup"},callToAction:"Try deterministic regeneration",references:[{label:"Generate Docs + Clients Guide",url:"/docs/guides/generate-docs-clients-schemas"},{label:"CLI Reference",url:"/docs/getting-started/cli"}]},HI={title:"Schema validation TypeScript",summary:"Generate TypeScript types from contracts and validate data at runtime with zero overhead.",problems:["Runtime type validation is boilerplate-heavy","Type definitions drift from schemas","Validation logic scattered across codebase","Poor error messages for invalid data"],solutions:["Auto-generated TypeScript from contracts","Zod schemas for runtime validation","Type-safe validation with clear errors","Single source of schema truth"],audience:{role:"TypeScript developers",industry:"Web development",maturity:"early"},callToAction:"Generate typed contracts now",references:[{label:"Type Safety Guide",url:"/docs/guides/spec-validation-and-typing"},{label:"Schema Reference",url:"/docs/schemas"}]},VI={title:"OpenAPI alternative",summary:"A spec-first approach that goes beyond OpenAPI with executable contracts and code generation.",problems:["OpenAPI is documentation-only","No type safety from OpenAPI specs","Manual SDK generation is complex","Cannot validate implementations against OpenAPI"],solutions:["Executable contracts with validation","Generate multiple outputs from one spec","Type-safe by default","Built-in testing and validation"],audience:{role:"API architects",industry:"Enterprise software",maturity:"enterprise"},callToAction:"Compare with OpenAPI approach",references:[{label:"Generate OpenAPI from Contracts",url:"/docs/guides/generate-docs-clients-schemas"},{label:"Contract vs OpenAPI",url:"/docs/comparison/openapi"}]},FI={title:"Generate client from schema",summary:"Automatically generate type-safe API clients in any language from your contracts.",problems:["Writing API clients is repetitive","Manual clients have type mismatches","Keeping clients in sync with APIs","Language-specific client maintenance"],solutions:["Generate clients for multiple languages","Type-safe request/response handling","Automatic client updates from contracts","Consistent error handling across languages"],audience:{role:"Full-stack developers",industry:"Software development",maturity:"scaleup"},callToAction:"Generate your first API client",references:[{label:"Client Generation Guide",url:"/docs/guides/generate-docs-clients-schemas"},{label:"Supported Languages",url:"/docs/integrations"}]};import{contractFirstApiBrief as Qi}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Sg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as yl}from"@contractspec/lib.design-system";import bl from"@contractspec/lib.ui-link";import{ChevronRight as Cg}from"lucide-react";import{jsx as Jt,jsxs as Eo}from"react/jsx-runtime";var XI=new Sg().optimize(Qi);function Ig(){return Eo("div",{className:"space-y-8",children:[Eo("div",{className:"space-y-3",children:[Jt("h1",{className:"font-bold text-4xl",children:Qi.title}),Jt("p",{className:"text-lg text-muted-foreground",children:Qi.summary})]}),Eo("div",{className:"card-subtle space-y-4 p-6",children:[Jt("h2",{className:"font-bold text-2xl",children:"Problems Solved"}),Jt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Qi.problems.map((e,t)=>Jt("li",{children:e},t))})]}),Eo("div",{className:"card-subtle space-y-4 p-6",children:[Jt("h2",{className:"font-bold text-2xl",children:"Solutions"}),Jt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Qi.solutions.map((e,t)=>Jt("li",{children:e},t))})]}),Eo("div",{className:"space-y-6",children:[Eo("div",{className:"space-y-3",children:[Jt("h2",{className:"font-bold text-2xl",children:"Quick Start"}),Jt("p",{className:"text-muted-foreground text-sm",children:"Define your first API contract and generate consistent implementations."}),Jt(yl,{language:"typescript",filename:"src/contracts/user-create.operation.ts",code:`import { defineOperation } from '@contractspec/lib.contracts-spec/operations';
2660
2660
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
2661
2661
 
2662
2662
  export const CreateUserOperation = defineOperation({
@@ -2690,7 +2690,7 @@ export const CreateUserOperation = defineOperation({
2690
2690
  tags: ['users', 'auth'],
2691
2691
  description: 'Create a new user account with email and password',
2692
2692
  },
2693
- });`})]}),Do("div",{className:"space-y-3",children:[Jt("h2",{className:"font-bold text-2xl",children:"Generate OpenAPI"}),Jt("p",{className:"text-muted-foreground text-sm",children:"Export OpenAPI documentation directly from your contracts."}),Jt(yl,{language:"bash",filename:"export-openapi",code:"contractspec openapi export \\\n --registry ./src/contracts/registry.ts \\\n --out ./openapi.json"})]})]}),Do("div",{className:"flex items-center gap-4 pt-4",children:[Do(bl,{href:"/docs/guides/nextjs-one-endpoint",className:"btn-primary",children:["Next.js Guide ",Jt(Cg,{size:16})]}),Jt(bl,{href:"/docs/intent/spec-driven-development",className:"btn-ghost",children:"Spec-driven Development"})]})]})}import{deterministicCodegenBrief as Yi}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Pg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as cn}from"@contractspec/lib.design-system";import vl from"@contractspec/lib.ui-link";import{ChevronRight as Tg}from"lucide-react";import{jsx as wt,jsxs as yo}from"react/jsx-runtime";var aP=new Pg().optimize(Yi);function Ag(){return yo("div",{className:"space-y-8",children:[yo("div",{className:"space-y-3",children:[wt("h1",{className:"font-bold text-4xl",children:Yi.title}),wt("p",{className:"text-lg text-muted-foreground",children:Yi.summary})]}),yo("div",{className:"card-subtle space-y-4 p-6",children:[wt("h2",{className:"font-bold text-2xl",children:"Regeneration Challenges"}),wt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Yi.problems.map((e,t)=>wt("li",{children:e},t))})]}),yo("div",{className:"card-subtle space-y-4 p-6",children:[wt("h2",{className:"font-bold text-2xl",children:"Deterministic Solutions"}),wt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Yi.solutions.map((e,t)=>wt("li",{children:e},t))})]}),yo("div",{className:"space-y-6",children:[yo("div",{className:"space-y-3",children:[wt("h2",{className:"font-bold text-2xl",children:"Protected Zones"}),wt("p",{className:"text-muted-foreground text-sm",children:"Separate generated code from hand-written business logic with clear boundaries."}),wt(cn,{language:"typescript",filename:"src/handlers/user-handlers.ts",code:`// Hand-written business logic (protected from regeneration)
2693
+ });`})]}),Eo("div",{className:"space-y-3",children:[Jt("h2",{className:"font-bold text-2xl",children:"Generate OpenAPI"}),Jt("p",{className:"text-muted-foreground text-sm",children:"Export OpenAPI documentation directly from your contracts."}),Jt(yl,{language:"bash",filename:"export-openapi",code:"contractspec openapi export \\\n --registry ./src/contracts/registry.ts \\\n --out ./openapi.json"})]})]}),Eo("div",{className:"flex items-center gap-4 pt-4",children:[Eo(bl,{href:"/docs/guides/nextjs-one-endpoint",className:"btn-primary",children:["Next.js Guide ",Jt(Cg,{size:16})]}),Jt(bl,{href:"/docs/intent/spec-driven-development",className:"btn-ghost",children:"Spec-driven Development"})]})]})}import{deterministicCodegenBrief as Yi}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Pg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as cn}from"@contractspec/lib.design-system";import vl from"@contractspec/lib.ui-link";import{ChevronRight as Tg}from"lucide-react";import{jsx as wt,jsxs as yo}from"react/jsx-runtime";var aP=new Pg().optimize(Yi);function Ag(){return yo("div",{className:"space-y-8",children:[yo("div",{className:"space-y-3",children:[wt("h1",{className:"font-bold text-4xl",children:Yi.title}),wt("p",{className:"text-lg text-muted-foreground",children:Yi.summary})]}),yo("div",{className:"card-subtle space-y-4 p-6",children:[wt("h2",{className:"font-bold text-2xl",children:"Regeneration Challenges"}),wt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Yi.problems.map((e,t)=>wt("li",{children:e},t))})]}),yo("div",{className:"card-subtle space-y-4 p-6",children:[wt("h2",{className:"font-bold text-2xl",children:"Deterministic Solutions"}),wt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Yi.solutions.map((e,t)=>wt("li",{children:e},t))})]}),yo("div",{className:"space-y-6",children:[yo("div",{className:"space-y-3",children:[wt("h2",{className:"font-bold text-2xl",children:"Protected Zones"}),wt("p",{className:"text-muted-foreground text-sm",children:"Separate generated code from hand-written business logic with clear boundaries."}),wt(cn,{language:"typescript",filename:"src/handlers/user-handlers.ts",code:`// Hand-written business logic (protected from regeneration)
2694
2694
  export class UserService {
2695
2695
  async createUser(input: CreateUserInput): Promise<CreateUserOutput> {
2696
2696
  // Custom validation and business rules
@@ -2727,7 +2727,7 @@ export const createUserHandler = wrapOperationHandler(
2727
2727
  operationName: 'createUser',
2728
2728
  errorMapper: mapToStandardErrors,
2729
2729
  }
2730
- );`})]}),yo("div",{className:"space-y-3",children:[wt("h2",{className:"font-bold text-2xl",children:"Incremental Regeneration"}),wt("p",{className:"text-muted-foreground text-sm",children:"Regenerate only what changed while preserving custom logic."}),wt(cn,{language:"bash",filename:"incremental-regen",code:"contractspec generate \\\n --incremental \\\n --preserve-zones ./src/handlers/*.ts \\\n --input ./src/contracts/ \\\n --output ./generated/"})]}),yo("div",{className:"space-y-3",children:[wt("h2",{className:"font-bold text-2xl",children:"Conflict Detection"}),wt("p",{className:"text-muted-foreground text-sm",children:"Automatically detect and report conflicts during regeneration."}),wt(cn,{language:"bash",filename:"check-conflicts",code:"contractspec generate \\\n --check-conflicts \\\n --report-conflicts ./conflicts.json"})]})]}),yo("div",{className:"flex items-center gap-4 pt-4",children:[yo(vl,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Client Generation ",wt(Tg,{size:16})]}),wt(vl,{href:"/docs/intent/schema-validation-typescript",className:"btn-ghost",children:"Type Safety"})]})]})}import{generateClientFromSchemaBrief as Ji}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Rg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as Li}from"@contractspec/lib.design-system";import Nl from"@contractspec/lib.ui-link";import{ChevronRight as Lg}from"lucide-react";import{jsx as Ie,jsxs as sa}from"react/jsx-runtime";var uP=new Rg().optimize(Ji);function Eg(){return sa("div",{className:"space-y-8",children:[sa("div",{className:"space-y-3",children:[Ie("h1",{className:"font-bold text-4xl",children:Ji.title}),Ie("p",{className:"text-lg text-muted-foreground",children:Ji.summary})]}),sa("div",{className:"card-subtle space-y-4 p-6",children:[Ie("h2",{className:"font-bold text-2xl",children:"Client Development Problems"}),Ie("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Ji.problems.map((e,t)=>Ie("li",{children:e},t))})]}),sa("div",{className:"card-subtle space-y-4 p-6",children:[Ie("h2",{className:"font-bold text-2xl",children:"Automated Solutions"}),Ie("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Ji.solutions.map((e,t)=>Ie("li",{children:e},t))})]}),sa("div",{className:"space-y-6",children:[sa("div",{className:"space-y-3",children:[Ie("h2",{className:"font-bold text-2xl",children:"Contract Definition"}),Ie("p",{className:"text-muted-foreground text-sm",children:"Define your API contract once, generate clients for any language."}),Ie(Li,{language:"typescript",filename:"src/contracts/api.contract.ts",code:`import { defineContract } from '@contractspec/lib.contracts-spec';
2730
+ );`})]}),yo("div",{className:"space-y-3",children:[wt("h2",{className:"font-bold text-2xl",children:"Incremental Regeneration"}),wt("p",{className:"text-muted-foreground text-sm",children:"Regenerate only what changed while preserving custom logic."}),wt(cn,{language:"bash",filename:"incremental-regen",code:"contractspec generate \\\n --incremental \\\n --preserve-zones ./src/handlers/*.ts \\\n --input ./src/contracts/ \\\n --output ./generated/"})]}),yo("div",{className:"space-y-3",children:[wt("h2",{className:"font-bold text-2xl",children:"Conflict Detection"}),wt("p",{className:"text-muted-foreground text-sm",children:"Automatically detect and report conflicts during regeneration."}),wt(cn,{language:"bash",filename:"check-conflicts",code:"contractspec generate \\\n --check-conflicts \\\n --report-conflicts ./conflicts.json"})]})]}),yo("div",{className:"flex items-center gap-4 pt-4",children:[yo(vl,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Client Generation ",wt(Tg,{size:16})]}),wt(vl,{href:"/docs/intent/schema-validation-typescript",className:"btn-ghost",children:"Type Safety"})]})]})}import{generateClientFromSchemaBrief as Ji}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Rg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as Li}from"@contractspec/lib.design-system";import Nl from"@contractspec/lib.ui-link";import{ChevronRight as Lg}from"lucide-react";import{jsx as Ie,jsxs as sa}from"react/jsx-runtime";var uP=new Rg().optimize(Ji);function Dg(){return sa("div",{className:"space-y-8",children:[sa("div",{className:"space-y-3",children:[Ie("h1",{className:"font-bold text-4xl",children:Ji.title}),Ie("p",{className:"text-lg text-muted-foreground",children:Ji.summary})]}),sa("div",{className:"card-subtle space-y-4 p-6",children:[Ie("h2",{className:"font-bold text-2xl",children:"Client Development Problems"}),Ie("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Ji.problems.map((e,t)=>Ie("li",{children:e},t))})]}),sa("div",{className:"card-subtle space-y-4 p-6",children:[Ie("h2",{className:"font-bold text-2xl",children:"Automated Solutions"}),Ie("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Ji.solutions.map((e,t)=>Ie("li",{children:e},t))})]}),sa("div",{className:"space-y-6",children:[sa("div",{className:"space-y-3",children:[Ie("h2",{className:"font-bold text-2xl",children:"Contract Definition"}),Ie("p",{className:"text-muted-foreground text-sm",children:"Define your API contract once, generate clients for any language."}),Ie(Li,{language:"typescript",filename:"src/contracts/api.contract.ts",code:`import { defineContract } from '@contractspec/lib.contracts-spec';
2731
2731
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
2732
2732
 
2733
2733
  export const ApiContract = defineContract({
@@ -2924,7 +2924,7 @@ const user2 = client.getUser({ id: '123' }); // Uses cached result
2924
2924
  // Request cancellation
2925
2925
  const controller = new AbortController();
2926
2926
  const promise = client.getUsers({ page: 1, signal: controller.signal });
2927
- controller.abort(); // Cancels the request`})]})]}),sa("div",{className:"flex items-center gap-4 pt-4",children:[sa(Nl,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Client Generation Guide ",Ie(Lg,{size:16})]}),Ie(Nl,{href:"/docs/intent/contract-first-api",className:"btn-ghost",children:"Contract-first API"})]})]})}import{openapiAlternativeBrief as $i}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Dg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as wl}from"@contractspec/lib.design-system";import kl from"@contractspec/lib.ui-link";import{ChevronRight as Og}from"lucide-react";import{jsx as pe,jsxs as pa}from"react/jsx-runtime";var wP=new Dg().optimize($i);function Bg(){return pa("div",{className:"space-y-8",children:[pa("div",{className:"space-y-3",children:[pe("h1",{className:"font-bold text-4xl",children:$i.title}),pe("p",{className:"text-lg text-muted-foreground",children:$i.summary})]}),pa("div",{className:"card-subtle space-y-4 p-6",children:[pe("h2",{className:"font-bold text-2xl",children:"OpenAPI Limitations"}),pe("ul",{className:"space-y-2 text-muted-foreground text-sm",children:$i.problems.map((e,t)=>pe("li",{children:e},t))})]}),pa("div",{className:"card-subtle space-y-4 p-6",children:[pe("h2",{className:"font-bold text-2xl",children:"ContractSpec Advantages"}),pe("ul",{className:"space-y-2 text-muted-foreground text-sm",children:$i.solutions.map((e,t)=>pe("li",{children:e},t))})]}),pa("div",{className:"space-y-6",children:[pa("div",{className:"space-y-3",children:[pe("h2",{className:"font-bold text-2xl",children:"Comparison: OpenAPI vs ContractSpec"}),pe("p",{className:"text-muted-foreground text-sm",children:"Key differences between OpenAPI documentation and ContractSpec executable contracts."}),pa("div",{className:"grid gap-6 md:grid-cols-2",children:[pa("div",{className:"card-subtle space-y-3 p-4",children:[pe("h3",{className:"font-semibold text-lg",children:"OpenAPI"}),pa("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[pe("li",{children:"\u2022 Documentation specification only"}),pe("li",{children:"\u2022 No runtime validation"}),pe("li",{children:"\u2022 Manual code generation"}),pe("li",{children:"\u2022 Type safety requires tools"}),pe("li",{children:"\u2022 Separate schemas from documentation"})]})]}),pa("div",{className:"card-subtle space-y-3 p-4",children:[pe("h3",{className:"font-semibold text-lg",children:"ContractSpec"}),pa("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[pe("li",{children:"\u2022 Executable contracts"}),pe("li",{children:"\u2022 Built-in runtime validation"}),pe("li",{children:"\u2022 Automatic code generation"}),pe("li",{children:"\u2022 Type-safe by default"}),pe("li",{children:"\u2022 Unified spec and implementation"})]})]})]})]}),pa("div",{className:"space-y-3",children:[pe("h2",{className:"font-bold text-2xl",children:"Export from Contracts"}),pe("p",{className:"text-muted-foreground text-sm",children:"Generate OpenAPI documentation from ContractSpec for existing tooling."}),pe(wl,{language:"bash",filename:"export-openapi",code:`# From ContractSpec contracts
2927
+ controller.abort(); // Cancels the request`})]})]}),sa("div",{className:"flex items-center gap-4 pt-4",children:[sa(Nl,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Client Generation Guide ",Ie(Lg,{size:16})]}),Ie(Nl,{href:"/docs/intent/contract-first-api",className:"btn-ghost",children:"Contract-first API"})]})]})}import{openapiAlternativeBrief as Zi}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Eg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as wl}from"@contractspec/lib.design-system";import kl from"@contractspec/lib.ui-link";import{ChevronRight as Og}from"lucide-react";import{jsx as pe,jsxs as pa}from"react/jsx-runtime";var wP=new Eg().optimize(Zi);function Bg(){return pa("div",{className:"space-y-8",children:[pa("div",{className:"space-y-3",children:[pe("h1",{className:"font-bold text-4xl",children:Zi.title}),pe("p",{className:"text-lg text-muted-foreground",children:Zi.summary})]}),pa("div",{className:"card-subtle space-y-4 p-6",children:[pe("h2",{className:"font-bold text-2xl",children:"OpenAPI Limitations"}),pe("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Zi.problems.map((e,t)=>pe("li",{children:e},t))})]}),pa("div",{className:"card-subtle space-y-4 p-6",children:[pe("h2",{className:"font-bold text-2xl",children:"ContractSpec Advantages"}),pe("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Zi.solutions.map((e,t)=>pe("li",{children:e},t))})]}),pa("div",{className:"space-y-6",children:[pa("div",{className:"space-y-3",children:[pe("h2",{className:"font-bold text-2xl",children:"Comparison: OpenAPI vs ContractSpec"}),pe("p",{className:"text-muted-foreground text-sm",children:"Key differences between OpenAPI documentation and ContractSpec executable contracts."}),pa("div",{className:"grid gap-6 md:grid-cols-2",children:[pa("div",{className:"card-subtle space-y-3 p-4",children:[pe("h3",{className:"font-semibold text-lg",children:"OpenAPI"}),pa("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[pe("li",{children:"\u2022 Documentation specification only"}),pe("li",{children:"\u2022 No runtime validation"}),pe("li",{children:"\u2022 Manual code generation"}),pe("li",{children:"\u2022 Type safety requires tools"}),pe("li",{children:"\u2022 Separate schemas from documentation"})]})]}),pa("div",{className:"card-subtle space-y-3 p-4",children:[pe("h3",{className:"font-semibold text-lg",children:"ContractSpec"}),pa("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[pe("li",{children:"\u2022 Executable contracts"}),pe("li",{children:"\u2022 Built-in runtime validation"}),pe("li",{children:"\u2022 Automatic code generation"}),pe("li",{children:"\u2022 Type-safe by default"}),pe("li",{children:"\u2022 Unified spec and implementation"})]})]})]})]}),pa("div",{className:"space-y-3",children:[pe("h2",{className:"font-bold text-2xl",children:"Export from Contracts"}),pe("p",{className:"text-muted-foreground text-sm",children:"Generate OpenAPI documentation from ContractSpec for existing tooling."}),pe(wl,{language:"bash",filename:"export-openapi",code:`# From ContractSpec contracts
2928
2928
  contractspec openapi export \\
2929
2929
  --registry ./src/contracts/registry.ts \\
2930
2930
  --format yaml \\
@@ -2962,7 +2962,7 @@ export const outputs = {
2962
2962
 
2963
2963
  // Type definitions
2964
2964
  types: UserApiContract.toTypescript(),
2965
- };`})]})]}),pa("div",{className:"flex items-center gap-4 pt-4",children:[pa(kl,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Generate from Contracts ",pe(Og,{size:16})]}),pe(kl,{href:"/docs/intent/generate-client-from-schema",className:"btn-ghost",children:"Client Generation"})]})]})}import{schemaValidationTypescriptBrief as Zi}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Mg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as ln}from"@contractspec/lib.design-system";import Sl from"@contractspec/lib.ui-link";import{ChevronRight as Ug}from"lucide-react";import{jsx as kt,jsxs as bo}from"react/jsx-runtime";var RP=new Mg().optimize(Zi);function Wg(){return bo("div",{className:"space-y-8",children:[bo("div",{className:"space-y-3",children:[kt("h1",{className:"font-bold text-4xl",children:Zi.title}),kt("p",{className:"text-lg text-muted-foreground",children:Zi.summary})]}),bo("div",{className:"card-subtle space-y-4 p-6",children:[kt("h2",{className:"font-bold text-2xl",children:"Validation Pain Points"}),kt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Zi.problems.map((e,t)=>kt("li",{children:e},t))})]}),bo("div",{className:"card-subtle space-y-4 p-6",children:[kt("h2",{className:"font-bold text-2xl",children:"Type-safe Solutions"}),kt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Zi.solutions.map((e,t)=>kt("li",{children:e},t))})]}),bo("div",{className:"space-y-6",children:[bo("div",{className:"space-y-3",children:[kt("h2",{className:"font-bold text-2xl",children:"Contract Schema"}),kt("p",{className:"text-muted-foreground text-sm",children:"Define data models with automatic TypeScript generation."}),kt(ln,{language:"typescript",filename:"src/contracts/user.schema.ts",code:`import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
2965
+ };`})]})]}),pa("div",{className:"flex items-center gap-4 pt-4",children:[pa(kl,{href:"/docs/guides/generate-docs-clients-schemas",className:"btn-primary",children:["Generate from Contracts ",pe(Og,{size:16})]}),pe(kl,{href:"/docs/intent/generate-client-from-schema",className:"btn-ghost",children:"Client Generation"})]})]})}import{schemaValidationTypescriptBrief as $i}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as Mg}from"@contractspec/lib.content-gen/seo";import{CodeBlock as ln}from"@contractspec/lib.design-system";import Sl from"@contractspec/lib.ui-link";import{ChevronRight as Ug}from"lucide-react";import{jsx as kt,jsxs as bo}from"react/jsx-runtime";var RP=new Mg().optimize($i);function Wg(){return bo("div",{className:"space-y-8",children:[bo("div",{className:"space-y-3",children:[kt("h1",{className:"font-bold text-4xl",children:$i.title}),kt("p",{className:"text-lg text-muted-foreground",children:$i.summary})]}),bo("div",{className:"card-subtle space-y-4 p-6",children:[kt("h2",{className:"font-bold text-2xl",children:"Validation Pain Points"}),kt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:$i.problems.map((e,t)=>kt("li",{children:e},t))})]}),bo("div",{className:"card-subtle space-y-4 p-6",children:[kt("h2",{className:"font-bold text-2xl",children:"Type-safe Solutions"}),kt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:$i.solutions.map((e,t)=>kt("li",{children:e},t))})]}),bo("div",{className:"space-y-6",children:[bo("div",{className:"space-y-3",children:[kt("h2",{className:"font-bold text-2xl",children:"Contract Schema"}),kt("p",{className:"text-muted-foreground text-sm",children:"Define data models with automatic TypeScript generation."}),kt(ln,{language:"typescript",filename:"src/contracts/user.schema.ts",code:`import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
2966
2966
 
2967
2967
  export const UserSchema = new SchemaModel({
2968
2968
  type: 'object',
@@ -3057,7 +3057,7 @@ export async function createUserHandler(request: Request) {
3057
3057
 
3058
3058
  throw error;
3059
3059
  }
3060
- }`})]})]}),bo("div",{className:"flex items-center gap-4 pt-4",children:[bo(Sl,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Type Safety Guide ",kt(Ug,{size:16})]}),kt(Sl,{href:"/docs/intent/generate-client-from-schema",className:"btn-ghost",children:"Client Generation"})]})]})}import{specDrivenDevelopmentBrief as Xi}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as _g}from"@contractspec/lib.content-gen/seo";import{CodeBlock as Cl}from"@contractspec/lib.design-system";import Il from"@contractspec/lib.ui-link";import{ChevronRight as zg}from"lucide-react";import{jsx as $t,jsxs as Oo}from"react/jsx-runtime";var WP=new _g().optimize(Xi);function Gg(){return Oo("div",{className:"space-y-8",children:[Oo("div",{className:"space-y-3",children:[$t("h1",{className:"font-bold text-4xl",children:Xi.title}),$t("p",{className:"text-lg text-muted-foreground",children:Xi.summary})]}),Oo("div",{className:"card-subtle space-y-4 p-6",children:[$t("h2",{className:"font-bold text-2xl",children:"Why Spec-driven?"}),$t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Xi.problems.map((e,t)=>$t("li",{children:e},t))})]}),Oo("div",{className:"card-subtle space-y-4 p-6",children:[$t("h2",{className:"font-bold text-2xl",children:"Benefits"}),$t("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Xi.solutions.map((e,t)=>$t("li",{children:e},t))})]}),Oo("div",{className:"space-y-6",children:[Oo("div",{className:"space-y-3",children:[$t("h2",{className:"font-bold text-2xl",children:"Feature Specification Example"}),$t("p",{className:"text-muted-foreground text-sm",children:"Define a complete feature with operations, events, and data models."}),$t(Cl,{language:"typescript",filename:"src/contracts/user-management.feature.ts",code:`import { defineFeature } from '@contractspec/lib.contracts-spec/features';
3060
+ }`})]})]}),bo("div",{className:"flex items-center gap-4 pt-4",children:[bo(Sl,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Type Safety Guide ",kt(Ug,{size:16})]}),kt(Sl,{href:"/docs/intent/generate-client-from-schema",className:"btn-ghost",children:"Client Generation"})]})]})}import{specDrivenDevelopmentBrief as Xi}from"@contractspec/bundle.library/components/docs/intent/intent-pages.docblocks";import{SeoOptimizer as _g}from"@contractspec/lib.content-gen/seo";import{CodeBlock as Cl}from"@contractspec/lib.design-system";import Il from"@contractspec/lib.ui-link";import{ChevronRight as zg}from"lucide-react";import{jsx as Zt,jsxs as Oo}from"react/jsx-runtime";var WP=new _g().optimize(Xi);function Gg(){return Oo("div",{className:"space-y-8",children:[Oo("div",{className:"space-y-3",children:[Zt("h1",{className:"font-bold text-4xl",children:Xi.title}),Zt("p",{className:"text-lg text-muted-foreground",children:Xi.summary})]}),Oo("div",{className:"card-subtle space-y-4 p-6",children:[Zt("h2",{className:"font-bold text-2xl",children:"Why Spec-driven?"}),Zt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Xi.problems.map((e,t)=>Zt("li",{children:e},t))})]}),Oo("div",{className:"card-subtle space-y-4 p-6",children:[Zt("h2",{className:"font-bold text-2xl",children:"Benefits"}),Zt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:Xi.solutions.map((e,t)=>Zt("li",{children:e},t))})]}),Oo("div",{className:"space-y-6",children:[Oo("div",{className:"space-y-3",children:[Zt("h2",{className:"font-bold text-2xl",children:"Feature Specification Example"}),Zt("p",{className:"text-muted-foreground text-sm",children:"Define a complete feature with operations, events, and data models."}),Zt(Cl,{language:"typescript",filename:"src/contracts/user-management.feature.ts",code:`import { defineFeature } from '@contractspec/lib.contracts-spec/features';
3061
3061
  import { defineOperation } from '@contractspec/lib.contracts-spec/operations';
3062
3062
  import { defineEvent } from '@contractspec/lib.contracts-spec/events';
3063
3063
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
@@ -3129,7 +3129,7 @@ export const UserManagementFeature = defineFeature({
3129
3129
  version: '1.0.0',
3130
3130
  description: 'Complete user management with operations and events',
3131
3131
  },
3132
- });`})]}),Oo("div",{className:"space-y-3",children:[$t("h2",{className:"font-bold text-2xl",children:"Generate Type-safe Implementations"}),$t("p",{className:"text-muted-foreground text-sm",children:"Generate validation, types, and API handlers from your feature."}),$t(Cl,{language:"bash",filename:"generate-from-feature",code:"contractspec generate \\\n --input ./src/contracts/user-management.feature.ts \\\n --output ./generated/user-management"})]})]}),Oo("div",{className:"flex items-center gap-4 pt-4",children:[Oo(Il,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Type Safety Guide ",$t(zg,{size:16})]}),$t(Il,{href:"/docs/intent/deterministic-codegen",className:"btn-ghost",children:"Deterministic Codegen"})]})]})}import Pl from"@contractspec/lib.ui-link";import{ChevronRight as Hg}from"lucide-react";import{jsx as n,jsxs as m}from"react/jsx-runtime";function qg(){return m("div",{className:"space-y-8",children:[m("div",{className:"space-y-4",children:[n("h1",{className:"font-bold text-4xl",children:"Knowledge Categories"}),n("p",{className:"text-muted-foreground",children:"ContractSpec classifies knowledge into four categories based on trust level, source authority, and intended use. This classification determines how knowledge can be used in workflows, policy decisions, and agent responses."})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"The four categories"}),n("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:n("pre",{children:`type KnowledgeCategory =
3132
+ });`})]}),Oo("div",{className:"space-y-3",children:[Zt("h2",{className:"font-bold text-2xl",children:"Generate Type-safe Implementations"}),Zt("p",{className:"text-muted-foreground text-sm",children:"Generate validation, types, and API handlers from your feature."}),Zt(Cl,{language:"bash",filename:"generate-from-feature",code:"contractspec generate \\\n --input ./src/contracts/user-management.feature.ts \\\n --output ./generated/user-management"})]})]}),Oo("div",{className:"flex items-center gap-4 pt-4",children:[Oo(Il,{href:"/docs/guides/spec-validation-and-typing",className:"btn-primary",children:["Type Safety Guide ",Zt(zg,{size:16})]}),Zt(Il,{href:"/docs/intent/deterministic-codegen",className:"btn-ghost",children:"Deterministic Codegen"})]})]})}import Pl from"@contractspec/lib.ui-link";import{ChevronRight as qg}from"lucide-react";import{jsx as n,jsxs as m}from"react/jsx-runtime";function Hg(){return m("div",{className:"space-y-8",children:[m("div",{className:"space-y-4",children:[n("h1",{className:"font-bold text-4xl",children:"Knowledge Categories"}),n("p",{className:"text-muted-foreground",children:"ContractSpec classifies knowledge into four categories based on trust level, source authority, and intended use. This classification determines how knowledge can be used in workflows, policy decisions, and agent responses."})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"The four categories"}),n("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:n("pre",{children:`type KnowledgeCategory =
3133
3133
  | "canonical" // Internal ground truth
3134
3134
  | "operational" // Internal operational docs
3135
3135
  | "external" // Third-party reference
@@ -3213,7 +3213,7 @@ export const UserManagementFeature = defineFeature({
3213
3213
  "session:user-uploads",
3214
3214
  "session:form-drafts"
3215
3215
  ]
3216
- }`})})]}),n("div",{className:"card-subtle border-red-500/30 bg-red-500/10 p-3",children:m("p",{className:"text-red-300 text-sm",children:[n("strong",{children:"\u26A0\uFE0F Critical:"})," Ephemeral knowledge is never used for policy decisions, compliance checks, or any authoritative purpose."]})})]})]})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Category comparison"}),n("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:m("table",{className:"w-full text-left text-sm",children:[n("thead",{className:"bg-card/50",children:m("tr",{className:"border-border/50 border-b",children:[n("th",{className:"px-4 py-3 font-semibold",children:"Feature"}),n("th",{className:"px-4 py-3 font-semibold",children:"Canonical"}),n("th",{className:"px-4 py-3 font-semibold",children:"Operational"}),n("th",{className:"px-4 py-3 font-semibold",children:"External"}),n("th",{className:"px-4 py-3 font-semibold",children:"Ephemeral"})]})}),m("tbody",{className:"divide-y divide-border/50",children:[m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Trust Level"}),n("td",{className:"px-4 py-3",children:"Highest"}),n("td",{className:"px-4 py-3",children:"High"}),n("td",{className:"px-4 py-3",children:"Medium"}),n("td",{className:"px-4 py-3",children:"Low"})]}),m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Policy Impact"}),n("td",{className:"px-4 py-3",children:"\u2705 Can drive decisions"}),n("td",{className:"px-4 py-3",children:"\u26A0\uFE0F Can inform"}),n("td",{className:"px-4 py-3",children:"\u274C Reference only"}),n("td",{className:"px-4 py-3",children:"\u274C Never used"})]}),m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Mutability"}),n("td",{className:"px-4 py-3",children:"Immutable"}),n("td",{className:"px-4 py-3",children:"Mutable"}),n("td",{className:"px-4 py-3",children:"Mutable"}),n("td",{className:"px-4 py-3",children:"Temporary"})]}),m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Retention"}),n("td",{className:"px-4 py-3",children:"Permanent"}),n("td",{className:"px-4 py-3",children:"Long-term"}),n("td",{className:"px-4 py-3",children:"Long-term"}),n("td",{className:"px-4 py-3",children:"Short-term"})]}),m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Audit Level"}),n("td",{className:"px-4 py-3",children:"Full audit"}),n("td",{className:"px-4 py-3",children:"Full audit"}),n("td",{className:"px-4 py-3",children:"Basic audit"}),n("td",{className:"px-4 py-3",children:"Minimal audit"})]})]})]})})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Best practices"}),m("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[n("li",{children:"Use canonical for anything that affects policy, pricing, or compliance"}),n("li",{children:"Use operational for context that helps but doesn't dictate decisions"}),n("li",{children:"Use external for reference material that's helpful but not authoritative"}),n("li",{children:"Use ephemeral for temporary working memory that shouldn't persist"}),n("li",{children:"Never mix categories in a single knowledge space - keep them separate"}),n("li",{children:"Document the category and purpose of each knowledge space clearly"})]})]}),m("div",{className:"flex items-center gap-4 pt-4",children:[n(Pl,{href:"/docs/knowledge",className:"btn-ghost",children:"Back to Knowledge"}),m(Pl,{href:"/docs/knowledge/spaces",className:"btn-primary",children:["Knowledge Spaces ",n(Hg,{size:16})]})]})]})}import Tl from"@contractspec/lib.ui-link";import{jsx as xe,jsxs as Wt}from"react/jsx-runtime";function Vg(){return Wt("div",{className:"space-y-8",children:[Wt("div",{className:"space-y-4",children:[xe("h1",{className:"font-bold text-4xl",children:"Knowledge Examples"}),xe("p",{className:"text-muted-foreground",children:"Real-world examples of how different applications use knowledge spaces to power intelligent workflows and agents."})]}),Wt("div",{className:"space-y-6",children:[Wt("div",{className:"space-y-4",children:[xe("h2",{className:"font-bold text-2xl",children:"Example 1: ArtisanOS Support Agent"}),Wt("p",{className:"text-muted-foreground",children:[xe("strong",{children:"Context:"})," ArtisanOS needs a support agent that can answer product questions using official documentation and learn from past support tickets."]}),xe("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:xe("pre",{children:`// Knowledge spaces
3216
+ }`})})]}),n("div",{className:"card-subtle border-red-500/30 bg-red-500/10 p-3",children:m("p",{className:"text-red-300 text-sm",children:[n("strong",{children:"\u26A0\uFE0F Critical:"})," Ephemeral knowledge is never used for policy decisions, compliance checks, or any authoritative purpose."]})})]})]})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Category comparison"}),n("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:m("table",{className:"w-full text-left text-sm",children:[n("thead",{className:"bg-card/50",children:m("tr",{className:"border-border/50 border-b",children:[n("th",{className:"px-4 py-3 font-semibold",children:"Feature"}),n("th",{className:"px-4 py-3 font-semibold",children:"Canonical"}),n("th",{className:"px-4 py-3 font-semibold",children:"Operational"}),n("th",{className:"px-4 py-3 font-semibold",children:"External"}),n("th",{className:"px-4 py-3 font-semibold",children:"Ephemeral"})]})}),m("tbody",{className:"divide-y divide-border/50",children:[m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Trust Level"}),n("td",{className:"px-4 py-3",children:"Highest"}),n("td",{className:"px-4 py-3",children:"High"}),n("td",{className:"px-4 py-3",children:"Medium"}),n("td",{className:"px-4 py-3",children:"Low"})]}),m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Policy Impact"}),n("td",{className:"px-4 py-3",children:"\u2705 Can drive decisions"}),n("td",{className:"px-4 py-3",children:"\u26A0\uFE0F Can inform"}),n("td",{className:"px-4 py-3",children:"\u274C Reference only"}),n("td",{className:"px-4 py-3",children:"\u274C Never used"})]}),m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Mutability"}),n("td",{className:"px-4 py-3",children:"Immutable"}),n("td",{className:"px-4 py-3",children:"Mutable"}),n("td",{className:"px-4 py-3",children:"Mutable"}),n("td",{className:"px-4 py-3",children:"Temporary"})]}),m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Retention"}),n("td",{className:"px-4 py-3",children:"Permanent"}),n("td",{className:"px-4 py-3",children:"Long-term"}),n("td",{className:"px-4 py-3",children:"Long-term"}),n("td",{className:"px-4 py-3",children:"Short-term"})]}),m("tr",{children:[n("td",{className:"px-4 py-3 font-semibold",children:"Audit Level"}),n("td",{className:"px-4 py-3",children:"Full audit"}),n("td",{className:"px-4 py-3",children:"Full audit"}),n("td",{className:"px-4 py-3",children:"Basic audit"}),n("td",{className:"px-4 py-3",children:"Minimal audit"})]})]})]})})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Best practices"}),m("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[n("li",{children:"Use canonical for anything that affects policy, pricing, or compliance"}),n("li",{children:"Use operational for context that helps but doesn't dictate decisions"}),n("li",{children:"Use external for reference material that's helpful but not authoritative"}),n("li",{children:"Use ephemeral for temporary working memory that shouldn't persist"}),n("li",{children:"Never mix categories in a single knowledge space - keep them separate"}),n("li",{children:"Document the category and purpose of each knowledge space clearly"})]})]}),m("div",{className:"flex items-center gap-4 pt-4",children:[n(Pl,{href:"/docs/knowledge",className:"btn-ghost",children:"Back to Knowledge"}),m(Pl,{href:"/docs/knowledge/spaces",className:"btn-primary",children:["Knowledge Spaces ",n(qg,{size:16})]})]})]})}import Tl from"@contractspec/lib.ui-link";import{jsx as xe,jsxs as Wt}from"react/jsx-runtime";function Vg(){return Wt("div",{className:"space-y-8",children:[Wt("div",{className:"space-y-4",children:[xe("h1",{className:"font-bold text-4xl",children:"Knowledge Examples"}),xe("p",{className:"text-muted-foreground",children:"Real-world examples of how different applications use knowledge spaces to power intelligent workflows and agents."})]}),Wt("div",{className:"space-y-6",children:[Wt("div",{className:"space-y-4",children:[xe("h2",{className:"font-bold text-2xl",children:"Example 1: ArtisanOS Support Agent"}),Wt("p",{className:"text-muted-foreground",children:[xe("strong",{children:"Context:"})," ArtisanOS needs a support agent that can answer product questions using official documentation and learn from past support tickets."]}),xe("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:xe("pre",{children:`// Knowledge spaces
3217
3217
  knowledgeSpaces: [
3218
3218
  {
3219
3219
  id: "product-canon",
@@ -3451,7 +3451,7 @@ steps:
3451
3451
  syncPolicy: { manual: true }
3452
3452
  }
3453
3453
  ]
3454
- }`})})]}),le("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Processing pipeline"}),f("p",{className:"text-muted-foreground",children:"When a source is synced, ContractSpec processes it through several stages:"}),le("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground",children:[le("li",{children:[f("strong",{children:"Fetch"})," - Retrieve content from source (API, database, file)"]}),le("li",{children:[f("strong",{children:"Parse"})," - Extract text from documents (PDF, Word, HTML)"]}),le("li",{children:[f("strong",{children:"Chunk"})," - Split into semantic chunks (paragraphs, sections)"]}),le("li",{children:[f("strong",{children:"Embed"})," - Generate vector embeddings (OpenAI, Cohere)"]}),le("li",{children:[f("strong",{children:"Index"})," - Store in vector database (Qdrant) or search engine"]}),le("li",{children:[f("strong",{children:"Audit"})," - Log sync operation and results"]})]})]}),le("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Best practices"}),le("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[f("li",{children:"Use webhooks for real-time sources (Notion, Gmail) to minimize latency"}),f("li",{children:"Set appropriate sync intervals - hourly for active docs, daily for stable content"}),f("li",{children:"Monitor sync failures and set up alerts for critical sources"}),f("li",{children:"Test sources in sandbox before enabling in production"}),f("li",{children:"Document the purpose and ownership of each source for your team"}),f("li",{children:"Use manual sync for sensitive or infrequently updated content"})]})]}),le("div",{className:"flex items-center gap-4 pt-4",children:[f(Al,{href:"/docs/knowledge/spaces",className:"btn-ghost",children:"Previous: Spaces"}),le(Al,{href:"/docs/knowledge/examples",className:"btn-primary",children:["Examples ",f(Yg,{size:16})]})]})]})}import Rl from"@contractspec/lib.ui-link";import{ChevronRight as $g}from"lucide-react";import{jsx as D,jsxs as Ae}from"react/jsx-runtime";function Zg(){return Ae("div",{className:"space-y-8",children:[Ae("div",{className:"space-y-4",children:[D("h1",{className:"font-bold text-4xl",children:"Knowledge Spaces"}),Ae("p",{className:"text-muted-foreground",children:["A ",D("strong",{children:"KnowledgeSpaceSpec"})," defines a logical domain of knowledge with a specific category, storage strategy, and intended audience. Spaces are defined globally and populated per-tenant through knowledge sources."]})]}),Ae("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"KnowledgeSpaceSpec"}),D("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:D("pre",{children:`type KnowledgeSpaceSpec = {
3454
+ }`})})]}),le("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Processing pipeline"}),f("p",{className:"text-muted-foreground",children:"When a source is synced, ContractSpec processes it through several stages:"}),le("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground",children:[le("li",{children:[f("strong",{children:"Fetch"})," - Retrieve content from source (API, database, file)"]}),le("li",{children:[f("strong",{children:"Parse"})," - Extract text from documents (PDF, Word, HTML)"]}),le("li",{children:[f("strong",{children:"Chunk"})," - Split into semantic chunks (paragraphs, sections)"]}),le("li",{children:[f("strong",{children:"Embed"})," - Generate vector embeddings (OpenAI, Cohere)"]}),le("li",{children:[f("strong",{children:"Index"})," - Store in vector database (Qdrant) or search engine"]}),le("li",{children:[f("strong",{children:"Audit"})," - Log sync operation and results"]})]})]}),le("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Best practices"}),le("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[f("li",{children:"Use webhooks for real-time sources (Notion, Gmail) to minimize latency"}),f("li",{children:"Set appropriate sync intervals - hourly for active docs, daily for stable content"}),f("li",{children:"Monitor sync failures and set up alerts for critical sources"}),f("li",{children:"Test sources in sandbox before enabling in production"}),f("li",{children:"Document the purpose and ownership of each source for your team"}),f("li",{children:"Use manual sync for sensitive or infrequently updated content"})]})]}),le("div",{className:"flex items-center gap-4 pt-4",children:[f(Al,{href:"/docs/knowledge/spaces",className:"btn-ghost",children:"Previous: Spaces"}),le(Al,{href:"/docs/knowledge/examples",className:"btn-primary",children:["Examples ",f(Yg,{size:16})]})]})]})}import Rl from"@contractspec/lib.ui-link";import{ChevronRight as Zg}from"lucide-react";import{jsx as E,jsxs as Ae}from"react/jsx-runtime";function $g(){return Ae("div",{className:"space-y-8",children:[Ae("div",{className:"space-y-4",children:[E("h1",{className:"font-bold text-4xl",children:"Knowledge Spaces"}),Ae("p",{className:"text-muted-foreground",children:["A ",E("strong",{children:"KnowledgeSpaceSpec"})," defines a logical domain of knowledge with a specific category, storage strategy, and intended audience. Spaces are defined globally and populated per-tenant through knowledge sources."]})]}),Ae("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"KnowledgeSpaceSpec"}),E("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:E("pre",{children:`type KnowledgeSpaceSpec = {
3455
3455
  id: string;
3456
3456
  label: string;
3457
3457
  description: string;
@@ -3476,7 +3476,7 @@ steps:
3476
3476
  owner?: string;
3477
3477
  createdAt: string;
3478
3478
  updatedAt: string;
3479
- };`})})]}),Ae("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Common knowledge spaces"}),Ae("div",{className:"space-y-6",children:[Ae("div",{className:"card-subtle p-4",children:[D("h3",{className:"mb-2 font-semibold text-lg",children:"Product Canon"}),D("div",{className:"overflow-x-auto rounded border border-border bg-background/50 p-3 font-mono text-muted-foreground text-xs",children:D("pre",{children:`{
3479
+ };`})})]}),Ae("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Common knowledge spaces"}),Ae("div",{className:"space-y-6",children:[Ae("div",{className:"card-subtle p-4",children:[E("h3",{className:"mb-2 font-semibold text-lg",children:"Product Canon"}),E("div",{className:"overflow-x-auto rounded border border-border bg-background/50 p-3 font-mono text-muted-foreground text-xs",children:E("pre",{children:`{
3480
3480
  id: "product-canon",
3481
3481
  label: "Product Canon",
3482
3482
  description: "Official product specifications and schemas",
@@ -3486,7 +3486,7 @@ steps:
3486
3486
  indexProvider: "qdrant",
3487
3487
  vectorDimensions: 1536,
3488
3488
  retentionPolicy: { versions: 10 }
3489
- }`})}),Ae("p",{className:"mt-2 text-muted-foreground text-sm",children:[D("strong",{children:"Use cases:"})," Invoice generation, quote creation, product recommendations, schema validation"]})]}),Ae("div",{className:"card-subtle p-4",children:[D("h3",{className:"mb-2 font-semibold text-lg",children:"Support History"}),D("div",{className:"overflow-x-auto rounded border border-border bg-background/50 p-3 font-mono text-muted-foreground text-xs",children:D("pre",{children:`{
3489
+ }`})}),Ae("p",{className:"mt-2 text-muted-foreground text-sm",children:[E("strong",{children:"Use cases:"})," Invoice generation, quote creation, product recommendations, schema validation"]})]}),Ae("div",{className:"card-subtle p-4",children:[E("h3",{className:"mb-2 font-semibold text-lg",children:"Support History"}),E("div",{className:"overflow-x-auto rounded border border-border bg-background/50 p-3 font-mono text-muted-foreground text-xs",children:E("pre",{children:`{
3490
3490
  id: "support-history",
3491
3491
  label: "Support History",
3492
3492
  description: "Past support tickets and resolutions",
@@ -3496,7 +3496,7 @@ steps:
3496
3496
  indexProvider: "qdrant",
3497
3497
  vectorDimensions: 1536,
3498
3498
  retentionPolicy: { days: 365 }
3499
- }`})}),Ae("p",{className:"mt-2 text-muted-foreground text-sm",children:[D("strong",{children:"Use cases:"})," Customer support, troubleshooting, similar issue detection"]})]}),Ae("div",{className:"card-subtle p-4",children:[D("h3",{className:"mb-2 font-semibold text-lg",children:"External Provider Docs"}),D("div",{className:"overflow-x-auto rounded border border-border bg-background/50 p-3 font-mono text-muted-foreground text-xs",children:D("pre",{children:`{
3499
+ }`})}),Ae("p",{className:"mt-2 text-muted-foreground text-sm",children:[E("strong",{children:"Use cases:"})," Customer support, troubleshooting, similar issue detection"]})]}),Ae("div",{className:"card-subtle p-4",children:[E("h3",{className:"mb-2 font-semibold text-lg",children:"External Provider Docs"}),E("div",{className:"overflow-x-auto rounded border border-border bg-background/50 p-3 font-mono text-muted-foreground text-xs",children:E("pre",{children:`{
3500
3500
  id: "provider-docs",
3501
3501
  label: "External Provider Docs",
3502
3502
  description: "Third-party integration documentation",
@@ -3505,7 +3505,7 @@ steps:
3505
3505
  storageStrategy: "search",
3506
3506
  indexProvider: "elasticsearch",
3507
3507
  retentionPolicy: { days: 90 }
3508
- }`})}),Ae("p",{className:"mt-2 text-muted-foreground text-sm",children:[D("strong",{children:"Use cases:"})," Integration help, API reference, troubleshooting external services"]})]}),Ae("div",{className:"card-subtle p-4",children:[D("h3",{className:"mb-2 font-semibold text-lg",children:"Agent Scratchpad"}),D("div",{className:"overflow-x-auto rounded border border-border bg-background/50 p-3 font-mono text-muted-foreground text-xs",children:D("pre",{children:`{
3508
+ }`})}),Ae("p",{className:"mt-2 text-muted-foreground text-sm",children:[E("strong",{children:"Use cases:"})," Integration help, API reference, troubleshooting external services"]})]}),Ae("div",{className:"card-subtle p-4",children:[E("h3",{className:"mb-2 font-semibold text-lg",children:"Agent Scratchpad"}),E("div",{className:"overflow-x-auto rounded border border-border bg-background/50 p-3 font-mono text-muted-foreground text-xs",children:E("pre",{children:`{
3509
3509
  id: "agent-scratchpad",
3510
3510
  label: "Agent Scratchpad",
3511
3511
  description: "Temporary agent working memory",
@@ -3515,7 +3515,7 @@ steps:
3515
3515
  indexProvider: "qdrant",
3516
3516
  vectorDimensions: 1536,
3517
3517
  retentionPolicy: { days: 1 }
3518
- }`})}),Ae("p",{className:"mt-2 text-muted-foreground text-sm",children:[D("strong",{children:"Use cases:"})," Conversation continuity, intermediate calculations, session state"]})]})]})]}),Ae("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Storage strategies"}),D("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Ae("table",{className:"w-full text-left text-sm",children:[D("thead",{className:"bg-card/50",children:Ae("tr",{className:"border-border/50 border-b",children:[D("th",{className:"px-4 py-3 font-semibold",children:"Strategy"}),D("th",{className:"px-4 py-3 font-semibold",children:"Best For"}),D("th",{className:"px-4 py-3 font-semibold",children:"Providers"})]})}),Ae("tbody",{className:"divide-y divide-border/50",children:[Ae("tr",{children:[D("td",{className:"px-4 py-3 font-mono text-xs",children:"vector"}),D("td",{className:"px-4 py-3",children:"Semantic search, RAG, similarity matching"}),D("td",{className:"px-4 py-3",children:"Qdrant, Pinecone, Weaviate"})]}),Ae("tr",{children:[D("td",{className:"px-4 py-3 font-mono text-xs",children:"search"}),D("td",{className:"px-4 py-3",children:"Keyword search, exact matching, filtering"}),D("td",{className:"px-4 py-3",children:"Elasticsearch, Algolia"})]}),Ae("tr",{children:[D("td",{className:"px-4 py-3 font-mono text-xs",children:"hybrid"}),D("td",{className:"px-4 py-3",children:"Combined semantic + keyword search"}),D("td",{className:"px-4 py-3",children:"Qdrant + Elasticsearch"})]})]})]})})]}),Ae("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Best practices"}),Ae("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[D("li",{children:"Choose storage strategy based on query patterns - use vector for semantic, search for exact"}),D("li",{children:"Set appropriate retention policies - canonical is permanent, ephemeral is short-lived"}),D("li",{children:"Use consistent vector dimensions across spaces that will be queried together"}),D("li",{children:"Document the intended audience and use cases for each space"}),D("li",{children:"Monitor space size and query performance - add sharding if needed"})]})]}),Ae("div",{className:"flex items-center gap-4 pt-4",children:[D(Rl,{href:"/docs/knowledge/categories",className:"btn-ghost",children:"Previous: Categories"}),Ae(Rl,{href:"/docs/knowledge/sources",className:"btn-primary",children:["Knowledge Sources ",D($g,{size:16})]})]})]})}import{CodeBlock as Ll,InstallCommand as Xg}from"@contractspec/lib.design-system";import El from"@contractspec/lib.ui-link";import{ChevronRight as xg}from"lucide-react";import{jsx as Be,jsxs as At}from"react/jsx-runtime";function jg(){return At("div",{className:"space-y-8",children:[At("div",{className:"space-y-4",children:[Be("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.accessibility"}),Be("p",{className:"text-muted-foreground",children:"Stable exports of accessibility primitives for LSSM web apps, ensuring WCAG compliance and inclusive design."})]}),At("div",{className:"space-y-4",children:[Be("h2",{className:"font-bold text-2xl",children:"Installation"}),Be(Xg,{package:"@contractspec/lib.accessibility"})]}),At("div",{className:"space-y-4",children:[Be("h2",{className:"font-bold text-2xl",children:"Exports"}),At("ul",{className:"space-y-2 text-muted-foreground",children:[At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"SkipLink"}),": A link to skip navigation, visible on focus"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"VisuallyHidden"}),": Hide content visually but keep it for screen readers"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"SRLiveRegionProvider"}),","," ",Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"useSRLiveRegion"}),": Manage live region announcements"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"RouteAnnouncer"}),": Announce page title/path changes on navigation"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"FocusOnRouteChange"}),": Reset focus to body or main content on navigation"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"useReducedMotion"}),": Detect if the user prefers reduced motion"]})]})]}),At("div",{className:"space-y-4",children:[Be("h2",{className:"font-bold text-2xl",children:"Example: App Setup"}),Be(Ll,{language:"tsx",code:`import {
3518
+ }`})}),Ae("p",{className:"mt-2 text-muted-foreground text-sm",children:[E("strong",{children:"Use cases:"})," Conversation continuity, intermediate calculations, session state"]})]})]})]}),Ae("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Storage strategies"}),E("div",{className:"overflow-x-auto rounded-lg border border-border/50",children:Ae("table",{className:"w-full text-left text-sm",children:[E("thead",{className:"bg-card/50",children:Ae("tr",{className:"border-border/50 border-b",children:[E("th",{className:"px-4 py-3 font-semibold",children:"Strategy"}),E("th",{className:"px-4 py-3 font-semibold",children:"Best For"}),E("th",{className:"px-4 py-3 font-semibold",children:"Providers"})]})}),Ae("tbody",{className:"divide-y divide-border/50",children:[Ae("tr",{children:[E("td",{className:"px-4 py-3 font-mono text-xs",children:"vector"}),E("td",{className:"px-4 py-3",children:"Semantic search, RAG, similarity matching"}),E("td",{className:"px-4 py-3",children:"Qdrant, Pinecone, Weaviate"})]}),Ae("tr",{children:[E("td",{className:"px-4 py-3 font-mono text-xs",children:"search"}),E("td",{className:"px-4 py-3",children:"Keyword search, exact matching, filtering"}),E("td",{className:"px-4 py-3",children:"Elasticsearch, Algolia"})]}),Ae("tr",{children:[E("td",{className:"px-4 py-3 font-mono text-xs",children:"hybrid"}),E("td",{className:"px-4 py-3",children:"Combined semantic + keyword search"}),E("td",{className:"px-4 py-3",children:"Qdrant + Elasticsearch"})]})]})]})})]}),Ae("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Best practices"}),Ae("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[E("li",{children:"Choose storage strategy based on query patterns - use vector for semantic, search for exact"}),E("li",{children:"Set appropriate retention policies - canonical is permanent, ephemeral is short-lived"}),E("li",{children:"Use consistent vector dimensions across spaces that will be queried together"}),E("li",{children:"Document the intended audience and use cases for each space"}),E("li",{children:"Monitor space size and query performance - add sharding if needed"})]})]}),Ae("div",{className:"flex items-center gap-4 pt-4",children:[E(Rl,{href:"/docs/knowledge/categories",className:"btn-ghost",children:"Previous: Categories"}),Ae(Rl,{href:"/docs/knowledge/sources",className:"btn-primary",children:["Knowledge Sources ",E(Zg,{size:16})]})]})]})}import{CodeBlock as Ll,InstallCommand as Xg}from"@contractspec/lib.design-system";import Dl from"@contractspec/lib.ui-link";import{ChevronRight as xg}from"lucide-react";import{jsx as Be,jsxs as At}from"react/jsx-runtime";function jg(){return At("div",{className:"space-y-8",children:[At("div",{className:"space-y-4",children:[Be("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.accessibility"}),Be("p",{className:"text-muted-foreground",children:"Stable exports of accessibility primitives for LSSM web apps, ensuring WCAG compliance and inclusive design."})]}),At("div",{className:"space-y-4",children:[Be("h2",{className:"font-bold text-2xl",children:"Installation"}),Be(Xg,{package:"@contractspec/lib.accessibility"})]}),At("div",{className:"space-y-4",children:[Be("h2",{className:"font-bold text-2xl",children:"Exports"}),At("ul",{className:"space-y-2 text-muted-foreground",children:[At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"SkipLink"}),": A link to skip navigation, visible on focus"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"VisuallyHidden"}),": Hide content visually but keep it for screen readers"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"SRLiveRegionProvider"}),","," ",Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"useSRLiveRegion"}),": Manage live region announcements"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"RouteAnnouncer"}),": Announce page title/path changes on navigation"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"FocusOnRouteChange"}),": Reset focus to body or main content on navigation"]}),At("li",{children:[Be("code",{className:"rounded bg-background/50 px-2 py-1",children:"useReducedMotion"}),": Detect if the user prefers reduced motion"]})]})]}),At("div",{className:"space-y-4",children:[Be("h2",{className:"font-bold text-2xl",children:"Example: App Setup"}),Be(Ll,{language:"tsx",code:`import {
3519
3519
  SRLiveRegionProvider,
3520
3520
  RouteAnnouncer,
3521
3521
  SkipLink
@@ -3546,7 +3546,7 @@ export function TodoList() {
3546
3546
  };
3547
3547
 
3548
3548
  return <button onClick={addTodo}>Add Todo</button>;
3549
- }`})]}),At("div",{className:"space-y-4",children:[Be("h2",{className:"font-bold text-2xl",children:"WCAG Compliance"}),At("p",{className:"text-muted-foreground",children:["These components map directly to WCAG 2.1 Level AA requirements documented in ",Be("code",{children:"docs/accessibility_wcag_compliance_specs.md"}),":"]}),At("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Be("li",{children:"2.4.1 Bypass Blocks (SkipLink)"}),Be("li",{children:"4.1.3 Status Messages (LiveRegion)"}),Be("li",{children:"2.4.3 Focus Order (FocusOnRouteChange)"}),Be("li",{children:"2.3.3 Animation from Interactions (useReducedMotion)"})]})]}),At("div",{className:"flex items-center gap-4 pt-4",children:[Be(El,{href:"/docs/libraries/design-system",className:"btn-ghost",children:"Previous: Design System"}),At(El,{href:"/docs/libraries",className:"btn-primary",children:["Back to Libraries ",Be(xg,{size:16})]})]})]})}import{CodeBlock as Dl,InstallCommand as ef}from"@contractspec/lib.design-system";import Ol from"@contractspec/lib.ui-link";import{ChevronRight as tf}from"lucide-react";import{jsx as Rt,jsxs as Qa}from"react/jsx-runtime";function af(){return Qa("div",{className:"space-y-8",children:[Qa("div",{className:"space-y-4",children:[Rt("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ai-agent"}),Rt("p",{className:"text-lg text-muted-foreground",children:"Define AI agents in TypeScript, run them with deterministic tool calling, capture working memory, and route low-confidence decisions to human reviewers."})]}),Qa("div",{className:"space-y-4",children:[Rt("h2",{className:"font-bold text-2xl",children:"Installation"}),Rt(ef,{package:"@contractspec/lib.ai-agent"})]}),Qa("div",{className:"space-y-3",children:[Rt("h2",{className:"font-bold text-2xl",children:"Define & register"}),Rt(Dl,{language:"typescript",code:`import { defineAgent, AgentRegistry } from '@contractspec/lib.contracts-spec/agent';
3549
+ }`})]}),At("div",{className:"space-y-4",children:[Be("h2",{className:"font-bold text-2xl",children:"WCAG Compliance"}),At("p",{className:"text-muted-foreground",children:["These components map directly to WCAG 2.1 Level AA requirements documented in ",Be("code",{children:"docs/accessibility_wcag_compliance_specs.md"}),":"]}),At("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Be("li",{children:"2.4.1 Bypass Blocks (SkipLink)"}),Be("li",{children:"4.1.3 Status Messages (LiveRegion)"}),Be("li",{children:"2.4.3 Focus Order (FocusOnRouteChange)"}),Be("li",{children:"2.3.3 Animation from Interactions (useReducedMotion)"})]})]}),At("div",{className:"flex items-center gap-4 pt-4",children:[Be(Dl,{href:"/docs/libraries/design-system",className:"btn-ghost",children:"Previous: Design System"}),At(Dl,{href:"/docs/libraries",className:"btn-primary",children:["Back to Libraries ",Be(xg,{size:16})]})]})]})}import{CodeBlock as El,InstallCommand as ef}from"@contractspec/lib.design-system";import Ol from"@contractspec/lib.ui-link";import{ChevronRight as tf}from"lucide-react";import{jsx as Rt,jsxs as Qa}from"react/jsx-runtime";function af(){return Qa("div",{className:"space-y-8",children:[Qa("div",{className:"space-y-4",children:[Rt("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ai-agent"}),Rt("p",{className:"text-lg text-muted-foreground",children:"Define AI agents in TypeScript, run them with deterministic tool calling, capture working memory, and route low-confidence decisions to human reviewers."})]}),Qa("div",{className:"space-y-4",children:[Rt("h2",{className:"font-bold text-2xl",children:"Installation"}),Rt(ef,{package:"@contractspec/lib.ai-agent"})]}),Qa("div",{className:"space-y-3",children:[Rt("h2",{className:"font-bold text-2xl",children:"Define & register"}),Rt(El,{language:"typescript",code:`import { defineAgent, AgentRegistry } from '@contractspec/lib.contracts-spec/agent';
3550
3550
 
3551
3551
  const SupportBot = defineAgent({
3552
3552
  meta: {
@@ -3565,7 +3565,7 @@ const SupportBot = defineAgent({
3565
3565
  },
3566
3566
  });
3567
3567
 
3568
- const registry = new AgentRegistry().register(SupportBot);`})]}),Qa("div",{className:"space-y-3",children:[Rt("h2",{className:"font-bold text-2xl",children:"Run with approvals"}),Rt(Dl,{language:"typescript",code:`import { createUnifiedAgent, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
3568
+ const registry = new AgentRegistry().register(SupportBot);`})]}),Qa("div",{className:"space-y-3",children:[Rt("h2",{className:"font-bold text-2xl",children:"Run with approvals"}),Rt(El,{language:"typescript",code:`import { createUnifiedAgent, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
3569
3569
 
3570
3570
  const approvals = new ApprovalWorkflow();
3571
3571
  const agent = createUnifiedAgent(SupportBot, {
@@ -3575,7 +3575,7 @@ const agent = createUnifiedAgent(SupportBot, {
3575
3575
 
3576
3576
  const result = await agent.run(ticket.body);
3577
3577
  // Route low-confidence or manual-review flows through approvals when needed.
3578
- `})]}),Qa("div",{className:"space-y-3",children:[Rt("h2",{className:"font-bold text-2xl",children:"What's inside"}),Qa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Qa("li",{children:[Rt("code",{children:"createUnifiedAgent"}),", ",Rt("code",{children:"ContractSpecAgent"}),","," ",Rt("code",{children:"UnifiedAgent"})]}),Rt("li",{children:"MCP, operation-backed, memory, and subagent tool adapters"}),Qa("li",{children:[Rt("code",{children:"InMemoryAgentMemory"})," plus interfaces for custom stores"]}),Qa("li",{children:[Rt("code",{children:"ApprovalWorkflow"})," + ",Rt("code",{children:"ApprovalStore"})," for human-in-the-loop reviews"]})]})]}),Qa("div",{className:"flex items-center gap-4 pt-4",children:[Rt(Ol,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Qa(Ol,{href:"/docs/libraries/support-bot",className:"btn-primary",children:["Next: Support Bot ",Rt(tf,{size:16})]})]})]})}import{CodeBlock as dn,InstallCommand as of}from"@contractspec/lib.design-system";import{jsx as vo,jsxs as Ei}from"react/jsx-runtime";function rf(){return Ei("div",{className:"space-y-8",children:[Ei("div",{className:"space-y-4",children:[vo("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.analytics"}),vo("p",{className:"text-lg text-muted-foreground",children:"Work directly with telemetry events to understand conversion, retention, churn, and growth opportunities."})]}),Ei("div",{className:"space-y-4",children:[vo("h2",{className:"font-bold text-2xl",children:"Installation"}),vo(of,{package:"@contractspec/lib.analytics"})]}),Ei("div",{className:"space-y-3",children:[vo("h2",{className:"font-bold text-2xl",children:"Funnels in memory"}),vo(dn,{language:"typescript",code:`import { FunnelAnalyzer } from '@contractspec/lib.analytics/funnel';
3578
+ `})]}),Qa("div",{className:"space-y-3",children:[Rt("h2",{className:"font-bold text-2xl",children:"What's inside"}),Qa("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Qa("li",{children:[Rt("code",{children:"createUnifiedAgent"}),", ",Rt("code",{children:"ContractSpecAgent"}),","," ",Rt("code",{children:"UnifiedAgent"})]}),Rt("li",{children:"MCP, operation-backed, memory, and subagent tool adapters"}),Qa("li",{children:[Rt("code",{children:"InMemoryAgentMemory"})," plus interfaces for custom stores"]}),Qa("li",{children:[Rt("code",{children:"ApprovalWorkflow"})," + ",Rt("code",{children:"ApprovalStore"})," for human-in-the-loop reviews"]})]})]}),Qa("div",{className:"flex items-center gap-4 pt-4",children:[Rt(Ol,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Qa(Ol,{href:"/docs/libraries/support-bot",className:"btn-primary",children:["Next: Support Bot ",Rt(tf,{size:16})]})]})]})}import{CodeBlock as dn,InstallCommand as of}from"@contractspec/lib.design-system";import{jsx as vo,jsxs as Di}from"react/jsx-runtime";function rf(){return Di("div",{className:"space-y-8",children:[Di("div",{className:"space-y-4",children:[vo("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.analytics"}),vo("p",{className:"text-lg text-muted-foreground",children:"Work directly with telemetry events to understand conversion, retention, churn, and growth opportunities."})]}),Di("div",{className:"space-y-4",children:[vo("h2",{className:"font-bold text-2xl",children:"Installation"}),vo(of,{package:"@contractspec/lib.analytics"})]}),Di("div",{className:"space-y-3",children:[vo("h2",{className:"font-bold text-2xl",children:"Funnels in memory"}),vo(dn,{language:"typescript",code:`import { FunnelAnalyzer } from '@contractspec/lib.analytics/funnel';
3579
3579
 
3580
3580
  const analyzer = new FunnelAnalyzer();
3581
3581
  const report = analyzer.analyze(events, {
@@ -3585,11 +3585,11 @@ const report = analyzer.analyze(events, {
3585
3585
  { id: 'submit', eventName: 'signup.submit' },
3586
3586
  { id: 'verified', eventName: 'account.verified' },
3587
3587
  ],
3588
- });`})]}),Ei("div",{className:"space-y-3",children:[vo("h2",{className:"font-bold text-2xl",children:"Cohorts & churn"}),vo(dn,{language:"typescript",code:`import { CohortTracker } from '@contractspec/lib.analytics/cohort';
3588
+ });`})]}),Di("div",{className:"space-y-3",children:[vo("h2",{className:"font-bold text-2xl",children:"Cohorts & churn"}),vo(dn,{language:"typescript",code:`import { CohortTracker } from '@contractspec/lib.analytics/cohort';
3589
3589
  import { ChurnPredictor } from '@contractspec/lib.analytics/churn';
3590
3590
 
3591
3591
  const cohorts = new CohortTracker().analyze(events, { bucket: 'week', periods: 8 });
3592
- const churn = new ChurnPredictor().score(events);`})]}),Ei("div",{className:"space-y-3",children:[vo("h2",{className:"font-bold text-2xl",children:"Growth hypotheses"}),vo(dn,{language:"typescript",code:`import { GrowthHypothesisGenerator } from '@contractspec/lib.analytics/growth';
3592
+ const churn = new ChurnPredictor().score(events);`})]}),Di("div",{className:"space-y-3",children:[vo("h2",{className:"font-bold text-2xl",children:"Growth hypotheses"}),vo(dn,{language:"typescript",code:`import { GrowthHypothesisGenerator } from '@contractspec/lib.analytics/growth';
3593
3593
 
3594
3594
  const ideas = new GrowthHypothesisGenerator().generate([
3595
3595
  { name: 'Activation rate', current: 0.42, previous: 0.55, target: 0.6 },
@@ -3674,7 +3674,7 @@ tracker.recordSample({
3674
3674
  onAlert: ({ tenantId, total }) => notifyFinance(tenantId, total),
3675
3675
  });
3676
3676
 
3677
- tracker.getTotals({ tenantId: 'acme' }).forEach((summary) => budgets.track(summary));`})]}),No("div",{className:"space-y-4",children:[Ya("h2",{className:"font-bold text-2xl",children:"Optimization Suggestions"}),No("p",{className:"text-muted-foreground text-sm",children:["Feed summaries into ",Ya("code",{children:"OptimizationRecommender"})," to surface N+1 queries, compute-heavy steps, or expensive external calls. Store the generated suggestions in the new Prisma model to power Ops playbooks."]})]}),No("div",{className:"flex items-center gap-4 pt-4",children:[Ya(Ul,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),No(Ul,{href:"/docs/libraries/slo",className:"btn-primary",children:["Next: SLO ",Ya(hf,{size:16})]})]})]})}var Wl=[{title:"@contractspec/lib.presentation-runtime-core",body:"Shared state, table models, workflow logic, visualization helpers, and the alias helpers consumed by web and native builds."},{title:"@contractspec/lib.presentation-runtime-react",body:"React-facing hooks such as useContractTable, useDataViewTable, and useWorkflow. This is the shared hook surface most product code starts from."},{title:"@contractspec/lib.presentation-runtime-react-native",body:"Native entrypoint for mobile apps. It re-exports the shared table and data-view hooks so the controller API stays aligned with the React package."},{title:"@contractspec/lib.ui-kit-web",body:"Browser-first primitives and accessibility helpers. Reach for this layer when you want direct control over the web renderer."},{title:"@contractspec/lib.ui-kit",body:"Native-first primitives for Expo and React Native. Reach for this layer when the render surface should stay mobile-native."},{title:"@contractspec/lib.design-system",body:"Composed components, ThemeSpec/TranslationSpec-aware controls, token helpers, and paired web/mobile implementations that sit on top of both UI kits."}],_l=[{title:"useContractTable",body:"Use this when your rows and column definitions already live in product code and you want one headless controller for sorting, pagination, selection, visibility, pinning, sizing, and expansion."},{title:"useDataViewTable",body:"Use this when the table should stay driven by a DataViewSpec instead of hand-authored columns. It adapts the spec to the same generic controller model."},{title:"Native re-export boundary",body:"On native apps, import the same hook names from @contractspec/lib.presentation-runtime-react-native when you want the import path itself to signal a mobile boundary."}],zl=[{title:"Next.js / Turbopack",body:"Use withPresentationTurbopackAliases as the default path in current Next.js apps. It patches nextConfig.turbopack instead of mutating a webpack config object."},{title:"Next.js / Webpack fallback",body:"Use withPresentationWebpackAliases only when a Next.js app explicitly opts back into webpack via the CLI flags."},{title:"Expo / Metro",body:"Use withPresentationMetroAliases on Metro when native platforms should resolve web ui-kit /ui imports and the shared React runtime root to native implementations."}],Gl=[{title:"withPlatformUI",body:"Use this lightweight adapter when a design-system surface needs one object that carries the current platform, tokens, and breakpoints."},{title:"mapTokensForPlatform",body:"Use this when resolved tokens need to be mapped into platform-specific token shapes before the final renderer consumes them."}],Hl=[{title:"What Webpack remaps",items:["@contractspec/lib.ui-kit -> @contractspec/lib.ui-kit-web","@contractspec/lib.presentation-runtime-react-native -> @contractspec/lib.presentation-runtime-react","Prepends .web.js, .web.jsx, .web.ts, and .web.tsx to webpack resolve.extensions"]},{title:"What Turbopack remaps",items:["@contractspec/lib.ui-kit -> @contractspec/lib.ui-kit-web","@contractspec/lib.presentation-runtime-react-native -> @contractspec/lib.presentation-runtime-react","Initializes or merges turbopack.resolveExtensions with a web-first extension list"]},{title:"What Metro remaps",items:["@contractspec/lib.ui-kit-web/ui/* -> @contractspec/lib.ui-kit/ui/* on ios/android/native/mobile","Root @contractspec/lib.presentation-runtime-react -> @contractspec/lib.presentation-runtime-react-native","Enables package exports and expands platform resolution ordering"]}],ql=["Set gap, align, justify, and wrap explicitly in shared code because defaults are not identical between web and native.","Shared-safe subset: VStack, HStack, and Box with className, gap, align, justify, and wrap.","Web-only feature: as lets stack primitives emit semantic elements such as section, header, main, or article.","Native-only extras: spacing, width, and padding exist on the native stack primitives and should stay out of shared renderer code.","HStack and Box reverse-wrap tokens differ: wrapReverse on web, reverse on native. Prefer nowrap or wrap in shared code.","Box defaults to nowrap on web and wrap on native, so shared code should set wrap intentionally."],Vl=["withPresentationNextAliases no longer exists. Use withPresentationTurbopackAliases for the default Next.js path or withPresentationWebpackAliases for explicit webpack fallback.","Prefer root runtime imports when alias helpers matter. Metro remaps the root @contractspec/lib.presentation-runtime-react package, not arbitrary deep hook subpaths.","Metro only rewrites @contractspec/lib.ui-kit-web/ui/* imports. Router-specific web packages and other web-only helpers still need platform-aware imports.","presentation-runtime-core is headless. It owns models and config helpers, not rendered React components.","design-system compatibility comes from paired .tsx / .mobile.tsx implementations and token helpers such as withPlatformUI and mapTokensForPlatform.","Form controls should come from @contractspec/lib.design-system when product code needs ThemeSpec or TranslationSpec support.","Stack primitives are similar across platforms, but the prop surface is not identical. Stay inside the common subset for shared renderers.","Alias helpers solve module resolution only. They do not replace app-level monorepo watchFolders, Expo Router setup, or other Next configuration."],Fl="Copy these markdown snippets into your own AGENTS.md, LLM guide, README, or engineering playbook when you want to enforce the same cross-surface rules across customer projects.",Kl=`import { withPresentationTurbopackAliases } from '@contractspec/lib.presentation-runtime-core';
3677
+ tracker.getTotals({ tenantId: 'acme' }).forEach((summary) => budgets.track(summary));`})]}),No("div",{className:"space-y-4",children:[Ya("h2",{className:"font-bold text-2xl",children:"Optimization Suggestions"}),No("p",{className:"text-muted-foreground text-sm",children:["Feed summaries into ",Ya("code",{children:"OptimizationRecommender"})," to surface N+1 queries, compute-heavy steps, or expensive external calls. Store the generated suggestions in the new Prisma model to power Ops playbooks."]})]}),No("div",{className:"flex items-center gap-4 pt-4",children:[Ya(Ul,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),No(Ul,{href:"/docs/libraries/slo",className:"btn-primary",children:["Next: SLO ",Ya(hf,{size:16})]})]})]})}var Wl=[{title:"@contractspec/lib.presentation-runtime-core",body:"Shared state, table models, workflow logic, visualization helpers, and the alias helpers consumed by web and native builds."},{title:"@contractspec/lib.presentation-runtime-react",body:"React-facing hooks such as useContractTable, useDataViewTable, and useWorkflow. This is the shared hook surface most product code starts from."},{title:"@contractspec/lib.presentation-runtime-react-native",body:"Native entrypoint for mobile apps. It re-exports the shared table and data-view hooks so the controller API stays aligned with the React package."},{title:"@contractspec/lib.ui-kit-web",body:"Browser-first primitives and accessibility helpers. Reach for this layer when you want direct control over the web renderer."},{title:"@contractspec/lib.ui-kit",body:"Native-first primitives for Expo and React Native. Reach for this layer when the render surface should stay mobile-native."},{title:"@contractspec/lib.design-system",body:"Composed components, ThemeSpec/TranslationSpec-aware controls, token helpers, and paired web/mobile implementations that sit on top of both UI kits."}],_l=[{title:"useContractTable",body:"Use this when your rows and column definitions already live in product code and you want one headless controller for sorting, pagination, selection, visibility, pinning, sizing, and expansion."},{title:"useDataViewTable",body:"Use this when the table should stay driven by a DataViewSpec instead of hand-authored columns. It adapts the spec to the same generic controller model."},{title:"Native re-export boundary",body:"On native apps, import the same hook names from @contractspec/lib.presentation-runtime-react-native when you want the import path itself to signal a mobile boundary."}],zl=[{title:"Next.js / Turbopack",body:"Use withPresentationTurbopackAliases as the default path in current Next.js apps. It patches nextConfig.turbopack instead of mutating a webpack config object."},{title:"Next.js / Webpack fallback",body:"Use withPresentationWebpackAliases only when a Next.js app explicitly opts back into webpack via the CLI flags."},{title:"Expo / Metro",body:"Use withPresentationMetroAliases on Metro when native platforms should resolve web ui-kit /ui imports and the shared React runtime root to native implementations."}],Gl=[{title:"withPlatformUI",body:"Use this lightweight adapter when a design-system surface needs one object that carries the current platform, tokens, and breakpoints."},{title:"mapTokensForPlatform",body:"Use this when resolved tokens need to be mapped into platform-specific token shapes before the final renderer consumes them."}],ql=[{title:"What Webpack remaps",items:["@contractspec/lib.ui-kit -> @contractspec/lib.ui-kit-web","@contractspec/lib.presentation-runtime-react-native -> @contractspec/lib.presentation-runtime-react","Prepends .web.js, .web.jsx, .web.ts, and .web.tsx to webpack resolve.extensions"]},{title:"What Turbopack remaps",items:["@contractspec/lib.ui-kit -> @contractspec/lib.ui-kit-web","@contractspec/lib.presentation-runtime-react-native -> @contractspec/lib.presentation-runtime-react","Initializes or merges turbopack.resolveExtensions with a web-first extension list"]},{title:"What Metro remaps",items:["@contractspec/lib.ui-kit-web/ui/* -> @contractspec/lib.ui-kit/ui/* on ios/android/native/mobile","Root @contractspec/lib.presentation-runtime-react -> @contractspec/lib.presentation-runtime-react-native","Enables package exports and expands platform resolution ordering"]}],Hl=["Set gap, align, justify, and wrap explicitly in shared code because defaults are not identical between web and native.","Shared-safe subset: VStack, HStack, and Box with className, gap, align, justify, and wrap.","Web-only feature: as lets stack primitives emit semantic elements such as section, header, main, or article.","Native-only extras: spacing, width, and padding exist on the native stack primitives and should stay out of shared renderer code.","HStack and Box reverse-wrap tokens differ: wrapReverse on web, reverse on native. Prefer nowrap or wrap in shared code.","Box defaults to nowrap on web and wrap on native, so shared code should set wrap intentionally."],Vl=["withPresentationNextAliases no longer exists. Use withPresentationTurbopackAliases for the default Next.js path or withPresentationWebpackAliases for explicit webpack fallback.","Prefer root runtime imports when alias helpers matter. Metro remaps the root @contractspec/lib.presentation-runtime-react package, not arbitrary deep hook subpaths.","Metro only rewrites @contractspec/lib.ui-kit-web/ui/* imports. Router-specific web packages and other web-only helpers still need platform-aware imports.","presentation-runtime-core is headless. It owns models and config helpers, not rendered React components.","design-system compatibility comes from paired .tsx / .mobile.tsx implementations and token helpers such as withPlatformUI and mapTokensForPlatform.","Form controls should come from @contractspec/lib.design-system when product code needs ThemeSpec or TranslationSpec support.","Stack primitives are similar across platforms, but the prop surface is not identical. Stay inside the common subset for shared renderers.","Alias helpers solve module resolution only. They do not replace app-level monorepo watchFolders, Expo Router setup, or other Next configuration."],Fl="Copy these markdown snippets into your own AGENTS.md, LLM guide, README, or engineering playbook when you want to enforce the same cross-surface rules across customer projects.",Kl=`import { withPresentationTurbopackAliases } from '@contractspec/lib.presentation-runtime-core';
3678
3678
 
3679
3679
  /** @type {import('next').NextConfig} */
3680
3680
  const nextConfig = withPresentationTurbopackAliases({
@@ -3701,7 +3701,7 @@ const projectRoot = __dirname;
3701
3701
  const config = getDefaultConfig(projectRoot);
3702
3702
 
3703
3703
  module.exports = withPresentationMetroAliases(config);`,Jl=["import {"," defaultTokens,"," mapTokensForPlatform,"," withPlatformUI,","} from '@contractspec/lib.design-system';","","const nativeTokens = mapTokensForPlatform('native', defaultTokens);","","const ui = withPlatformUI({"," tokens: defaultTokens,"," platform: 'web',","});","","// ui is a lightweight config object for design-system consumers.","// nativeTokens is the mapped token shape for a native renderer."].join(`
3704
- `),$l=`import { Box, HStack, VStack } from '@contractspec/lib.ui-kit-web/ui/stack';
3704
+ `),Zl=`import { Box, HStack, VStack } from '@contractspec/lib.ui-kit-web/ui/stack';
3705
3705
 
3706
3706
  export function AccountSummaryHeader() {
3707
3707
  return (
@@ -3722,7 +3722,7 @@ export function AccountSummaryHeader() {
3722
3722
  // @contractspec/lib.ui-kit/ui/stack
3723
3723
  //
3724
3724
  // On web-only pages, VStack / HStack / Box also support:
3725
- // <VStack as="section">...</VStack>`,Zl=`import { DataTable as DesignSystemTable } from '@contractspec/lib.design-system';
3725
+ // <VStack as="section">...</VStack>`,$l=`import { DataTable as DesignSystemTable } from '@contractspec/lib.design-system';
3726
3726
  import { DataTable as NativeTable } from '@contractspec/lib.ui-kit/ui/data-table';
3727
3727
  import { DataTable as WebTable } from '@contractspec/lib.ui-kit-web/ui/data-table';
3728
3728
  import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
@@ -3758,7 +3758,7 @@ export function ProductAccounts({ controller }) {
3758
3758
  }
3759
3759
 
3760
3760
  // If the table is spec-driven instead of hand-authored,
3761
- // swap useContractTable for useDataViewTable.`,Xl="# Cross-Surface Rendering Policy\n\n- Import runtime bundler helpers from `@contractspec/lib.presentation-runtime-core` root only.\n- Use `withPresentationTurbopackAliases` for default Next.js projects.\n- Use `withPresentationWebpackAliases` only when the app explicitly opts into webpack.\n- Use `withPresentationMetroAliases` for Expo and Metro builds.\n- Prefer `@contractspec/lib.design-system` for shared product-facing surfaces.\n- Use design-system controls when a field must respect ThemeSpec component variants or TranslationSpec messages.\n- Use `@contractspec/lib.ui-kit-web` only for web-specific primitive lanes.\n- Use `@contractspec/lib.ui-kit` only for native-specific primitive lanes.\n- Keep shared layout code inside the common `VStack` / `HStack` / `Box` subset.\n- Do not use removed `withPresentationNextAliases`.\n- Treat `.tsx` / `.mobile.tsx` pairs as the standard design-system compatibility boundary.",xl="# Cross-Surface Rendering Checklist\n\n1. Configure the bundler aliases before sharing any UI code.\n2. Choose the controller layer:\n - use `useContractTable` for app-owned rows and columns\n - use `useDataViewTable` for DataViewSpec-driven tables\n3. Choose the renderer lane:\n - web primitive: `@contractspec/lib.ui-kit-web`\n - native primitive: `@contractspec/lib.ui-kit`\n - shared product surface: `@contractspec/lib.design-system`\n4. Verify mirrored `.tsx` / `.mobile.tsx` implementations where the design-system owns the surface.\n5. Wrap product surfaces in `DesignSystemThemeProvider` and `DesignSystemTranslationProvider` when ThemeSpec or TranslationSpec data is available.\n6. In shared layout code, set `gap`, `align`, `justify`, and `wrap` explicitly.\n7. Check docs and examples for root imports and current helper names before copying them into product code.";import{CodeBlock as jo}from"@contractspec/lib.design-system";import Sr from"@contractspec/lib.ui-link";import{ChevronRight as bf}from"lucide-react";import{jsx as C,jsxs as je}from"react/jsx-runtime";function vf(){return je("div",{className:"space-y-8",children:[je("div",{className:"space-y-4",children:[C("h1",{className:"font-bold text-4xl",children:"Cross-platform UI"}),C("p",{className:"text-lg text-muted-foreground",children:"How ContractSpec keeps React and React Native components compatible by splitting responsibility across shared runtime models, platform primitives, resolver aliases, and the composed design-system layer."})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"What cross-platform means here"}),C("p",{className:"text-muted-foreground",children:"The shared rendering story is layered: the core package owns models and resolver helpers, the React packages own hook APIs, the UI kits own raw primitives, and the design-system owns the higher-level product surfaces that pair web and mobile implementations."}),C("div",{className:"grid gap-4 md:grid-cols-2",children:Wl.map((e)=>je("div",{className:"rounded-[20px] border border-border/70 p-4",children:[C("h3",{className:"font-semibold text-base",children:e.title}),C("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),C("div",{className:"grid gap-4 md:grid-cols-3",children:_l.map((e)=>je("div",{className:"card-subtle p-4",children:[C("h3",{className:"font-semibold",children:e.title}),C("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),je("div",{className:"grid gap-4 lg:grid-cols-[1.1fr_0.9fr]",children:[C("div",{className:"grid gap-4 md:grid-cols-2",children:Gl.map((e)=>je("div",{className:"card-subtle p-4",children:[C("h3",{className:"font-semibold",children:e.title}),C("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),C(jo,{language:"typescript",filename:"design-system-platform.ts",code:Jl})]})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Resolver and alias setup"}),je("p",{className:"text-muted-foreground",children:["Teach the bundler what \u201Cweb\u201D and \u201Cnative\u201D mean before you try to share component code. These helpers are public from the root",C("code",{children:" @contractspec/lib.presentation-runtime-core "}),"entrypoint."]}),C("div",{className:"grid gap-4 md:grid-cols-2",children:zl.map((e)=>je("div",{className:"card-subtle p-4",children:[C("h3",{className:"font-semibold",children:e.title}),C("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),je("div",{className:"grid gap-4 xl:grid-cols-3",children:[C(jo,{language:"typescript",filename:"next.config.mjs",code:Kl}),C(jo,{language:"typescript",filename:"next.config.mjs",code:Ql}),C(jo,{language:"javascript",filename:"metro.config.js",code:Yl})]})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"How the remapping works"}),C("p",{className:"text-muted-foreground",children:"The helpers are intentionally asymmetric because Turbopack patches the Next config object, Webpack mutates a resolver config, and Metro maps modules at request time for native platforms."}),C("div",{className:"grid gap-4 xl:grid-cols-3",children:Hl.map((e)=>je("div",{className:"card-subtle p-4",children:[C("h3",{className:"font-semibold",children:e.title}),C("ul",{className:"mt-2 space-y-2 text-muted-foreground text-sm leading-7",children:e.items.map((t)=>C("li",{children:t},t))})]},e.title))})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Layout primitives"}),je("p",{className:"text-muted-foreground",children:[C("code",{children:"VStack"}),", ",C("code",{children:"HStack"}),", and ",C("code",{children:"Box"})," are the closest thing to a shared layout vocabulary, but their defaults and a few props still differ across the web and native packages."]}),C("div",{className:"grid gap-4 md:grid-cols-2",children:ql.map((e)=>C("div",{className:"card-subtle p-4 text-muted-foreground text-sm leading-7",children:e},e))}),C(jo,{language:"tsx",filename:"stack-layout.tsx",code:$l})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Rendering patterns"}),C("p",{className:"text-muted-foreground",children:"Keep the controller stable, then decide whether the final surface should be a raw web primitive, a raw native primitive, or a composed design-system wrapper."}),C(jo,{language:"tsx",filename:"cross-platform-rendering.tsx",code:Zl}),je("div",{className:"card-subtle p-4 text-muted-foreground text-sm leading-7",children:["For higher-level shared rendering, use the design-system surfaces that already ship paired implementations such as"," ",C("code",{children:"DataViewRenderer"}),", ",C("code",{children:"ListTablePage"}),", and"," ",C("code",{children:"DataTable"}),". The web and mobile files stay separate inside the package while your app imports one design-system boundary."]})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Gotchas and boundaries"}),C("ul",{className:"space-y-2 text-muted-foreground leading-7",children:Vl.map((e)=>C("li",{children:e},e))})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Customer markdown kit"}),C("p",{className:"text-muted-foreground",children:Fl}),je("div",{className:"grid gap-4 xl:grid-cols-2",children:[C(jo,{language:"markdown",filename:"cross-surface-policy.md",code:Xl}),C(jo,{language:"markdown",filename:"cross-surface-checklist.md",code:xl})]})]}),je("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[C(Sr,{href:"/docs/libraries/runtime",className:"btn-ghost",children:"Runtime libraries"}),C(Sr,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"UI Kit"}),C(Sr,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"UI Kit Web"}),je(Sr,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Design System ",C(bf,{size:16})]})]})]})}import{CodeBlock as Nf}from"@contractspec/lib.design-system";import jl from"@contractspec/lib.ui-link";import{ChevronRight as wf}from"lucide-react";import{jsx as _t,jsxs as zt}from"react/jsx-runtime";function kf(){return zt("div",{className:"space-y-8",children:[zt("div",{className:"space-y-4",children:[_t("h1",{className:"font-bold text-4xl",children:"Data & Backend"}),_t("p",{className:"text-muted-foreground",children:"A collection of robust, platform-agnostic libraries for building the backend infrastructure of your LSSM applications."})]}),zt("div",{className:"space-y-4",children:[_t("h2",{className:"font-bold text-2xl",children:"Libraries"}),zt("div",{className:"space-y-6",children:[zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/app.cli-database"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"Prisma Wrapper & CLI"}),". Provides a unified way to manage database schemas, migrations, and clients. Includes seeders and factory patterns for testing."]})]}),zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/lib.bus"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"Type-Safe Event Bus"}),". Decouple your architecture with typed events. Supports in-memory dispatch for monoliths and can be extended for distributed message queues (Redis, SQS)."]})]}),zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/lib.logger"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"High-Performance Logging"}),". Optimized for Bun and structured JSON output. Includes plugins for ElysiaJS to log HTTP requests automatically."]})]}),zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/lib.error"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"Standardized Errors"}),". Use `AppError` with standard codes (NOT_FOUND, UNAUTHORIZED) to ensure consistent HTTP responses and error handling across services."]})]}),zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/lib.exporter"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"Data Export"}),". Generate CSV and XML files from your data. Platform-agnostic and streaming-friendly."]})]})]})]}),zt("div",{className:"space-y-4",children:[_t("h2",{className:"font-bold text-2xl",children:"Example: Unified Backend Flow"}),_t(Nf,{language:"typescript",code:`import { logger } from '@contractspec/lib.logger';
3761
+ // swap useContractTable for useDataViewTable.`,Xl="# Cross-Surface Rendering Policy\n\n- Import runtime bundler helpers from `@contractspec/lib.presentation-runtime-core` root only.\n- Use `withPresentationTurbopackAliases` for default Next.js projects.\n- Use `withPresentationWebpackAliases` only when the app explicitly opts into webpack.\n- Use `withPresentationMetroAliases` for Expo and Metro builds.\n- Prefer `@contractspec/lib.design-system` for shared product-facing surfaces.\n- Use design-system controls when a field must respect ThemeSpec component variants or TranslationSpec messages.\n- Use `@contractspec/lib.ui-kit-web` only for web-specific primitive lanes.\n- Use `@contractspec/lib.ui-kit` only for native-specific primitive lanes.\n- Keep shared layout code inside the common `VStack` / `HStack` / `Box` subset.\n- Do not use removed `withPresentationNextAliases`.\n- Treat `.tsx` / `.mobile.tsx` pairs as the standard design-system compatibility boundary.",xl="# Cross-Surface Rendering Checklist\n\n1. Configure the bundler aliases before sharing any UI code.\n2. Choose the controller layer:\n - use `useContractTable` for app-owned rows and columns\n - use `useDataViewTable` for DataViewSpec-driven tables\n3. Choose the renderer lane:\n - web primitive: `@contractspec/lib.ui-kit-web`\n - native primitive: `@contractspec/lib.ui-kit`\n - shared product surface: `@contractspec/lib.design-system`\n4. Verify mirrored `.tsx` / `.mobile.tsx` implementations where the design-system owns the surface.\n5. Wrap product surfaces in `DesignSystemThemeProvider` and `DesignSystemTranslationProvider` when ThemeSpec or TranslationSpec data is available.\n6. In shared layout code, set `gap`, `align`, `justify`, and `wrap` explicitly.\n7. Check docs and examples for root imports and current helper names before copying them into product code.";import{CodeBlock as jo}from"@contractspec/lib.design-system";import Sr from"@contractspec/lib.ui-link";import{ChevronRight as bf}from"lucide-react";import{jsx as C,jsxs as je}from"react/jsx-runtime";function vf(){return je("div",{className:"space-y-8",children:[je("div",{className:"space-y-4",children:[C("h1",{className:"font-bold text-4xl",children:"Cross-platform UI"}),C("p",{className:"text-lg text-muted-foreground",children:"How ContractSpec keeps React and React Native components compatible by splitting responsibility across shared runtime models, platform primitives, resolver aliases, and the composed design-system layer."})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"What cross-platform means here"}),C("p",{className:"text-muted-foreground",children:"The shared rendering story is layered: the core package owns models and resolver helpers, the React packages own hook APIs, the UI kits own raw primitives, and the design-system owns the higher-level product surfaces that pair web and mobile implementations."}),C("div",{className:"grid gap-4 md:grid-cols-2",children:Wl.map((e)=>je("div",{className:"rounded-[20px] border border-border/70 p-4",children:[C("h3",{className:"font-semibold text-base",children:e.title}),C("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),C("div",{className:"grid gap-4 md:grid-cols-3",children:_l.map((e)=>je("div",{className:"card-subtle p-4",children:[C("h3",{className:"font-semibold",children:e.title}),C("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),je("div",{className:"grid gap-4 lg:grid-cols-[1.1fr_0.9fr]",children:[C("div",{className:"grid gap-4 md:grid-cols-2",children:Gl.map((e)=>je("div",{className:"card-subtle p-4",children:[C("h3",{className:"font-semibold",children:e.title}),C("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),C(jo,{language:"typescript",filename:"design-system-platform.ts",code:Jl})]})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Resolver and alias setup"}),je("p",{className:"text-muted-foreground",children:["Teach the bundler what \u201Cweb\u201D and \u201Cnative\u201D mean before you try to share component code. These helpers are public from the root",C("code",{children:" @contractspec/lib.presentation-runtime-core "}),"entrypoint."]}),C("div",{className:"grid gap-4 md:grid-cols-2",children:zl.map((e)=>je("div",{className:"card-subtle p-4",children:[C("h3",{className:"font-semibold",children:e.title}),C("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),je("div",{className:"grid gap-4 xl:grid-cols-3",children:[C(jo,{language:"typescript",filename:"next.config.mjs",code:Kl}),C(jo,{language:"typescript",filename:"next.config.mjs",code:Ql}),C(jo,{language:"javascript",filename:"metro.config.js",code:Yl})]})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"How the remapping works"}),C("p",{className:"text-muted-foreground",children:"The helpers are intentionally asymmetric because Turbopack patches the Next config object, Webpack mutates a resolver config, and Metro maps modules at request time for native platforms."}),C("div",{className:"grid gap-4 xl:grid-cols-3",children:ql.map((e)=>je("div",{className:"card-subtle p-4",children:[C("h3",{className:"font-semibold",children:e.title}),C("ul",{className:"mt-2 space-y-2 text-muted-foreground text-sm leading-7",children:e.items.map((t)=>C("li",{children:t},t))})]},e.title))})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Layout primitives"}),je("p",{className:"text-muted-foreground",children:[C("code",{children:"VStack"}),", ",C("code",{children:"HStack"}),", and ",C("code",{children:"Box"})," are the closest thing to a shared layout vocabulary, but their defaults and a few props still differ across the web and native packages."]}),C("div",{className:"grid gap-4 md:grid-cols-2",children:Hl.map((e)=>C("div",{className:"card-subtle p-4 text-muted-foreground text-sm leading-7",children:e},e))}),C(jo,{language:"tsx",filename:"stack-layout.tsx",code:Zl})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Rendering patterns"}),C("p",{className:"text-muted-foreground",children:"Keep the controller stable, then decide whether the final surface should be a raw web primitive, a raw native primitive, or a composed design-system wrapper."}),C(jo,{language:"tsx",filename:"cross-platform-rendering.tsx",code:$l}),je("div",{className:"card-subtle p-4 text-muted-foreground text-sm leading-7",children:["For higher-level shared rendering, use the design-system surfaces that already ship paired implementations such as"," ",C("code",{children:"DataViewRenderer"}),", ",C("code",{children:"ListTablePage"}),", and"," ",C("code",{children:"DataTable"}),". The web and mobile files stay separate inside the package while your app imports one design-system boundary."]})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Gotchas and boundaries"}),C("ul",{className:"space-y-2 text-muted-foreground leading-7",children:Vl.map((e)=>C("li",{children:e},e))})]}),je("div",{className:"space-y-4",children:[C("h2",{className:"font-bold text-2xl",children:"Customer markdown kit"}),C("p",{className:"text-muted-foreground",children:Fl}),je("div",{className:"grid gap-4 xl:grid-cols-2",children:[C(jo,{language:"markdown",filename:"cross-surface-policy.md",code:Xl}),C(jo,{language:"markdown",filename:"cross-surface-checklist.md",code:xl})]})]}),je("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[C(Sr,{href:"/docs/libraries/runtime",className:"btn-ghost",children:"Runtime libraries"}),C(Sr,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"UI Kit"}),C(Sr,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"UI Kit Web"}),je(Sr,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Design System ",C(bf,{size:16})]})]})]})}import{CodeBlock as Nf}from"@contractspec/lib.design-system";import jl from"@contractspec/lib.ui-link";import{ChevronRight as wf}from"lucide-react";import{jsx as _t,jsxs as zt}from"react/jsx-runtime";function kf(){return zt("div",{className:"space-y-8",children:[zt("div",{className:"space-y-4",children:[_t("h1",{className:"font-bold text-4xl",children:"Data & Backend"}),_t("p",{className:"text-muted-foreground",children:"A collection of robust, platform-agnostic libraries for building the backend infrastructure of your LSSM applications."})]}),zt("div",{className:"space-y-4",children:[_t("h2",{className:"font-bold text-2xl",children:"Libraries"}),zt("div",{className:"space-y-6",children:[zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/app.cli-database"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"Prisma Wrapper & CLI"}),". Provides a unified way to manage database schemas, migrations, and clients. Includes seeders and factory patterns for testing."]})]}),zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/lib.bus"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"Type-Safe Event Bus"}),". Decouple your architecture with typed events. Supports in-memory dispatch for monoliths and can be extended for distributed message queues (Redis, SQS)."]})]}),zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/lib.logger"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"High-Performance Logging"}),". Optimized for Bun and structured JSON output. Includes plugins for ElysiaJS to log HTTP requests automatically."]})]}),zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/lib.error"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"Standardized Errors"}),". Use `AppError` with standard codes (NOT_FOUND, UNAUTHORIZED) to ensure consistent HTTP responses and error handling across services."]})]}),zt("div",{className:"card-subtle p-6",children:[_t("h3",{className:"font-bold text-lg",children:"@contractspec/lib.exporter"}),zt("p",{className:"mt-2 text-muted-foreground text-sm",children:[_t("strong",{children:"Data Export"}),". Generate CSV and XML files from your data. Platform-agnostic and streaming-friendly."]})]})]})]}),zt("div",{className:"space-y-4",children:[_t("h2",{className:"font-bold text-2xl",children:"Example: Unified Backend Flow"}),_t(Nf,{language:"typescript",code:`import { logger } from '@contractspec/lib.logger';
3762
3762
  import { AppError } from '@contractspec/lib.error';
3763
3763
  import { db } from '@contractspec/app.cli-database';
3764
3764
  import { EventBus } from '@contractspec/lib.bus';
@@ -3776,7 +3776,7 @@ export async function createUser(email: string) {
3776
3776
  await EventBus.publish('user.created', { userId: user.id });
3777
3777
 
3778
3778
  return user;
3779
- }`})]}),zt("div",{className:"flex items-center gap-4 pt-4",children:[zt(jl,{href:"/docs/libraries/runtime",className:"btn-primary",children:["Next: Runtime ",_t(wf,{size:16})]}),_t(jl,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"})]})]})}import{CodeBlock as ed,InstallCommand as Sf}from"@contractspec/lib.design-system";import td from"@contractspec/lib.ui-link";import{ChevronRight as Cf}from"lucide-react";import{jsx as qe,jsxs as Zt}from"react/jsx-runtime";function If(){return Zt("div",{className:"space-y-8",children:[Zt("div",{className:"space-y-4",children:[qe("h1",{className:"font-bold text-4xl",children:"DataViews Runtime Library"}),Zt("p",{className:"text-lg text-muted-foreground",children:["The ",qe("code",{children:"@contractspec/lib.contracts-spec/data-views"})," and"," ",qe("code",{children:"@contractspec/lib.design-system"})," libraries provide the runtime logic and UI components to render DataViews in your application."]})]}),Zt("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"Installation"}),qe(Sf,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.design-system"]})]}),Zt("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"DataViewRenderer"}),qe("p",{className:"text-muted-foreground",children:"The primary component for rendering any DataView. It automatically selects the correct layout (List, Table, Grid, Detail) based on the spec."}),qe(ed,{language:"tsx",code:`import { DataViewRenderer } from '@contractspec/lib.design-system';
3779
+ }`})]}),zt("div",{className:"flex items-center gap-4 pt-4",children:[zt(jl,{href:"/docs/libraries/runtime",className:"btn-primary",children:["Next: Runtime ",_t(wf,{size:16})]}),_t(jl,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"})]})]})}import{CodeBlock as ed,InstallCommand as Sf}from"@contractspec/lib.design-system";import td from"@contractspec/lib.ui-link";import{ChevronRight as Cf}from"lucide-react";import{jsx as He,jsxs as $t}from"react/jsx-runtime";function If(){return $t("div",{className:"space-y-8",children:[$t("div",{className:"space-y-4",children:[He("h1",{className:"font-bold text-4xl",children:"DataViews Runtime Library"}),$t("p",{className:"text-lg text-muted-foreground",children:["The ",He("code",{children:"@contractspec/lib.contracts-spec/data-views"})," and"," ",He("code",{children:"@contractspec/lib.design-system"})," libraries provide the runtime logic and UI components to render DataViews in your application."]})]}),$t("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"Installation"}),He(Sf,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.design-system"]})]}),$t("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"DataViewRenderer"}),He("p",{className:"text-muted-foreground",children:"The primary component for rendering any DataView. It automatically selects the correct layout (List, Table, Grid, Detail) based on the spec."}),He(ed,{language:"tsx",code:`import { DataViewRenderer } from '@contractspec/lib.design-system';
3780
3780
  import { MyUserList } from './specs/users.data-view';
3781
3781
 
3782
3782
  export function UserPage() {
@@ -3788,7 +3788,7 @@ export function UserPage() {
3788
3788
  onPageChange={(page) => fetchPage(page)}
3789
3789
  />
3790
3790
  );
3791
- }`}),qe("h3",{className:"font-semibold text-xl",children:"Props"}),Zt("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[Zt("li",{children:[qe("code",{children:"spec"}),": The DataViewSpec definition."]}),Zt("li",{children:[qe("code",{children:"items"}),": Array of data items to render."]}),Zt("li",{children:[qe("code",{children:"filters"}),": Current filter state object."]}),Zt("li",{children:[qe("code",{children:"onFilterChange"}),": Callback when filters change."]}),Zt("li",{children:[qe("code",{children:"pagination"}),": Object with ",qe("code",{children:"page"}),","," ",qe("code",{children:"pageSize"}),", ",qe("code",{children:"total"}),"."]}),Zt("li",{children:[qe("code",{children:"onPageChange"}),": Callback when page changes."]})]})]}),Zt("div",{className:"space-y-4",children:[qe("h2",{className:"font-bold text-2xl",children:"Query Generation"}),Zt("p",{className:"text-muted-foreground",children:["The ",qe("code",{children:"DataViewQueryGenerator"})," utility helps translate DataView parameters (filters, sorting, pagination) into query arguments for your backend."]}),qe(ed,{language:"typescript",code:`import { DataViewQueryGenerator } from '@contractspec/lib.contracts-spec/data-views/query-generator';
3791
+ }`}),He("h3",{className:"font-semibold text-xl",children:"Props"}),$t("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[$t("li",{children:[He("code",{children:"spec"}),": The DataViewSpec definition."]}),$t("li",{children:[He("code",{children:"items"}),": Array of data items to render."]}),$t("li",{children:[He("code",{children:"filters"}),": Current filter state object."]}),$t("li",{children:[He("code",{children:"onFilterChange"}),": Callback when filters change."]}),$t("li",{children:[He("code",{children:"pagination"}),": Object with ",He("code",{children:"page"}),","," ",He("code",{children:"pageSize"}),", ",He("code",{children:"total"}),"."]}),$t("li",{children:[He("code",{children:"onPageChange"}),": Callback when page changes."]})]})]}),$t("div",{className:"space-y-4",children:[He("h2",{className:"font-bold text-2xl",children:"Query Generation"}),$t("p",{className:"text-muted-foreground",children:["The ",He("code",{children:"DataViewQueryGenerator"})," utility helps translate DataView parameters (filters, sorting, pagination) into query arguments for your backend."]}),He(ed,{language:"typescript",code:`import { DataViewQueryGenerator } from '@contractspec/lib.contracts-spec/data-views/query-generator';
3792
3792
 
3793
3793
  const generator = new DataViewQueryGenerator(MyUserList);
3794
3794
  const query = generator.generate({
@@ -3796,7 +3796,7 @@ const query = generator.generate({
3796
3796
  filters: { role: 'admin' }
3797
3797
  });
3798
3798
 
3799
- // query.input contains { skip: 0, take: 20, role: 'admin' }`})]}),Zt("div",{className:"flex items-center gap-4 pt-4",children:[qe(td,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Zt(td,{href:"/docs/libraries/data-backend",className:"btn-primary",children:["Next: Data & Backend ",qe(Cf,{size:16})]})]})]})}import{CodeBlock as pn,InstallCommand as Pf}from"@contractspec/lib.design-system";import Cr from"@contractspec/lib.ui-link";import{ChevronRight as Tf}from"lucide-react";import{jsx as O,jsxs as ne}from"react/jsx-runtime";var Af=`import { Button, DataTable } from '@contractspec/lib.design-system';
3799
+ // query.input contains { skip: 0, take: 20, role: 'admin' }`})]}),$t("div",{className:"flex items-center gap-4 pt-4",children:[He(td,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),$t(td,{href:"/docs/libraries/data-backend",className:"btn-primary",children:["Next: Data & Backend ",He(Cf,{size:16})]})]})]})}import{CodeBlock as pn,InstallCommand as Pf}from"@contractspec/lib.design-system";import Cr from"@contractspec/lib.ui-link";import{ChevronRight as Tf}from"lucide-react";import{jsx as O,jsxs as ne}from"react/jsx-runtime";var Af=`import { Button, DataTable } from '@contractspec/lib.design-system';
3800
3800
  import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
3801
3801
 
3802
3802
  import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
@@ -3880,7 +3880,7 @@ import { FormDialog } from '@contractspec/lib.design-system/forms';
3880
3880
  import { HStack } from '@contractspec/lib.design-system/layout';
3881
3881
 
3882
3882
  // Root imports remain supported:
3883
- import { Button, DataTable } from '@contractspec/lib.design-system';`;function Ef(){return ne("div",{className:"space-y-8",children:[ne("div",{className:"space-y-4",children:[O("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.design-system"}),ne("p",{className:"text-muted-foreground",children:["High-level design system components, patterns, and layouts for LSSM applications. Built on top of ",O("code",{children:"@contractspec/lib.ui-kit"}),"."]})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Installation"}),O(Pf,{package:"@contractspec/lib.design-system"})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"What It Provides"}),ne("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[ne("li",{children:[O("strong",{children:"Composite Components"}),": Molecules and Organisms that solve common UI problems"]}),ne("li",{children:[O("strong",{children:"Layouts"}),": Ready-to-use page structures for dashboards, marketing sites, and lists"]}),ne("li",{children:[O("strong",{children:"Data Views"}),": Standardized renderers for lists, tables, and detail views"]}),ne("li",{children:[O("strong",{children:"Forms"}),": Zod-integrated form layouts and components"]}),ne("li",{children:[O("strong",{children:"Code Display"}),": Syntax-highlighted code blocks with package manager tabs"]}),ne("li",{children:[O("strong",{children:"Platform Utilities"}),": Hooks for responsive and adaptive design"]}),ne("li",{children:[O("strong",{children:"Theme Bridge"}),": ThemeSpec to Tailwind variables, presets, CSS text, and runtime light/dark mode"]}),ne("li",{children:[O("strong",{children:"Legal Templates"}),": Compliant templates for Terms, Privacy, and GDPR"]})]})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"ThemeSpec to Tailwind"}),ne("p",{className:"text-muted-foreground",children:["The theme bridge keeps ",O("code",{children:"ThemeSpec"})," as the source of truth and exposes no-generation Tailwind helpers, optional CSS text serialization, runtime CSS variables, light/dark modes, and OKLCH color pass-through."]}),O(pn,{language:"tsx",code:Rf})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Focused import surfaces"}),O("p",{className:"text-muted-foreground",children:"New code can use focused subpaths for theme, controls, forms, and layout while existing root imports remain compatible."}),O(pn,{language:"tsx",code:Lf})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Data table example"}),ne("p",{className:"text-muted-foreground",children:["This is the composed lane from the canonical"," ",O(Cr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),". The design-system wrapper owns title, description, header actions, and the opinionated card shell on top of the raw web primitive."]}),O(pn,{language:"tsx",code:Af})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Key Exports"}),ne("div",{className:"grid gap-4 md:grid-cols-2",children:[ne("div",{className:"card-subtle p-4",children:[O("h3",{className:"mb-2 font-semibold",children:"Organisms"}),ne("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[O("li",{children:"AppLayout, AppHeader, AppSidebar"}),O("li",{children:"MarketingLayout, HeroSection"}),O("li",{children:"ListCardPage, ListTablePage"})]})]}),ne("div",{className:"card-subtle p-4",children:[O("h3",{className:"mb-2 font-semibold",children:"Data & Forms"}),ne("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[O("li",{children:"DataTable"}),O("li",{children:"DataViewTable"}),O("li",{children:"DataViewRenderer"}),O("li",{children:"ZodForm"}),O("li",{children:"FormLayout, FormDialog"})]})]}),ne("div",{className:"card-subtle p-4",children:[O("h3",{className:"mb-2 font-semibold",children:"Code Display"}),ne("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[O("li",{children:"CodeBlock (syntax highlighting)"}),O("li",{children:"CommandTabs (package manager tabs)"}),O("li",{children:"InstallCommand (convenience wrapper)"}),O("li",{children:"CopyButton"})]})]}),ne("div",{className:"card-subtle p-4",children:[O("h3",{className:"mb-2 font-semibold",children:"Providers"}),O("ul",{className:"space-y-1 text-muted-foreground text-sm",children:O("li",{children:"PackageManagerProvider"})})]})]})]}),ne("div",{className:"card-subtle space-y-3 p-6",children:[O("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),ne("p",{className:"text-muted-foreground",children:["Read"," ",O(Cr,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the package split between shared runtime controllers, leaf platform primitives, and this composed design-system layer."]})]}),ne("div",{className:"flex items-center gap-4 pt-4",children:[O(Cr,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"Previous: UI Kit Web"}),ne(Cr,{href:"/docs/libraries/accessibility",className:"btn-primary",children:["Next: Accessibility ",O(Tf,{size:16})]})]})]})}import{CodeBlock as mn,InstallCommand as Df}from"@contractspec/lib.design-system";import ad from"@contractspec/lib.ui-link";import{ChevronRight as Of}from"lucide-react";import{jsx as ma,jsxs as Bo}from"react/jsx-runtime";function Bf(){return Bo("div",{className:"space-y-8",children:[Bo("div",{className:"space-y-4",children:[ma("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.evolution"}),ma("p",{className:"text-lg text-muted-foreground",children:"Analyze production telemetry, surface anomalies, and turn them into AI-reviewed spec proposals that can be approved, rolled out, or reverted."})]}),Bo("div",{className:"space-y-4",children:[ma("h2",{className:"font-bold text-2xl",children:"Installation"}),ma(Df,{package:"@contractspec/lib.evolution"})]}),Bo("div",{className:"space-y-3",children:[ma("h2",{className:"font-bold text-2xl",children:"From telemetry to intent"}),ma(mn,{language:"typescript",code:`import { SpecAnalyzer } from '@contractspec/lib.evolution/analyzer';
3883
+ import { Button, DataTable } from '@contractspec/lib.design-system';`;function Df(){return ne("div",{className:"space-y-8",children:[ne("div",{className:"space-y-4",children:[O("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.design-system"}),ne("p",{className:"text-muted-foreground",children:["High-level design system components, patterns, and layouts for LSSM applications. Built on top of ",O("code",{children:"@contractspec/lib.ui-kit"}),"."]})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Installation"}),O(Pf,{package:"@contractspec/lib.design-system"})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"What It Provides"}),ne("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[ne("li",{children:[O("strong",{children:"Composite Components"}),": Molecules and Organisms that solve common UI problems"]}),ne("li",{children:[O("strong",{children:"Layouts"}),": Ready-to-use page structures for dashboards, marketing sites, and lists"]}),ne("li",{children:[O("strong",{children:"Data Views"}),": Standardized renderers for lists, tables, and detail views"]}),ne("li",{children:[O("strong",{children:"Forms"}),": Zod-integrated form layouts and components"]}),ne("li",{children:[O("strong",{children:"Code Display"}),": Syntax-highlighted code blocks with package manager tabs"]}),ne("li",{children:[O("strong",{children:"Platform Utilities"}),": Hooks for responsive and adaptive design"]}),ne("li",{children:[O("strong",{children:"Theme Bridge"}),": ThemeSpec to Tailwind variables, presets, CSS text, and runtime light/dark mode"]}),ne("li",{children:[O("strong",{children:"Legal Templates"}),": Compliant templates for Terms, Privacy, and GDPR"]})]})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"ThemeSpec to Tailwind"}),ne("p",{className:"text-muted-foreground",children:["The theme bridge keeps ",O("code",{children:"ThemeSpec"})," as the source of truth and exposes no-generation Tailwind helpers, optional CSS text serialization, runtime CSS variables, light/dark modes, and OKLCH color pass-through."]}),O(pn,{language:"tsx",code:Rf})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Focused import surfaces"}),O("p",{className:"text-muted-foreground",children:"New code can use focused subpaths for theme, controls, forms, and layout while existing root imports remain compatible."}),O(pn,{language:"tsx",code:Lf})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Data table example"}),ne("p",{className:"text-muted-foreground",children:["This is the composed lane from the canonical"," ",O(Cr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),". The design-system wrapper owns title, description, header actions, and the opinionated card shell on top of the raw web primitive."]}),O(pn,{language:"tsx",code:Af})]}),ne("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Key Exports"}),ne("div",{className:"grid gap-4 md:grid-cols-2",children:[ne("div",{className:"card-subtle p-4",children:[O("h3",{className:"mb-2 font-semibold",children:"Organisms"}),ne("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[O("li",{children:"AppLayout, AppHeader, AppSidebar"}),O("li",{children:"MarketingLayout, HeroSection"}),O("li",{children:"ListCardPage, ListTablePage"})]})]}),ne("div",{className:"card-subtle p-4",children:[O("h3",{className:"mb-2 font-semibold",children:"Data & Forms"}),ne("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[O("li",{children:"DataTable"}),O("li",{children:"DataViewTable"}),O("li",{children:"DataViewRenderer"}),O("li",{children:"ZodForm"}),O("li",{children:"FormLayout, FormDialog"})]})]}),ne("div",{className:"card-subtle p-4",children:[O("h3",{className:"mb-2 font-semibold",children:"Code Display"}),ne("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[O("li",{children:"CodeBlock (syntax highlighting)"}),O("li",{children:"CommandTabs (package manager tabs)"}),O("li",{children:"InstallCommand (convenience wrapper)"}),O("li",{children:"CopyButton"})]})]}),ne("div",{className:"card-subtle p-4",children:[O("h3",{className:"mb-2 font-semibold",children:"Providers"}),O("ul",{className:"space-y-1 text-muted-foreground text-sm",children:O("li",{children:"PackageManagerProvider"})})]})]})]}),ne("div",{className:"card-subtle space-y-3 p-6",children:[O("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),ne("p",{className:"text-muted-foreground",children:["Read"," ",O(Cr,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the package split between shared runtime controllers, leaf platform primitives, and this composed design-system layer."]})]}),ne("div",{className:"flex items-center gap-4 pt-4",children:[O(Cr,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"Previous: UI Kit Web"}),ne(Cr,{href:"/docs/libraries/accessibility",className:"btn-primary",children:["Next: Accessibility ",O(Tf,{size:16})]})]})]})}import{CodeBlock as mn,InstallCommand as Ef}from"@contractspec/lib.design-system";import ad from"@contractspec/lib.ui-link";import{ChevronRight as Of}from"lucide-react";import{jsx as ma,jsxs as Bo}from"react/jsx-runtime";function Bf(){return Bo("div",{className:"space-y-8",children:[Bo("div",{className:"space-y-4",children:[ma("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.evolution"}),ma("p",{className:"text-lg text-muted-foreground",children:"Analyze production telemetry, surface anomalies, and turn them into AI-reviewed spec proposals that can be approved, rolled out, or reverted."})]}),Bo("div",{className:"space-y-4",children:[ma("h2",{className:"font-bold text-2xl",children:"Installation"}),ma(Ef,{package:"@contractspec/lib.evolution"})]}),Bo("div",{className:"space-y-3",children:[ma("h2",{className:"font-bold text-2xl",children:"From telemetry to intent"}),ma(mn,{language:"typescript",code:`import { SpecAnalyzer } from '@contractspec/lib.evolution/analyzer';
3884
3884
  import { EvolutionPipeline } from '@contractspec/lib.observability';
3885
3885
 
3886
3886
  const analyzer = new SpecAnalyzer();
@@ -3934,7 +3934,7 @@ registerContractsOnBuilder(builder, registry);
3934
3934
 
3935
3935
  // 3. Build and print schema
3936
3936
  const schema = builder.toSchema();
3937
- console.log(printSchema(schema));`})]}),Xt("div",{className:"space-y-4",children:[ut("h2",{className:"font-bold text-2xl",children:"Features"}),Xt("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Xt("li",{children:[ut("strong",{children:"Code-First"}),": Define schema in TypeScript (Pothos), get SDL as artifact."]}),Xt("li",{children:[ut("strong",{children:"Spec Integration"}),": `registerContractsOnBuilder` automatically converts Command/Query specs into Mutations/Queries."]}),Xt("li",{children:[ut("strong",{children:"Federation Ready"}),": Just add `provider: 'federation'` to your config."]})]})]}),Xt("div",{className:"flex items-center gap-4 pt-4",children:[Xt(od,{href:"/docs/libraries/data-backend",className:"btn-primary",children:["Next: Data & Backend ",ut(Wf,{size:16})]}),ut(od,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"})]})]})}import{CodeBlock as id,InstallCommand as zf}from"@contractspec/lib.design-system";import rd from"@contractspec/lib.ui-link";import{ChevronRight as Gf}from"lucide-react";import{jsx as wo,jsxs as pi}from"react/jsx-runtime";function Hf(){return pi("div",{className:"space-y-8",children:[pi("div",{className:"space-y-4",children:[wo("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.growth"}),wo("p",{className:"text-lg text-muted-foreground",children:"Launch experiments without third-party SDKs. Register variants, assign users deterministically, track exposures, and compute significance."})]}),pi("div",{className:"space-y-4",children:[wo("h2",{className:"font-bold text-2xl",children:"Installation"}),wo(zf,{package:"@contractspec/lib.growth"})]}),pi("div",{className:"space-y-3",children:[wo("h2",{className:"font-bold text-2xl",children:"Register + assign"}),wo(id,{language:"typescript",code:`import { ExperimentRegistry, ExperimentRunner } from '@contractspec/lib.growth/experiments';
3937
+ console.log(printSchema(schema));`})]}),Xt("div",{className:"space-y-4",children:[ut("h2",{className:"font-bold text-2xl",children:"Features"}),Xt("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Xt("li",{children:[ut("strong",{children:"Code-First"}),": Define schema in TypeScript (Pothos), get SDL as artifact."]}),Xt("li",{children:[ut("strong",{children:"Spec Integration"}),": `registerContractsOnBuilder` automatically converts Command/Query specs into Mutations/Queries."]}),Xt("li",{children:[ut("strong",{children:"Federation Ready"}),": Just add `provider: 'federation'` to your config."]})]})]}),Xt("div",{className:"flex items-center gap-4 pt-4",children:[Xt(od,{href:"/docs/libraries/data-backend",className:"btn-primary",children:["Next: Data & Backend ",ut(Wf,{size:16})]}),ut(od,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"})]})]})}import{CodeBlock as id,InstallCommand as zf}from"@contractspec/lib.design-system";import rd from"@contractspec/lib.ui-link";import{ChevronRight as Gf}from"lucide-react";import{jsx as wo,jsxs as pi}from"react/jsx-runtime";function qf(){return pi("div",{className:"space-y-8",children:[pi("div",{className:"space-y-4",children:[wo("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.growth"}),wo("p",{className:"text-lg text-muted-foreground",children:"Launch experiments without third-party SDKs. Register variants, assign users deterministically, track exposures, and compute significance."})]}),pi("div",{className:"space-y-4",children:[wo("h2",{className:"font-bold text-2xl",children:"Installation"}),wo(zf,{package:"@contractspec/lib.growth"})]}),pi("div",{className:"space-y-3",children:[wo("h2",{className:"font-bold text-2xl",children:"Register + assign"}),wo(id,{language:"typescript",code:`import { ExperimentRegistry, ExperimentRunner } from '@contractspec/lib.growth/experiments';
3938
3938
 
3939
3939
  const registry = new ExperimentRegistry().register({
3940
3940
  key: 'pricing.cta',
@@ -3964,7 +3964,7 @@ await tracker.recordSample({
3964
3964
  const stats = new StatsEngine().summarize(
3965
3965
  await tracker.getSamples(assignment.experimentKey, 'demo_booked'),
3966
3966
  'demo_booked'
3967
- );`})]}),pi("div",{className:"flex items-center gap-4 pt-4",children:[wo(rd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),pi(rd,{href:"/docs/libraries/analytics",className:"btn-primary",children:["Next: Analytics ",wo(Gf,{size:16})]})]})]})}import{CodeBlock as nd,InstallCommand as qf}from"@contractspec/lib.design-system";import cd from"@contractspec/lib.ui-link";import{ChevronRight as Vf}from"lucide-react";import{jsx as Ja,jsxs as Mo}from"react/jsx-runtime";function Ff(){return Mo("div",{className:"space-y-8",children:[Mo("div",{className:"space-y-4",children:[Ja("h1",{className:"font-bold text-4xl",children:"Multi-Tenancy Library"}),Mo("p",{className:"text-lg text-muted-foreground",children:["The ",Ja("code",{children:"@contractspec/lib.multi-tenancy"})," library provides the core building blocks for secure SaaS applications."]})]}),Mo("div",{className:"space-y-4",children:[Ja("h2",{className:"font-bold text-2xl",children:"Installation"}),Ja(qf,{package:"@contractspec/lib.multi-tenancy"})]}),Mo("div",{className:"space-y-4",children:[Ja("h2",{className:"font-bold text-2xl",children:"Prisma RLS Middleware"}),Mo("p",{className:"text-muted-foreground",children:["Automatically injects ",Ja("code",{children:"tenantId"})," into all queries."]}),Ja(nd,{language:"typescript",code:`import { createRlsMiddleware } from '@contractspec/lib.multi-tenancy/rls';
3967
+ );`})]}),pi("div",{className:"flex items-center gap-4 pt-4",children:[wo(rd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),pi(rd,{href:"/docs/libraries/analytics",className:"btn-primary",children:["Next: Analytics ",wo(Gf,{size:16})]})]})]})}import{CodeBlock as nd,InstallCommand as Hf}from"@contractspec/lib.design-system";import cd from"@contractspec/lib.ui-link";import{ChevronRight as Vf}from"lucide-react";import{jsx as Ja,jsxs as Mo}from"react/jsx-runtime";function Ff(){return Mo("div",{className:"space-y-8",children:[Mo("div",{className:"space-y-4",children:[Ja("h1",{className:"font-bold text-4xl",children:"Multi-Tenancy Library"}),Mo("p",{className:"text-lg text-muted-foreground",children:["The ",Ja("code",{children:"@contractspec/lib.multi-tenancy"})," library provides the core building blocks for secure SaaS applications."]})]}),Mo("div",{className:"space-y-4",children:[Ja("h2",{className:"font-bold text-2xl",children:"Installation"}),Ja(Hf,{package:"@contractspec/lib.multi-tenancy"})]}),Mo("div",{className:"space-y-4",children:[Ja("h2",{className:"font-bold text-2xl",children:"Prisma RLS Middleware"}),Mo("p",{className:"text-muted-foreground",children:["Automatically injects ",Ja("code",{children:"tenantId"})," into all queries."]}),Ja(nd,{language:"typescript",code:`import { createRlsMiddleware } from '@contractspec/lib.multi-tenancy/rls';
3968
3968
  import { prisma } from './db';
3969
3969
  import { getTenantId } from './context';
3970
3970
 
@@ -3999,7 +3999,7 @@ const signals = detector.evaluate(point);
3999
3999
  signals.forEach((signal) => {
4000
4000
  const analysis = analyzer.analyze(signal, recentDeployments);
4001
4001
  alertManager.notify(signal, analysis);
4002
- });`})]}),ko("div",{className:"flex items-center gap-4 pt-4",children:[xt(ld,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ko(ld,{href:"/docs/libraries/slo",className:"btn-primary",children:["Next: SLO ",xt(Qf,{size:16})]})]})]})}import{CodeBlock as un,InstallCommand as Jf}from"@contractspec/lib.design-system";import dd from"@contractspec/lib.ui-link";import{ChevronRight as $f}from"lucide-react";import{jsx as La,jsxs as ei}from"react/jsx-runtime";function Zf(){return ei("div",{className:"space-y-8",children:[ei("div",{className:"space-y-4",children:[La("h1",{className:"font-bold text-4xl",children:"Overlay Engine"}),La("p",{className:"text-lg text-muted-foreground",children:"`@contractspec/lib.overlay-engine` keeps OverlaySpecs typed, signed, and auditable across tenants, roles, users, and devices."})]}),ei("div",{className:"space-y-4",children:[La("h2",{className:"font-bold text-2xl",children:"Installation"}),La(Jf,{package:"@contractspec/lib.overlay-engine"})]}),ei("div",{className:"space-y-4",children:[La("h2",{className:"font-bold text-2xl",children:"Define + Sign"}),La(un,{language:"typescript",code:`import { defineOverlay } from '@contractspec/lib.overlay-engine/spec';
4002
+ });`})]}),ko("div",{className:"flex items-center gap-4 pt-4",children:[xt(ld,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ko(ld,{href:"/docs/libraries/slo",className:"btn-primary",children:["Next: SLO ",xt(Qf,{size:16})]})]})]})}import{CodeBlock as un,InstallCommand as Jf}from"@contractspec/lib.design-system";import dd from"@contractspec/lib.ui-link";import{ChevronRight as Zf}from"lucide-react";import{jsx as La,jsxs as ei}from"react/jsx-runtime";function $f(){return ei("div",{className:"space-y-8",children:[ei("div",{className:"space-y-4",children:[La("h1",{className:"font-bold text-4xl",children:"Overlay Engine"}),La("p",{className:"text-lg text-muted-foreground",children:"`@contractspec/lib.overlay-engine` keeps OverlaySpecs typed, signed, and auditable across tenants, roles, users, and devices."})]}),ei("div",{className:"space-y-4",children:[La("h2",{className:"font-bold text-2xl",children:"Installation"}),La(Jf,{package:"@contractspec/lib.overlay-engine"})]}),ei("div",{className:"space-y-4",children:[La("h2",{className:"font-bold text-2xl",children:"Define + Sign"}),La(un,{language:"typescript",code:`import { defineOverlay } from '@contractspec/lib.overlay-engine/spec';
4003
4003
  import { signOverlay } from '@contractspec/lib.overlay-engine/signer';
4004
4004
 
4005
4005
  const overlay = defineOverlay({
@@ -4027,7 +4027,7 @@ const { target } = useOverlay(engine, {
4027
4027
  target: { fields },
4028
4028
  capability: 'billing.createOrder',
4029
4029
  tenantId: 'acme',
4030
- });`})]}),ei("div",{className:"flex items-center gap-4 pt-4",children:[La(dd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ei(dd,{href:"/docs/libraries/workflow-composer",className:"btn-primary",children:["Next: Workflow Composer ",La($f,{size:16})]})]})]})}import Xf from"@contractspec/lib.ui-link";import{ChevronRight as xf}from"lucide-react";import{jsx as Wa,jsxs as ti}from"react/jsx-runtime";var jf=[{title:"Contract and schema foundation",body:"Use these packages to define explicit contracts, schemas, and generated artifacts without inventing a new platform-specific language.",items:[{title:"@contractspec/lib.contracts-spec",description:"Define operations, events, policies, and generated surfaces in TypeScript.",href:"/docs/libraries/contracts"},{title:"@contractspec/lib.schema",description:"Share type-safe schema definitions across validation, clients, and runtime adapters.",href:"/docs/libraries/schema"}]},{title:"Runtime and surface libraries",body:"These packages execute the contract model across UI, data, observability, workflows, and generated runtime behavior.",items:[{title:"@contractspec/lib.runtime",description:"Run typed capability surfaces, execute policies, and connect runtime adapters.",href:"/docs/libraries/runtime"},{title:"@contractspec/lib.ui-kit",description:"Render shared surfaces across web and React Native without forking the contract layer.",href:"/docs/libraries/ui-kit"},{title:"@contractspec/lib.ui-kit-web",description:"Use the raw web primitive layer directly when you want the browser table, accessibility, and interaction model without the design-system shell.",href:"/docs/libraries/ui-kit-web"},{title:"@contractspec/lib.design-system",description:"Build higher-level product surfaces and documented marketing/docs primitives on top of the web and native UI packages.",href:"/docs/libraries/design-system"},{title:"Cross-platform UI",description:"See how the presentation runtimes, ui-kit-web, ui-kit, and design-system stay compatible across React and React Native.",href:"/docs/libraries/cross-platform-ui"},{title:"@contractspec/lib.data-views",description:"Generate and render list/detail style surfaces that stay aligned with data contracts.",href:"/docs/libraries/data-views"}]},{title:"Operator and system packages",body:"These packages matter once the system is live and you need governance, resilience, and observability.",items:[{title:"@contractspec/lib.observability",description:"Trace, log, and measure contract execution using the same system boundaries.",href:"/docs/libraries/observability"},{title:"@contractspec/lib.resilience",description:"Add circuit breakers, retries, and failure controls without hiding the integration model.",href:"/docs/libraries/resilience"},{title:"@contractspec/lib.multi-tenancy",description:"Keep tenant-specific config, policy, and surface resolution explicit.",href:"/docs/libraries/multi-tenancy"},{title:"@contractspec/lib.workflow-composer",description:"Compose and extend workflows without smearing orchestration concerns across apps.",href:"/docs/libraries/workflow-composer"}]}];function eh(){return ti("div",{className:"space-y-10",children:[ti("div",{className:"space-y-3",children:[Wa("p",{className:"editorial-kicker",children:"Build"}),Wa("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"The OSS foundation is a library system, not a closed platform."}),Wa("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is assembled from libraries that remain useful on their own and stronger together. Start with the contract and schema foundation, then add runtime, UI, integration, and operator packages as your system grows."})]}),ti("div",{className:"editorial-proof-strip",children:[ti("div",{className:"editorial-stat",children:[Wa("span",{className:"editorial-label",children:"Layering rule"}),Wa("span",{className:"editorial-stat-value",children:"libs \u2192 bundles \u2192 apps"})]}),Wa("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Keep reusable behavior in libraries, compose it into bundle-level surfaces, and reserve app packages for concrete delivery shells."})]}),Wa("div",{className:"space-y-6",children:jf.map((e)=>ti("section",{className:"editorial-panel space-y-5",children:[ti("div",{className:"space-y-2",children:[Wa("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:e.title}),Wa("p",{className:"text-muted-foreground text-sm leading-7",children:e.body})]}),Wa("div",{className:"grid gap-4 md:grid-cols-2",children:e.items.map((t)=>ti(Xf,{href:t.href,className:"rounded-[24px] border border-border/75 bg-background/70 p-5 transition-colors hover:border-[color:rgb(162_79_42_/_0.45)]",children:[Wa("h3",{className:"font-semibold text-lg",children:t.title}),Wa("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:t.description}),ti("div",{className:"mt-3 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Learn more ",Wa(xf,{size:14})]})]},t.title))})]},e.title))})]})}import{CodeBlock as gn,InstallCommand as th}from"@contractspec/lib.design-system";import sd from"@contractspec/lib.ui-link";import{ChevronRight as ah}from"lucide-react";import{jsx as ua,jsxs as ai}from"react/jsx-runtime";function oh(){return ai("div",{className:"space-y-8",children:[ai("div",{className:"space-y-4",children:[ua("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.personalization"}),ua("p",{className:"text-lg text-muted-foreground",children:"Track field/feature/workflow usage, analyze drop-offs, and convert insights into OverlaySpecs or workflow tweaks."})]}),ai("div",{className:"space-y-4",children:[ua("h2",{className:"font-bold text-2xl",children:"Installation"}),ua(th,{package:"@contractspec/lib.personalization"})]}),ai("div",{className:"space-y-4",children:[ua("h2",{className:"font-bold text-2xl",children:"Tracker"}),ua("p",{className:"text-muted-foreground",children:"Buffer events per tenant/user and emit OpenTelemetry counters automatically."}),ua(gn,{language:"typescript",code:`import { createBehaviorTracker } from '@contractspec/lib.personalization';
4030
+ });`})]}),ei("div",{className:"flex items-center gap-4 pt-4",children:[La(dd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ei(dd,{href:"/docs/libraries/workflow-composer",className:"btn-primary",children:["Next: Workflow Composer ",La(Zf,{size:16})]})]})]})}import Xf from"@contractspec/lib.ui-link";import{ChevronRight as xf}from"lucide-react";import{jsx as Wa,jsxs as ti}from"react/jsx-runtime";var jf=[{title:"Contract and schema foundation",body:"Use these packages to define explicit contracts, schemas, and generated artifacts without inventing a new platform-specific language.",items:[{title:"@contractspec/lib.contracts-spec",description:"Define operations, events, policies, and generated surfaces in TypeScript.",href:"/docs/libraries/contracts"},{title:"@contractspec/lib.schema",description:"Share type-safe schema definitions across validation, clients, and runtime adapters.",href:"/docs/libraries/schema"}]},{title:"Runtime and surface libraries",body:"These packages execute the contract model across UI, data, observability, workflows, and generated runtime behavior.",items:[{title:"@contractspec/lib.runtime",description:"Run typed capability surfaces, execute policies, and connect runtime adapters.",href:"/docs/libraries/runtime"},{title:"@contractspec/lib.ui-kit",description:"Render shared surfaces across web and React Native without forking the contract layer.",href:"/docs/libraries/ui-kit"},{title:"@contractspec/lib.ui-kit-web",description:"Use the raw web primitive layer directly when you want the browser table, accessibility, and interaction model without the design-system shell.",href:"/docs/libraries/ui-kit-web"},{title:"@contractspec/lib.design-system",description:"Build higher-level product surfaces and documented marketing/docs primitives on top of the web and native UI packages.",href:"/docs/libraries/design-system"},{title:"Cross-platform UI",description:"See how the presentation runtimes, ui-kit-web, ui-kit, and design-system stay compatible across React and React Native.",href:"/docs/libraries/cross-platform-ui"},{title:"@contractspec/lib.data-views",description:"Generate and render list/detail style surfaces that stay aligned with data contracts.",href:"/docs/libraries/data-views"}]},{title:"Operator and system packages",body:"These packages matter once the system is live and you need governance, resilience, and observability.",items:[{title:"@contractspec/lib.observability",description:"Trace, log, and measure contract execution using the same system boundaries.",href:"/docs/libraries/observability"},{title:"@contractspec/lib.resilience",description:"Add circuit breakers, retries, and failure controls without hiding the integration model.",href:"/docs/libraries/resilience"},{title:"@contractspec/lib.multi-tenancy",description:"Keep tenant-specific config, policy, and surface resolution explicit.",href:"/docs/libraries/multi-tenancy"},{title:"@contractspec/lib.workflow-composer",description:"Compose and extend workflows without smearing orchestration concerns across apps.",href:"/docs/libraries/workflow-composer"}]}];function eh(){return ti("div",{className:"space-y-10",children:[ti("div",{className:"space-y-3",children:[Wa("p",{className:"editorial-kicker",children:"Build"}),Wa("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"The OSS foundation is a library system, not a closed platform."}),Wa("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is assembled from libraries that remain useful on their own and stronger together. Start with the contract and schema foundation, then add runtime, UI, integration, and operator packages as your system grows."})]}),ti("div",{className:"editorial-proof-strip",children:[ti("div",{className:"editorial-stat",children:[Wa("span",{className:"editorial-label",children:"Layering rule"}),Wa("span",{className:"editorial-stat-value",children:"libs \u2192 bundles \u2192 apps"})]}),Wa("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Keep reusable behavior in libraries, compose it into bundle-level surfaces, and reserve app packages for concrete delivery shells."})]}),Wa("div",{className:"space-y-6",children:jf.map((e)=>ti("section",{className:"editorial-panel space-y-5",children:[ti("div",{className:"space-y-2",children:[Wa("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:e.title}),Wa("p",{className:"text-muted-foreground text-sm leading-7",children:e.body})]}),Wa("div",{className:"grid gap-4 md:grid-cols-2",children:e.items.map((t)=>ti(Xf,{href:t.href,className:"rounded-[24px] border border-border/75 bg-background/70 p-5 transition-colors hover:border-[color:rgb(162_79_42_/_0.45)]",children:[Wa("h3",{className:"font-semibold text-lg",children:t.title}),Wa("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:t.description}),ti("div",{className:"mt-3 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Learn more ",Wa(xf,{size:14})]})]},t.title))})]},e.title))})]})}import{CodeBlock as gn,InstallCommand as th}from"@contractspec/lib.design-system";import sd from"@contractspec/lib.ui-link";import{ChevronRight as ah}from"lucide-react";import{jsx as ua,jsxs as ai}from"react/jsx-runtime";function oh(){return ai("div",{className:"space-y-8",children:[ai("div",{className:"space-y-4",children:[ua("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.personalization"}),ua("p",{className:"text-lg text-muted-foreground",children:"Track field/feature/workflow usage, analyze drop-offs, and convert insights into OverlaySpecs or workflow tweaks."})]}),ai("div",{className:"space-y-4",children:[ua("h2",{className:"font-bold text-2xl",children:"Installation"}),ua(th,{package:"@contractspec/lib.personalization"})]}),ai("div",{className:"space-y-4",children:[ua("h2",{className:"font-bold text-2xl",children:"Tracker"}),ua("p",{className:"text-muted-foreground",children:"Buffer events per tenant/user and emit OpenTelemetry counters automatically."}),ua(gn,{language:"typescript",code:`import { createBehaviorTracker } from '@contractspec/lib.personalization';
4031
4031
 
4032
4032
  const tracker = createBehaviorTracker({
4033
4033
  store,
@@ -4127,7 +4127,7 @@ export function OnboardingPage() {
4127
4127
  </div>
4128
4128
  </div>
4129
4129
  );
4130
- }`})]}),Ve("div",{className:"space-y-4",children:[Me("h2",{className:"font-bold text-2xl",children:"Architecture"}),Me("p",{className:"text-muted-foreground",children:'The runtime follows a "render-loop" pattern:'}),Ve("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[Ve("li",{children:[Me("strong",{children:"Spec"}),": Defines the flow, fields, and validation rules."]}),Ve("li",{children:[Me("strong",{children:"Core"}),": Tracks current step, data state, and validation errors."]}),Ve("li",{children:[Me("strong",{children:"Renderer"}),": Maps spec fields to UI components (Input, Select, etc.)."]}),Ve("li",{children:[Me("strong",{children:"User"}),": Interacts with components, updating core state."]}),Ve("li",{children:[Me("strong",{children:"Policy"}),": (Optional) Re-evaluates visibility on every change."]})]})]}),Ve("div",{className:"card-subtle space-y-3 p-6",children:[Me("h2",{className:"font-bold text-2xl",children:"Related reading"}),Ve("p",{className:"text-muted-foreground",children:["For the full React and React Native layering story across runtime, primitives, and composed components, read"," ",Me(hn,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"}),"."]})]}),Ve("div",{className:"flex items-center gap-4 pt-4",children:[Me(hn,{href:"/docs/libraries/data-backend",className:"btn-ghost",children:"Previous: Data & Backend"}),Ve(hn,{href:"/docs/libraries",className:"btn-primary",children:["Back to Libraries ",Me(mh,{size:16})]})]})]})}import{CodeBlock as gd,InstallCommand as gh}from"@contractspec/lib.design-system";import fd from"@contractspec/lib.ui-link";import{ChevronRight as fh}from"lucide-react";import{jsx as E,jsxs as Fe}from"react/jsx-runtime";function hh(){return Fe("div",{className:"space-y-8",children:[Fe("div",{className:"space-y-4",children:[E("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.schema"}),E("p",{className:"text-muted-foreground",children:"A small schema dictionary to describe operation I/O once and export to Zod (runtime validation), Pothos (GraphQL type refs), and JSON Schema."})]}),Fe("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Installation"}),E(gh,{package:"@contractspec/lib.schema"})]}),Fe("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Core Exports"}),Fe("ul",{className:"space-y-2 text-muted-foreground",children:[Fe("li",{children:[E("code",{className:"rounded bg-background/50 px-2 py-1",children:"SchemaModel"}),": Compose fields into typed object models"]}),Fe("li",{children:[E("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum"}),": Common scalar types (NonEmptyString, Email, DateTime, etc.)"]}),Fe("li",{children:[E("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum"}),": Create type-safe enums"]}),Fe("li",{children:[E("code",{className:"rounded bg-background/50 px-2 py-1",children:"FieldType"}),": Wrap scalars with Zod/GraphQL/JSON Schema"]})]})]}),Fe("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Example: Basic Schema"}),E(gd,{language:"typescript",code:`import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
4130
+ }`})]}),Ve("div",{className:"space-y-4",children:[Me("h2",{className:"font-bold text-2xl",children:"Architecture"}),Me("p",{className:"text-muted-foreground",children:'The runtime follows a "render-loop" pattern:'}),Ve("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[Ve("li",{children:[Me("strong",{children:"Spec"}),": Defines the flow, fields, and validation rules."]}),Ve("li",{children:[Me("strong",{children:"Core"}),": Tracks current step, data state, and validation errors."]}),Ve("li",{children:[Me("strong",{children:"Renderer"}),": Maps spec fields to UI components (Input, Select, etc.)."]}),Ve("li",{children:[Me("strong",{children:"User"}),": Interacts with components, updating core state."]}),Ve("li",{children:[Me("strong",{children:"Policy"}),": (Optional) Re-evaluates visibility on every change."]})]})]}),Ve("div",{className:"card-subtle space-y-3 p-6",children:[Me("h2",{className:"font-bold text-2xl",children:"Related reading"}),Ve("p",{className:"text-muted-foreground",children:["For the full React and React Native layering story across runtime, primitives, and composed components, read"," ",Me(hn,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"}),"."]})]}),Ve("div",{className:"flex items-center gap-4 pt-4",children:[Me(hn,{href:"/docs/libraries/data-backend",className:"btn-ghost",children:"Previous: Data & Backend"}),Ve(hn,{href:"/docs/libraries",className:"btn-primary",children:["Back to Libraries ",Me(mh,{size:16})]})]})]})}import{CodeBlock as gd,InstallCommand as gh}from"@contractspec/lib.design-system";import fd from"@contractspec/lib.ui-link";import{ChevronRight as fh}from"lucide-react";import{jsx as D,jsxs as Fe}from"react/jsx-runtime";function hh(){return Fe("div",{className:"space-y-8",children:[Fe("div",{className:"space-y-4",children:[D("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.schema"}),D("p",{className:"text-muted-foreground",children:"A small schema dictionary to describe operation I/O once and export to Zod (runtime validation), Pothos (GraphQL type refs), and JSON Schema."})]}),Fe("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Installation"}),D(gh,{package:"@contractspec/lib.schema"})]}),Fe("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Core Exports"}),Fe("ul",{className:"space-y-2 text-muted-foreground",children:[Fe("li",{children:[D("code",{className:"rounded bg-background/50 px-2 py-1",children:"SchemaModel"}),": Compose fields into typed object models"]}),Fe("li",{children:[D("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum"}),": Common scalar types (NonEmptyString, Email, DateTime, etc.)"]}),Fe("li",{children:[D("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum"}),": Create type-safe enums"]}),Fe("li",{children:[D("code",{className:"rounded bg-background/50 px-2 py-1",children:"FieldType"}),": Wrap scalars with Zod/GraphQL/JSON Schema"]})]})]}),Fe("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Example: Basic Schema"}),D(gd,{language:"typescript",code:`import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
4131
4131
 
4132
4132
  export const CreateSpotInput = new SchemaModel({
4133
4133
  name: 'CreateSpotInput',
@@ -4145,7 +4145,7 @@ const zodSchema = CreateSpotInput.getZod();
4145
4145
  const pothosName = CreateSpotInput.getPothosInput();
4146
4146
 
4147
4147
  // Get JSON Schema
4148
- const jsonSchema = CreateSpotInput.getJsonSchema();`})]}),Fe("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Example: Enums"}),E(gd,{language:"typescript",code:`import { defineEnum, SchemaModel } from '@contractspec/lib.schema';
4148
+ const jsonSchema = CreateSpotInput.getJsonSchema();`})]}),Fe("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Example: Enums"}),D(gd,{language:"typescript",code:`import { defineEnum, SchemaModel } from '@contractspec/lib.schema';
4149
4149
 
4150
4150
  const Weekday = defineEnum('Weekday', [
4151
4151
  'MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU',
@@ -4160,7 +4160,7 @@ const RecurrenceRule = new SchemaModel({
4160
4160
  },
4161
4161
  byWeekday: { type: Weekday, isOptional: true, isArray: true },
4162
4162
  },
4163
- });`})]}),Fe("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Available Scalars"}),Fe("div",{className:"grid gap-4 md:grid-cols-2",children:[Fe("div",{className:"card-subtle p-4",children:[E("h3",{className:"mb-2 font-semibold",children:"Strings"}),Fe("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[E("li",{children:E("code",{children:"NonEmptyString()"})}),E("li",{children:E("code",{children:"Email()"})}),E("li",{children:E("code",{children:"PhoneNumber()"})}),E("li",{children:E("code",{children:"CountryCode()"})}),E("li",{children:E("code",{children:"Locale()"})}),E("li",{children:E("code",{children:"TimeZone()"})})]})]}),Fe("div",{className:"card-subtle p-4",children:[E("h3",{className:"mb-2 font-semibold",children:"Numbers"}),Fe("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[E("li",{children:E("code",{children:"PositiveNumber()"})}),E("li",{children:E("code",{children:"Latitude()"})}),E("li",{children:E("code",{children:"Longitude()"})})]})]}),Fe("div",{className:"card-subtle p-4",children:[E("h3",{className:"mb-2 font-semibold",children:"Dates & Times"}),Fe("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[E("li",{children:E("code",{children:"Date()"})}),E("li",{children:E("code",{children:"DateTime()"})})]})]}),Fe("div",{className:"card-subtle p-4",children:[E("h3",{className:"mb-2 font-semibold",children:"Generic"}),Fe("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[E("li",{children:E("code",{children:"String()"})}),E("li",{children:E("code",{children:"JSON()"})})]})]})]})]}),Fe("div",{className:"flex items-center gap-4 pt-4",children:[E(fd,{href:"/docs/libraries/contracts",className:"btn-ghost",children:"Previous: Contracts"}),Fe(fd,{href:"/docs/libraries/ui-kit",className:"btn-primary",children:["Next: UI Kit ",E(fh,{size:16})]})]})]})}import{CodeBlock as hd,InstallCommand as yh}from"@contractspec/lib.design-system";import yd from"@contractspec/lib.ui-link";import{ChevronRight as bh}from"lucide-react";import{jsx as _a,jsxs as So}from"react/jsx-runtime";function vh(){return So("div",{className:"space-y-8",children:[So("div",{className:"space-y-4",children:[_a("h1",{className:"font-bold text-4xl",children:"SLO Library"}),So("p",{className:"text-lg text-muted-foreground",children:[_a("code",{children:"@contractspec/lib.slo"})," keeps service level objectives front and center\u2014declarative definitions, rolling snapshots, burn-rate math, and automated incidents."]})]}),So("div",{className:"space-y-4",children:[_a("h2",{className:"font-bold text-2xl",children:"Installation"}),_a(yh,{package:"@contractspec/lib.slo"})]}),So("div",{className:"space-y-4",children:[_a("h2",{className:"font-bold text-2xl",children:"Define Targets"}),_a(hd,{language:"typescript",code:`const definition: SLODefinition = {
4163
+ });`})]}),Fe("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Available Scalars"}),Fe("div",{className:"grid gap-4 md:grid-cols-2",children:[Fe("div",{className:"card-subtle p-4",children:[D("h3",{className:"mb-2 font-semibold",children:"Strings"}),Fe("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[D("li",{children:D("code",{children:"NonEmptyString()"})}),D("li",{children:D("code",{children:"Email()"})}),D("li",{children:D("code",{children:"PhoneNumber()"})}),D("li",{children:D("code",{children:"CountryCode()"})}),D("li",{children:D("code",{children:"Locale()"})}),D("li",{children:D("code",{children:"TimeZone()"})})]})]}),Fe("div",{className:"card-subtle p-4",children:[D("h3",{className:"mb-2 font-semibold",children:"Numbers"}),Fe("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[D("li",{children:D("code",{children:"PositiveNumber()"})}),D("li",{children:D("code",{children:"Latitude()"})}),D("li",{children:D("code",{children:"Longitude()"})})]})]}),Fe("div",{className:"card-subtle p-4",children:[D("h3",{className:"mb-2 font-semibold",children:"Dates & Times"}),Fe("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[D("li",{children:D("code",{children:"Date()"})}),D("li",{children:D("code",{children:"DateTime()"})})]})]}),Fe("div",{className:"card-subtle p-4",children:[D("h3",{className:"mb-2 font-semibold",children:"Generic"}),Fe("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[D("li",{children:D("code",{children:"String()"})}),D("li",{children:D("code",{children:"JSON()"})})]})]})]})]}),Fe("div",{className:"flex items-center gap-4 pt-4",children:[D(fd,{href:"/docs/libraries/contracts",className:"btn-ghost",children:"Previous: Contracts"}),Fe(fd,{href:"/docs/libraries/ui-kit",className:"btn-primary",children:["Next: UI Kit ",D(fh,{size:16})]})]})]})}import{CodeBlock as hd,InstallCommand as yh}from"@contractspec/lib.design-system";import yd from"@contractspec/lib.ui-link";import{ChevronRight as bh}from"lucide-react";import{jsx as _a,jsxs as So}from"react/jsx-runtime";function vh(){return So("div",{className:"space-y-8",children:[So("div",{className:"space-y-4",children:[_a("h1",{className:"font-bold text-4xl",children:"SLO Library"}),So("p",{className:"text-lg text-muted-foreground",children:[_a("code",{children:"@contractspec/lib.slo"})," keeps service level objectives front and center\u2014declarative definitions, rolling snapshots, burn-rate math, and automated incidents."]})]}),So("div",{className:"space-y-4",children:[_a("h2",{className:"font-bold text-2xl",children:"Installation"}),_a(yh,{package:"@contractspec/lib.slo"})]}),So("div",{className:"space-y-4",children:[_a("h2",{className:"font-bold text-2xl",children:"Define Targets"}),_a(hd,{language:"typescript",code:`const definition: SLODefinition = {
4164
4164
  id: 'billing.createInvoice.availability',
4165
4165
  targetAvailability: 0.999,
4166
4166
  latencyP99TargetMs: 500,
@@ -4211,7 +4211,7 @@ const code = generator.generate(snapshots, {
4211
4211
  runnerImport: './tests/run-operation',
4212
4212
  runnerFunction: 'runOrdersCommand',
4213
4213
  framework: 'vitest',
4214
- });`})]}),Wo("div",{className:"space-y-3",children:[ya("h2",{className:"font-bold text-2xl",children:"CLI workflow"}),ya(yn,{language:"bash",code:"contractspec test generate \\\n --operation orders.create \\\n --output tests/orders.create.golden.test.ts \\\n --runner-import ./tests/run-operation \\\n --runner-fn runOrdersCommand \\\n --from-production \\\n --days 7 \\\n --sample-rate 0.05"})]}),ya("div",{className:"grid gap-4 md:grid-cols-2",children:[{title:"Framework agnostic",description:"Vitest by default, Jest via `generateJestSuite`, or call `runGoldenTests` manually inside CI."},{title:"Sanitize & sample",description:"Scrub payloads before persistence and control sample rates per operation to stay within compliance limits."}].map((e)=>Wo("div",{className:"card-subtle space-y-2 p-4",children:[ya("h3",{className:"font-semibold text-lg",children:e.title}),ya("p",{className:"text-muted-foreground text-sm",children:e.description})]},e.title))}),Wo("div",{className:"flex items-center gap-4 pt-4",children:[ya(Nd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Wo(Nd,{href:"/docs/libraries/resilience",className:"btn-primary",children:["Next: Resilience ",ya(Ch,{size:16})]})]})]})}import{CodeBlock as Ph,InstallCommand as Th}from"@contractspec/lib.design-system";import Pr from"@contractspec/lib.ui-link";import{ChevronRight as Ah}from"lucide-react";import{jsx as $,jsxs as Ue}from"react/jsx-runtime";var Rh=`import { DataTable } from '@contractspec/lib.ui-kit/ui/data-table';
4214
+ });`})]}),Wo("div",{className:"space-y-3",children:[ya("h2",{className:"font-bold text-2xl",children:"CLI workflow"}),ya(yn,{language:"bash",code:"contractspec test generate \\\n --operation orders.create \\\n --output tests/orders.create.golden.test.ts \\\n --runner-import ./tests/run-operation \\\n --runner-fn runOrdersCommand \\\n --from-production \\\n --days 7 \\\n --sample-rate 0.05"})]}),ya("div",{className:"grid gap-4 md:grid-cols-2",children:[{title:"Framework agnostic",description:"Vitest by default, Jest via `generateJestSuite`, or call `runGoldenTests` manually inside CI."},{title:"Sanitize & sample",description:"Scrub payloads before persistence and control sample rates per operation to stay within compliance limits."}].map((e)=>Wo("div",{className:"card-subtle space-y-2 p-4",children:[ya("h3",{className:"font-semibold text-lg",children:e.title}),ya("p",{className:"text-muted-foreground text-sm",children:e.description})]},e.title))}),Wo("div",{className:"flex items-center gap-4 pt-4",children:[ya(Nd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Wo(Nd,{href:"/docs/libraries/resilience",className:"btn-primary",children:["Next: Resilience ",ya(Ch,{size:16})]})]})]})}import{CodeBlock as Ph,InstallCommand as Th}from"@contractspec/lib.design-system";import Pr from"@contractspec/lib.ui-link";import{ChevronRight as Ah}from"lucide-react";import{jsx as Z,jsxs as Ue}from"react/jsx-runtime";var Rh=`import { DataTable } from '@contractspec/lib.ui-kit/ui/data-table';
4215
4215
  import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
4216
4216
 
4217
4217
  import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
@@ -4255,7 +4255,7 @@ export function NativeAccountGrid() {
4255
4255
  footer={\`Rows \${controller.rows.length}\`}
4256
4256
  />
4257
4257
  );
4258
- }`;function Lh(){return Ue("div",{className:"space-y-8",children:[Ue("div",{className:"space-y-4",children:[$("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit"}),Ue("p",{className:"text-muted-foreground",children:["Universal UI components for React Native and Web, built on top of",$("code",{children:"nativewind"})," and ",$("code",{children:"@rn-primitives"}),"."]})]}),Ue("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Installation"}),$(Th,{package:"@contractspec/lib.ui-kit"})]}),Ue("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Key Features"}),Ue("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Ue("li",{children:[$("strong",{children:"Universal"}),": Components render natively on iOS/Android and as standard HTML on web"]}),Ue("li",{children:[$("strong",{children:"Styled with NativeWind"}),": Uses Tailwind CSS classes for styling"]}),Ue("li",{children:[$("strong",{children:"Accessible"}),": Leverages ",$("code",{children:"@rn-primitives"})," ","(Radix UI for Native)"]}),Ue("li",{children:[$("strong",{children:"Atomic Design"}),": Exports atoms, molecules, and organisms"]})]})]}),Ue("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Data table example"}),Ue("p",{className:"text-muted-foreground",children:["The canonical"," ",$(Pr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"})," ","uses ",$("code",{children:"@contractspec/lib.ui-kit/ui/data-table"})," as the native-first primitive lane. It shares the same controller model as the web renderer while keeping the React Native / Expo surface explicit."]}),$(Ph,{language:"tsx",code:Rh})]}),Ue("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Core Components"}),Ue("div",{className:"grid gap-4 md:grid-cols-3",children:[Ue("div",{className:"card-subtle p-4",children:[$("h3",{className:"mb-2 font-semibold",children:"Form Controls"}),Ue("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[$("li",{children:"Button"}),$("li",{children:"Input"}),$("li",{children:"Checkbox"}),$("li",{children:"Switch"}),$("li",{children:"Select"})]})]}),Ue("div",{className:"card-subtle p-4",children:[$("h3",{className:"mb-2 font-semibold",children:"Layout"}),Ue("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[$("li",{children:"Card"}),$("li",{children:"Stack"}),$("li",{children:"Separator"}),$("li",{children:"Sheet"})]})]}),Ue("div",{className:"card-subtle p-4",children:[$("h3",{className:"mb-2 font-semibold",children:"Feedback"}),Ue("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[$("li",{children:"Alert"}),$("li",{children:"Skeleton"}),$("li",{children:"Progress"}),$("li",{children:"Tooltip"})]})]})]})]}),Ue("div",{className:"card-subtle space-y-3 p-6",children:[$("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),Ue("p",{className:"text-muted-foreground",children:["Read"," ",$(Pr,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the full React and React Native compatibility model around this native-first primitive lane."]})]}),Ue("div",{className:"flex items-center gap-4 pt-4",children:[$(Pr,{href:"/docs/libraries/schema",className:"btn-ghost",children:"Previous: Schema"}),Ue(Pr,{href:"/docs/libraries/ui-kit-web",className:"btn-primary",children:["Next: UI Kit Web ",$(Ah,{size:16})]})]})]})}import{CodeBlock as Eh,InstallCommand as Dh}from"@contractspec/lib.design-system";import Tr from"@contractspec/lib.ui-link";import{ChevronRight as Oh}from"lucide-react";import{jsx as ba,jsxs as no}from"react/jsx-runtime";var Bh=`import { DataTable } from '@contractspec/lib.ui-kit-web/ui/data-table';
4258
+ }`;function Lh(){return Ue("div",{className:"space-y-8",children:[Ue("div",{className:"space-y-4",children:[Z("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit"}),Ue("p",{className:"text-muted-foreground",children:["Universal UI components for React Native and Web, built on top of",Z("code",{children:"nativewind"})," and ",Z("code",{children:"@rn-primitives"}),"."]})]}),Ue("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Installation"}),Z(Th,{package:"@contractspec/lib.ui-kit"})]}),Ue("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Key Features"}),Ue("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Ue("li",{children:[Z("strong",{children:"Universal"}),": Components render natively on iOS/Android and as standard HTML on web"]}),Ue("li",{children:[Z("strong",{children:"Styled with NativeWind"}),": Uses Tailwind CSS classes for styling"]}),Ue("li",{children:[Z("strong",{children:"Accessible"}),": Leverages ",Z("code",{children:"@rn-primitives"})," ","(Radix UI for Native)"]}),Ue("li",{children:[Z("strong",{children:"Atomic Design"}),": Exports atoms, molecules, and organisms"]})]})]}),Ue("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Data table example"}),Ue("p",{className:"text-muted-foreground",children:["The canonical"," ",Z(Pr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"})," ","uses ",Z("code",{children:"@contractspec/lib.ui-kit/ui/data-table"})," as the native-first primitive lane. It shares the same controller model as the web renderer while keeping the React Native / Expo surface explicit."]}),Z(Ph,{language:"tsx",code:Rh})]}),Ue("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Core Components"}),Ue("div",{className:"grid gap-4 md:grid-cols-3",children:[Ue("div",{className:"card-subtle p-4",children:[Z("h3",{className:"mb-2 font-semibold",children:"Form Controls"}),Ue("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[Z("li",{children:"Button"}),Z("li",{children:"Input"}),Z("li",{children:"Checkbox"}),Z("li",{children:"Switch"}),Z("li",{children:"Select"})]})]}),Ue("div",{className:"card-subtle p-4",children:[Z("h3",{className:"mb-2 font-semibold",children:"Layout"}),Ue("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[Z("li",{children:"Card"}),Z("li",{children:"Stack"}),Z("li",{children:"Separator"}),Z("li",{children:"Sheet"})]})]}),Ue("div",{className:"card-subtle p-4",children:[Z("h3",{className:"mb-2 font-semibold",children:"Feedback"}),Ue("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[Z("li",{children:"Alert"}),Z("li",{children:"Skeleton"}),Z("li",{children:"Progress"}),Z("li",{children:"Tooltip"})]})]})]})]}),Ue("div",{className:"card-subtle space-y-3 p-6",children:[Z("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),Ue("p",{className:"text-muted-foreground",children:["Read"," ",Z(Pr,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the full React and React Native compatibility model around this native-first primitive lane."]})]}),Ue("div",{className:"flex items-center gap-4 pt-4",children:[Z(Pr,{href:"/docs/libraries/schema",className:"btn-ghost",children:"Previous: Schema"}),Ue(Pr,{href:"/docs/libraries/ui-kit-web",className:"btn-primary",children:["Next: UI Kit Web ",Z(Ah,{size:16})]})]})]})}import{CodeBlock as Dh,InstallCommand as Eh}from"@contractspec/lib.design-system";import Tr from"@contractspec/lib.ui-link";import{ChevronRight as Oh}from"lucide-react";import{jsx as ba,jsxs as no}from"react/jsx-runtime";var Bh=`import { DataTable } from '@contractspec/lib.ui-kit-web/ui/data-table';
4259
4259
  import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
4260
4260
 
4261
4261
  import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
@@ -4300,7 +4300,7 @@ export function WebAccountGrid() {
4300
4300
  footer={\`Rows \${controller.totalItems}\`}
4301
4301
  />
4302
4302
  );
4303
- }`;function Mh(){return no("div",{className:"space-y-8",children:[no("div",{className:"space-y-4",children:[ba("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit-web"}),ba("p",{className:"text-muted-foreground",children:"Web-first React and Next primitives for ContractSpec. The canonical data-table example uses this package to render the raw browser table layer directly, without the design-system shell on top."})]}),no("div",{className:"space-y-4",children:[ba("h2",{className:"font-bold text-2xl",children:"Installation"}),ba(Dh,{package:"@contractspec/lib.ui-kit-web"})]}),no("div",{className:"space-y-4",children:[ba("h2",{className:"font-bold text-2xl",children:"Data table example"}),no("p",{className:"text-muted-foreground",children:["This is the raw browser lane from the canonical"," ",ba(Tr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),". It demonstrates the primitive renderer with sorting, pagination, single selection, column visibility, column resizing, left/right pinning, row expansion, loading, and empty-state slots."]}),ba(Eh,{language:"tsx",filename:"web-account-grid.tsx",code:Bh})]}),no("div",{className:"space-y-4",children:[ba("h2",{className:"font-bold text-2xl",children:"What this layer owns"}),no("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[ba("li",{children:"The raw table renderer and browser interaction model."}),ba("li",{children:"Pagination, column visibility menus, pin menus, resize handles, and empty/loading states."}),ba("li",{children:"Accessibility helpers and other web-specific primitives that stay outside the native-first package."})]})]}),no("div",{className:"card-subtle space-y-3 p-6",children:[ba("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),no("p",{className:"text-muted-foreground",children:["Read"," ",ba(Tr,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the shared runtime story behind the web and native render lanes."]})]}),no("div",{className:"flex items-center gap-4 pt-4",children:[ba(Tr,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"Previous: UI Kit"}),no(Tr,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Next: Design System ",ba(Oh,{size:16})]})]})]})}import{CodeBlock as wd,InstallCommand as Uh}from"@contractspec/lib.design-system";import kd from"@contractspec/lib.ui-link";import{ChevronRight as Wh}from"lucide-react";import{jsx as Co,jsxs as mi}from"react/jsx-runtime";function _h(){return mi("div",{className:"space-y-8",children:[mi("div",{className:"space-y-4",children:[Co("h1",{className:"font-bold text-4xl",children:"Workflow Composer"}),Co("p",{className:"text-lg text-muted-foreground",children:"`@contractspec/lib.workflow-composer` injects tenant-/role-/device-specific steps into base WorkflowSpecs and keeps transitions valid."})]}),mi("div",{className:"space-y-4",children:[Co("h2",{className:"font-bold text-2xl",children:"Installation"}),Co(Uh,{package:"@contractspec/lib.workflow-composer"})]}),mi("div",{className:"space-y-4",children:[Co("h2",{className:"font-bold text-2xl",children:"Register extensions"}),Co(wd,{language:"typescript",code:`const composer = new WorkflowComposer();
4303
+ }`;function Mh(){return no("div",{className:"space-y-8",children:[no("div",{className:"space-y-4",children:[ba("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit-web"}),ba("p",{className:"text-muted-foreground",children:"Web-first React and Next primitives for ContractSpec. The canonical data-table example uses this package to render the raw browser table layer directly, without the design-system shell on top."})]}),no("div",{className:"space-y-4",children:[ba("h2",{className:"font-bold text-2xl",children:"Installation"}),ba(Eh,{package:"@contractspec/lib.ui-kit-web"})]}),no("div",{className:"space-y-4",children:[ba("h2",{className:"font-bold text-2xl",children:"Data table example"}),no("p",{className:"text-muted-foreground",children:["This is the raw browser lane from the canonical"," ",ba(Tr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),". It demonstrates the primitive renderer with sorting, pagination, single selection, column visibility, column resizing, left/right pinning, row expansion, loading, and empty-state slots."]}),ba(Dh,{language:"tsx",filename:"web-account-grid.tsx",code:Bh})]}),no("div",{className:"space-y-4",children:[ba("h2",{className:"font-bold text-2xl",children:"What this layer owns"}),no("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[ba("li",{children:"The raw table renderer and browser interaction model."}),ba("li",{children:"Pagination, column visibility menus, pin menus, resize handles, and empty/loading states."}),ba("li",{children:"Accessibility helpers and other web-specific primitives that stay outside the native-first package."})]})]}),no("div",{className:"card-subtle space-y-3 p-6",children:[ba("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),no("p",{className:"text-muted-foreground",children:["Read"," ",ba(Tr,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the shared runtime story behind the web and native render lanes."]})]}),no("div",{className:"flex items-center gap-4 pt-4",children:[ba(Tr,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"Previous: UI Kit"}),no(Tr,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Next: Design System ",ba(Oh,{size:16})]})]})]})}import{CodeBlock as wd,InstallCommand as Uh}from"@contractspec/lib.design-system";import kd from"@contractspec/lib.ui-link";import{ChevronRight as Wh}from"lucide-react";import{jsx as Co,jsxs as mi}from"react/jsx-runtime";function _h(){return mi("div",{className:"space-y-8",children:[mi("div",{className:"space-y-4",children:[Co("h1",{className:"font-bold text-4xl",children:"Workflow Composer"}),Co("p",{className:"text-lg text-muted-foreground",children:"`@contractspec/lib.workflow-composer` injects tenant-/role-/device-specific steps into base WorkflowSpecs and keeps transitions valid."})]}),mi("div",{className:"space-y-4",children:[Co("h2",{className:"font-bold text-2xl",children:"Installation"}),Co(Uh,{package:"@contractspec/lib.workflow-composer"})]}),mi("div",{className:"space-y-4",children:[Co("h2",{className:"font-bold text-2xl",children:"Register extensions"}),Co(wd,{language:"typescript",code:`const composer = new WorkflowComposer();
4304
4304
 
4305
4305
  composer.register({
4306
4306
  workflow: 'billing.invoiceApproval',
@@ -4322,7 +4322,7 @@ composer.register({
4322
4322
  tenantId: 'acme',
4323
4323
  });
4324
4324
 
4325
- workflowRunner.execute(tenantWorkflow, ctx);`})]}),mi("div",{className:"flex items-center gap-4 pt-4",children:[Co(kd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),mi(kd,{href:"/docs/libraries/workflows",className:"btn-primary",children:["Next: Workflow Runtime ",Co(Wh,{size:16})]})]})]})}import{CodeBlock as zh,InstallCommand as Gh}from"@contractspec/lib.design-system";import Sd from"@contractspec/lib.ui-link";import{ChevronRight as Hh}from"lucide-react";import{jsx as me,jsxs as Ea}from"react/jsx-runtime";function qh(){return Ea("div",{className:"space-y-8",children:[Ea("div",{className:"space-y-4",children:[me("h1",{className:"font-bold text-4xl",children:"Workflow Runtime Library"}),Ea("p",{className:"text-lg text-muted-foreground",children:["The ",me("code",{children:"@contractspec/lib.contracts-spec/workflow"})," library provides the core ",me("code",{children:"WorkflowRunner"})," for executing stateful, durable workflows."]})]}),Ea("div",{className:"space-y-4",children:[me("h2",{className:"font-bold text-2xl",children:"Installation"}),me(Gh,{package:"@contractspec/lib.contracts-spec"})]}),Ea("div",{className:"space-y-4",children:[me("h2",{className:"font-bold text-2xl",children:"WorkflowRunner"}),me("p",{className:"text-muted-foreground",children:"The runner manages execution state, step transitions, retries, and compensation."}),me(zh,{language:"typescript",code:`import { WorkflowRunner } from '@contractspec/lib.contracts-spec/workflow/runner';
4325
+ workflowRunner.execute(tenantWorkflow, ctx);`})]}),mi("div",{className:"flex items-center gap-4 pt-4",children:[Co(kd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),mi(kd,{href:"/docs/libraries/workflows",className:"btn-primary",children:["Next: Workflow Runtime ",Co(Wh,{size:16})]})]})]})}import{CodeBlock as zh,InstallCommand as Gh}from"@contractspec/lib.design-system";import Sd from"@contractspec/lib.ui-link";import{ChevronRight as qh}from"lucide-react";import{jsx as me,jsxs as Da}from"react/jsx-runtime";function Hh(){return Da("div",{className:"space-y-8",children:[Da("div",{className:"space-y-4",children:[me("h1",{className:"font-bold text-4xl",children:"Workflow Runtime Library"}),Da("p",{className:"text-lg text-muted-foreground",children:["The ",me("code",{children:"@contractspec/lib.contracts-spec/workflow"})," library provides the core ",me("code",{children:"WorkflowRunner"})," for executing stateful, durable workflows."]})]}),Da("div",{className:"space-y-4",children:[me("h2",{className:"font-bold text-2xl",children:"Installation"}),me(Gh,{package:"@contractspec/lib.contracts-spec"})]}),Da("div",{className:"space-y-4",children:[me("h2",{className:"font-bold text-2xl",children:"WorkflowRunner"}),me("p",{className:"text-muted-foreground",children:"The runner manages execution state, step transitions, retries, and compensation."}),me(zh,{language:"typescript",code:`import { WorkflowRunner } from '@contractspec/lib.contracts-spec/workflow/runner';
4326
4326
  import { InMemoryStateStore } from '@contractspec/lib.contracts-spec/workflow/adapters/memory-store';
4327
4327
  import { WorkflowRegistry } from '@contractspec/lib.contracts-spec/workflow/spec';
4328
4328
 
@@ -4342,7 +4342,7 @@ const runner = new WorkflowRunner({
4342
4342
  const workflowId = await runner.start('my.workflow', 1, { userId: '123' });
4343
4343
 
4344
4344
  // Execute next step (usually called by a worker or queue consumer)
4345
- await runner.executeStep(workflowId);`})]}),Ea("div",{className:"space-y-4",children:[me("h2",{className:"font-bold text-2xl",children:"State Persistence"}),Ea("p",{className:"text-muted-foreground",children:["The runner relies on a ",me("code",{children:"StateStore"})," to persist workflow execution history. ContractSpec ships with:"]}),Ea("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[Ea("li",{children:[me("code",{children:"InMemoryStateStore"})," - for testing and development."]}),Ea("li",{children:[me("code",{children:"PrismaStateStore"})," - for production using Prisma ORM."]})]})]}),Ea("div",{className:"space-y-4",children:[me("h2",{className:"font-bold text-2xl",children:"Events"}),me("p",{className:"text-muted-foreground",children:"The runner emits events that you can subscribe to for monitoring:"}),Ea("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[me("li",{children:me("code",{children:"workflow.started"})}),me("li",{children:me("code",{children:"workflow.step_completed"})}),me("li",{children:me("code",{children:"workflow.step_failed"})}),me("li",{children:me("code",{children:"workflow.step_retrying"})}),me("li",{children:me("code",{children:"workflow.completed"})}),me("li",{children:me("code",{children:"workflow.cancelled"})}),me("li",{children:me("code",{children:"workflow.compensation_step_completed"})})]})]}),Ea("div",{className:"flex items-center gap-4 pt-4",children:[me(Sd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Ea(Sd,{href:"/docs/libraries/data-views",className:"btn-primary",children:["Next: Data Views ",me(Hh,{size:16})]})]})]})}import{jsx as co,jsxs as ui}from"react/jsx-runtime";function Vh(){return ui("div",{className:"space-y-8",children:[ui("div",{className:"space-y-3",children:[co("p",{className:"editorial-kicker",children:"Why ContractSpec"}),co("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Open system, explicit contracts, incremental adoption."}),co("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec exists to make AI-native software more legible and more governable. The system should help teams express durable boundaries, keep generated surfaces aligned, and still own the code and contracts they ship."})]}),ui("div",{className:"space-y-6",children:[ui("section",{className:"editorial-panel space-y-3",children:[co("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Open system, not closed platform"}),co("p",{className:"text-muted-foreground text-sm leading-7",children:"The OSS layer should remain useful on its own. Teams need explicit contracts, readable code, and outputs they can keep. Studio can sit on top of that system, but it should never be the only way to own or understand the behavior."})]}),ui("section",{className:"editorial-panel space-y-3",children:[co("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Contracts before surface sprawl"}),co("p",{className:"text-muted-foreground text-sm leading-7",children:"AI tooling accelerates surface creation faster than most teams can govern it. The answer is not more hidden glue. The answer is a durable contract layer that keeps API, UI, data, workflows, and operator behavior aligned."})]}),ui("section",{className:"editorial-panel space-y-3",children:[co("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Incremental adoption wins"}),co("p",{className:"text-muted-foreground text-sm leading-7",children:"Most teams already have a codebase. The practical path is to stabilize one boundary at a time, prove the loop, and grow from there. That is why the docs and product should lead with one module, one endpoint, one workflow, one unsafe surface at a time."})]}),ui("section",{className:"editorial-panel space-y-3",children:[co("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Studio should stay additive"}),co("p",{className:"text-muted-foreground text-sm leading-7",children:"The best operating product can and should exist on top of the open system. But the OSS foundation must remain strong enough that technical adopters trust it before they ever adopt Studio."})]})]})]})}import{jsx as dt,jsxs as oi}from"react/jsx-runtime";function Fh(){return oi("div",{className:"space-y-8",children:[oi("div",{className:"space-y-4",children:[dt("h1",{className:"font-bold text-4xl",children:"Auto-Evolution Runbook"}),dt("p",{className:"text-lg text-muted-foreground",children:"Configure sampling, approvals, experiments, and golden tests so your app keeps improving without regressions."})]}),oi("div",{className:"space-y-3",children:[dt("h2",{className:"font-bold text-2xl",children:"Pipeline overview"}),oi("ol",{className:"list-decimal space-y-2 pl-6 text-muted-foreground text-sm",children:[dt("li",{children:"Tracing middleware emits telemetry samples with tenant/user context."}),dt("li",{children:"IntentAggregator batches samples (15m window, configurable)."}),dt("li",{children:"IntentDetector raises error/latency/throughput signals."}),dt("li",{children:"SpecGenerator produces proposals with confidence scores."}),dt("li",{children:"ApprovalWorkflow routes low-confidence suggestions to humans."}),dt("li",{children:"SpecExperimentRegistry rolls out approved variants using guardrails."}),dt("li",{children:"TrafficRecorder captures new traffic and GoldenTestGenerator outputs suites."})]})]}),oi("div",{className:"space-y-3",children:[dt("h2",{className:"font-bold text-2xl",children:"Key environment variables"}),dt("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`# Telemetry sampling
4345
+ await runner.executeStep(workflowId);`})]}),Da("div",{className:"space-y-4",children:[me("h2",{className:"font-bold text-2xl",children:"State Persistence"}),Da("p",{className:"text-muted-foreground",children:["The runner relies on a ",me("code",{children:"StateStore"})," to persist workflow execution history. ContractSpec ships with:"]}),Da("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[Da("li",{children:[me("code",{children:"InMemoryStateStore"})," - for testing and development."]}),Da("li",{children:[me("code",{children:"PrismaStateStore"})," - for production using Prisma ORM."]})]})]}),Da("div",{className:"space-y-4",children:[me("h2",{className:"font-bold text-2xl",children:"Events"}),me("p",{className:"text-muted-foreground",children:"The runner emits events that you can subscribe to for monitoring:"}),Da("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[me("li",{children:me("code",{children:"workflow.started"})}),me("li",{children:me("code",{children:"workflow.step_completed"})}),me("li",{children:me("code",{children:"workflow.step_failed"})}),me("li",{children:me("code",{children:"workflow.step_retrying"})}),me("li",{children:me("code",{children:"workflow.completed"})}),me("li",{children:me("code",{children:"workflow.cancelled"})}),me("li",{children:me("code",{children:"workflow.compensation_step_completed"})})]})]}),Da("div",{className:"flex items-center gap-4 pt-4",children:[me(Sd,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Da(Sd,{href:"/docs/libraries/data-views",className:"btn-primary",children:["Next: Data Views ",me(qh,{size:16})]})]})]})}import{jsx as co,jsxs as ui}from"react/jsx-runtime";function Vh(){return ui("div",{className:"space-y-8",children:[ui("div",{className:"space-y-3",children:[co("p",{className:"editorial-kicker",children:"Why ContractSpec"}),co("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Open system, explicit contracts, incremental adoption."}),co("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec exists to make AI-native software more legible and more governable. The system should help teams express durable boundaries, keep generated surfaces aligned, and still own the code and contracts they ship."})]}),ui("div",{className:"space-y-6",children:[ui("section",{className:"editorial-panel space-y-3",children:[co("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Open system, not closed platform"}),co("p",{className:"text-muted-foreground text-sm leading-7",children:"The OSS layer should remain useful on its own. Teams need explicit contracts, readable code, and outputs they can keep. Studio can sit on top of that system, but it should never be the only way to own or understand the behavior."})]}),ui("section",{className:"editorial-panel space-y-3",children:[co("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Contracts before surface sprawl"}),co("p",{className:"text-muted-foreground text-sm leading-7",children:"AI tooling accelerates surface creation faster than most teams can govern it. The answer is not more hidden glue. The answer is a durable contract layer that keeps API, UI, data, workflows, and operator behavior aligned."})]}),ui("section",{className:"editorial-panel space-y-3",children:[co("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Incremental adoption wins"}),co("p",{className:"text-muted-foreground text-sm leading-7",children:"Most teams already have a codebase. The practical path is to stabilize one boundary at a time, prove the loop, and grow from there. That is why the docs and product should lead with one module, one endpoint, one workflow, one unsafe surface at a time."})]}),ui("section",{className:"editorial-panel space-y-3",children:[co("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Studio should stay additive"}),co("p",{className:"text-muted-foreground text-sm leading-7",children:"The best operating product can and should exist on top of the open system. But the OSS foundation must remain strong enough that technical adopters trust it before they ever adopt Studio."})]})]})]})}import{jsx as dt,jsxs as oi}from"react/jsx-runtime";function Fh(){return oi("div",{className:"space-y-8",children:[oi("div",{className:"space-y-4",children:[dt("h1",{className:"font-bold text-4xl",children:"Auto-Evolution Runbook"}),dt("p",{className:"text-lg text-muted-foreground",children:"Configure sampling, approvals, experiments, and golden tests so your app keeps improving without regressions."})]}),oi("div",{className:"space-y-3",children:[dt("h2",{className:"font-bold text-2xl",children:"Pipeline overview"}),oi("ol",{className:"list-decimal space-y-2 pl-6 text-muted-foreground text-sm",children:[dt("li",{children:"Tracing middleware emits telemetry samples with tenant/user context."}),dt("li",{children:"IntentAggregator batches samples (15m window, configurable)."}),dt("li",{children:"IntentDetector raises error/latency/throughput signals."}),dt("li",{children:"SpecGenerator produces proposals with confidence scores."}),dt("li",{children:"ApprovalWorkflow routes low-confidence suggestions to humans."}),dt("li",{children:"SpecExperimentRegistry rolls out approved variants using guardrails."}),dt("li",{children:"TrafficRecorder captures new traffic and GoldenTestGenerator outputs suites."})]})]}),oi("div",{className:"space-y-3",children:[dt("h2",{className:"font-bold text-2xl",children:"Key environment variables"}),dt("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`# Telemetry sampling
4346
4346
  AUTO_EVOLUTION_SAMPLE_RATE=0.02
4347
4347
  AUTO_EVOLUTION_WINDOW_MS=900000
4348
4348
 
@@ -4355,12 +4355,12 @@ AUTO_EVOLUTION_MAX_ERROR_RATE=0.02
4355
4355
  AUTO_EVOLUTION_MAX_P99_MS=500`})]}),oi("div",{className:"space-y-3",children:[dt("h2",{className:"font-bold text-2xl",children:"Operations checklist"}),oi("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground text-sm",children:[dt("li",{children:"Review new `SpecSuggestion` records every morning (UI coming soon; Prisma view today)."}),dt("li",{children:"Keep at least one reviewer per domain on-call for approvals."}),dt("li",{children:"Attach `SpecExperimentAdapter.trackOutcome` to every runtime adapter."}),dt("li",{children:"Schedule `contractspec test generate` nightly (or on deploy) to refresh golden suites."}),dt("li",{children:"Feed `runGoldenTests` into CI to gate merges touching evolved specs."})]})]}),dt("div",{className:"grid gap-4 md:grid-cols-3",children:[{title:"Sampling",description:"Start at 1\u20132% of traffic. Increase only after sanitization is verified."},{title:"Approvals",description:"High-risk ops (money, compliance) should never auto-approve. Use ApprovalWorkflow notes for audit."},{title:"On-call alerts",description:"Tie SpecExperimentController rollbacks into PagerDuty/Slack so engineers see guardrail trips immediately."}].map((e)=>oi("div",{className:"card-subtle space-y-2 p-4",children:[dt("h3",{className:"font-semibold text-lg",children:e.title}),dt("p",{className:"text-muted-foreground text-sm",children:e.description})]},e.title))})]})}import{jsx as lo,jsxs as xi}from"react/jsx-runtime";function Kh(){return xi("div",{className:"space-y-8",children:[xi("div",{className:"space-y-4",children:[lo("h1",{className:"font-bold text-4xl",children:"Distributed Tracing"}),lo("p",{className:"text-lg text-muted-foreground",children:"ContractSpec uses OpenTelemetry (OTel) for distributed tracing. This guide explains how to configure exporters and collectors."})]}),xi("div",{className:"space-y-4",children:[lo("h2",{className:"font-bold text-2xl",children:"Configuration"}),lo("p",{children:"Configure the OTel SDK via environment variables:"}),lo("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`OTEL_SERVICE_NAME=my-service
4356
4356
  OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
4357
4357
  OTEL_TRACES_SAMPLER=parentbased_traceidratio
4358
- OTEL_TRACES_SAMPLER_ARG=0.1`})]}),xi("div",{className:"space-y-4",children:[lo("h2",{className:"font-bold text-2xl",children:"Exporters"}),lo("p",{children:"By default, the OTLP exporter is used. You can point it to:"}),xi("ul",{className:"list-disc space-y-2 pl-6",children:[lo("li",{children:"Jaeger"}),lo("li",{children:"Tempo (Grafana)"}),lo("li",{children:"Honeycomb"}),lo("li",{children:"Datadog (via OTel Collector)"})]})]})]})}import{DocsIndexDataView as Qh,DocsSearchForm as Yh}from"@contractspec/lib.contracts-spec/docs";import{DataViewList as Jh,formRenderer as $h,StatusChip as bn}from"@contractspec/lib.design-system";import{HStack as Zh,VStack as vn}from"@contractspec/lib.ui-kit-web/ui/stack";import{H1 as Xh,Muted as Cd}from"@contractspec/lib.ui-kit-web/ui/typography";import{useMemo as Id,useState as xh}from"react";import{jsx as ii,jsxs as Nn}from"react/jsx-runtime";function jh(e){if(!e)return;return e.replace(/<!--.*?-->/g,"").replace(/[ \t]+/g," ").replace(/\n{3,}/g,`
4358
+ OTEL_TRACES_SAMPLER_ARG=0.1`})]}),xi("div",{className:"space-y-4",children:[lo("h2",{className:"font-bold text-2xl",children:"Exporters"}),lo("p",{children:"By default, the OTLP exporter is used. You can point it to:"}),xi("ul",{className:"list-disc space-y-2 pl-6",children:[lo("li",{children:"Jaeger"}),lo("li",{children:"Tempo (Grafana)"}),lo("li",{children:"Honeycomb"}),lo("li",{children:"Datadog (via OTel Collector)"})]})]})]})}import{DocsIndexDataView as Qh,DocsSearchForm as Yh}from"@contractspec/lib.contracts-spec/docs";import{DataViewList as Jh,formRenderer as Zh,StatusChip as bn}from"@contractspec/lib.design-system";import{HStack as $h,VStack as vn}from"@contractspec/lib.ui-kit-web/ui/stack";import{H1 as Xh,Muted as Cd}from"@contractspec/lib.ui-kit-web/ui/typography";import{useMemo as Id,useState as xh}from"react";import{jsx as ii,jsxs as Nn}from"react/jsx-runtime";function jh(e){if(!e)return;return e.replace(/<!--.*?-->/g,"").replace(/[ \t]+/g," ").replace(/\n{3,}/g,`
4359
4359
 
4360
- `).trim()}function ey(e){let t=jh(e.summary),a=e.kind??(e.source==="generated"?"reference":void 0),r=e.visibility??(e.source==="generated"?"public":void 0);return{...e,summary:t,kind:a,visibility:r}}function ty(e,t){if(!t)return!0;return[e.title,e.summary,e.id,...e.tags??[]].filter(Boolean).join(" ").toLowerCase().includes(t.toLowerCase())}function Pd({entries:e}){let[t,a]=xh({}),r=Id(()=>e.map(ey),[e]),l=Id(()=>{let h=t.query?.trim()??"";return r.filter((v)=>{if(t.kind&&v.kind!==t.kind)return!1;if(t.visibility&&v.visibility!==t.visibility)return!1;return ty(v,h)})},[t,r]),b=$h.render(Yh,{defaultValues:{query:t.query??"",visibility:t.visibility??"",kind:t.kind??""},overrides:{onSubmitOverride:(h)=>{let v=h;a({query:v.query??"",visibility:v.visibility??"",kind:v.kind??""})}}});return Nn(vn,{gap:"xl",children:[Nn(vn,{gap:"sm",children:[ii(Xh,{children:"Reference"}),ii(Cd,{children:"Generated reference material for public contract surfaces, versions, owners, and example-backed implementations. Use this when you need the repo truth, not just the narrative docs layer."})]}),ii(vn,{gap:"sm",className:"max-w-2xl",children:b}),ii(Jh,{spec:Qh,items:l,emptyState:ii(Cd,{children:"No reference docs match your filters."}),onSelect:(h)=>{if(h.route)window.location.assign(h.route)},renderActions:(h)=>{return Nn(Zh,{gap:"xs",justify:"end",children:[h.kind?ii(bn,{size:"sm",label:h.kind}):null,h.visibility?ii(bn,{size:"sm",label:h.visibility}):null,h.version?ii(bn,{size:"sm",label:`v${h.version}`}):null]})}})]})}import{jsx as oy}from"react/jsx-runtime";async function ay(){let e=await Wc();return oy(Pd,{entries:e})}var iy=/^##\s+Metadata[\s\S]*?(?=^##\s|^#\s|Z)/m;function ry(e){return e.replace(/^#\s+.*\n+/m,"").replace(iy,"")}function Td(e){return/^#{1,4}\s+/.test(e)||/^```/.test(e)||/^\s*[-*]\s+/.test(e)||/^\s*\d+\.\s+/.test(e)||/^>\s+/.test(e)}function Ad(e){let t=ry(e).split(/\r?\n/),a=[],r=0;while(r<t.length){let l=t[r]??"";if(l.startsWith("<!-- @generated")){r+=1;continue}let b=l.trim();if(!b){r+=1;continue}if(b.startsWith("```")){let v=b.slice(3).trim(),V=[];r+=1;while(r<t.length&&!(t[r]??"").trim().startsWith("```"))V.push(t[r]??""),r+=1;r+=1,a.push({type:"code",language:v||"text",code:V.join(`
4361
- `)});continue}if(/^#{1,4}\s+/.test(b)){let v=b.match(/^#{1,4}/)?.[0].length??2;a.push({type:"heading",level:v,text:b.replace(/^#{1,4}\s+/,"")}),r+=1;continue}if(/^>\s+/.test(b)){let v=[];while(r<t.length&&/^>\s+/.test((t[r]??"").trim()))v.push((t[r]??"").trim().replace(/^>\s+/,"")),r+=1;a.push({type:"quote",text:v.join(" ")});continue}if(/^[-*]\s+/.test(b)||/^\d+\.\s+/.test(b)){let v=/^\d+\.\s+/.test(b),V=[];while(r<t.length&&Td((t[r]??"").trim())){let g=(t[r]??"").trim();if(v&&/^\d+\.\s+/.test(g))V.push(g.replace(/^\d+\.\s+/,""));else if(!v&&/^[-*]\s+/.test(g))V.push(g.replace(/^[-*]\s+/,""));else break;r+=1}a.push({type:"list",ordered:v,items:V});continue}let h=[];while(r<t.length&&!Td((t[r]??"").trim())){let v=(t[r]??"").trim();if(!v)break;h.push(v),r+=1}a.push({type:"paragraph",text:h.join(" ")})}return a}import{CodeBlock as ny}from"@contractspec/lib.design-system";import{HStack as cy,VStack as wn}from"@contractspec/lib.ui-kit-web/ui/stack";import{BlockQuote as ly,H2 as dy,H3 as sy,H4 as py,Muted as Rd,P as Ld}from"@contractspec/lib.ui-kit-web/ui/typography";import{jsx as $a,jsxs as fy}from"react/jsx-runtime";var my=new Set(["typescript","tsx","javascript","jsx","bash","shell","json","yaml","graphql","sql","python","go","rust","css","scss","html","markdown","text"]);function uy(e){if(!e)return"text";let t=e.toLowerCase();return my.has(t)?t:"text"}function gy(e,t){if(e<=2)return $a(dy,{children:t});if(e===3)return $a(sy,{children:t});return $a(py,{children:t})}function Ed({content:e}){let t=Ad(e);if(!t.length)return $a(Rd,{children:"No reference content available."});return $a(wn,{gap:"md",children:t.map((a,r)=>{switch(a.type){case"heading":return $a(wn,{children:gy(a.level,a.text)},r);case"paragraph":return $a(Ld,{children:a.text},r);case"quote":return $a(ly,{children:a.text},r);case"code":return $a(ny,{language:uy(a.language),code:a.code},r);case"list":return $a(wn,{gap:"xs",children:a.items.map((l,b)=>fy(cy,{gap:"sm",align:"start",children:[$a(Rd,{children:a.ordered?`${b+1}.`:"\u2022"}),$a(Ld,{className:"leading-relaxed",children:l})]},b))},r);default:return null}})})}import{ContractReferenceDataView as Ar}from"@contractspec/lib.contracts-spec/docs";import{DataViewRenderer as hy}from"@contractspec/lib.design-system";import{VStack as yy}from"@contractspec/lib.ui-kit-web/ui/stack";import{jsx as Dd,jsxs as vy}from"react/jsx-runtime";function ji(e,t){return e.match(new RegExp(`- \\*\\*${t}\\*\\*: (.+)`,"i"))?.[1]?.trim()}function by(e){if(!e)return;return e.replace(/<!--.*?-->/g,"").replace(/[ \t]+/g," ").replace(/\n{3,}/g,`
4360
+ `).trim()}function ey(e){let t=jh(e.summary),a=e.kind??(e.source==="generated"?"reference":void 0),r=e.visibility??(e.source==="generated"?"public":void 0);return{...e,summary:t,kind:a,visibility:r}}function ty(e,t){if(!t)return!0;return[e.title,e.summary,e.id,...e.tags??[]].filter(Boolean).join(" ").toLowerCase().includes(t.toLowerCase())}function Pd({entries:e}){let[t,a]=xh({}),r=Id(()=>e.map(ey),[e]),l=Id(()=>{let h=t.query?.trim()??"";return r.filter((v)=>{if(t.kind&&v.kind!==t.kind)return!1;if(t.visibility&&v.visibility!==t.visibility)return!1;return ty(v,h)})},[t,r]),b=Zh.render(Yh,{defaultValues:{query:t.query??"",visibility:t.visibility??"",kind:t.kind??""},overrides:{onSubmitOverride:(h)=>{let v=h;a({query:v.query??"",visibility:v.visibility??"",kind:v.kind??""})}}});return Nn(vn,{gap:"xl",children:[Nn(vn,{gap:"sm",children:[ii(Xh,{children:"Reference"}),ii(Cd,{children:"Generated reference material for public contract surfaces, versions, owners, and example-backed implementations. Use this when you need the repo truth, not just the narrative docs layer."})]}),ii(vn,{gap:"sm",className:"max-w-2xl",children:b}),ii(Jh,{spec:Qh,items:l,emptyState:ii(Cd,{children:"No reference docs match your filters."}),onSelect:(h)=>{if(h.route)window.location.assign(h.route)},renderActions:(h)=>{return Nn($h,{gap:"xs",justify:"end",children:[h.kind?ii(bn,{size:"sm",label:h.kind}):null,h.visibility?ii(bn,{size:"sm",label:h.visibility}):null,h.version?ii(bn,{size:"sm",label:`v${h.version}`}):null]})}})]})}import{jsx as oy}from"react/jsx-runtime";async function ay(){let e=await Wc();return oy(Pd,{entries:e})}var iy=/^##\s+Metadata[\s\S]*?(?=^##\s|^#\s|Z)/m;function ry(e){return e.replace(/^#\s+.*\n+/m,"").replace(iy,"")}function Td(e){return/^#{1,4}\s+/.test(e)||/^```/.test(e)||/^\s*[-*]\s+/.test(e)||/^\s*\d+\.\s+/.test(e)||/^>\s+/.test(e)}function Ad(e){let t=ry(e).split(/\r?\n/),a=[],r=0;while(r<t.length){let l=t[r]??"";if(l.startsWith("<!-- @generated")){r+=1;continue}let b=l.trim();if(!b){r+=1;continue}if(b.startsWith("```")){let v=b.slice(3).trim(),V=[];r+=1;while(r<t.length&&!(t[r]??"").trim().startsWith("```"))V.push(t[r]??""),r+=1;r+=1,a.push({type:"code",language:v||"text",code:V.join(`
4361
+ `)});continue}if(/^#{1,4}\s+/.test(b)){let v=b.match(/^#{1,4}/)?.[0].length??2;a.push({type:"heading",level:v,text:b.replace(/^#{1,4}\s+/,"")}),r+=1;continue}if(/^>\s+/.test(b)){let v=[];while(r<t.length&&/^>\s+/.test((t[r]??"").trim()))v.push((t[r]??"").trim().replace(/^>\s+/,"")),r+=1;a.push({type:"quote",text:v.join(" ")});continue}if(/^[-*]\s+/.test(b)||/^\d+\.\s+/.test(b)){let v=/^\d+\.\s+/.test(b),V=[];while(r<t.length&&Td((t[r]??"").trim())){let g=(t[r]??"").trim();if(v&&/^\d+\.\s+/.test(g))V.push(g.replace(/^\d+\.\s+/,""));else if(!v&&/^[-*]\s+/.test(g))V.push(g.replace(/^[-*]\s+/,""));else break;r+=1}a.push({type:"list",ordered:v,items:V});continue}let h=[];while(r<t.length&&!Td((t[r]??"").trim())){let v=(t[r]??"").trim();if(!v)break;h.push(v),r+=1}a.push({type:"paragraph",text:h.join(" ")})}return a}import{CodeBlock as ny}from"@contractspec/lib.design-system";import{HStack as cy,VStack as wn}from"@contractspec/lib.ui-kit-web/ui/stack";import{BlockQuote as ly,H2 as dy,H3 as sy,H4 as py,Muted as Rd,P as Ld}from"@contractspec/lib.ui-kit-web/ui/typography";import{jsx as Za,jsxs as fy}from"react/jsx-runtime";var my=new Set(["typescript","tsx","javascript","jsx","bash","shell","json","yaml","graphql","sql","python","go","rust","css","scss","html","markdown","text"]);function uy(e){if(!e)return"text";let t=e.toLowerCase();return my.has(t)?t:"text"}function gy(e,t){if(e<=2)return Za(dy,{children:t});if(e===3)return Za(sy,{children:t});return Za(py,{children:t})}function Dd({content:e}){let t=Ad(e);if(!t.length)return Za(Rd,{children:"No reference content available."});return Za(wn,{gap:"md",children:t.map((a,r)=>{switch(a.type){case"heading":return Za(wn,{children:gy(a.level,a.text)},r);case"paragraph":return Za(Ld,{children:a.text},r);case"quote":return Za(ly,{children:a.text},r);case"code":return Za(ny,{language:uy(a.language),code:a.code},r);case"list":return Za(wn,{gap:"xs",children:a.items.map((l,b)=>fy(cy,{gap:"sm",align:"start",children:[Za(Rd,{children:a.ordered?`${b+1}.`:"\u2022"}),Za(Ld,{className:"leading-relaxed",children:l})]},b))},r);default:return null}})})}import{ContractReferenceDataView as Ar}from"@contractspec/lib.contracts-spec/docs";import{DataViewRenderer as hy}from"@contractspec/lib.design-system";import{VStack as yy}from"@contractspec/lib.ui-kit-web/ui/stack";import{jsx as Ed,jsxs as vy}from"react/jsx-runtime";function ji(e,t){return e.match(new RegExp(`- \\*\\*${t}\\*\\*: (.+)`,"i"))?.[1]?.trim()}function by(e){if(!e)return;return e.replace(/<!--.*?-->/g,"").replace(/[ \t]+/g," ").replace(/\n{3,}/g,`
4362
4362
 
4363
- `).trim()}function Od({entry:e,content:t}){let a=by(e.summary),r=ji(t,"Type"),l=ji(t,"Version")??e.version,b=ji(t,"Tags")?.split(",").map((tt)=>tt.trim()).filter(Boolean),h=ji(t,"Owners")?.split(",").map((tt)=>tt.trim()).filter(Boolean),v=ji(t,"Stability")??e.visibility,V={reference:{key:e.title??e.id,version:l,type:r,title:e.title??e.id,description:a,tags:b??e.tags,owners:h??e.owners,stability:v}},g={...Ar,meta:{...Ar.meta,title:e.title??Ar.meta.title,description:a??Ar.meta.description}};return vy(yy,{gap:"xl",children:[Dd(hy,{spec:g,item:V}),Dd(Ed,{content:t})]})}import{jsx as wy}from"react/jsx-runtime";function Ny({entry:e,content:t}){return wy(Od,{entry:e,content:t})}import kn from"@contractspec/lib.ui-link";import{ChevronRight as ky}from"lucide-react";import{jsx as L,jsxs as oe}from"react/jsx-runtime";function Sy(){return oe("div",{className:"space-y-8",children:[oe("div",{className:"space-y-4",children:[L("h1",{className:"font-bold text-4xl",children:"Audit Logs"}),oe("p",{className:"text-muted-foreground",children:["An ",L("strong",{children:"audit log"})," (also called an audit trail) is a chronological record of system activities. According to"," ",L("a",{href:"https://www.sumologic.com/glossary/audit-log/",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Sumo Logic"}),', audit logs "provide a detailed record of events and changes within a system, enabling organizations to track user actions, system changes, and access to sensitive data."']})]}),oe("div",{className:"space-y-4",children:[L("h2",{className:"font-bold text-2xl",children:"Why audit logs matter"}),oe("div",{className:"space-y-3",children:[oe("div",{children:[L("h3",{className:"font-semibold text-lg",children:"Accountability"}),L("p",{className:"text-muted-foreground",children:'Audit logs answer the question "who did what, when?" This is essential for holding users and administrators accountable for their actions. If data is deleted or modified, the audit log shows exactly who made the change.'})]}),oe("div",{children:[L("h3",{className:"font-semibold text-lg",children:"Security"}),L("p",{className:"text-muted-foreground",children:"Audit logs help detect and investigate security incidents. For example, if an attacker gains unauthorized access, the logs reveal which resources they accessed and what actions they performed. This information is critical for incident response and forensics."})]}),oe("div",{children:[L("h3",{className:"font-semibold text-lg",children:"Compliance"}),L("p",{className:"text-muted-foreground",children:"Many regulations (GDPR, HIPAA, SOC 2, PCI DSS) require organizations to maintain audit logs. These logs must be tamper-evident, retained for a specified period, and available for inspection by auditors."})]}),oe("div",{children:[L("h3",{className:"font-semibold text-lg",children:"Debugging"}),L("p",{className:"text-muted-foreground",children:"When something goes wrong in production, audit logs provide a detailed timeline of events leading up to the failure. This makes it much easier to diagnose and fix issues."})]})]})]}),oe("div",{className:"space-y-4",children:[L("h2",{className:"font-bold text-2xl",children:"What ContractSpec logs"}),L("p",{className:"text-muted-foreground",children:"ContractSpec automatically logs every significant operation, including:"}),oe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[oe("li",{children:[L("strong",{children:"API calls"})," \u2013 Every invocation of a capability, including inputs, outputs, and the user who made the call."]}),oe("li",{children:[L("strong",{children:"Policy decisions"})," \u2013 Every decision made by the"," ",L(kn,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"}),", including the rule that matched and the reason for the decision."]}),oe("li",{children:[L("strong",{children:"Data access"})," \u2013 Every query to a data view, including which fields were accessed and whether any were redacted."]}),oe("li",{children:[L("strong",{children:"Workflow execution"})," \u2013 Every step in a workflow, including retries, compensations, and failures."]}),oe("li",{children:[L("strong",{children:"Administrative actions"})," \u2013 Spec deployments, configuration changes, user role assignments, and other privileged operations."]}),oe("li",{children:[L("strong",{children:"Authentication events"})," \u2013 Login attempts, password resets, and session expirations."]})]})]}),oe("div",{className:"space-y-4",children:[L("h2",{className:"font-bold text-2xl",children:"Audit log format"}),L("p",{className:"text-muted-foreground",children:"Each audit log entry is a structured JSON object containing:"}),L("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:L("pre",{children:`{
4363
+ `).trim()}function Od({entry:e,content:t}){let a=by(e.summary),r=ji(t,"Type"),l=ji(t,"Version")??e.version,b=ji(t,"Tags")?.split(",").map((tt)=>tt.trim()).filter(Boolean),h=ji(t,"Owners")?.split(",").map((tt)=>tt.trim()).filter(Boolean),v=ji(t,"Stability")??e.visibility,V={reference:{key:e.title??e.id,version:l,type:r,title:e.title??e.id,description:a,tags:b??e.tags,owners:h??e.owners,stability:v}},g={...Ar,meta:{...Ar.meta,title:e.title??Ar.meta.title,description:a??Ar.meta.description}};return vy(yy,{gap:"xl",children:[Ed(hy,{spec:g,item:V}),Ed(Dd,{content:t})]})}import{jsx as wy}from"react/jsx-runtime";function Ny({entry:e,content:t}){return wy(Od,{entry:e,content:t})}import kn from"@contractspec/lib.ui-link";import{ChevronRight as ky}from"lucide-react";import{jsx as L,jsxs as oe}from"react/jsx-runtime";function Sy(){return oe("div",{className:"space-y-8",children:[oe("div",{className:"space-y-4",children:[L("h1",{className:"font-bold text-4xl",children:"Audit Logs"}),oe("p",{className:"text-muted-foreground",children:["An ",L("strong",{children:"audit log"})," (also called an audit trail) is a chronological record of system activities. According to"," ",L("a",{href:"https://www.sumologic.com/glossary/audit-log/",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:text-violet-300",children:"Sumo Logic"}),', audit logs "provide a detailed record of events and changes within a system, enabling organizations to track user actions, system changes, and access to sensitive data."']})]}),oe("div",{className:"space-y-4",children:[L("h2",{className:"font-bold text-2xl",children:"Why audit logs matter"}),oe("div",{className:"space-y-3",children:[oe("div",{children:[L("h3",{className:"font-semibold text-lg",children:"Accountability"}),L("p",{className:"text-muted-foreground",children:'Audit logs answer the question "who did what, when?" This is essential for holding users and administrators accountable for their actions. If data is deleted or modified, the audit log shows exactly who made the change.'})]}),oe("div",{children:[L("h3",{className:"font-semibold text-lg",children:"Security"}),L("p",{className:"text-muted-foreground",children:"Audit logs help detect and investigate security incidents. For example, if an attacker gains unauthorized access, the logs reveal which resources they accessed and what actions they performed. This information is critical for incident response and forensics."})]}),oe("div",{children:[L("h3",{className:"font-semibold text-lg",children:"Compliance"}),L("p",{className:"text-muted-foreground",children:"Many regulations (GDPR, HIPAA, SOC 2, PCI DSS) require organizations to maintain audit logs. These logs must be tamper-evident, retained for a specified period, and available for inspection by auditors."})]}),oe("div",{children:[L("h3",{className:"font-semibold text-lg",children:"Debugging"}),L("p",{className:"text-muted-foreground",children:"When something goes wrong in production, audit logs provide a detailed timeline of events leading up to the failure. This makes it much easier to diagnose and fix issues."})]})]})]}),oe("div",{className:"space-y-4",children:[L("h2",{className:"font-bold text-2xl",children:"What ContractSpec logs"}),L("p",{className:"text-muted-foreground",children:"ContractSpec automatically logs every significant operation, including:"}),oe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[oe("li",{children:[L("strong",{children:"API calls"})," \u2013 Every invocation of a capability, including inputs, outputs, and the user who made the call."]}),oe("li",{children:[L("strong",{children:"Policy decisions"})," \u2013 Every decision made by the"," ",L(kn,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"}),", including the rule that matched and the reason for the decision."]}),oe("li",{children:[L("strong",{children:"Data access"})," \u2013 Every query to a data view, including which fields were accessed and whether any were redacted."]}),oe("li",{children:[L("strong",{children:"Workflow execution"})," \u2013 Every step in a workflow, including retries, compensations, and failures."]}),oe("li",{children:[L("strong",{children:"Administrative actions"})," \u2013 Spec deployments, configuration changes, user role assignments, and other privileged operations."]}),oe("li",{children:[L("strong",{children:"Authentication events"})," \u2013 Login attempts, password resets, and session expirations."]})]})]}),oe("div",{className:"space-y-4",children:[L("h2",{className:"font-bold text-2xl",children:"Audit log format"}),L("p",{className:"text-muted-foreground",children:"Each audit log entry is a structured JSON object containing:"}),L("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:L("pre",{children:`{
4364
4364
  "timestamp": "2025-11-13T14:32:15.123Z",
4365
4365
  "eventId": "evt_abc123",
4366
4366
  "eventType": "capability.invoked",
@@ -4432,11 +4432,11 @@ rules:
4432
4432
  effect: DENY
4433
4433
  condition: |
4434
4434
  user.role NOT IN ['admin', 'support'] AND
4435
- field.sensitivity == 'PII'`})}),_("p",{className:"text-muted-foreground",children:"With this policy, admins see all data, support staff see redacted PII, and other users cannot access PII at all."})]}),Pe("div",{className:"space-y-4",children:[_("h2",{className:"font-bold text-2xl",children:"Benefits of centralized decision-making"}),Pe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Pe("li",{children:[_("strong",{children:"Consistency"})," \u2013 Policies are enforced uniformly across all surfaces (API, UI, workflows)."]}),Pe("li",{children:[_("strong",{children:"Auditability"})," \u2013 Every decision is logged, making it easy to trace why access was granted or denied."]}),Pe("li",{children:[_("strong",{children:"Flexibility"})," \u2013 Policies can be updated without changing application code."]}),Pe("li",{children:[_("strong",{children:"Security"})," \u2013 Reduces the risk of authorization bugs by removing ad-hoc checks scattered throughout the codebase."]})]})]}),Pe("div",{className:"space-y-4",children:[_("h2",{className:"font-bold text-2xl",children:"Performance considerations"}),_("p",{className:"text-muted-foreground",children:"Because the PDP is invoked on every operation, performance is critical. ContractSpec optimizes this by:"}),Pe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[_("li",{children:"Caching policy decisions for identical requests"}),_("li",{children:"Compiling policies into efficient bytecode"}),_("li",{children:"Evaluating only the minimal set of rules needed for each request"}),_("li",{children:"Running the PDP in-process to avoid network latency"})]}),_("p",{className:"text-muted-foreground",children:"In practice, PDP overhead is typically less than 1ms per request."})]}),Pe("div",{className:"flex items-center gap-4 pt-4",children:[_(Sn,{href:"/docs/safety/signing",className:"btn-ghost",children:"Previous: Spec Signing"}),Pe(Sn,{href:"/docs/safety/auditing",className:"btn-primary",children:["Next: Audit Logs ",_(Ry,{size:16})]})]})]})}import Cn from"@contractspec/lib.ui-link";import{ChevronRight as In}from"lucide-react";import{jsx as fe,jsxs as Lt}from"react/jsx-runtime";function Ey(){return Lt("div",{className:"space-y-8",children:[Lt("div",{className:"space-y-4",children:[fe("h1",{className:"font-bold text-4xl",children:"Security & Trust"}),fe("p",{className:"text-muted-foreground",children:"ContractSpec focuses on deterministic, auditable software delivery. This page summarizes our security posture and trust commitments so teams can adopt with clarity."})]}),Lt("div",{className:"card-subtle space-y-4 p-6",children:[fe("h2",{className:"font-bold text-2xl",children:"Security policy"}),fe("p",{className:"text-muted-foreground text-sm",children:"We publish a dedicated security policy that explains how to report vulnerabilities and how we respond."}),Lt(Cn,{href:"/SECURITY.md",className:"btn-primary",children:["Read the security policy ",fe(In,{size:16})]})]}),Lt("div",{className:"grid gap-4 md:grid-cols-2",children:[Lt("div",{className:"card-subtle space-y-3 p-6",children:[fe("h3",{className:"font-semibold text-lg",children:"Release hygiene"}),fe("p",{className:"text-muted-foreground text-sm",children:"We ship with deterministic CI, changesets, and contract validation so teams can trust every release."}),Lt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[fe("li",{children:"Changesets required for published packages."}),fe("li",{children:"CI gate for contract validation and drift detection."}),fe("li",{children:"Rollback-friendly release process."})]})]}),Lt("div",{className:"card-subtle space-y-3 p-6",children:[fe("h3",{className:"font-semibold text-lg",children:"Data handling"}),fe("p",{className:"text-muted-foreground text-sm",children:"ContractSpec promotes strict data classification and policy-driven access. Specs can tag sensitive fields for enforcement."}),Lt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[fe("li",{children:"Schema-level sensitivity tags."}),fe("li",{children:"Policy Decision Point enforcement."}),fe("li",{children:"Audit logs for operational traceability."})]})]})]}),Lt("div",{className:"grid gap-4 md:grid-cols-2",children:[Lt("div",{className:"card-subtle space-y-3 p-6",children:[fe("h3",{className:"font-semibold text-lg",children:"Supply chain"}),fe("p",{className:"text-muted-foreground text-sm",children:"We track dependency updates and keep the monorepo build reproducible."}),Lt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[fe("li",{children:"Dependabot + Renovate-style updates where available."}),fe("li",{children:"Signed release artifacts planned for Studio release cycles."}),fe("li",{children:"Transparent changelogs for every package."})]})]}),Lt("div",{className:"card-subtle space-y-3 p-6",children:[fe("h3",{className:"font-semibold text-lg",children:"Responsible disclosure"}),fe("p",{className:"text-muted-foreground text-sm",children:"We respond quickly to security reports and coordinate fixes before public disclosure."}),Lt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[fe("li",{children:"Security response within 5 business days."}),fe("li",{children:"Private disclosure via security@contractspec.io."}),fe("li",{children:"Credit for researchers (with permission)."})]})]})]}),Lt("div",{className:"space-y-4",children:[fe("h2",{className:"font-bold text-2xl",children:"Next steps"}),fe("p",{className:"text-muted-foreground",children:"Explore the broader safety controls or read the roadmap to see upcoming trust investments."}),Lt("div",{className:"flex flex-wrap gap-4 pt-4",children:[Lt(Cn,{href:"/docs/safety",className:"btn-ghost",children:["Safety overview ",fe(In,{size:16})]}),Lt(Cn,{href:"/ROADMAP.md",className:"btn-ghost",children:["Roadmap ",fe(In,{size:16})]})]})]})]})}import Dy from"@contractspec/lib.ui-link";import{ChevronRight as Oy}from"lucide-react";import{jsx as Za,jsxs as gi}from"react/jsx-runtime";function By(){return gi("div",{className:"space-y-8",children:[gi("div",{className:"space-y-2",children:[Za("h1",{className:"font-bold text-4xl",children:"Spec Signing"}),Za("p",{className:"text-lg text-muted-foreground",children:"Signing ensures specs haven't been tampered with and provides an audit trail of all changes."})]}),gi("div",{className:"space-y-6",children:[gi("div",{className:"space-y-3",children:[Za("h2",{className:"font-bold text-2xl",children:"How it works"}),Za("p",{className:"text-muted-foreground",children:"Every spec is cryptographically signed before deployment. The signature proves that the spec hasn't been modified since it was signed and creates a permanent record of who deployed it and when."})]}),gi("div",{className:"space-y-3",children:[Za("h2",{className:"font-bold text-2xl",children:"Signing a spec"}),Za("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Za("pre",{children:`contractspec sign app.spec.ts --key ~/.contractspec/key.pem
4436
- contractspec deploy --signed app.spec.ts.signed`})})]}),gi("div",{className:"space-y-3",children:[Za("h2",{className:"font-bold text-2xl",children:"Verifying signatures"}),Za("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Za("pre",{children:`contractspec verify app.spec.ts.signed
4435
+ field.sensitivity == 'PII'`})}),_("p",{className:"text-muted-foreground",children:"With this policy, admins see all data, support staff see redacted PII, and other users cannot access PII at all."})]}),Pe("div",{className:"space-y-4",children:[_("h2",{className:"font-bold text-2xl",children:"Benefits of centralized decision-making"}),Pe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Pe("li",{children:[_("strong",{children:"Consistency"})," \u2013 Policies are enforced uniformly across all surfaces (API, UI, workflows)."]}),Pe("li",{children:[_("strong",{children:"Auditability"})," \u2013 Every decision is logged, making it easy to trace why access was granted or denied."]}),Pe("li",{children:[_("strong",{children:"Flexibility"})," \u2013 Policies can be updated without changing application code."]}),Pe("li",{children:[_("strong",{children:"Security"})," \u2013 Reduces the risk of authorization bugs by removing ad-hoc checks scattered throughout the codebase."]})]})]}),Pe("div",{className:"space-y-4",children:[_("h2",{className:"font-bold text-2xl",children:"Performance considerations"}),_("p",{className:"text-muted-foreground",children:"Because the PDP is invoked on every operation, performance is critical. ContractSpec optimizes this by:"}),Pe("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[_("li",{children:"Caching policy decisions for identical requests"}),_("li",{children:"Compiling policies into efficient bytecode"}),_("li",{children:"Evaluating only the minimal set of rules needed for each request"}),_("li",{children:"Running the PDP in-process to avoid network latency"})]}),_("p",{className:"text-muted-foreground",children:"In practice, PDP overhead is typically less than 1ms per request."})]}),Pe("div",{className:"flex items-center gap-4 pt-4",children:[_(Sn,{href:"/docs/safety/signing",className:"btn-ghost",children:"Previous: Spec Signing"}),Pe(Sn,{href:"/docs/safety/auditing",className:"btn-primary",children:["Next: Audit Logs ",_(Ry,{size:16})]})]})]})}import Cn from"@contractspec/lib.ui-link";import{ChevronRight as In}from"lucide-react";import{jsx as fe,jsxs as Lt}from"react/jsx-runtime";function Dy(){return Lt("div",{className:"space-y-8",children:[Lt("div",{className:"space-y-4",children:[fe("h1",{className:"font-bold text-4xl",children:"Security & Trust"}),fe("p",{className:"text-muted-foreground",children:"ContractSpec focuses on deterministic, auditable software delivery. This page summarizes our security posture and trust commitments so teams can adopt with clarity."})]}),Lt("div",{className:"card-subtle space-y-4 p-6",children:[fe("h2",{className:"font-bold text-2xl",children:"Security policy"}),fe("p",{className:"text-muted-foreground text-sm",children:"We publish a dedicated security policy that explains how to report vulnerabilities and how we respond."}),Lt(Cn,{href:"/SECURITY.md",className:"btn-primary",children:["Read the security policy ",fe(In,{size:16})]})]}),Lt("div",{className:"grid gap-4 md:grid-cols-2",children:[Lt("div",{className:"card-subtle space-y-3 p-6",children:[fe("h3",{className:"font-semibold text-lg",children:"Release hygiene"}),fe("p",{className:"text-muted-foreground text-sm",children:"We ship with deterministic CI, changesets, and contract validation so teams can trust every release."}),Lt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[fe("li",{children:"Changesets required for published packages."}),fe("li",{children:"CI gate for contract validation and drift detection."}),fe("li",{children:"Rollback-friendly release process."})]})]}),Lt("div",{className:"card-subtle space-y-3 p-6",children:[fe("h3",{className:"font-semibold text-lg",children:"Data handling"}),fe("p",{className:"text-muted-foreground text-sm",children:"ContractSpec promotes strict data classification and policy-driven access. Specs can tag sensitive fields for enforcement."}),Lt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[fe("li",{children:"Schema-level sensitivity tags."}),fe("li",{children:"Policy Decision Point enforcement."}),fe("li",{children:"Audit logs for operational traceability."})]})]})]}),Lt("div",{className:"grid gap-4 md:grid-cols-2",children:[Lt("div",{className:"card-subtle space-y-3 p-6",children:[fe("h3",{className:"font-semibold text-lg",children:"Supply chain"}),fe("p",{className:"text-muted-foreground text-sm",children:"We track dependency updates and keep the monorepo build reproducible."}),Lt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[fe("li",{children:"Dependabot + Renovate-style updates where available."}),fe("li",{children:"Signed release artifacts planned for Studio release cycles."}),fe("li",{children:"Transparent changelogs for every package."})]})]}),Lt("div",{className:"card-subtle space-y-3 p-6",children:[fe("h3",{className:"font-semibold text-lg",children:"Responsible disclosure"}),fe("p",{className:"text-muted-foreground text-sm",children:"We respond quickly to security reports and coordinate fixes before public disclosure."}),Lt("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[fe("li",{children:"Security response within 5 business days."}),fe("li",{children:"Private disclosure via security@contractspec.io."}),fe("li",{children:"Credit for researchers (with permission)."})]})]})]}),Lt("div",{className:"space-y-4",children:[fe("h2",{className:"font-bold text-2xl",children:"Next steps"}),fe("p",{className:"text-muted-foreground",children:"Explore the broader safety controls or read the roadmap to see upcoming trust investments."}),Lt("div",{className:"flex flex-wrap gap-4 pt-4",children:[Lt(Cn,{href:"/docs/safety",className:"btn-ghost",children:["Safety overview ",fe(In,{size:16})]}),Lt(Cn,{href:"/ROADMAP.md",className:"btn-ghost",children:["Roadmap ",fe(In,{size:16})]})]})]})]})}import Ey from"@contractspec/lib.ui-link";import{ChevronRight as Oy}from"lucide-react";import{jsx as $a,jsxs as gi}from"react/jsx-runtime";function By(){return gi("div",{className:"space-y-8",children:[gi("div",{className:"space-y-2",children:[$a("h1",{className:"font-bold text-4xl",children:"Spec Signing"}),$a("p",{className:"text-lg text-muted-foreground",children:"Signing ensures specs haven't been tampered with and provides an audit trail of all changes."})]}),gi("div",{className:"space-y-6",children:[gi("div",{className:"space-y-3",children:[$a("h2",{className:"font-bold text-2xl",children:"How it works"}),$a("p",{className:"text-muted-foreground",children:"Every spec is cryptographically signed before deployment. The signature proves that the spec hasn't been modified since it was signed and creates a permanent record of who deployed it and when."})]}),gi("div",{className:"space-y-3",children:[$a("h2",{className:"font-bold text-2xl",children:"Signing a spec"}),$a("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:$a("pre",{children:`contractspec sign app.spec.ts --key ~/.contractspec/key.pem
4436
+ contractspec deploy --signed app.spec.ts.signed`})})]}),gi("div",{className:"space-y-3",children:[$a("h2",{className:"font-bold text-2xl",children:"Verifying signatures"}),$a("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:$a("pre",{children:`contractspec verify app.spec.ts.signed
4437
4437
  # Output: \u2713 Signature valid
4438
4438
  # Signed by: alice@example.com
4439
- # Timestamp: 2024-11-08T10:30:00Z`})})]}),Za("div",{className:"flex items-center gap-4 pt-4",children:gi(Dy,{href:"/docs/safety/pdp",className:"btn-primary",children:["Next: Policy Decision Points ",Za(Oy,{size:16})]})})]})]})}import{jsx as zo,jsxs as fi}from"react/jsx-runtime";function My(){return fi("div",{className:"space-y-8",children:[fi("div",{className:"space-y-4",children:[zo("h1",{className:"font-bold text-4xl",children:"Tenant Isolation"}),zo("p",{className:"text-lg text-muted-foreground",children:'Preventing cross-tenant data leaks is the #1 security priority for any SaaS. ContractSpec employs "Defense in Depth" to ensure safety.'})]}),fi("div",{className:"space-y-4",children:[zo("h2",{className:"font-bold text-2xl",children:"Layer 1: RLS Middleware"}),fi("p",{children:["The primary defense is the Prisma middleware that rewrites queries to include ",zo("code",{children:"WHERE tenantId = ?"}),". This protects against developer error (forgetting to filter)."]})]}),fi("div",{className:"space-y-4",children:[zo("h2",{className:"font-bold text-2xl",children:"Layer 2: Isolation Validator"}),fi("p",{children:["For high-security environments, you can use the"," ",zo("code",{children:"IsolationValidator"})," in your test suite to verify that every query generated by your operations actually includes the tenant ID."]}),zo("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { IsolationValidator } from '@contractspec/lib.multi-tenancy/isolation';
4439
+ # Timestamp: 2024-11-08T10:30:00Z`})})]}),$a("div",{className:"flex items-center gap-4 pt-4",children:gi(Ey,{href:"/docs/safety/pdp",className:"btn-primary",children:["Next: Policy Decision Points ",$a(Oy,{size:16})]})})]})]})}import{jsx as zo,jsxs as fi}from"react/jsx-runtime";function My(){return fi("div",{className:"space-y-8",children:[fi("div",{className:"space-y-4",children:[zo("h1",{className:"font-bold text-4xl",children:"Tenant Isolation"}),zo("p",{className:"text-lg text-muted-foreground",children:'Preventing cross-tenant data leaks is the #1 security priority for any SaaS. ContractSpec employs "Defense in Depth" to ensure safety.'})]}),fi("div",{className:"space-y-4",children:[zo("h2",{className:"font-bold text-2xl",children:"Layer 1: RLS Middleware"}),fi("p",{children:["The primary defense is the Prisma middleware that rewrites queries to include ",zo("code",{children:"WHERE tenantId = ?"}),". This protects against developer error (forgetting to filter)."]})]}),fi("div",{className:"space-y-4",children:[zo("h2",{className:"font-bold text-2xl",children:"Layer 2: Isolation Validator"}),fi("p",{children:["For high-security environments, you can use the"," ",zo("code",{children:"IsolationValidator"})," in your test suite to verify that every query generated by your operations actually includes the tenant ID."]}),zo("pre",{className:"rounded-lg border bg-muted p-4 text-sm",children:`import { IsolationValidator } from '@contractspec/lib.multi-tenancy/isolation';
4440
4440
 
4441
4441
  test('findUser query is isolated', () => {
4442
4442
  const isValid = IsolationValidator.validateQuery(
@@ -4493,7 +4493,7 @@ const state = useBuilderWorkbenchState({
4493
4493
  onRunReadiness={runReadiness}
4494
4494
  onExecuteExport={executeExport}
4495
4495
  selectedExportRuntimeMode="hybrid"
4496
- />;`})]}),We("section",{className:"editorial-panel space-y-4",children:[G("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Read this with the Studio bridge in mind"}),G("p",{className:"text-muted-foreground text-sm leading-7",children:"Builder is where the OSS foundation meets the richer operating layer. Use the Studio overview when you want the higher-level product posture and team workflows on top of these contracts."}),We("div",{className:"flex flex-wrap gap-3",children:[G(Md,{href:"/docs/studio",className:"btn-primary",children:"Studio overview"}),G(Md,{href:"/docs/architecture/control-plane",className:"btn-ghost",children:"Control-plane runtime"})]})]})]})}import Gy from"@contractspec/lib.ui-link";import{ChevronRight as Hy}from"lucide-react";import{jsx as jt,jsxs as Da}from"react/jsx-runtime";function qy(){return Da("div",{className:"space-y-8",children:[Da("div",{className:"space-y-2",children:[jt("h1",{className:"font-bold text-4xl",children:"Capabilities"}),jt("p",{className:"text-lg text-muted-foreground",children:"Capabilities are the core building block of ContractSpec. They define what your app can do."})]}),Da("div",{className:"space-y-6",children:[Da("div",{className:"space-y-3",children:[jt("h2",{className:"font-bold text-2xl",children:"Overview"}),jt("p",{className:"text-muted-foreground",children:"A ContractSpec (or Capability) is a typed, declarative description of an operation. It defines the operation's name, version, inputs, outputs, policies, and side effects. Runtime adapters automatically serve these as REST/GraphQL/MCP endpoints with full validation and policy enforcement."})]}),Da("div",{className:"space-y-3",children:[jt("h2",{className:"font-bold text-2xl",children:"Defining a Command (Write)"}),jt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:jt("pre",{children:`import { defineCommand } from '@contractspec/lib.contracts-spec';
4496
+ />;`})]}),We("section",{className:"editorial-panel space-y-4",children:[G("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Read this with the Studio bridge in mind"}),G("p",{className:"text-muted-foreground text-sm leading-7",children:"Builder is where the OSS foundation meets the richer operating layer. Use the Studio overview when you want the higher-level product posture and team workflows on top of these contracts."}),We("div",{className:"flex flex-wrap gap-3",children:[G(Md,{href:"/docs/studio",className:"btn-primary",children:"Studio overview"}),G(Md,{href:"/docs/architecture/control-plane",className:"btn-ghost",children:"Control-plane runtime"})]})]})]})}import Gy from"@contractspec/lib.ui-link";import{ChevronRight as qy}from"lucide-react";import{jsx as jt,jsxs as Ea}from"react/jsx-runtime";function Hy(){return Ea("div",{className:"space-y-8",children:[Ea("div",{className:"space-y-2",children:[jt("h1",{className:"font-bold text-4xl",children:"Capabilities"}),jt("p",{className:"text-lg text-muted-foreground",children:"Capabilities are the core building block of ContractSpec. They define what your app can do."})]}),Ea("div",{className:"space-y-6",children:[Ea("div",{className:"space-y-3",children:[jt("h2",{className:"font-bold text-2xl",children:"Overview"}),jt("p",{className:"text-muted-foreground",children:"A ContractSpec (or Capability) is a typed, declarative description of an operation. It defines the operation's name, version, inputs, outputs, policies, and side effects. Runtime adapters automatically serve these as REST/GraphQL/MCP endpoints with full validation and policy enforcement."})]}),Ea("div",{className:"space-y-3",children:[jt("h2",{className:"font-bold text-2xl",children:"Defining a Command (Write)"}),jt("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:jt("pre",{children:`import { defineCommand } from '@contractspec/lib.contracts-spec';
4497
4497
  import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
4498
4498
 
4499
4499
  const TransferFundsInput = new SchemaModel({
@@ -4531,7 +4531,7 @@ export const TransferFunds = defineCommand({
4531
4531
  auth: 'user',
4532
4532
  flags: ['payments_enabled'],
4533
4533
  },
4534
- });`})})]}),Da("div",{className:"space-y-3",children:[jt("h2",{className:"font-bold text-2xl",children:"Schema Types"}),Da("p",{className:"text-muted-foreground",children:["ContractSpec uses ",jt("code",{children:"@contractspec/lib.schema"})," for I/O definitions. This provides Zod validation, GraphQL types, and JSON Schema from a single source."]}),Da("ul",{className:"space-y-2 text-muted-foreground",children:[Da("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.NonEmptyString()"})," ","- Non-empty text"]}),Da("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.PositiveNumber()"})," ","- Positive numbers"]}),Da("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.DateTime()"})," ","- ISO 8601 timestamps"]}),Da("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.Email()"})," ","- Valid email addresses"]}),Da("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum(...)"})," ","- Type-safe enums"]})]})]}),jt("div",{className:"flex items-center gap-4 pt-4",children:Da(Gy,{href:"/docs/specs/dataviews",className:"btn-primary",children:["Next: DataViews ",jt(Hy,{size:16})]})})]})]})}import{CodeBlock as Vy}from"@contractspec/lib.design-system";import Ud from"@contractspec/lib.ui-link";import{jsx as ue,jsxs as Et}from"react/jsx-runtime";var Fy=[{title:"ContextPack",body:"Projects the current repo state, impacted contracts, canon packs, policy bindings, and acceptance checks into one task-scoped envelope."},{title:"PlanPacket",body:"Compiles a candidate objective into ACP-aware steps plus explicit refs back to control-plane intent, plan compile, and plan verify contracts."},{title:"PatchVerdict",body:"Classifies one file edit or shell command as permit, rewrite, require_review, or deny, with runtime-linked control-plane state when available."},{title:"ReviewPacket",body:"Persists the evidence a human needs when Connect escalates, while keeping the local artifact trail authoritative in OSS mode."}],Ky=["`.contractspec/adoption/catalog.json` mirrored from the bundled ContractSpec catalog","family-aware reuse recommendations for `ui`, `contracts`, `integrations`, `runtime`, `sharedLibs`, and `solutions`","verdict thresholds that can prefer workspace reuse, ContractSpec reuse, review, or explicit denial before a new implementation starts"],Qy=["Enable `connect` in `.contractsrc.json` and keep your protected, immutable, generated, and smoke-check policies explicit.","Run `contractspec connect context` and `contractspec connect plan` before risky work so the agent is operating on task-scoped evidence, not ambient repo assumptions.","Gate file and shell mutations through `contractspec connect verify` or the host hook commands instead of inventing editor-specific approval logic.","Inspect pending review packets locally first, then sync them to the Studio bridge only if your team wants centralized operator workflows.","Use replay and harness evaluation to prove whether a prior decision stayed safe when the workspace changed."],Yy=["Connect is not a second control plane or a second package family.","Verdicts are projections over existing `controlPlane.*`, ACP, workspace, and harness primitives.","Studio is optional for baseline enforcement. Local artifacts remain the OSS source of truth.","Destructive commands, protected paths, drift, and unknown impact stay visible instead of being hidden behind adapter magic."];function Jy(){return Et("div",{className:"space-y-10",children:[Et("section",{className:"space-y-3",children:[ue("p",{className:"editorial-kicker",children:"Spec pack"}),ue("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"ContractSpec Connect puts coding-agent actions behind explicit, local-first governance."}),ue("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"Connect is the adapter layer between agent-native actions and the existing ContractSpec stack. It reuses control-plane, ACP, workspace, knowledge, and harness primitives to explain what the agent is trying to do before a file edit or shell command lands."})]}),Et("section",{className:"editorial-proof-strip",children:[Et("div",{className:"editorial-stat",children:[ue("span",{className:"editorial-label",children:"Authoritative surfaces"}),ue("span",{className:"editorial-stat-value",children:"control plane, ACP, workspace, harness"})]}),ue("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Connect stays narrow on purpose. It projects local evidence, maps its verdicts back to runtime semantics, and leaves the canonical system contracts where they already live."})]}),Et("section",{className:"editorial-panel space-y-5",children:[Et("div",{className:"space-y-2",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What you use in practice"}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:"The CLI and the workspace service already implement the pack. The main workflow is local initialization, task projection, verification, then optional review sync."})]}),ue(Vy,{language:"bash",filename:"contractspec-connect",code:`contractspec connect init --scope workspace
4534
+ });`})})]}),Ea("div",{className:"space-y-3",children:[jt("h2",{className:"font-bold text-2xl",children:"Schema Types"}),Ea("p",{className:"text-muted-foreground",children:["ContractSpec uses ",jt("code",{children:"@contractspec/lib.schema"})," for I/O definitions. This provides Zod validation, GraphQL types, and JSON Schema from a single source."]}),Ea("ul",{className:"space-y-2 text-muted-foreground",children:[Ea("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.NonEmptyString()"})," ","- Non-empty text"]}),Ea("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.PositiveNumber()"})," ","- Positive numbers"]}),Ea("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.DateTime()"})," ","- ISO 8601 timestamps"]}),Ea("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum.Email()"})," ","- Valid email addresses"]}),Ea("li",{children:["\u2022"," ",jt("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum(...)"})," ","- Type-safe enums"]})]})]}),jt("div",{className:"flex items-center gap-4 pt-4",children:Ea(Gy,{href:"/docs/specs/dataviews",className:"btn-primary",children:["Next: DataViews ",jt(qy,{size:16})]})})]})]})}import{CodeBlock as Vy}from"@contractspec/lib.design-system";import Ud from"@contractspec/lib.ui-link";import{jsx as ue,jsxs as Dt}from"react/jsx-runtime";var Fy=[{title:"ContextPack",body:"Projects the current repo state, impacted contracts, canon packs, policy bindings, and acceptance checks into one task-scoped envelope."},{title:"PlanPacket",body:"Compiles a candidate objective into ACP-aware steps plus explicit refs back to control-plane intent, plan compile, and plan verify contracts."},{title:"PatchVerdict",body:"Classifies one file edit or shell command as permit, rewrite, require_review, or deny, with runtime-linked control-plane state when available."},{title:"ReviewPacket",body:"Persists the evidence a human needs when Connect escalates, while keeping the local artifact trail authoritative in OSS mode."}],Ky=["`.contractspec/adoption/catalog.json` mirrored from the bundled ContractSpec catalog","family-aware reuse recommendations for `ui`, `contracts`, `integrations`, `runtime`, `sharedLibs`, and `solutions`","verdict thresholds that can prefer workspace reuse, ContractSpec reuse, review, or explicit denial before a new implementation starts"],Qy=["Enable `connect` in `.contractsrc.json` and keep your protected, immutable, generated, and smoke-check policies explicit.","Run `contractspec connect context` and `contractspec connect plan` before risky work so the agent is operating on task-scoped evidence, not ambient repo assumptions.","Gate file and shell mutations through `contractspec connect verify` or the host hook commands instead of inventing editor-specific approval logic.","Inspect pending review packets locally first, then sync them to the Studio bridge only if your team wants centralized operator workflows.","Use replay and harness evaluation to prove whether a prior decision stayed safe when the workspace changed."],Yy=["Connect is not a second control plane or a second package family.","Verdicts are projections over existing `controlPlane.*`, ACP, workspace, and harness primitives.","Studio is optional for baseline enforcement. Local artifacts remain the OSS source of truth.","Destructive commands, protected paths, drift, and unknown impact stay visible instead of being hidden behind adapter magic."];function Jy(){return Dt("div",{className:"space-y-10",children:[Dt("section",{className:"space-y-3",children:[ue("p",{className:"editorial-kicker",children:"Spec pack"}),ue("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"ContractSpec Connect puts coding-agent actions behind explicit, local-first governance."}),ue("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"Connect is the adapter layer between agent-native actions and the existing ContractSpec stack. It reuses control-plane, ACP, workspace, knowledge, and harness primitives to explain what the agent is trying to do before a file edit or shell command lands."})]}),Dt("section",{className:"editorial-proof-strip",children:[Dt("div",{className:"editorial-stat",children:[ue("span",{className:"editorial-label",children:"Authoritative surfaces"}),ue("span",{className:"editorial-stat-value",children:"control plane, ACP, workspace, harness"})]}),ue("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Connect stays narrow on purpose. It projects local evidence, maps its verdicts back to runtime semantics, and leaves the canonical system contracts where they already live."})]}),Dt("section",{className:"editorial-panel space-y-5",children:[Dt("div",{className:"space-y-2",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What you use in practice"}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:"The CLI and the workspace service already implement the pack. The main workflow is local initialization, task projection, verification, then optional review sync."})]}),ue(Vy,{language:"bash",filename:"contractspec-connect",code:`contractspec connect init --scope workspace
4535
4535
  contractspec connect adoption sync --json
4536
4536
  printf '{"goal":"Prefer an existing release helper before adding a new one"}' | contractspec connect adoption resolve --family sharedLibs --stdin --json
4537
4537
  contractspec connect context --task refactor-docs --paths packages/libs/contracts-spec/src/control-plane/contracts.ts --json
@@ -4539,7 +4539,7 @@ printf '{"objective":"Document the control-plane contract surface","commands":["
4539
4539
  printf '{"operation":"edit","path":"packages/libs/contracts-spec/src/control-plane/contracts.ts"}' | contractspec connect verify --task refactor-docs --tool acp.fs.access --stdin --json
4540
4540
  printf 'bun run typecheck' | contractspec connect verify --task refactor-docs --tool acp.terminal.exec --stdin --json
4541
4541
  contractspec connect review list --json
4542
- contractspec connect replay <decisionId> --json`})]}),Et("section",{className:"space-y-5",children:[Et("div",{className:"space-y-2",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"The four core artifacts"}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:"Every Connect command is there to emit or inspect one of these reviewable objects under `.contractspec/connect/*`."})]}),ue("div",{className:"grid gap-4 md:grid-cols-2",children:Fy.map((e)=>Et("article",{className:"editorial-panel space-y-3",children:[ue("h3",{className:"font-semibold text-xl",children:e.title}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:e.body})]},e.title))})]}),Et("section",{className:"editorial-panel space-y-5",children:[Et("div",{className:"space-y-2",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Reuse-first adoption is part of the workflow"}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:"Connect adoption keeps reuse guidance in the same local control surface. Before a new contract family, helper, or runtime abstraction lands, Connect can mirror the bundled catalog and resolve the best reuse candidate by family."})]}),ue("ul",{className:"editorial-list",children:Ky.map((e)=>Et("li",{children:[ue("span",{className:"editorial-list-marker"}),ue("span",{children:e})]},e))})]}),Et("section",{className:"grid gap-5 lg:grid-cols-2",children:[Et("article",{className:"editorial-panel space-y-4",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Adopt Connect in this order"}),ue("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:Qy.map((e)=>ue("li",{children:e},e))})]}),Et("article",{className:"editorial-panel space-y-4",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Boundaries that keep it trustworthy"}),ue("ul",{className:"editorial-list",children:Yy.map((e)=>Et("li",{children:[ue("span",{className:"editorial-list-marker"}),ue("span",{children:e})]},e))})]})]}),Et("section",{className:"editorial-panel space-y-4",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Where Connect fits in the rest of the docs"}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:"Read the control-plane runtime page when you want the underlying governance contracts, then use the Studio bridge only if your team wants centralized review queues on top of the OSS-local evidence path."}),Et("div",{className:"flex flex-wrap gap-3",children:[ue(Ud,{href:"/docs/architecture/control-plane",className:"btn-primary",children:"Control-plane runtime"}),ue(Ud,{href:"/docs/studio",className:"btn-ghost",children:"Studio bridge"})]})]})]})}import Rr from"@contractspec/lib.ui-link";import{ChevronRight as $y}from"lucide-react";import{jsx as Z,jsxs as Re}from"react/jsx-runtime";var Zy=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
4542
+ contractspec connect replay <decisionId> --json`})]}),Dt("section",{className:"space-y-5",children:[Dt("div",{className:"space-y-2",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"The four core artifacts"}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:"Every Connect command is there to emit or inspect one of these reviewable objects under `.contractspec/connect/*`."})]}),ue("div",{className:"grid gap-4 md:grid-cols-2",children:Fy.map((e)=>Dt("article",{className:"editorial-panel space-y-3",children:[ue("h3",{className:"font-semibold text-xl",children:e.title}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:e.body})]},e.title))})]}),Dt("section",{className:"editorial-panel space-y-5",children:[Dt("div",{className:"space-y-2",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Reuse-first adoption is part of the workflow"}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:"Connect adoption keeps reuse guidance in the same local control surface. Before a new contract family, helper, or runtime abstraction lands, Connect can mirror the bundled catalog and resolve the best reuse candidate by family."})]}),ue("ul",{className:"editorial-list",children:Ky.map((e)=>Dt("li",{children:[ue("span",{className:"editorial-list-marker"}),ue("span",{children:e})]},e))})]}),Dt("section",{className:"grid gap-5 lg:grid-cols-2",children:[Dt("article",{className:"editorial-panel space-y-4",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Adopt Connect in this order"}),ue("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:Qy.map((e)=>ue("li",{children:e},e))})]}),Dt("article",{className:"editorial-panel space-y-4",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Boundaries that keep it trustworthy"}),ue("ul",{className:"editorial-list",children:Yy.map((e)=>Dt("li",{children:[ue("span",{className:"editorial-list-marker"}),ue("span",{children:e})]},e))})]})]}),Dt("section",{className:"editorial-panel space-y-4",children:[ue("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Where Connect fits in the rest of the docs"}),ue("p",{className:"text-muted-foreground text-sm leading-7",children:"Read the control-plane runtime page when you want the underlying governance contracts, then use the Studio bridge only if your team wants centralized review queues on top of the OSS-local evidence path."}),Dt("div",{className:"flex flex-wrap gap-3",children:[ue(Ud,{href:"/docs/architecture/control-plane",className:"btn-primary",children:"Control-plane runtime"}),ue(Ud,{href:"/docs/studio",className:"btn-ghost",children:"Studio bridge"})]})]})]})}import Rr from"@contractspec/lib.ui-link";import{ChevronRight as Zy}from"lucide-react";import{jsx as $,jsxs as Re}from"react/jsx-runtime";var $y=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
4543
4543
  import { ListDataGridShowcaseRowsQuery } from '@contractspec/example.data-grid-showcase/contracts/data-grid-showcase.operation';
4544
4544
 
4545
4545
  export const DataGridShowcaseDataView = defineDataView({
@@ -4586,7 +4586,7 @@ export const DataGridShowcaseDataView = defineDataView({
4586
4586
  { key: 'notes', label: 'Notes', dataPath: 'notes' },
4587
4587
  ],
4588
4588
  },
4589
- });`;function Xy(){return Re("div",{className:"space-y-8",children:[Re("div",{className:"space-y-4",children:[Z("h1",{className:"font-bold text-4xl",children:"DataViews"}),Re("p",{className:"text-muted-foreground",children:["A ",Z("strong",{children:"DataViewSpec"})," describes how data should be queried, filtered, sorted, and presented to users. Runtime adapters execute optimized database queries and serve list views, detail views, and search interfaces while respecting policy constraints."]})]}),Re("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Core concepts"}),Re("div",{className:"space-y-3",children:[Re("div",{children:[Z("h3",{className:"font-semibold text-lg",children:"Data sources"}),Z("p",{className:"text-muted-foreground",children:"A DataView connects to one or more data sources\u2014databases, APIs, or other capabilities. You specify the source and the fields you want to expose."})]}),Re("div",{children:[Z("h3",{className:"font-semibold text-lg",children:"Filtering"}),Z("p",{className:"text-muted-foreground",children:`Define filters that users can apply to narrow down results. Filters can be simple (e.g., "status equals 'active'") or complex (e.g., "created within the last 30 days AND assigned to current user").`})]}),Re("div",{children:[Z("h3",{className:"font-semibold text-lg",children:"Sorting"}),Z("p",{className:"text-muted-foreground",children:"Specify which fields can be sorted and the default sort order. ContractSpec generates efficient database queries with proper indexes."})]}),Re("div",{children:[Z("h3",{className:"font-semibold text-lg",children:"Pagination"}),Z("p",{className:"text-muted-foreground",children:"DataViews automatically support pagination to handle large datasets. You can configure page size limits and cursor-based or offset-based pagination."})]}),Re("div",{children:[Z("h3",{className:"font-semibold text-lg",children:"Aggregations"}),Z("p",{className:"text-muted-foreground",children:"Compute aggregates like counts, sums, averages, and group-by operations. These are useful for dashboards and summary views."})]})]})]}),Re("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Example DataViewSpec"}),Re("p",{className:"text-muted-foreground",children:["Here is the canonical table contract used by the live"," ",Z(Rr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),":"]}),Z("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:Z("pre",{children:Zy})}),Z("p",{className:"text-muted-foreground text-sm",children:"This one contract drives the DataView lane, while the same rows and controller also feed the raw web primitive, native-first primitive, and composed design-system demos."})]}),Re("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Policy integration"}),Re("p",{className:"text-muted-foreground",children:["DataViews automatically enforce"," ",Z(Rr,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". If a user doesn't have permission to see certain fields, those fields are automatically filtered out or redacted. If a user can only see their own data, the query is automatically scoped."]}),Z("p",{className:"text-muted-foreground",children:"This means you define the data view once, and it works correctly for all users based on their permissions\u2014no need to write separate queries for different roles."})]}),Re("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Served outputs"}),Z("p",{className:"text-muted-foreground",children:"From a DataViewSpec, ContractSpec serves:"}),Re("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Re("li",{children:[Z("strong",{children:"Database queries"})," \u2013 Optimized SQL or NoSQL queries executed at runtime"]}),Re("li",{children:[Z("strong",{children:"API endpoints"})," \u2013 RESTful or GraphQL endpoints for fetching data"]}),Re("li",{children:[Z("strong",{children:"UI components"})," \u2013 List views, tables, cards, and detail views"]}),Re("li",{children:[Z("strong",{children:"Search interfaces"})," \u2013 Full-text search with autocomplete"]}),Re("li",{children:[Z("strong",{children:"Export functions"})," \u2013 CSV, JSON, or Excel exports"]})]})]}),Re("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Best practices"}),Re("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Z("li",{children:"Only expose fields that users actually need\u2014this improves performance and security."}),Z("li",{children:"Use appropriate indexes for sortable and filterable fields."}),Z("li",{children:"Set reasonable pagination limits to prevent performance issues."}),Z("li",{children:"Use aggregations sparingly\u2014they can be expensive on large datasets."}),Z("li",{children:"Test DataViews with realistic data volumes to ensure they perform well."})]})]}),Re("div",{className:"flex items-center gap-4 pt-4",children:[Z(Rr,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),Re(Rr,{href:"/docs/specs/workflows",className:"btn-primary",children:["Next: Workflows ",Z($y,{size:16})]})]})]})}import{CodeBlock as Wd}from"@contractspec/lib.design-system";import _d from"@contractspec/lib.ui-link";import{jsx as de,jsxs as gt}from"react/jsx-runtime";var xy=["declared routes, surfaces, layouts, slots, actions, and data recipes","entity registries and field renderers for relation-heavy workbenches","preference-aware adaptation across guidance, density, data depth, control, media, pace, and narrative","auditable overlays and bounded AI patch proposals instead of free-form JSX generation"],jy=["Define one `ModuleBundleSpec` with `defineModuleBundle` and keep the route and surface map explicit.","Resolve the bundle with `resolveBundle` for a real user, route, device, and preference profile.","Render the plan through `BundleProvider` and `BundleRenderer` so the UI stays downstream of the resolved spec.","Add overlays, policy hooks, planner proposals, and telemetry only after the base route resolves cleanly.","Pilot one dense domain first, such as a PM or operations workbench, before expanding the abstraction across the app."];function eb(){return gt("div",{className:"space-y-10",children:[gt("section",{className:"space-y-3",children:[de("p",{className:"editorial-kicker",children:"Spec pack"}),de("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Module bundles turn surface composition into a typed ContractSpec runtime instead of a pile of bespoke page code."}),gt("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:["The implemented package is"," ",de("code",{children:"@contractspec/lib.surface-runtime"}),". It lets you define a bundle spec once, resolve it into a personalized surface plan, then render that plan through React without letting AI or per-route custom code bypass the declared system boundary."]})]}),gt("section",{className:"editorial-proof-strip",children:[gt("div",{className:"editorial-stat",children:[de("span",{className:"editorial-label",children:"Runtime promise"}),de("span",{className:"editorial-stat-value",children:"bundle spec \u2192 resolved surface plan"})]}),de("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"The bundle spec owns what can render, where it can render, which preferences matter, and how overlays and AI proposals stay bounded."})]}),de("section",{className:"grid gap-4 md:grid-cols-2",children:xy.map((e)=>gt("article",{className:"editorial-panel space-y-3",children:[de("h2",{className:"font-semibold text-xl",children:"Bundle capability"}),de("p",{className:"text-muted-foreground text-sm leading-7",children:e})]},e))}),gt("section",{className:"editorial-panel space-y-5",children:[gt("div",{className:"space-y-2",children:[de("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"1) Define the bundle"}),de("p",{className:"text-muted-foreground text-sm leading-7",children:"Start with a typed route and one surface. The runtime validates that you declared routes, surfaces, and verification coverage for all seven preference dimensions."})]}),de(Wd,{language:"typescript",filename:"support.workbench.bundle.ts",code:`import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec/define-module-bundle";
4589
+ });`;function Xy(){return Re("div",{className:"space-y-8",children:[Re("div",{className:"space-y-4",children:[$("h1",{className:"font-bold text-4xl",children:"DataViews"}),Re("p",{className:"text-muted-foreground",children:["A ",$("strong",{children:"DataViewSpec"})," describes how data should be queried, filtered, sorted, and presented to users. Runtime adapters execute optimized database queries and serve list views, detail views, and search interfaces while respecting policy constraints."]})]}),Re("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Core concepts"}),Re("div",{className:"space-y-3",children:[Re("div",{children:[$("h3",{className:"font-semibold text-lg",children:"Data sources"}),$("p",{className:"text-muted-foreground",children:"A DataView connects to one or more data sources\u2014databases, APIs, or other capabilities. You specify the source and the fields you want to expose."})]}),Re("div",{children:[$("h3",{className:"font-semibold text-lg",children:"Filtering"}),$("p",{className:"text-muted-foreground",children:`Define filters that users can apply to narrow down results. Filters can be simple (e.g., "status equals 'active'") or complex (e.g., "created within the last 30 days AND assigned to current user").`})]}),Re("div",{children:[$("h3",{className:"font-semibold text-lg",children:"Sorting"}),$("p",{className:"text-muted-foreground",children:"Specify which fields can be sorted and the default sort order. ContractSpec generates efficient database queries with proper indexes."})]}),Re("div",{children:[$("h3",{className:"font-semibold text-lg",children:"Pagination"}),$("p",{className:"text-muted-foreground",children:"DataViews automatically support pagination to handle large datasets. You can configure page size limits and cursor-based or offset-based pagination."})]}),Re("div",{children:[$("h3",{className:"font-semibold text-lg",children:"Aggregations"}),$("p",{className:"text-muted-foreground",children:"Compute aggregates like counts, sums, averages, and group-by operations. These are useful for dashboards and summary views."})]})]})]}),Re("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Example DataViewSpec"}),Re("p",{className:"text-muted-foreground",children:["Here is the canonical table contract used by the live"," ",$(Rr,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),":"]}),$("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:$("pre",{children:$y})}),$("p",{className:"text-muted-foreground text-sm",children:"This one contract drives the DataView lane, while the same rows and controller also feed the raw web primitive, native-first primitive, and composed design-system demos."})]}),Re("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Policy integration"}),Re("p",{className:"text-muted-foreground",children:["DataViews automatically enforce"," ",$(Rr,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". If a user doesn't have permission to see certain fields, those fields are automatically filtered out or redacted. If a user can only see their own data, the query is automatically scoped."]}),$("p",{className:"text-muted-foreground",children:"This means you define the data view once, and it works correctly for all users based on their permissions\u2014no need to write separate queries for different roles."})]}),Re("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Served outputs"}),$("p",{className:"text-muted-foreground",children:"From a DataViewSpec, ContractSpec serves:"}),Re("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[Re("li",{children:[$("strong",{children:"Database queries"})," \u2013 Optimized SQL or NoSQL queries executed at runtime"]}),Re("li",{children:[$("strong",{children:"API endpoints"})," \u2013 RESTful or GraphQL endpoints for fetching data"]}),Re("li",{children:[$("strong",{children:"UI components"})," \u2013 List views, tables, cards, and detail views"]}),Re("li",{children:[$("strong",{children:"Search interfaces"})," \u2013 Full-text search with autocomplete"]}),Re("li",{children:[$("strong",{children:"Export functions"})," \u2013 CSV, JSON, or Excel exports"]})]})]}),Re("div",{className:"space-y-4",children:[$("h2",{className:"font-bold text-2xl",children:"Best practices"}),Re("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[$("li",{children:"Only expose fields that users actually need\u2014this improves performance and security."}),$("li",{children:"Use appropriate indexes for sortable and filterable fields."}),$("li",{children:"Set reasonable pagination limits to prevent performance issues."}),$("li",{children:"Use aggregations sparingly\u2014they can be expensive on large datasets."}),$("li",{children:"Test DataViews with realistic data volumes to ensure they perform well."})]})]}),Re("div",{className:"flex items-center gap-4 pt-4",children:[$(Rr,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),Re(Rr,{href:"/docs/specs/workflows",className:"btn-primary",children:["Next: Workflows ",$(Zy,{size:16})]})]})]})}import{CodeBlock as Wd}from"@contractspec/lib.design-system";import _d from"@contractspec/lib.ui-link";import{jsx as de,jsxs as gt}from"react/jsx-runtime";var xy=["declared routes, surfaces, layouts, slots, actions, and data recipes","entity registries and field renderers for relation-heavy workbenches","preference-aware adaptation across guidance, density, data depth, control, media, pace, and narrative","auditable overlays and bounded AI patch proposals instead of free-form JSX generation"],jy=["Define one `ModuleBundleSpec` with `defineModuleBundle` and keep the route and surface map explicit.","Resolve the bundle with `resolveBundle` for a real user, route, device, and preference profile.","Render the plan through `BundleProvider` and `BundleRenderer` so the UI stays downstream of the resolved spec.","Add overlays, policy hooks, planner proposals, and telemetry only after the base route resolves cleanly.","Pilot one dense domain first, such as a PM or operations workbench, before expanding the abstraction across the app."];function eb(){return gt("div",{className:"space-y-10",children:[gt("section",{className:"space-y-3",children:[de("p",{className:"editorial-kicker",children:"Spec pack"}),de("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Module bundles turn surface composition into a typed ContractSpec runtime instead of a pile of bespoke page code."}),gt("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:["The implemented package is"," ",de("code",{children:"@contractspec/lib.surface-runtime"}),". It lets you define a bundle spec once, resolve it into a personalized surface plan, then render that plan through React without letting AI or per-route custom code bypass the declared system boundary."]})]}),gt("section",{className:"editorial-proof-strip",children:[gt("div",{className:"editorial-stat",children:[de("span",{className:"editorial-label",children:"Runtime promise"}),de("span",{className:"editorial-stat-value",children:"bundle spec \u2192 resolved surface plan"})]}),de("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"The bundle spec owns what can render, where it can render, which preferences matter, and how overlays and AI proposals stay bounded."})]}),de("section",{className:"grid gap-4 md:grid-cols-2",children:xy.map((e)=>gt("article",{className:"editorial-panel space-y-3",children:[de("h2",{className:"font-semibold text-xl",children:"Bundle capability"}),de("p",{className:"text-muted-foreground text-sm leading-7",children:e})]},e))}),gt("section",{className:"editorial-panel space-y-5",children:[gt("div",{className:"space-y-2",children:[de("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"1) Define the bundle"}),de("p",{className:"text-muted-foreground text-sm leading-7",children:"Start with a typed route and one surface. The runtime validates that you declared routes, surfaces, and verification coverage for all seven preference dimensions."})]}),de(Wd,{language:"typescript",filename:"support.workbench.bundle.ts",code:`import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec/define-module-bundle";
4590
4590
 
4591
4591
  export const SupportWorkbenchBundle = defineModuleBundle({
4592
4592
  meta: {
@@ -4651,7 +4651,7 @@ export function SurfaceHost() {
4651
4651
  <BundleRenderer assistantSlotId="assistant" />
4652
4652
  </BundleProvider>
4653
4653
  );
4654
- }`})]}),gt("section",{className:"grid gap-5 lg:grid-cols-2",children:[gt("article",{className:"editorial-panel space-y-4",children:[de("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Adoption loop"}),de("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:jy.map((e)=>de("li",{children:e},e))})]}),gt("article",{className:"editorial-panel space-y-4",children:[de("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Guardrails that matter"}),gt("ul",{className:"editorial-list",children:[gt("li",{children:[de("span",{className:"editorial-list-marker"}),de("span",{children:"Do not stuff this behavior back into `lib.ui-kit`."})]}),gt("li",{children:[de("span",{className:"editorial-list-marker"}),de("span",{children:"Do not let AI invent undeclared components or mutate raw DOM state."})]}),gt("li",{children:[de("span",{className:"editorial-list-marker"}),de("span",{children:"Keep third-party UI libraries behind adapter subpaths only."})]}),gt("li",{children:[de("span",{className:"editorial-list-marker"}),de("span",{children:"Every surface still needs explicit verification coverage for the seven preference dimensions."})]})]})]})]}),gt("section",{className:"editorial-panel space-y-4",children:[de("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Continue with overlays and runtime architecture"}),de("p",{className:"text-muted-foreground text-sm leading-7",children:"Once the bundle resolves deterministically, move into safe customization and the wider architecture that surrounds it."}),gt("div",{className:"flex flex-wrap gap-3",children:[de(_d,{href:"/docs/specs/overlays",className:"btn-primary",children:"Overlays"}),de(_d,{href:"/docs/architecture",className:"btn-ghost",children:"Architecture overview"})]})]})]})}import Di from"@contractspec/lib.ui-link";import{ChevronRight as tb}from"lucide-react";import{jsx as P,jsxs as q}from"react/jsx-runtime";function ab(){return q("div",{className:"space-y-8",children:[q("div",{className:"space-y-4",children:[P("h1",{className:"font-bold text-4xl",children:"Overlays"}),q("p",{className:"text-muted-foreground",children:["An ",P("strong",{children:"OverlaySpec"})," allows tenants or users to customize UI layouts and field visibility without modifying the underlying application code. Overlays are cryptographically signed to ensure they respect policy boundaries and cannot introduce security vulnerabilities."]})]}),q("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Why overlays matter"}),P("p",{className:"text-muted-foreground",children:"Different users have different needs. A power user might want to see all available fields and actions, while a casual user prefers a simplified interface. A tenant in a multi-tenant application might want to brand the UI or hide features they don't use."}),P("p",{className:"text-muted-foreground",children:"Traditional approaches require either building multiple UIs or adding complex configuration logic throughout the codebase. OverlaySpecs provide a safer, more maintainable solution: users can customize their experience, but only within the bounds allowed by the underlying specs and policies."})]}),q("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"What overlays can do"}),q("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:[P("strong",{children:"Hide or show fields"})," \u2013 Remove fields from forms or detail views (but only if the user has permission to see them in the first place)"]}),q("li",{children:[P("strong",{children:"Reorder fields"})," \u2013 Change the order in which fields appear"]}),q("li",{children:[P("strong",{children:"Rename labels"})," \u2013 Use different terminology that's more familiar to the user"]}),q("li",{children:[P("strong",{children:"Change layouts"})," \u2013 Switch between list, grid, or card views"]}),q("li",{children:[P("strong",{children:"Add help text"})," \u2013 Provide context-specific guidance"]}),q("li",{children:[P("strong",{children:"Set default values"})," \u2013 Pre-fill forms with tenant-specific defaults"]}),q("li",{children:[P("strong",{children:"Apply branding"})," \u2013 Customize colors, logos, and styling (within approved themes)"]})]})]}),q("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Example OverlaySpec"}),P("p",{className:"text-muted-foreground",children:"Here's an overlay that customizes an order form:"}),P("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:P("pre",{children:`overlayId: acme-order-form
4654
+ }`})]}),gt("section",{className:"grid gap-5 lg:grid-cols-2",children:[gt("article",{className:"editorial-panel space-y-4",children:[de("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Adoption loop"}),de("ol",{className:"list-inside list-decimal space-y-3 text-muted-foreground text-sm leading-7",children:jy.map((e)=>de("li",{children:e},e))})]}),gt("article",{className:"editorial-panel space-y-4",children:[de("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Guardrails that matter"}),gt("ul",{className:"editorial-list",children:[gt("li",{children:[de("span",{className:"editorial-list-marker"}),de("span",{children:"Do not stuff this behavior back into `lib.ui-kit`."})]}),gt("li",{children:[de("span",{className:"editorial-list-marker"}),de("span",{children:"Do not let AI invent undeclared components or mutate raw DOM state."})]}),gt("li",{children:[de("span",{className:"editorial-list-marker"}),de("span",{children:"Keep third-party UI libraries behind adapter subpaths only."})]}),gt("li",{children:[de("span",{className:"editorial-list-marker"}),de("span",{children:"Every surface still needs explicit verification coverage for the seven preference dimensions."})]})]})]})]}),gt("section",{className:"editorial-panel space-y-4",children:[de("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Continue with overlays and runtime architecture"}),de("p",{className:"text-muted-foreground text-sm leading-7",children:"Once the bundle resolves deterministically, move into safe customization and the wider architecture that surrounds it."}),gt("div",{className:"flex flex-wrap gap-3",children:[de(_d,{href:"/docs/specs/overlays",className:"btn-primary",children:"Overlays"}),de(_d,{href:"/docs/architecture",className:"btn-ghost",children:"Architecture overview"})]})]})]})}import Ei from"@contractspec/lib.ui-link";import{ChevronRight as tb}from"lucide-react";import{jsx as P,jsxs as H}from"react/jsx-runtime";function ab(){return H("div",{className:"space-y-8",children:[H("div",{className:"space-y-4",children:[P("h1",{className:"font-bold text-4xl",children:"Overlays"}),H("p",{className:"text-muted-foreground",children:["An ",P("strong",{children:"OverlaySpec"})," allows tenants or users to customize UI layouts and field visibility without modifying the underlying application code. Overlays are cryptographically signed to ensure they respect policy boundaries and cannot introduce security vulnerabilities."]})]}),H("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Why overlays matter"}),P("p",{className:"text-muted-foreground",children:"Different users have different needs. A power user might want to see all available fields and actions, while a casual user prefers a simplified interface. A tenant in a multi-tenant application might want to brand the UI or hide features they don't use."}),P("p",{className:"text-muted-foreground",children:"Traditional approaches require either building multiple UIs or adding complex configuration logic throughout the codebase. OverlaySpecs provide a safer, more maintainable solution: users can customize their experience, but only within the bounds allowed by the underlying specs and policies."})]}),H("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"What overlays can do"}),H("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[H("li",{children:[P("strong",{children:"Hide or show fields"})," \u2013 Remove fields from forms or detail views (but only if the user has permission to see them in the first place)"]}),H("li",{children:[P("strong",{children:"Reorder fields"})," \u2013 Change the order in which fields appear"]}),H("li",{children:[P("strong",{children:"Rename labels"})," \u2013 Use different terminology that's more familiar to the user"]}),H("li",{children:[P("strong",{children:"Change layouts"})," \u2013 Switch between list, grid, or card views"]}),H("li",{children:[P("strong",{children:"Add help text"})," \u2013 Provide context-specific guidance"]}),H("li",{children:[P("strong",{children:"Set default values"})," \u2013 Pre-fill forms with tenant-specific defaults"]}),H("li",{children:[P("strong",{children:"Apply branding"})," \u2013 Customize colors, logos, and styling (within approved themes)"]})]})]}),H("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Example OverlaySpec"}),P("p",{className:"text-muted-foreground",children:"Here's an overlay that customizes an order form:"}),P("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:P("pre",{children:`overlayId: acme-order-form
4655
4655
  version: '1.0.0'.0.0
4656
4656
  appliesTo:
4657
4657
  capability: createOrder
@@ -4688,7 +4688,7 @@ modifications:
4688
4688
  signature:
4689
4689
  algorithm: EdDSA
4690
4690
  publicKey: "acme-corp-overlay-key"
4691
- signature: "base64-encoded-signature"`})})]}),q("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Safety guarantees"}),P("p",{className:"text-muted-foreground",children:"Overlays are powerful, but they must not compromise security or data integrity. ContractSpec enforces several guarantees:"}),q("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:[P("strong",{children:"Overlays cannot grant new permissions"})," \u2013 They can only hide or rearrange what the user is already allowed to see"]}),q("li",{children:[P("strong",{children:"Overlays cannot bypass validation"})," \u2013 Field types, constraints, and business rules from the underlying spec still apply"]}),q("li",{children:[P("strong",{children:"Overlays must be signed"})," \u2013 Only authorized parties (typically tenant admins) can create overlays"]}),q("li",{children:[P("strong",{children:"Overlays are versioned"})," \u2013 Changes to overlays are tracked and can be rolled back"]}),q("li",{children:[P("strong",{children:"Overlays are audited"})," \u2013 Every overlay application is logged"]})]})]}),q("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Creating overlays"}),P("p",{className:"text-muted-foreground",children:"Overlays can be created through:"}),q("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:[P("strong",{children:"Visual editor"})," \u2013 A drag-and-drop interface for non-technical users"]}),q("li",{children:[P("strong",{children:"TypeScript/JSON"})," \u2013 For developers who prefer code"]}),q("li",{children:[P("strong",{children:"API"})," \u2013 Programmatically create overlays for automation"]})]}),P("p",{className:"text-muted-foreground",children:"Once created, overlays must be signed using a private key. The corresponding public key is registered with ContractSpec, which verifies the signature before applying the overlay."}),q("p",{className:"text-muted-foreground",children:["See"," ",P(Di,{href:"/docs/libraries/overlay-engine",className:"text-violet-400 underline",children:"Overlay Engine docs"})," ","and the"," ",P(Di,{href:"/docs/advanced/overlay-editor",className:"text-violet-400 underline",children:"Overlay Editor guide"})," ","for end-to-end workflows."]})]}),q("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Overlay scope"}),P("p",{className:"text-muted-foreground",children:"Overlays can be scoped to:"}),q("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[q("li",{children:[P("strong",{children:"Tenant"})," \u2013 All users in a tenant see the same overlay"]}),q("li",{children:[P("strong",{children:"User"})," \u2013 Individual users can have personal overlays"]}),q("li",{children:[P("strong",{children:"Role"})," \u2013 All users with a specific role see the overlay"]}),q("li",{children:[P("strong",{children:"Device"})," \u2013 Different overlays for mobile vs desktop"]})]}),P("p",{className:"text-muted-foreground",children:"If multiple overlays apply to the same user, they are merged in order of specificity (user overlays override role overlays, which override tenant overlays)."})]}),q("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Best practices"}),q("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[P("li",{children:"Start with the default UI and only create overlays when users request specific changes."}),P("li",{children:"Document why each overlay modification was made\u2014this helps when reviewing or updating overlays."}),P("li",{children:"Test overlays thoroughly to ensure they don't break workflows or confuse users."}),P("li",{children:"Use tenant-level overlays for organizational customizations and user-level overlays for personal preferences."}),P("li",{children:"Regularly review overlays to remove ones that are no longer needed."}),P("li",{children:"Protect overlay signing keys carefully\u2014they control what customizations are allowed."})]})]}),q("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Where overlays fit in the runtime"}),P("p",{className:"text-muted-foreground",children:"Overlays are safest when they sit on top of a declared bundle surface instead of ad hoc page code. Use the module-bundles docs first, then apply overlays as auditable customization on top of the resolved surface plan."}),q("div",{className:"flex flex-wrap gap-3",children:[P(Di,{href:"/docs/specs/module-bundles",className:"btn-primary",children:"Module bundles"}),P(Di,{href:"/docs/guides/first-module-bundle",className:"btn-ghost",children:"Build a first module bundle"})]})]}),q("div",{className:"flex items-center gap-4 pt-4",children:[P(Di,{href:"/docs/specs/policy",className:"btn-ghost",children:"Previous: Policy"}),q(Di,{href:"/docs/safety",className:"btn-primary",children:["Next: Safety ",P(tb,{size:16})]})]})]})}import zd from"@contractspec/lib.ui-link";import{ChevronRight as Gd}from"lucide-react";import{jsx as ke,jsxs as Dt}from"react/jsx-runtime";var ob=[{title:"Capabilities",body:"Model operations, events, and presentations as explicit system behavior.",href:"/docs/specs/capabilities"},{title:"Data views",body:"Describe query, filtering, and presentation behavior from the same source model.",href:"/docs/specs/dataviews"},{title:"Workflows",body:"Coordinate multi-step execution, retries, monitoring, and hand-offs.",href:"/docs/specs/workflows"},{title:"Policy",body:"Carry governance and access rules through every generated and runtime-served surface.",href:"/docs/specs/policy"},{title:"Overlays",body:"Customize generated surfaces safely instead of forking them permanently.",href:"/docs/specs/overlays"},{title:"Safety and migration",body:"Keep change safe with signing, audits, rollbacks, and explicit migration behavior.",href:"/docs/safety"}],ib=[{title:"Module bundles",body:"Define typed surface bundles that resolve into auditable runtime plans instead of hand-built page logic.",href:"/docs/specs/module-bundles"},{title:"ContractSpec Connect",body:"Put coding-agent edits and commands behind local-first context, verification, replay, and review artifacts.",href:"/docs/specs/connect"},{title:"Builder control plane",body:"Coordinate multimodal authoring, provider routing, readiness, export, and mobile review on top of OSS and Studio.",href:"/docs/specs/builder-control-plane"}];function rb(){return Dt("div",{className:"space-y-10",children:[Dt("div",{className:"space-y-3",children:[ke("p",{className:"editorial-kicker",children:"Core model"}),ke("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Contracts are the durable system boundary."}),ke("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec uses explicit TypeScript specs to describe behavior before it spreads across APIs, UI, data models, events, and operator flows. The goal is not to hide implementation. The goal is to make the system boundary explicit enough that generation, validation, runtime enforcement, and regeneration can stay coherent."})]}),Dt("div",{className:"editorial-proof-strip",children:[Dt("div",{className:"editorial-stat",children:[ke("span",{className:"editorial-label",children:"System promise"}),ke("span",{className:"editorial-stat-value",children:"one contract \u2192 many surfaces"})]}),ke("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Use the contract layer to keep surface behavior aligned, then let runtimes and generators do the repetitive work without inventing a closed platform."})]}),ke("section",{className:"editorial-panel space-y-5",children:Dt("div",{className:"space-y-2",children:[ke("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What the contract layer owns"}),Dt("ul",{className:"editorial-list",children:[Dt("li",{children:[ke("span",{className:"editorial-list-marker"}),ke("span",{children:"Behavior: operations, events, presentations, workflows."})]}),Dt("li",{children:[ke("span",{className:"editorial-list-marker"}),ke("span",{children:"Validation: input, output, and schema boundaries."})]}),Dt("li",{children:[ke("span",{className:"editorial-list-marker"}),ke("span",{children:"Governance: policy, auditability, and migration rules."})]}),Dt("li",{children:[ke("span",{className:"editorial-list-marker"}),ke("span",{children:"Surface alignment: generated or served behavior across API, UI, data, and agent-facing interfaces."})]})]})]})}),Dt("section",{className:"space-y-5",children:[Dt("div",{className:"space-y-2",children:[ke("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Specification types"}),ke("p",{className:"text-muted-foreground text-sm leading-7",children:"You can adopt the model one part at a time. Not every system needs every spec type on day one."})]}),ke("div",{className:"grid gap-4 md:grid-cols-2",children:ob.map((e)=>Dt(zd,{href:e.href,className:"editorial-panel",children:[ke("h3",{className:"font-semibold text-xl",children:e.title}),ke("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body}),Dt("div",{className:"mt-4 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Open section ",ke(Gd,{size:14})]})]},e.title))})]}),Dt("section",{className:"space-y-5",children:[Dt("div",{className:"space-y-2",children:[ke("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Implemented spec packs"}),ke("p",{className:"text-muted-foreground text-sm leading-7",children:"These packs combine multiple contract surfaces into higher-order systems you can use directly today: agent enforcement, AI-native surface runtime, and governed Builder authoring."})]}),ke("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:ib.map((e)=>Dt(zd,{href:e.href,className:"editorial-panel",children:[ke("h3",{className:"font-semibold text-xl",children:e.title}),ke("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body}),Dt("div",{className:"mt-4 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Open pack ",ke(Gd,{size:14})]})]},e.title))})]})]})}import Oi from"@contractspec/lib.ui-link";import{ChevronRight as nb}from"lucide-react";import{jsx as w,jsxs as X}from"react/jsx-runtime";function cb(){return X("div",{className:"space-y-8",children:[X("div",{className:"space-y-4",children:[w("h1",{className:"font-bold text-4xl",children:"Policy"}),X("p",{className:"text-muted-foreground",children:["A ",w("strong",{children:"PolicySpec"})," defines who can do what, when, and under what conditions. ContractSpec uses attribute-based access control (ABAC) to enforce policies across your entire application\u2014from API endpoints to UI components."]})]}),X("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Why policies matter"}),w("p",{className:"text-muted-foreground",children:"Traditional access control relies on roles (RBAC), which can become unwieldy as applications grow. ABAC is more flexible\u2014it evaluates policies based on attributes of the user, resource, action, and context."}),X("p",{className:"text-muted-foreground",children:["ContractSpec's policy engine ensures that access control is consistent across all surfaces. You don't have to remember to add authorization checks in every API endpoint or UI component\u2014the"," ",w(Oi,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"})," ","enforces policies automatically."]})]}),X("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Policy structure"}),w("p",{className:"text-muted-foreground",children:"A PolicySpec contains one or more rules. Each rule has:"}),X("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[X("li",{children:[w("strong",{children:"Effect"})," \u2013 PERMIT, DENY, or REDACT"]}),X("li",{children:[w("strong",{children:"Condition"})," \u2013 A boolean expression that determines when the rule applies"]}),X("li",{children:[w("strong",{children:"Scope"})," \u2013 Which resources, actions, or fields the rule applies to"]}),X("li",{children:[w("strong",{children:"Priority"})," \u2013 Rules are evaluated in priority order; the first matching rule wins"]})]})]}),X("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Example PolicySpec"}),w("p",{className:"text-muted-foreground",children:"Here's a policy that controls access to customer data in TypeScript:"}),w("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:w("pre",{children:`import { definePolicy } from '@contractspec/lib.contracts-spec';
4691
+ signature: "base64-encoded-signature"`})})]}),H("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Safety guarantees"}),P("p",{className:"text-muted-foreground",children:"Overlays are powerful, but they must not compromise security or data integrity. ContractSpec enforces several guarantees:"}),H("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[H("li",{children:[P("strong",{children:"Overlays cannot grant new permissions"})," \u2013 They can only hide or rearrange what the user is already allowed to see"]}),H("li",{children:[P("strong",{children:"Overlays cannot bypass validation"})," \u2013 Field types, constraints, and business rules from the underlying spec still apply"]}),H("li",{children:[P("strong",{children:"Overlays must be signed"})," \u2013 Only authorized parties (typically tenant admins) can create overlays"]}),H("li",{children:[P("strong",{children:"Overlays are versioned"})," \u2013 Changes to overlays are tracked and can be rolled back"]}),H("li",{children:[P("strong",{children:"Overlays are audited"})," \u2013 Every overlay application is logged"]})]})]}),H("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Creating overlays"}),P("p",{className:"text-muted-foreground",children:"Overlays can be created through:"}),H("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[H("li",{children:[P("strong",{children:"Visual editor"})," \u2013 A drag-and-drop interface for non-technical users"]}),H("li",{children:[P("strong",{children:"TypeScript/JSON"})," \u2013 For developers who prefer code"]}),H("li",{children:[P("strong",{children:"API"})," \u2013 Programmatically create overlays for automation"]})]}),P("p",{className:"text-muted-foreground",children:"Once created, overlays must be signed using a private key. The corresponding public key is registered with ContractSpec, which verifies the signature before applying the overlay."}),H("p",{className:"text-muted-foreground",children:["See"," ",P(Ei,{href:"/docs/libraries/overlay-engine",className:"text-violet-400 underline",children:"Overlay Engine docs"})," ","and the"," ",P(Ei,{href:"/docs/advanced/overlay-editor",className:"text-violet-400 underline",children:"Overlay Editor guide"})," ","for end-to-end workflows."]})]}),H("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Overlay scope"}),P("p",{className:"text-muted-foreground",children:"Overlays can be scoped to:"}),H("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[H("li",{children:[P("strong",{children:"Tenant"})," \u2013 All users in a tenant see the same overlay"]}),H("li",{children:[P("strong",{children:"User"})," \u2013 Individual users can have personal overlays"]}),H("li",{children:[P("strong",{children:"Role"})," \u2013 All users with a specific role see the overlay"]}),H("li",{children:[P("strong",{children:"Device"})," \u2013 Different overlays for mobile vs desktop"]})]}),P("p",{className:"text-muted-foreground",children:"If multiple overlays apply to the same user, they are merged in order of specificity (user overlays override role overlays, which override tenant overlays)."})]}),H("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Best practices"}),H("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[P("li",{children:"Start with the default UI and only create overlays when users request specific changes."}),P("li",{children:"Document why each overlay modification was made\u2014this helps when reviewing or updating overlays."}),P("li",{children:"Test overlays thoroughly to ensure they don't break workflows or confuse users."}),P("li",{children:"Use tenant-level overlays for organizational customizations and user-level overlays for personal preferences."}),P("li",{children:"Regularly review overlays to remove ones that are no longer needed."}),P("li",{children:"Protect overlay signing keys carefully\u2014they control what customizations are allowed."})]})]}),H("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Where overlays fit in the runtime"}),P("p",{className:"text-muted-foreground",children:"Overlays are safest when they sit on top of a declared bundle surface instead of ad hoc page code. Use the module-bundles docs first, then apply overlays as auditable customization on top of the resolved surface plan."}),H("div",{className:"flex flex-wrap gap-3",children:[P(Ei,{href:"/docs/specs/module-bundles",className:"btn-primary",children:"Module bundles"}),P(Ei,{href:"/docs/guides/first-module-bundle",className:"btn-ghost",children:"Build a first module bundle"})]})]}),H("div",{className:"flex items-center gap-4 pt-4",children:[P(Ei,{href:"/docs/specs/policy",className:"btn-ghost",children:"Previous: Policy"}),H(Ei,{href:"/docs/safety",className:"btn-primary",children:["Next: Safety ",P(tb,{size:16})]})]})]})}import zd from"@contractspec/lib.ui-link";import{ChevronRight as Gd}from"lucide-react";import{jsx as ke,jsxs as Et}from"react/jsx-runtime";var ob=[{title:"Capabilities",body:"Model operations, events, and presentations as explicit system behavior.",href:"/docs/specs/capabilities"},{title:"Data views",body:"Describe query, filtering, and presentation behavior from the same source model.",href:"/docs/specs/dataviews"},{title:"Workflows",body:"Coordinate multi-step execution, retries, monitoring, and hand-offs.",href:"/docs/specs/workflows"},{title:"Policy",body:"Carry governance and access rules through every generated and runtime-served surface.",href:"/docs/specs/policy"},{title:"Overlays",body:"Customize generated surfaces safely instead of forking them permanently.",href:"/docs/specs/overlays"},{title:"Safety and migration",body:"Keep change safe with signing, audits, rollbacks, and explicit migration behavior.",href:"/docs/safety"}],ib=[{title:"Module bundles",body:"Define typed surface bundles that resolve into auditable runtime plans instead of hand-built page logic.",href:"/docs/specs/module-bundles"},{title:"ContractSpec Connect",body:"Put coding-agent edits and commands behind local-first context, verification, replay, and review artifacts.",href:"/docs/specs/connect"},{title:"Builder control plane",body:"Coordinate multimodal authoring, provider routing, readiness, export, and mobile review on top of OSS and Studio.",href:"/docs/specs/builder-control-plane"}];function rb(){return Et("div",{className:"space-y-10",children:[Et("div",{className:"space-y-3",children:[ke("p",{className:"editorial-kicker",children:"Core model"}),ke("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Contracts are the durable system boundary."}),ke("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec uses explicit TypeScript specs to describe behavior before it spreads across APIs, UI, data models, events, and operator flows. The goal is not to hide implementation. The goal is to make the system boundary explicit enough that generation, validation, runtime enforcement, and regeneration can stay coherent."})]}),Et("div",{className:"editorial-proof-strip",children:[Et("div",{className:"editorial-stat",children:[ke("span",{className:"editorial-label",children:"System promise"}),ke("span",{className:"editorial-stat-value",children:"one contract \u2192 many surfaces"})]}),ke("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Use the contract layer to keep surface behavior aligned, then let runtimes and generators do the repetitive work without inventing a closed platform."})]}),ke("section",{className:"editorial-panel space-y-5",children:Et("div",{className:"space-y-2",children:[ke("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"What the contract layer owns"}),Et("ul",{className:"editorial-list",children:[Et("li",{children:[ke("span",{className:"editorial-list-marker"}),ke("span",{children:"Behavior: operations, events, presentations, workflows."})]}),Et("li",{children:[ke("span",{className:"editorial-list-marker"}),ke("span",{children:"Validation: input, output, and schema boundaries."})]}),Et("li",{children:[ke("span",{className:"editorial-list-marker"}),ke("span",{children:"Governance: policy, auditability, and migration rules."})]}),Et("li",{children:[ke("span",{className:"editorial-list-marker"}),ke("span",{children:"Surface alignment: generated or served behavior across API, UI, data, and agent-facing interfaces."})]})]})]})}),Et("section",{className:"space-y-5",children:[Et("div",{className:"space-y-2",children:[ke("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Specification types"}),ke("p",{className:"text-muted-foreground text-sm leading-7",children:"You can adopt the model one part at a time. Not every system needs every spec type on day one."})]}),ke("div",{className:"grid gap-4 md:grid-cols-2",children:ob.map((e)=>Et(zd,{href:e.href,className:"editorial-panel",children:[ke("h3",{className:"font-semibold text-xl",children:e.title}),ke("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body}),Et("div",{className:"mt-4 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Open section ",ke(Gd,{size:14})]})]},e.title))})]}),Et("section",{className:"space-y-5",children:[Et("div",{className:"space-y-2",children:[ke("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Implemented spec packs"}),ke("p",{className:"text-muted-foreground text-sm leading-7",children:"These packs combine multiple contract surfaces into higher-order systems you can use directly today: agent enforcement, AI-native surface runtime, and governed Builder authoring."})]}),ke("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-3",children:ib.map((e)=>Et(zd,{href:e.href,className:"editorial-panel",children:[ke("h3",{className:"font-semibold text-xl",children:e.title}),ke("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body}),Et("div",{className:"mt-4 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Open pack ",ke(Gd,{size:14})]})]},e.title))})]})]})}import Oi from"@contractspec/lib.ui-link";import{ChevronRight as nb}from"lucide-react";import{jsx as w,jsxs as X}from"react/jsx-runtime";function cb(){return X("div",{className:"space-y-8",children:[X("div",{className:"space-y-4",children:[w("h1",{className:"font-bold text-4xl",children:"Policy"}),X("p",{className:"text-muted-foreground",children:["A ",w("strong",{children:"PolicySpec"})," defines who can do what, when, and under what conditions. ContractSpec uses attribute-based access control (ABAC) to enforce policies across your entire application\u2014from API endpoints to UI components."]})]}),X("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Why policies matter"}),w("p",{className:"text-muted-foreground",children:"Traditional access control relies on roles (RBAC), which can become unwieldy as applications grow. ABAC is more flexible\u2014it evaluates policies based on attributes of the user, resource, action, and context."}),X("p",{className:"text-muted-foreground",children:["ContractSpec's policy engine ensures that access control is consistent across all surfaces. You don't have to remember to add authorization checks in every API endpoint or UI component\u2014the"," ",w(Oi,{href:"/docs/safety/pdp",className:"text-violet-400 hover:text-violet-300",children:"Policy Decision Point"})," ","enforces policies automatically."]})]}),X("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Policy structure"}),w("p",{className:"text-muted-foreground",children:"A PolicySpec contains one or more rules. Each rule has:"}),X("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[X("li",{children:[w("strong",{children:"Effect"})," \u2013 PERMIT, DENY, or REDACT"]}),X("li",{children:[w("strong",{children:"Condition"})," \u2013 A boolean expression that determines when the rule applies"]}),X("li",{children:[w("strong",{children:"Scope"})," \u2013 Which resources, actions, or fields the rule applies to"]}),X("li",{children:[w("strong",{children:"Priority"})," \u2013 Rules are evaluated in priority order; the first matching rule wins"]})]})]}),X("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Example PolicySpec"}),w("p",{className:"text-muted-foreground",children:"Here's a policy that controls access to customer data in TypeScript:"}),w("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:w("pre",{children:`import { definePolicy } from '@contractspec/lib.contracts-spec';
4692
4692
 
4693
4693
  export const CustomerDataAccess = definePolicy({
4694
4694
  meta: {
@@ -4795,9 +4795,9 @@ export const PaymentFlow = defineWorkflow({
4795
4795
  maxDuration: 30000, // milliseconds
4796
4796
  alertOnBreach: true,
4797
4797
  },
4798
- });`})})]}),he("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Triggers"}),M("p",{className:"text-muted-foreground",children:"Workflows can be triggered in several ways:"}),he("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[he("li",{children:[M("strong",{children:"Manual invocation"})," \u2013 A user or system calls the workflow via an API endpoint."]}),he("li",{children:[M("strong",{children:"Event-driven"})," \u2013 The workflow starts automatically when a specific event occurs (e.g., a new order is created)."]}),he("li",{children:[M("strong",{children:"Scheduled"})," \u2013 The workflow runs on a cron schedule (e.g., nightly batch processing)."]}),he("li",{children:[M("strong",{children:"Chained"})," \u2013 One workflow can invoke another as a step."]})]})]}),he("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Monitoring and versioning"}),M("p",{className:"text-muted-foreground",children:"ContractSpec automatically instruments workflows with telemetry. You can view:"}),he("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[M("li",{children:"Real-time execution status for each step"}),M("li",{children:"Historical run data and success/failure rates"}),M("li",{children:"Latency distributions and SLA compliance"}),M("li",{children:"Compensation events and retry attempts"})]}),M("p",{className:"text-muted-foreground",children:"When you update a workflow, you increment its version. Running workflows continue on their original version, while new invocations use the latest version. This allows safe, zero-downtime deployments."})]}),he("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Best practices"}),he("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[M("li",{children:"Keep steps idempotent \u2013 they should be safe to retry without side effects."}),M("li",{children:"Define compensation for any step that modifies external state."}),M("li",{children:"Use meaningful step IDs that describe the operation."}),M("li",{children:"Set realistic SLAs and monitor them in production."}),M("li",{children:"Test failure scenarios locally before deploying."})]})]}),he("div",{className:"flex items-center gap-4 pt-4",children:[M(Tn,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),he(Tn,{href:"/docs/safety",className:"btn-primary",children:["Next: Safety Features ",M(lb,{size:16})]})]})]})}import sb from"@contractspec/lib.ui-link";import{jsx as An,jsxs as mb}from"react/jsx-runtime";function pb(){return mb("main",{className:"space-y-6 py-12",children:[An("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),An("p",{className:"text-muted-foreground text-sm",children:"Security and BYOK guidance now lives in the Studio app docs."}),An(sb,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import ub from"@contractspec/lib.ui-link";import{jsx as Rn,jsxs as fb}from"react/jsx-runtime";function gb(){return fb("main",{className:"space-y-6 py-12",children:[Rn("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),Rn("p",{className:"text-muted-foreground text-sm",children:"Deployment guidance now lives in the Studio app docs."}),Rn(ub,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import hb from"@contractspec/lib.ui-link";import{jsx as Ln,jsxs as bb}from"react/jsx-runtime";function yb(){return bb("main",{className:"space-y-6 py-12",children:[Ln("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),Ln("p",{className:"text-muted-foreground text-sm",children:"The latest getting-started guide now lives in the Studio app docs."}),Ln(hb,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import vb from"@contractspec/lib.ui-link";import{jsx as En,jsxs as wb}from"react/jsx-runtime";function Nb(){return wb("main",{className:"space-y-6 py-12",children:[En("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),En("p",{className:"text-muted-foreground text-sm",children:"Integration guides now live in the Studio app docs."}),En(vb,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import Lr from"@contractspec/lib.ui-link";import{jsx as Le,jsxs as ea}from"react/jsx-runtime";var kb=["decision workflows that turn product evidence into proposed spec changes","governed execution loops and task packs on top of the OSS contract layer","operator surfaces for teams that need a managed workflow instead of raw building blocks","deeper product-facing workflows that sit above the open system without replacing it"];function Sb(){return ea("main",{className:"space-y-10",children:[ea("section",{className:"space-y-3",children:[Le("p",{className:"editorial-kicker",children:"Studio bridge"}),Le("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Studio is the operating layer built on top of OSS ContractSpec."}),Le("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"Start with the open system first: contracts, generated surfaces, runtimes, integrations, and safe regeneration. Move to Studio when a team wants the product-facing workflow, decision loop, and managed operator surface on top of that foundation."})]}),ea("section",{className:"editorial-proof-strip",children:[ea("div",{className:"editorial-stat",children:[Le("span",{className:"editorial-label",children:"What stays open"}),Le("span",{className:"editorial-stat-value",children:"contracts, code, generated surfaces"})]}),Le("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Studio is additive. It does not replace the OSS source of truth or ask teams to abandon their contract layer."})]}),ea("section",{className:"grid gap-4 md:grid-cols-2",children:[ea("article",{className:"editorial-panel space-y-4",children:[Le("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Start with OSS when you need:"}),ea("ul",{className:"editorial-list",children:[ea("li",{children:[Le("span",{className:"editorial-list-marker"}),Le("span",{children:"explicit contracts and generated surfaces you still own"})]}),ea("li",{children:[Le("span",{className:"editorial-list-marker"}),Le("span",{children:"incremental adoption inside an existing codebase"})]}),ea("li",{children:[Le("span",{className:"editorial-list-marker"}),Le("span",{children:"runtime governance, integrations, and safe regeneration without a managed operating product"})]})]})]}),ea("article",{className:"editorial-panel space-y-4",children:[Le("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Adopt Studio when you need:"}),Le("ul",{className:"editorial-list",children:kb.map((e)=>ea("li",{children:[Le("span",{className:"editorial-list-marker"}),Le("span",{children:e})]},e))})]})]}),ea("section",{className:"editorial-panel space-y-4",children:[Le("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Builder is the governed authoring layer"}),Le("p",{className:"text-muted-foreground text-sm leading-7",children:"If your team wants a concrete authoring control plane on top of the OSS foundation, start with the Builder control-plane docs and the workbench host guide before you dive into the larger Studio product surface."}),ea("div",{className:"flex flex-wrap gap-3",children:[Le(Lr,{href:"/docs/specs/builder-control-plane",className:"btn-primary",children:"Builder control plane"}),Le(Lr,{href:"/docs/guides/host-builder-workbench",className:"btn-ghost",children:"Host the Builder workbench"})]})]}),ea("section",{className:"editorial-panel space-y-4",children:[Le("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Go to the Studio product docs for the full product surface"}),Le("p",{className:"text-muted-foreground text-sm leading-7",children:"The OSS site keeps this section intentionally short. Deep Studio product guidance belongs in the Studio app docs."}),ea("div",{className:"flex flex-wrap gap-3",children:[Le(Lr,{href:"https://www.contractspec.studio",className:"btn-primary",children:"Open Studio"}),Le(Lr,{href:"https://www.contractspec.studio/docs",className:"btn-ghost",children:"Read Studio docs"})]})]})]})}import Cb from"@contractspec/lib.ui-link";import{jsx as Dn,jsxs as Pb}from"react/jsx-runtime";function Ib(){return Pb("main",{className:"space-y-6 py-12",children:[Dn("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),Dn("p",{className:"text-muted-foreground text-sm",children:"Visual builder documentation now lives in the Studio app docs."}),Dn(Cb,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import{Button as On}from"@contractspec/lib.design-system";import{PlugZap as Tb,ToggleRight as Ab}from"lucide-react";import{jsx as hi,jsxs as Go}from"react/jsx-runtime";function Hd({id:e,provider:t,name:a,category:r,enabled:l=!0,lastSyncAt:b,status:h="connected",onToggle:v,onConfigure:V}){return Go("div",{className:"flex flex-col gap-4 rounded-2xl border border-border bg-card p-4 shadow-sm",children:[Go("header",{className:"flex items-center justify-between",children:[Go("div",{children:[hi("p",{className:"font-semibold text-xl",children:a}),hi("p",{className:"text-muted-foreground text-sm",children:t})]}),Go(On,{variant:"outline",size:"sm",className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 font-semibold text-xs uppercase tracking-wide ${h==="connected"?"text-emerald-500 bg-emerald-500/10 border-emerald-500/30":h==="error"?"text-red-500 bg-red-500/10 border-red-500/30":"text-gray-500 bg-gray-500/10 border-gray-500/30"}`,onPress:()=>v?.(e,!l),children:[hi(Ab,{className:"h-3.5 w-3.5"}),l?"Enabled":"Disabled"]})]}),Go("div",{className:"text-muted-foreground text-sm",children:[r&&hi("span",{className:"font-medium",children:r}),Go("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-xs uppercase tracking-wide",children:[Go("span",{className:"inline-flex items-center gap-1",children:[hi(Tb,{className:"h-3 w-3"}),h]}),Go("span",{children:["Last sync:"," ",b?new Date(b).toLocaleString():"Not synced yet"]})]})]}),Go("footer",{className:"flex items-center gap-2",children:[hi(On,{className:"flex-1",onPress:()=>V?.(e),children:"Configure"}),hi(On,{variant:"ghost",className:"flex-1",onPress:()=>v?.(e,!l),children:l?"Disconnect":"Connect"})]})]})}import{Input as Rb}from"@contractspec/lib.design-system";import{Select as Lb,SelectContent as Eb,SelectItem as qd,SelectTrigger as Db,SelectValue as Ob}from"@contractspec/lib.ui-kit-web/ui/select";import{Boxes as Bb,Search as Mb}from"lucide-react";import*as tr from"react";import{jsx as Xa,jsxs as yi}from"react/jsx-runtime";function GL({integrations:e,onToggle:t,onConfigure:a}){let[r,l]=tr.useState(""),[b,h]=tr.useState("all"),v=tr.useMemo(()=>Array.from(new Set(e.map((g)=>g.category))),[e]),V=e.filter((g)=>{let tt=g.name.toLowerCase().includes(r.toLowerCase())||g.provider.toLowerCase().includes(r.toLowerCase()),va=b==="all"?!0:g.category===b;return tt&&va});return yi("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-4",children:[yi("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[yi("div",{children:[Xa("p",{className:"font-semibold text-sm uppercase tracking-wide",children:"Integration marketplace"}),Xa("p",{className:"text-muted-foreground text-sm",children:"Connect AI providers, payments, analytics, and internal tools with BYOK controls."})]}),Xa(Bb,{className:"h-5 w-5 text-muted-foreground"})]}),yi("div",{className:"flex flex-wrap gap-3",children:[yi("div",{className:"relative min-w-[200px] flex-1",children:[Xa(Mb,{className:"pointer-events-none absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),Xa(Rb,{type:"search","aria-label":"Search providers",className:"w-full py-2 pr-3 pl-9 text-sm",value:r,onChange:(g)=>l(g.target.value),placeholder:"Search providers"})]}),yi(Lb,{value:b,onValueChange:h,children:[Xa(Db,{className:"w-[200px]",children:Xa(Ob,{placeholder:"All categories"})}),yi(Eb,{children:[Xa(qd,{value:"all",children:"All categories"}),v.map((g)=>Xa(qd,{value:g,children:g},g))]})]})]}),Xa("div",{className:"grid gap-4 md:grid-cols-2",children:V.length?V.map((g)=>Xa(Hd,{id:g.id,provider:g.provider,name:g.name,category:g.category,enabled:g.enabled,status:g.status,lastSyncAt:g.lastSyncAt,onToggle:t,onConfigure:a},g.id)):Xa("div",{className:"rounded-xl border border-border border-dashed p-6 text-center text-muted-foreground text-sm md:col-span-2",children:"No integrations match your filters."})})]})}import{Button as Vd,Input as Bn,Textarea as Ub}from"@contractspec/lib.design-system";import{Checkbox as Wb}from"@contractspec/lib.ui-kit-web/ui/checkbox";import{Label as Bi}from"@contractspec/lib.ui-kit-web/ui/label";import{Select as Fd,SelectContent as Kd,SelectItem as Er,SelectTrigger as Qd,SelectValue as Yd}from"@contractspec/lib.ui-kit-web/ui/select";import{Key as _b,ShieldCheck as zb,TestTube2 as Gb}from"lucide-react";import*as Jd from"react";import{jsx as Se,jsxs as et}from"react/jsx-runtime";function JL({provider:e,initialValues:t,onTestConnection:a,onSave:r,isSaving:l,isTesting:b}){let[h,v]=Jd.useState({apiKey:t?.apiKey??"",secret:t?.secret??"",ownershipMode:t?.ownershipMode??"managed",secretProvider:t?.secretProvider??"env",secretRef:t?.secretRef??"",config:t?.config??`{
4798
+ });`})})]}),he("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Triggers"}),M("p",{className:"text-muted-foreground",children:"Workflows can be triggered in several ways:"}),he("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[he("li",{children:[M("strong",{children:"Manual invocation"})," \u2013 A user or system calls the workflow via an API endpoint."]}),he("li",{children:[M("strong",{children:"Event-driven"})," \u2013 The workflow starts automatically when a specific event occurs (e.g., a new order is created)."]}),he("li",{children:[M("strong",{children:"Scheduled"})," \u2013 The workflow runs on a cron schedule (e.g., nightly batch processing)."]}),he("li",{children:[M("strong",{children:"Chained"})," \u2013 One workflow can invoke another as a step."]})]})]}),he("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Monitoring and versioning"}),M("p",{className:"text-muted-foreground",children:"ContractSpec automatically instruments workflows with telemetry. You can view:"}),he("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[M("li",{children:"Real-time execution status for each step"}),M("li",{children:"Historical run data and success/failure rates"}),M("li",{children:"Latency distributions and SLA compliance"}),M("li",{children:"Compensation events and retry attempts"})]}),M("p",{className:"text-muted-foreground",children:"When you update a workflow, you increment its version. Running workflows continue on their original version, while new invocations use the latest version. This allows safe, zero-downtime deployments."})]}),he("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Best practices"}),he("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[M("li",{children:"Keep steps idempotent \u2013 they should be safe to retry without side effects."}),M("li",{children:"Define compensation for any step that modifies external state."}),M("li",{children:"Use meaningful step IDs that describe the operation."}),M("li",{children:"Set realistic SLAs and monitor them in production."}),M("li",{children:"Test failure scenarios locally before deploying."})]})]}),he("div",{className:"flex items-center gap-4 pt-4",children:[M(Tn,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),he(Tn,{href:"/docs/safety",className:"btn-primary",children:["Next: Safety Features ",M(lb,{size:16})]})]})]})}import sb from"@contractspec/lib.ui-link";import{jsx as An,jsxs as mb}from"react/jsx-runtime";function pb(){return mb("main",{className:"space-y-6 py-12",children:[An("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),An("p",{className:"text-muted-foreground text-sm",children:"Security and BYOK guidance now lives in the Studio app docs."}),An(sb,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import ub from"@contractspec/lib.ui-link";import{jsx as Rn,jsxs as fb}from"react/jsx-runtime";function gb(){return fb("main",{className:"space-y-6 py-12",children:[Rn("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),Rn("p",{className:"text-muted-foreground text-sm",children:"Deployment guidance now lives in the Studio app docs."}),Rn(ub,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import hb from"@contractspec/lib.ui-link";import{jsx as Ln,jsxs as bb}from"react/jsx-runtime";function yb(){return bb("main",{className:"space-y-6 py-12",children:[Ln("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),Ln("p",{className:"text-muted-foreground text-sm",children:"The latest getting-started guide now lives in the Studio app docs."}),Ln(hb,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import vb from"@contractspec/lib.ui-link";import{jsx as Dn,jsxs as wb}from"react/jsx-runtime";function Nb(){return wb("main",{className:"space-y-6 py-12",children:[Dn("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),Dn("p",{className:"text-muted-foreground text-sm",children:"Integration guides now live in the Studio app docs."}),Dn(vb,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import Lr from"@contractspec/lib.ui-link";import{jsx as Le,jsxs as ea}from"react/jsx-runtime";var kb=["decision workflows that turn product evidence into proposed spec changes","governed execution loops and task packs on top of the OSS contract layer","operator surfaces for teams that need a managed workflow instead of raw building blocks","deeper product-facing workflows that sit above the open system without replacing it"];function Sb(){return ea("main",{className:"space-y-10",children:[ea("section",{className:"space-y-3",children:[Le("p",{className:"editorial-kicker",children:"Studio bridge"}),Le("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Studio is the operating layer built on top of OSS ContractSpec."}),Le("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"Start with the open system first: contracts, generated surfaces, runtimes, integrations, and safe regeneration. Move to Studio when a team wants the product-facing workflow, decision loop, and managed operator surface on top of that foundation."})]}),ea("section",{className:"editorial-proof-strip",children:[ea("div",{className:"editorial-stat",children:[Le("span",{className:"editorial-label",children:"What stays open"}),Le("span",{className:"editorial-stat-value",children:"contracts, code, generated surfaces"})]}),Le("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Studio is additive. It does not replace the OSS source of truth or ask teams to abandon their contract layer."})]}),ea("section",{className:"grid gap-4 md:grid-cols-2",children:[ea("article",{className:"editorial-panel space-y-4",children:[Le("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Start with OSS when you need:"}),ea("ul",{className:"editorial-list",children:[ea("li",{children:[Le("span",{className:"editorial-list-marker"}),Le("span",{children:"explicit contracts and generated surfaces you still own"})]}),ea("li",{children:[Le("span",{className:"editorial-list-marker"}),Le("span",{children:"incremental adoption inside an existing codebase"})]}),ea("li",{children:[Le("span",{className:"editorial-list-marker"}),Le("span",{children:"runtime governance, integrations, and safe regeneration without a managed operating product"})]})]})]}),ea("article",{className:"editorial-panel space-y-4",children:[Le("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Adopt Studio when you need:"}),Le("ul",{className:"editorial-list",children:kb.map((e)=>ea("li",{children:[Le("span",{className:"editorial-list-marker"}),Le("span",{children:e})]},e))})]})]}),ea("section",{className:"editorial-panel space-y-4",children:[Le("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Builder is the governed authoring layer"}),Le("p",{className:"text-muted-foreground text-sm leading-7",children:"If your team wants a concrete authoring control plane on top of the OSS foundation, start with the Builder control-plane docs and the workbench host guide before you dive into the larger Studio product surface."}),ea("div",{className:"flex flex-wrap gap-3",children:[Le(Lr,{href:"/docs/specs/builder-control-plane",className:"btn-primary",children:"Builder control plane"}),Le(Lr,{href:"/docs/guides/host-builder-workbench",className:"btn-ghost",children:"Host the Builder workbench"})]})]}),ea("section",{className:"editorial-panel space-y-4",children:[Le("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"Go to the Studio product docs for the full product surface"}),Le("p",{className:"text-muted-foreground text-sm leading-7",children:"The OSS site keeps this section intentionally short. Deep Studio product guidance belongs in the Studio app docs."}),ea("div",{className:"flex flex-wrap gap-3",children:[Le(Lr,{href:"https://www.contractspec.studio",className:"btn-primary",children:"Open Studio"}),Le(Lr,{href:"https://www.contractspec.studio/docs",className:"btn-ghost",children:"Read Studio docs"})]})]})]})}import Cb from"@contractspec/lib.ui-link";import{jsx as En,jsxs as Pb}from"react/jsx-runtime";function Ib(){return Pb("main",{className:"space-y-6 py-12",children:[En("h1",{className:"font-bold text-3xl",children:"Studio docs moved"}),En("p",{className:"text-muted-foreground text-sm",children:"Visual builder documentation now lives in the Studio app docs."}),En(Cb,{href:"https://www.contractspec.studio/docs",className:"btn-primary",children:"Open Studio docs"})]})}import{Button as On}from"@contractspec/lib.design-system";import{PlugZap as Tb,ToggleRight as Ab}from"lucide-react";import{jsx as hi,jsxs as Go}from"react/jsx-runtime";function qd({id:e,provider:t,name:a,category:r,enabled:l=!0,lastSyncAt:b,status:h="connected",onToggle:v,onConfigure:V}){return Go("div",{className:"flex flex-col gap-4 rounded-2xl border border-border bg-card p-4 shadow-sm",children:[Go("header",{className:"flex items-center justify-between",children:[Go("div",{children:[hi("p",{className:"font-semibold text-xl",children:a}),hi("p",{className:"text-muted-foreground text-sm",children:t})]}),Go(On,{variant:"outline",size:"sm",className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 font-semibold text-xs uppercase tracking-wide ${h==="connected"?"text-emerald-500 bg-emerald-500/10 border-emerald-500/30":h==="error"?"text-red-500 bg-red-500/10 border-red-500/30":"text-gray-500 bg-gray-500/10 border-gray-500/30"}`,onPress:()=>v?.(e,!l),children:[hi(Ab,{className:"h-3.5 w-3.5"}),l?"Enabled":"Disabled"]})]}),Go("div",{className:"text-muted-foreground text-sm",children:[r&&hi("span",{className:"font-medium",children:r}),Go("div",{className:"mt-2 flex flex-wrap items-center gap-3 text-xs uppercase tracking-wide",children:[Go("span",{className:"inline-flex items-center gap-1",children:[hi(Tb,{className:"h-3 w-3"}),h]}),Go("span",{children:["Last sync:"," ",b?new Date(b).toLocaleString():"Not synced yet"]})]})]}),Go("footer",{className:"flex items-center gap-2",children:[hi(On,{className:"flex-1",onPress:()=>V?.(e),children:"Configure"}),hi(On,{variant:"ghost",className:"flex-1",onPress:()=>v?.(e,!l),children:l?"Disconnect":"Connect"})]})]})}import{Input as Rb}from"@contractspec/lib.design-system";import{Select as Lb,SelectContent as Db,SelectItem as Hd,SelectTrigger as Eb,SelectValue as Ob}from"@contractspec/lib.ui-kit-web/ui/select";import{Boxes as Bb,Search as Mb}from"lucide-react";import*as tr from"react";import{jsx as Xa,jsxs as yi}from"react/jsx-runtime";function GL({integrations:e,onToggle:t,onConfigure:a}){let[r,l]=tr.useState(""),[b,h]=tr.useState("all"),v=tr.useMemo(()=>Array.from(new Set(e.map((g)=>g.category))),[e]),V=e.filter((g)=>{let tt=g.name.toLowerCase().includes(r.toLowerCase())||g.provider.toLowerCase().includes(r.toLowerCase()),va=b==="all"?!0:g.category===b;return tt&&va});return yi("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-4",children:[yi("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[yi("div",{children:[Xa("p",{className:"font-semibold text-sm uppercase tracking-wide",children:"Integration marketplace"}),Xa("p",{className:"text-muted-foreground text-sm",children:"Connect AI providers, payments, analytics, and internal tools with BYOK controls."})]}),Xa(Bb,{className:"h-5 w-5 text-muted-foreground"})]}),yi("div",{className:"flex flex-wrap gap-3",children:[yi("div",{className:"relative min-w-[200px] flex-1",children:[Xa(Mb,{className:"pointer-events-none absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),Xa(Rb,{type:"search","aria-label":"Search providers",className:"w-full py-2 pr-3 pl-9 text-sm",value:r,onChange:(g)=>l(g.target.value),placeholder:"Search providers"})]}),yi(Lb,{value:b,onValueChange:h,children:[Xa(Eb,{className:"w-[200px]",children:Xa(Ob,{placeholder:"All categories"})}),yi(Db,{children:[Xa(Hd,{value:"all",children:"All categories"}),v.map((g)=>Xa(Hd,{value:g,children:g},g))]})]})]}),Xa("div",{className:"grid gap-4 md:grid-cols-2",children:V.length?V.map((g)=>Xa(qd,{id:g.id,provider:g.provider,name:g.name,category:g.category,enabled:g.enabled,status:g.status,lastSyncAt:g.lastSyncAt,onToggle:t,onConfigure:a},g.id)):Xa("div",{className:"rounded-xl border border-border border-dashed p-6 text-center text-muted-foreground text-sm md:col-span-2",children:"No integrations match your filters."})})]})}import{Button as Vd,Input as Bn,Textarea as Ub}from"@contractspec/lib.design-system";import{Checkbox as Wb}from"@contractspec/lib.ui-kit-web/ui/checkbox";import{Label as Bi}from"@contractspec/lib.ui-kit-web/ui/label";import{Select as Fd,SelectContent as Kd,SelectItem as Dr,SelectTrigger as Qd,SelectValue as Yd}from"@contractspec/lib.ui-kit-web/ui/select";import{Key as _b,ShieldCheck as zb,TestTube2 as Gb}from"lucide-react";import*as Jd from"react";import{jsx as Se,jsxs as et}from"react/jsx-runtime";function JL({provider:e,initialValues:t,onTestConnection:a,onSave:r,isSaving:l,isTesting:b}){let[h,v]=Jd.useState({apiKey:t?.apiKey??"",secret:t?.secret??"",ownershipMode:t?.ownershipMode??"managed",secretProvider:t?.secretProvider??"env",secretRef:t?.secretRef??"",config:t?.config??`{
4799
4799
  "region": "eu-west-1"
4800
- }`}),V=(g)=>{let tt=g.target,{name:va,value:ye}=tt;v((Ke)=>({...Ke,[va]:ye}))};return et("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-4",children:[et("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[et("div",{children:[et("p",{className:"font-semibold text-sm uppercase tracking-wide",children:[e," credentials"]}),Se("p",{className:"text-muted-foreground text-sm",children:"Store encrypted keys with BYOK and run safe connection tests."})]}),Se(zb,{className:"h-5 w-5 text-muted-foreground"})]}),Se("div",{className:"grid gap-4 md:grid-cols-2",children:et("div",{className:"space-y-2",children:[Se(Bi,{htmlFor:"ownershipMode",children:"Ownership"}),et(Fd,{value:h.ownershipMode??"managed",onValueChange:(g)=>v((tt)=>({...tt,ownershipMode:g})),children:[Se(Qd,{id:"ownershipMode",className:"w-full",children:Se(Yd,{})}),et(Kd,{children:[Se(Er,{value:"managed",children:"Managed (store encrypted)"}),Se(Er,{value:"byok",children:"BYOK (store secret reference)"})]})]})]})}),et("div",{className:"grid gap-4 md:grid-cols-2",children:[et("div",{className:"space-y-1 text-sm",children:[Se(Bi,{htmlFor:"apiKey",className:"font-semibold",children:"API key"}),et("div",{className:"relative",children:[Se(_b,{className:"pointer-events-none absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),Se(Bn,{type:"text",name:"apiKey",id:"apiKey",className:"w-full py-2 pr-3 pl-9",value:h.apiKey,onChange:V,required:!0})]})]}),et("div",{className:"space-y-1 text-sm",children:[Se(Bi,{htmlFor:"secret",className:"font-semibold",children:"Secret"}),Se(Bn,{type:"password",id:"secret",name:"secret",className:"w-full px-3 py-2",value:h.secret,onChange:V})]})]}),h.ownershipMode==="byok"?et("div",{className:"space-y-4 rounded-xl border border-blue-500/20 bg-blue-500/5 p-4",children:[Se("p",{className:"font-semibold text-sm",children:"BYOK secret reference"}),et("div",{className:"grid gap-4 md:grid-cols-2",children:[et("div",{className:"space-y-2",children:[Se(Bi,{htmlFor:"secretProvider",children:"Secret provider"}),et(Fd,{value:h.secretProvider??"env",onValueChange:(g)=>v((tt)=>({...tt,secretProvider:g})),children:[Se(Qd,{id:"secretProvider",className:"w-full",children:Se(Yd,{})}),et(Kd,{children:[Se(Er,{value:"env",children:"Environment"}),Se(Er,{value:"gcp",children:"GCP Secret Manager"})]})]})]}),et("div",{className:"space-y-2",children:[Se(Bi,{htmlFor:"secretRef",children:"Secret reference"}),Se(Bn,{id:"secretRef",name:"secretRef",placeholder:h.secretProvider==="gcp"?"gcp://projects/.../secrets/...":"env://MY_TOKEN_ENV_VAR",value:h.secretRef??"",onChange:V})]})]})]}):et("div",{className:"flex items-center gap-3 rounded-xl border border-emerald-500/20 bg-emerald-500/5 p-4 text-sm",children:[Se(Wb,{checked:!0,onCheckedChange:()=>{},"aria-label":"Managed"}),et("div",{children:[Se("p",{className:"font-semibold",children:"Managed encryption enabled"}),Se("p",{className:"text-muted-foreground",children:"Secrets are encrypted server-side for this tenant."})]})]}),et("div",{className:"space-y-1 text-sm",children:[Se(Bi,{htmlFor:"config",className:"font-semibold",children:"Configuration (JSON)"}),Se(Ub,{id:"config",name:"config",className:"min-h-[140px] w-full font-mono text-sm",value:h.config,onChange:V})]}),et("div",{className:"flex flex-wrap items-center gap-3",children:[et(Vd,{variant:"ghost",onPress:()=>a?.(h),disabled:b,children:[Se(Gb,{className:"h-4 w-4"}),"Test connection"]}),Se(Vd,{variant:"default",onPress:()=>r?.(h),disabled:l,children:"Save settings"})]})]})}import{BookCopy as Hb,Plus as qb,RefreshCcw as Vb}from"lucide-react";import{jsx as so,jsxs as Ho}from"react/jsx-runtime";function xL({sources:e,onRefresh:t,onDelete:a,onAdd:r}){return Ho("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-4",children:[Ho("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[Ho("div",{children:[so("p",{className:"font-semibold text-sm uppercase tracking-wide",children:"Knowledge sources"}),so("p",{className:"text-muted-foreground text-sm",children:"Manage documentation, specs, and repos powering Studio RAG flows."})]}),Ho("button",{type:"button",className:"btn-primary inline-flex items-center gap-2",onClick:r,children:[so(qb,{className:"h-4 w-4"}),"Add source"]})]}),so("div",{className:"space-y-3",children:e.length?e.map((l)=>Ho("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-background p-4",children:[Ho("div",{className:"flex items-center gap-3",children:[so(Hb,{className:"h-8 w-8 text-muted-foreground"}),Ho("div",{children:[so("p",{className:"font-semibold text-base",children:l.name}),so("p",{className:"text-muted-foreground text-sm",children:l.type}),so("p",{className:"text-muted-foreground text-xs",children:l.indexed?`Indexed ${l.lastIndexed?new Date(l.lastIndexed).toLocaleString():""}`:"Pending indexing"})]})]}),Ho("div",{className:"flex items-center gap-2",children:[Ho("button",{type:"button",className:"btn-ghost inline-flex items-center gap-1 text-sm",onClick:()=>t?.(l.id),children:[so(Vb,{className:"h-3.5 w-3.5"}),"Reindex"]}),so("button",{type:"button",className:"btn-ghost text-destructive text-sm",onClick:()=>a?.(l.id),children:"Remove"})]})]},l.id)):so("div",{className:"rounded-xl border border-border border-dashed p-6 text-center text-muted-foreground text-sm",children:"No knowledge sources added yet."})})]})}import{jsx as o,jsxs as d}from"react/jsx-runtime";var nE={title:"Privacy Policy | ContractSpec",description:"Learn how ContractSpec collects, uses, and protects your personal data in compliance with GDPR."};function Fb(){return o("main",{className:"flex grow flex-col items-center justify-center pt-24",children:o("section",{className:"section-padding",children:d("div",{className:"prose prose-invert mx-auto max-w-3xl",children:[o("h1",{className:"mb-4 font-bold text-4xl",children:"Privacy Policy"}),o("p",{className:"mb-8 text-muted-foreground",children:"Last updated: December 18, 2025"}),d("section",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"1. Who We Are"}),d("p",{className:"text-muted-foreground",children:[o("strong",{className:"text-foreground",children:"ContractSpec"})," is a brand of"," ",o("strong",{className:"text-foreground",children:"CHAMAN VENTURES"}),", a simplified joint-stock company (SASU) registered in France."]}),d("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:[o("p",{className:"mb-2",children:o("strong",{className:"text-foreground",children:"Data Controller:"})}),d("ul",{className:"list-none space-y-1 pl-0",children:[o("li",{children:"CHAMAN VENTURES, SASU"}),o("li",{children:"RCS Paris \u2022 SIREN 989 498 902"}),o("li",{children:"229 rue Saint-Honor\xE9, 75001 Paris, France"}),d("li",{children:["Contact:"," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"})]})]})]}),o("p",{className:"text-muted-foreground",children:"We are responsible for deciding how we hold and use personal data about you. We are required under data protection legislation to notify you of the information contained in this privacy policy."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"2. What This Policy Covers"}),o("p",{className:"text-muted-foreground",children:"This privacy policy explains:"}),d("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[o("li",{children:"What personal data we collect through the ContractSpec website and services"}),o("li",{children:"Why we collect and process your data"}),o("li",{children:"How we store and protect your data"}),o("li",{children:"Who we may share your data with"}),o("li",{children:"Your rights under the General Data Protection Regulation (GDPR)"})]}),o("p",{className:"text-muted-foreground",children:"This policy applies to visitors of our website, users who sign up for our waitlist or contact us, and customers who use our services."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"3. Data We Collect"}),o("p",{className:"text-muted-foreground",children:"We collect different types of data depending on how you interact with ContractSpec:"}),o("div",{className:"overflow-x-auto",children:d("table",{className:"w-full border-collapse text-muted-foreground text-sm",children:[o("thead",{children:d("tr",{className:"border-white/20 border-b",children:[o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Category"}),o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Data Collected"}),o("th",{className:"py-3 text-left font-semibold text-foreground",children:"When Collected"})]})}),d("tbody",{children:[d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Website Analytics"}),o("td",{className:"py-3 pr-4",children:"Page views, click events, device type, browser, approximate location (country level), session duration, referral source"}),o("td",{className:"py-3",children:"When browsing our website (with consent in EU/EEA)"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Contact / Waitlist"}),o("td",{className:"py-3 pr-4",children:"Name, email address, message content"}),o("td",{className:"py-3",children:"When you submit a form or join our waitlist"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Account Data"}),d("td",{className:"py-3 pr-4",children:[o("em",{children:"Not yet applicable"})," \u2014 We do not currently offer user accounts. This section will be updated when accounts are introduced."]}),o("td",{className:"py-3",children:"\u2014"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Billing Data"}),d("td",{className:"py-3 pr-4",children:[o("em",{children:"Not yet applicable"})," \u2014 We do not currently process payments. This section will be updated when billing is introduced."]}),o("td",{className:"py-3",children:"\u2014"})]})]})]})})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"4. Why We Process Data (Purposes & Legal Bases)"}),o("p",{className:"text-muted-foreground",children:"Under GDPR, we must have a lawful basis for processing your personal data. We rely on the following:"}),o("div",{className:"overflow-x-auto",children:d("table",{className:"w-full border-collapse text-muted-foreground text-sm",children:[o("thead",{children:d("tr",{className:"border-white/20 border-b",children:[o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Purpose"}),o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Legal Basis"}),o("th",{className:"py-3 text-left font-semibold text-foreground",children:"Details"})]})}),d("tbody",{children:[d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Website operation & security"}),o("td",{className:"py-3 pr-4",children:"Legitimate interest"}),o("td",{className:"py-3",children:"Ensuring our website functions correctly, preventing abuse, and maintaining security"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Analytics & improvement"}),o("td",{className:"py-3 pr-4",children:"Consent"}),o("td",{className:"py-3",children:"Understanding how users interact with our site to improve our services (gated behind consent in EU/EEA)"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Responding to enquiries"}),o("td",{className:"py-3 pr-4",children:"Legitimate interest / Contract"}),o("td",{className:"py-3",children:"Responding to your questions, processing waitlist requests, or pre-contractual discussions"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Service delivery"}),o("td",{className:"py-3 pr-4",children:"Contract"}),o("td",{className:"py-3",children:"If/when you become a customer, processing your data is necessary to fulfil our contractual obligations"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Legal compliance"}),o("td",{className:"py-3 pr-4",children:"Legal obligation"}),o("td",{className:"py-3",children:"Complying with applicable laws, regulations, or legal processes"})]})]})]})})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"5. Cookies & Tracking"}),d("p",{className:"text-muted-foreground",children:["We use ",o("strong",{className:"text-foreground",children:"PostHog"})," for product analytics to understand how visitors use our website. PostHog may use cookies or similar technologies to collect this information."]}),o("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"Consent in the EU/EEA"}),o("p",{className:"text-muted-foreground",children:"If you are located in the European Union or European Economic Area, we gate analytics tracking behind your explicit consent. Analytics cookies will not be set until you opt-in through our cookie consent mechanism."}),o("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"Withdrawing Consent / Opting Out"}),o("p",{className:"text-muted-foreground",children:"You can withdraw consent or opt out at any time:"}),d("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[d("li",{children:[o("strong",{children:"Cookie settings:"})," Use the cookie preferences link in our website footer to manage your consent"]}),d("li",{children:[o("strong",{children:"Browser settings:"})," Configure your browser to reject cookies or alert you when cookies are being set"]}),d("li",{children:[o("strong",{children:"PostHog opt-out:"}),' PostHog respects "Do Not Track" browser signals where applicable']})]}),o("p",{className:"text-muted-foreground",children:"Note: Rejecting analytics cookies will not affect your ability to use our website."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"6. Sub-processors & Recipients"}),o("p",{className:"text-muted-foreground",children:"We share data with the following third-party service providers who process data on our behalf:"}),o("div",{className:"overflow-x-auto",children:d("table",{className:"w-full border-collapse text-muted-foreground text-sm",children:[o("thead",{children:d("tr",{className:"border-white/20 border-b",children:[o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Provider"}),o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Purpose"}),o("th",{className:"py-3 text-left font-semibold text-foreground",children:"Location"})]})}),d("tbody",{children:[d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"PostHog"}),o("td",{className:"py-3 pr-4",children:"Product analytics"}),o("td",{className:"py-3",children:"EU (PostHog Cloud EU) or US"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Vercel"}),o("td",{className:"py-3 pr-4",children:"Website hosting & CDN"}),o("td",{className:"py-3",children:"Global (including EU regions)"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Scaleway"}),o("td",{className:"py-3 pr-4",children:"Cloud infrastructure"}),o("td",{className:"py-3",children:"France / EU"})]}),d("tr",{className:"border-white/10 border-b",children:[d("td",{className:"py-3 pr-4 font-medium",children:["Email provider ",o("em",{children:"(TBD)"})]}),o("td",{className:"py-3 pr-4",children:"Transactional & marketing emails"}),o("td",{className:"py-3",children:o("em",{children:"To be confirmed"})})]}),d("tr",{className:"border-white/10 border-b",children:[d("td",{className:"py-3 pr-4 font-medium",children:["Error tracking ",o("em",{children:"(TBD)"})]}),o("td",{className:"py-3 pr-4",children:"Application error monitoring"}),o("td",{className:"py-3",children:o("em",{children:"To be confirmed"})})]}),d("tr",{className:"border-white/10 border-b",children:[d("td",{className:"py-3 pr-4 font-medium",children:["Payment processor ",o("em",{children:"(TBD)"})]}),o("td",{className:"py-3 pr-4",children:"Billing & subscription management"}),o("td",{className:"py-3",children:o("em",{children:"To be confirmed"})})]})]})]})}),o("p",{className:"mt-4 text-muted-foreground",children:"We carefully select our sub-processors and require them to maintain appropriate security measures and only process data according to our instructions."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"7. International Data Transfers"}),o("p",{className:"text-muted-foreground",children:"As a France-based company, we aim to keep your data within the European Union wherever possible."}),o("p",{className:"text-muted-foreground",children:"However, some of our service providers may process data outside the EU/EEA. When this occurs, we ensure appropriate safeguards are in place, such as:"}),d("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[d("li",{children:[o("strong",{children:"Standard Contractual Clauses (SCCs)"})," approved by the European Commission"]}),d("li",{children:[o("strong",{children:"Adequacy decisions"})," where the recipient country has been deemed to provide adequate protection"]}),d("li",{children:[o("strong",{children:"Binding Corporate Rules"})," where applicable"]})]}),d("p",{className:"text-muted-foreground",children:["You may request more information about these safeguards by contacting us at"," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"}),"."]})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"8. Data Retention"}),o("p",{className:"text-muted-foreground",children:"We retain your personal data only for as long as necessary to fulfil the purposes for which it was collected:"}),o("div",{className:"overflow-x-auto",children:d("table",{className:"w-full border-collapse text-muted-foreground text-sm",children:[o("thead",{children:d("tr",{className:"border-white/20 border-b",children:[o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Data Type"}),o("th",{className:"py-3 text-left font-semibold text-foreground",children:"Retention Period"})]})}),d("tbody",{children:[d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Analytics data"}),o("td",{className:"py-3",children:"24 months from collection"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Waitlist / contact form data"}),o("td",{className:"py-3",children:"Until you request deletion or 24 months after last interaction"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Account data (when applicable)"}),o("td",{className:"py-3",children:"Duration of account plus 12 months after closure"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Billing records (when applicable)"}),o("td",{className:"py-3",children:"10 years (French legal requirement)"})]})]})]})}),o("p",{className:"mt-4 text-muted-foreground",children:"We may retain certain data longer if required by law or to establish, exercise, or defend legal claims."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"9. Your Rights Under GDPR"}),o("p",{className:"text-muted-foreground",children:"As a data subject in the EU, you have the following rights:"}),d("ul",{className:"list-disc space-y-3 pl-6 text-muted-foreground",children:[d("li",{children:[o("strong",{className:"text-foreground",children:"Right to access"})," \u2014 Request a copy of the personal data we hold about you"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to rectification"})," ","\u2014 Request correction of inaccurate or incomplete data"]}),d("li",{children:[o("strong",{className:"text-foreground",children:'Right to erasure ("right to be forgotten")'})," ","\u2014 Request deletion of your personal data in certain circumstances"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to restriction"})," ","\u2014 Request that we limit how we use your data"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to data portability"})," ","\u2014 Receive your data in a structured, machine-readable format"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to object"})," \u2014 Object to processing based on legitimate interests or direct marketing"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to withdraw consent"})," ","\u2014 Where processing is based on consent, withdraw it at any time"]})]}),d("p",{className:"mt-4 text-muted-foreground",children:["To exercise any of these rights, please contact us at"," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"}),". We will respond within one month as required by GDPR."]})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"10. Security"}),o("p",{className:"text-muted-foreground",children:"We implement appropriate technical and organisational measures to protect your personal data against unauthorised access, alteration, disclosure, or destruction. These measures include:"}),d("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[o("li",{children:"Encryption of data in transit (TLS/HTTPS)"}),o("li",{children:"Encryption of data at rest where appropriate"}),o("li",{children:"Access controls and authentication"}),o("li",{children:"Regular security reviews and updates"}),o("li",{children:"Careful vetting of sub-processors"})]}),o("p",{className:"text-muted-foreground",children:"While we strive to protect your data, no method of transmission over the Internet or electronic storage is 100% secure. We cannot guarantee absolute security but are committed to continuous improvement."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"11. Contact & Complaints"}),o("p",{className:"text-muted-foreground",children:"If you have any questions, concerns, or requests regarding this privacy policy or our data practices, please contact us:"}),d("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:[d("p",{children:[o("strong",{className:"text-foreground",children:"Email:"})," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"})]}),d("p",{className:"mt-2",children:[o("strong",{className:"text-foreground",children:"Address:"})," CHAMAN VENTURES, 229 rue Saint-Honor\xE9, 75001 Paris, France"]})]}),o("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"Supervisory Authority"}),o("p",{className:"text-muted-foreground",children:"If you are not satisfied with our response or believe we are processing your data unlawfully, you have the right to lodge a complaint with a supervisory authority. In France, the relevant authority is:"}),d("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:[o("p",{children:o("strong",{className:"text-foreground",children:"Commission Nationale de l'Informatique et des Libert\xE9s (CNIL)"})}),o("p",{children:"3 Place de Fontenoy, TSA 80715, 75334 Paris Cedex 07"}),d("p",{children:["Website:"," ",o("a",{href:"https://www.cnil.fr",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"www.cnil.fr"})]})]})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"12. Changes to This Policy"}),o("p",{className:"text-muted-foreground",children:'We may update this privacy policy from time to time to reflect changes in our practices, technology, legal requirements, or for other operational reasons. We will notify you of any material changes by updating the "Last updated" date at the top of this page.'}),o("p",{className:"text-muted-foreground",children:"We encourage you to review this policy periodically to stay informed about how we protect your data."})]}),o("div",{className:"mt-12 border-white/10 border-t pt-8",children:d("p",{className:"text-muted-foreground text-sm",children:["For questions about this privacy policy, please contact us at"," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"})]})})]})})})}import{jsx as i,jsxs as p}from"react/jsx-runtime";var dE={title:"Terms of Service | ContractSpec",description:"Terms of Service for ContractSpec. Read our terms governing use of the ContractSpec website and services."};function Kb(){return i("main",{className:"flex grow flex-col items-center justify-center pt-24",children:i("section",{className:"section-padding",children:p("div",{className:"prose prose-invert mx-auto max-w-3xl",children:[i("h1",{className:"mb-4 font-bold text-4xl",children:"Terms of Service"}),i("p",{className:"mb-8 text-muted-foreground",children:"Last updated: December 18, 2025"}),p("section",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"1. Definitions"}),i("p",{className:"text-muted-foreground",children:'In these Terms of Service ("Terms"), the following definitions apply:'}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:'"ContractSpec"'}),","," ",i("strong",{className:"text-foreground",children:'"we"'}),","," ",i("strong",{className:"text-foreground",children:'"us"'}),", or"," ",i("strong",{className:"text-foreground",children:'"our"'})," refers to CHAMAN VENTURES, SASU, operating under the ContractSpec brand."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"Service"'})," or"," ",i("strong",{className:"text-foreground",children:'"Services"'})," refers to the ContractSpec website, ContractSpec Studio, APIs, documentation, and any related products or features we provide."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"User"'}),","," ",i("strong",{className:"text-foreground",children:'"you"'}),", or"," ",i("strong",{className:"text-foreground",children:'"your"'})," refers to any individual or entity accessing or using the Services."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"User Content"'})," ","refers to any data, specifications, configurations, or other materials you create, upload, or submit through the Services."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"ContractSpec Core"'})," ","refers to the open-source components of ContractSpec available under their respective open-source licenses."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"Design Partner"'})," ","refers to early users who have entered into a separate design partnership arrangement with us."]})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"2. Who We Are"}),p("p",{className:"text-muted-foreground",children:["ContractSpec is a brand of"," ",i("strong",{className:"text-foreground",children:"CHAMAN VENTURES"}),", a simplified joint-stock company (SASU) registered in France."]}),i("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:p("ul",{className:"list-none space-y-1 pl-0",children:[i("li",{children:"CHAMAN VENTURES, SASU"}),i("li",{children:"RCS Paris \u2022 SIREN 989 498 902"}),i("li",{children:"229 rue Saint-Honor\xE9, 75001 Paris, France"}),p("li",{children:["Contact:"," ",i("a",{href:"mailto:legal@contractspec.io",className:"text-primary hover:underline",children:"legal@contractspec.io"})]})]})})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"3. Acceptance of Terms"}),p("p",{className:"text-muted-foreground",children:["By accessing or using ContractSpec, you agree to be bound by these Terms and our"," ",i("a",{href:"/legal/privacy",className:"text-primary hover:underline",children:"Privacy Policy"}),". If you do not agree to these Terms, you must not use the Services."]}),i("p",{className:"text-muted-foreground",children:'We may update these Terms from time to time. We will notify you of material changes by updating the "Last updated" date. Continued use of the Services after changes constitutes acceptance of the updated Terms.'})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"4. Eligibility"}),i("p",{className:"text-muted-foreground",children:"To use the Services, you must:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Be at least 18 years old or the age of majority in your jurisdiction"}),i("li",{children:"Have the legal capacity to enter into binding contracts"}),i("li",{children:"Not be prohibited from using the Services under applicable laws"}),i("li",{children:"If acting on behalf of an organisation, have the authority to bind that organisation to these Terms"})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"5. Accounts"}),p("div",{className:"rounded-lg border border-yellow-500/20 bg-yellow-500/5 p-4 text-muted-foreground",children:[i("p",{className:"mb-2 font-medium text-yellow-500",children:"Note"}),i("p",{children:"User accounts are not yet available. When accounts are introduced, the following terms will apply:"})]}),p("ul",{className:"mt-4 list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"You are responsible for maintaining the confidentiality of your account credentials"}),i("li",{children:"You are responsible for all activities that occur under your account"}),i("li",{children:"You must notify us immediately of any unauthorised use of your account"}),i("li",{children:"We reserve the right to suspend or terminate accounts that violate these Terms"})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"6. License & Intellectual Property"}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"6.1 Our Intellectual Property"}),i("p",{className:"text-muted-foreground",children:"The ContractSpec name, logo, website design, proprietary software, documentation, and all associated intellectual property rights are owned by CHAMAN VENTURES. Subject to these Terms, we grant you a limited, non-exclusive, non-transferable, revocable license to access and use the Services for their intended purpose."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"6.2 Open-Source Components"}),i("p",{className:"text-muted-foreground",children:'Certain components of ContractSpec ("ContractSpec Core") are made available as open-source software under their respective licenses (e.g., MIT, Apache 2.0). Your use of open-source components is governed by those licenses, which may grant you additional rights not covered by these Terms. In case of conflict between these Terms and an open-source license, the open-source license prevails for the applicable component.'}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"6.3 Your Content"}),p("p",{className:"text-muted-foreground",children:[i("strong",{className:"text-foreground",children:"You retain ownership"})," ","of all User Content you create, upload, or submit through the Services. This includes your specifications, configurations, and any other materials you generate."]}),i("p",{className:"text-muted-foreground",children:"By using the Services, you grant us a limited, non-exclusive, worldwide, royalty-free license to host, store, process, and display your User Content solely to the extent necessary to provide and improve the Services. This license terminates when you delete your User Content or close your account, except where retention is required by law or for legitimate business purposes (e.g., backups, legal compliance)."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"6.4 Feedback"}),i("p",{className:"text-muted-foreground",children:"If you provide feedback, suggestions, or ideas about the Services, you grant us a perpetual, irrevocable, royalty-free license to use, modify, and incorporate such feedback without obligation to you."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"7. Acceptable Use"}),i("p",{className:"text-muted-foreground",children:"When using the Services, you agree not to:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"Abuse the Services:"})," ","Use the Services in a manner that disrupts, damages, or impairs our infrastructure or other users' experience"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Probe security:"})," ","Attempt to gain unauthorised access to our systems, networks, or data; perform security testing without prior written permission"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Distribute harmful content:"})," ","Upload, share, or distribute malware, viruses, or other malicious code"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Engage in illegal activity:"})," ","Use the Services for any purpose that is unlawful, fraudulent, or harmful"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Interfere with operations:"})," ","Attempt to interfere with, disrupt, or circumvent any security or access controls"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Violate rights:"})," ","Infringe upon the intellectual property, privacy, or other rights of third parties"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Misrepresent identity:"})," ","Impersonate any person or entity, or falsely claim affiliation with ContractSpec"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Circumvent limits:"})," ","Attempt to bypass any usage limits, rate limits, or access restrictions"]})]}),i("p",{className:"mt-4 text-muted-foreground",children:"We reserve the right to investigate violations and take appropriate action, including suspension or termination of access."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"8. Beta & Preview Services"}),p("div",{className:"rounded-lg border border-orange-500/20 bg-orange-500/5 p-4 text-muted-foreground",children:[i("p",{className:"mb-2 font-medium text-orange-400",children:"\u26A0\uFE0F Important"}),i("p",{children:'ContractSpec is currently in active development. Some features may be labelled as "Beta", "Preview", "Alpha", or similar designations.'})]}),i("p",{className:"mt-4 text-muted-foreground",children:"By using beta or preview features, you acknowledge:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"Things may break:"})," ","Beta features may contain bugs, errors, or unexpected behaviour"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"No availability guarantee:"})," ","We do not guarantee uptime, availability, or continuity of beta features"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Features may change or disappear:"})," ","We may modify, suspend, or discontinue beta features at any time without notice"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Not for production:"})," ","Beta features should not be relied upon for mission-critical or production workloads unless you accept these risks"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Data may be lost:"})," ","We cannot guarantee the preservation of data created using beta features"]})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"9. Design Partner Program"}),i("p",{className:"text-muted-foreground",children:"We offer a Design Partner program for early users who wish to collaborate closely with us to shape the product. If you participate as a Design Partner:"}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"9.1 Scope"}),i("p",{className:"text-muted-foreground",children:"Design Partners receive early access to features, provide feedback, and help validate product direction. The specific scope of your participation will be outlined in a separate agreement or communication."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"9.2 Feedback"}),i("p",{className:"text-muted-foreground",children:"We value your input. Feedback you provide may be used to improve the Services. See Section 6.4 for licensing terms regarding feedback."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"9.3 Confidentiality"}),i("p",{className:"text-muted-foreground",children:"Design Partners may receive access to confidential or pre-release information. Unless otherwise specified in a separate agreement, you agree to keep such information confidential and not share it publicly without our prior written consent."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"9.4 Mutual Expectations"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"From us:"})," Regular communications, responsiveness to feedback, and transparency about product direction"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"From you:"})," Timely and honest feedback, reasonable engagement, and adherence to these Terms"]})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"10. Fees & Billing"}),p("div",{className:"rounded-lg border border-yellow-500/20 bg-yellow-500/5 p-4 text-muted-foreground",children:[i("p",{className:"mb-2 font-medium text-yellow-500",children:"Note"}),i("p",{children:"Paid plans are not yet available. When paid plans are introduced, the following terms will apply:"})]}),p("ul",{className:"mt-4 list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Fees will be clearly communicated before you commit to a paid plan"}),i("li",{children:"Payment terms, billing cycles, and refund policies will be specified at that time"}),i("li",{children:"We reserve the right to change pricing with reasonable notice"}),i("li",{children:"Failure to pay may result in suspension or termination of paid features"})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"11. Third-Party Services"}),i("p",{className:"text-muted-foreground",children:"The Services may integrate with or contain links to third-party services, websites, or content. We do not control and are not responsible for third-party services."}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Your use of third-party services is governed by their respective terms and policies"}),i("li",{children:"We make no warranties or representations about third-party services"}),i("li",{children:"Links to third-party sites do not imply endorsement"}),i("li",{children:"You are responsible for reviewing the terms of any third-party services you use"})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"12. Disclaimer of Warranties"}),i("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:i("p",{className:"font-medium uppercase",children:'THE SERVICES ARE PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED.'})}),i("p",{className:"mt-4 text-muted-foreground",children:"To the fullest extent permitted by law, we disclaim:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Warranties of merchantability, fitness for a particular purpose, and non-infringement"}),i("li",{children:"Any warranty that the Services will be uninterrupted, secure, or error-free"}),i("li",{children:"Any warranty regarding the accuracy, reliability, or completeness of content"}),i("li",{children:"Any warranty that defects will be corrected or that the Services are free of viruses or harmful components"})]}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"No Professional Advice"}),i("p",{className:"text-muted-foreground",children:"The Services are tools for software development. Nothing in the Services constitutes legal, financial, technical, or other professional advice. You are solely responsible for evaluating the suitability of the Services for your needs and for any decisions you make based on the output."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"13. Limitation of Liability"}),i("p",{className:"text-muted-foreground",children:"To the maximum extent permitted by applicable law:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"No indirect damages:"})," ","We shall not be liable for any indirect, incidental, special, consequential, or punitive damages, including loss of profits, data, goodwill, or other intangible losses"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Limited direct liability:"})," ","Our total aggregate liability for any claims arising from or related to the Services shall not exceed the greater of: (a) the amount you paid us in the 12 months preceding the claim, or (b) \u20AC100"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Exceptions:"})," These limitations do not apply to liability that cannot be excluded under applicable law, including liability for fraud or wilful misconduct"]})]}),i("p",{className:"mt-4 text-muted-foreground",children:"You acknowledge that these limitations reflect a reasonable allocation of risk and are a fundamental basis of the agreement between us."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"14. Termination"}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"14.1 By You"}),i("p",{className:"text-muted-foreground",children:"You may stop using the Services at any time. When accounts are available, you may close your account through the account settings or by contacting us."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"14.2 By Us"}),i("p",{className:"text-muted-foreground",children:"We may suspend or terminate your access to the Services at any time, with or without cause, with or without notice. Reasons for termination may include:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Violation of these Terms"}),i("li",{children:"Conduct that we believe is harmful to other users or our business"}),i("li",{children:"Extended inactivity"}),i("li",{children:"Discontinuation of the Services"})]}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"14.3 Effect of Termination"}),i("p",{className:"text-muted-foreground",children:"Upon termination, your right to use the Services ceases immediately. Provisions that by their nature should survive termination will survive, including intellectual property rights, disclaimers, limitations of liability, and dispute resolution."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"15. Governing Law & Jurisdiction"}),p("p",{className:"text-muted-foreground",children:["These Terms are governed by and construed in accordance with the laws of ",i("strong",{className:"text-foreground",children:"France"}),", without regard to conflict of law principles."]}),p("p",{className:"text-muted-foreground",children:["Any disputes arising from or related to these Terms or the Services shall be subject to the exclusive jurisdiction of the courts of"," ",i("strong",{className:"text-foreground",children:"Paris, France"}),"."]}),i("p",{className:"text-muted-foreground",children:"If you are a consumer in the European Union, nothing in these Terms affects your rights under mandatory consumer protection laws of your country of residence."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"16. Contact"}),i("p",{className:"text-muted-foreground",children:"If you have any questions about these Terms, please contact us:"}),p("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:[p("p",{children:[i("strong",{className:"text-foreground",children:"Email:"})," ",i("a",{href:"mailto:legal@contractspec.io",className:"text-primary hover:underline",children:"legal@contractspec.io"})]}),p("p",{className:"mt-2",children:[i("strong",{className:"text-foreground",children:"Address:"})," CHAMAN VENTURES, 229 rue Saint-Honor\xE9, 75001 Paris, France"]})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"17. Miscellaneous"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"Entire Agreement:"})," ","These Terms, together with our Privacy Policy and any additional agreements, constitute the entire agreement between you and ContractSpec regarding the Services"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Severability:"})," If any provision of these Terms is found unenforceable, the remaining provisions will continue in effect"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Waiver:"})," Our failure to enforce any right or provision does not constitute a waiver of that right or provision"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Assignment:"})," You may not assign or transfer your rights under these Terms without our consent. We may assign our rights freely"]})]})]}),i("div",{className:"mt-12 border-white/10 border-t pt-8",children:p("p",{className:"text-muted-foreground text-sm",children:["For questions about these terms, please contact us at"," ",i("a",{href:"mailto:legal@contractspec.io",className:"text-primary hover:underline",children:"legal@contractspec.io"})]})})]})})})}import{Lock as Qb}from"lucide-react";import{jsx as ar,jsxs as Yb}from"react/jsx-runtime";function hE({title:e,description:t,actionLabel:a,onAction:r}){return Yb("div",{className:"text-center",children:[ar("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted/40",children:ar(Qb,{className:"h-5 w-5 text-muted-foreground"})}),ar("h3",{className:"mt-4 font-semibold text-lg",children:e}),ar("p",{className:"mt-2 text-muted-foreground text-sm",children:t}),a?ar("button",{type:"button",className:"btn-primary mt-4 inline-flex items-center justify-center",onClick:r,children:a}):null]})}import{Select as Jb,SelectContent as $b,SelectItem as Zb,SelectTrigger as Xb,SelectValue as xb}from"@contractspec/lib.ui-kit-web/ui/select";import*as $d from"react";import{jsx as xa,jsxs as Mi}from"react/jsx-runtime";function Dr({title:e,subtitle:t,workspaceSelect:a,projectSelect:r,environmentSelect:l,stickyHeaderOffsetPx:b,headerRight:h}){return xa("div",{className:"sticky top-0 z-10 border-border border-b bg-card",style:{top:b??0},children:Mi("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-3 px-4 py-3 md:flex-row md:items-center md:justify-between",children:[Mi("div",{className:"min-w-0",children:[Mi("div",{className:"flex items-center gap-2",children:[xa("p",{className:"truncate font-semibold text-base",children:e}),t?xa("p",{className:"hidden text-muted-foreground text-sm md:block",children:t}):null]}),Mi("div",{className:"mt-2 flex flex-wrap gap-2",children:[a?xa(Mn,{select:a}):null,r?xa(Mn,{select:r}):null,l?xa(Mn,{select:l}):null]})]}),xa("div",{className:"flex items-center justify-between gap-2 md:justify-end",children:h})]})})}function Mn({select:e}){let t=$d.useId();return Mi("div",{className:"flex min-w-[220px] flex-col gap-1",children:[xa("span",{id:t,className:"text-muted-foreground text-xs",children:e.label}),Mi(Jb,{value:e.value,onValueChange:e.onChange,children:[xa(Xb,{"aria-labelledby":t,className:"w-full",children:xa(xb,{placeholder:e.placeholder??e.label})}),xa($b,{children:e.options.map((a)=>xa(Zb,{value:a.value,children:a.label},a.value))})]})]})}import{Sidebar as jb,SidebarContent as ev,SidebarFooter as tv,SidebarHeader as av,SidebarMenu as ov,SidebarMenuButton as Zd,SidebarMenuItem as Xd,SidebarRail as iv}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{Settings as rv}from"lucide-react";import{jsx as Io,jsxs as Or}from"react/jsx-runtime";function Br({modules:e,activeModuleId:t,onModuleChange:a,sidebarFooter:r}){return Or(jb,{children:[Io(iv,{}),Io(av,{}),Io(ev,{children:Or(ov,{children:[e.map((l)=>Io(Xd,{children:Or(Zd,{isActive:l.id===t,onClick:()=>a(l.id),children:[l.icon,Io("span",{children:l.label}),l.badge!=null?Io("span",{className:"ml-auto text-muted-foreground text-xs",children:String(l.badge)}):null]})},l.id)),Io(Xd,{children:Or(Zd,{isActive:t==="settings",onClick:()=>a("settings"),children:[Io(rv,{className:"size-4"}),Io("span",{children:"Settings"})]})})]})}),Io(tv,{children:r})]})}import{SidebarInset as nv,SidebarProvider as cv}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{cn as lv}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as Mr,jsxs as xd}from"react/jsx-runtime";function DE({title:e,subtitle:t,workspaceSelect:a,projectSelect:r,environmentSelect:l,stickyHeaderOffsetPx:b,headerRight:h,modules:v,activeModuleId:V,onModuleChange:g,sidebarFooter:tt,assistant:va,children:ye,className:Ke}){return xd(cv,{children:[Mr(Br,{modules:v,activeModuleId:V,onModuleChange:g,sidebarFooter:tt}),Mr(nv,{children:xd("div",{className:lv("min-h-svh bg-background",Ke),children:[Mr(Dr,{title:e,subtitle:t,workspaceSelect:a,projectSelect:r,environmentSelect:l,stickyHeaderOffsetPx:b,headerRight:h}),Mr("main",{className:"m-4",children:ye})]})}),va]})}import{BundleProvider as dv,BundleRenderer as sv}from"@contractspec/lib.surface-runtime/react";import{SidebarProvider as pv}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{jsx as bi}from"react/jsx-runtime";function zE({plan:e,title:t,subtitle:a,workspaceSelect:r,projectSelect:l,environmentSelect:b,stickyHeaderOffsetPx:h,headerRight:v,modules:V,activeModuleId:g,onModuleChange:tt,sidebarFooter:va,assistant:ye,children:Ke,className:Gi}){let Qe={header:bi(Dr,{title:t,subtitle:a,workspaceSelect:r,projectSelect:l,environmentSelect:b,stickyHeaderOffsetPx:h,headerRight:v}),sidebar:bi(Br,{modules:V,activeModuleId:g,onModuleChange:tt,sidebarFooter:va}),primary:bi("main",{className:Gi?`m-4 ${Gi}`:"m-4",children:Ke})};if(ye!=null)Qe.assistant=ye;return bi(pv,{children:bi(dv,{plan:e,children:bi("div",{className:"min-h-svh bg-background",children:bi(sv,{slotContent:Qe})})})})}import{gql as mv}from"@apollo/client";import{useQuery as uv}from"@apollo/client/react";import{useTemplateRuntime as gv}from"@contractspec/lib.example-shared-ui";import{MessageCircle as fv,Users as hv}from"lucide-react";import{useMemo as yv}from"react";import{jsx as vi,jsxs as Ui}from"react/jsx-runtime";var bv=mv`
4800
+ }`}),V=(g)=>{let tt=g.target,{name:va,value:ye}=tt;v((Ke)=>({...Ke,[va]:ye}))};return et("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-4",children:[et("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[et("div",{children:[et("p",{className:"font-semibold text-sm uppercase tracking-wide",children:[e," credentials"]}),Se("p",{className:"text-muted-foreground text-sm",children:"Store encrypted keys with BYOK and run safe connection tests."})]}),Se(zb,{className:"h-5 w-5 text-muted-foreground"})]}),Se("div",{className:"grid gap-4 md:grid-cols-2",children:et("div",{className:"space-y-2",children:[Se(Bi,{htmlFor:"ownershipMode",children:"Ownership"}),et(Fd,{value:h.ownershipMode??"managed",onValueChange:(g)=>v((tt)=>({...tt,ownershipMode:g})),children:[Se(Qd,{id:"ownershipMode",className:"w-full",children:Se(Yd,{})}),et(Kd,{children:[Se(Dr,{value:"managed",children:"Managed (store encrypted)"}),Se(Dr,{value:"byok",children:"BYOK (store secret reference)"})]})]})]})}),et("div",{className:"grid gap-4 md:grid-cols-2",children:[et("div",{className:"space-y-1 text-sm",children:[Se(Bi,{htmlFor:"apiKey",className:"font-semibold",children:"API key"}),et("div",{className:"relative",children:[Se(_b,{className:"pointer-events-none absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),Se(Bn,{type:"text",name:"apiKey",id:"apiKey",className:"w-full py-2 pr-3 pl-9",value:h.apiKey,onChange:V,required:!0})]})]}),et("div",{className:"space-y-1 text-sm",children:[Se(Bi,{htmlFor:"secret",className:"font-semibold",children:"Secret"}),Se(Bn,{type:"password",id:"secret",name:"secret",className:"w-full px-3 py-2",value:h.secret,onChange:V})]})]}),h.ownershipMode==="byok"?et("div",{className:"space-y-4 rounded-xl border border-blue-500/20 bg-blue-500/5 p-4",children:[Se("p",{className:"font-semibold text-sm",children:"BYOK secret reference"}),et("div",{className:"grid gap-4 md:grid-cols-2",children:[et("div",{className:"space-y-2",children:[Se(Bi,{htmlFor:"secretProvider",children:"Secret provider"}),et(Fd,{value:h.secretProvider??"env",onValueChange:(g)=>v((tt)=>({...tt,secretProvider:g})),children:[Se(Qd,{id:"secretProvider",className:"w-full",children:Se(Yd,{})}),et(Kd,{children:[Se(Dr,{value:"env",children:"Environment"}),Se(Dr,{value:"gcp",children:"GCP Secret Manager"})]})]})]}),et("div",{className:"space-y-2",children:[Se(Bi,{htmlFor:"secretRef",children:"Secret reference"}),Se(Bn,{id:"secretRef",name:"secretRef",placeholder:h.secretProvider==="gcp"?"gcp://projects/.../secrets/...":"env://MY_TOKEN_ENV_VAR",value:h.secretRef??"",onChange:V})]})]})]}):et("div",{className:"flex items-center gap-3 rounded-xl border border-emerald-500/20 bg-emerald-500/5 p-4 text-sm",children:[Se(Wb,{checked:!0,onCheckedChange:()=>{},"aria-label":"Managed"}),et("div",{children:[Se("p",{className:"font-semibold",children:"Managed encryption enabled"}),Se("p",{className:"text-muted-foreground",children:"Secrets are encrypted server-side for this tenant."})]})]}),et("div",{className:"space-y-1 text-sm",children:[Se(Bi,{htmlFor:"config",className:"font-semibold",children:"Configuration (JSON)"}),Se(Ub,{id:"config",name:"config",className:"min-h-[140px] w-full font-mono text-sm",value:h.config,onChange:V})]}),et("div",{className:"flex flex-wrap items-center gap-3",children:[et(Vd,{variant:"ghost",onPress:()=>a?.(h),disabled:b,children:[Se(Gb,{className:"h-4 w-4"}),"Test connection"]}),Se(Vd,{variant:"default",onPress:()=>r?.(h),disabled:l,children:"Save settings"})]})]})}import{BookCopy as qb,Plus as Hb,RefreshCcw as Vb}from"lucide-react";import{jsx as so,jsxs as qo}from"react/jsx-runtime";function xL({sources:e,onRefresh:t,onDelete:a,onAdd:r}){return qo("div",{className:"space-y-4 rounded-2xl border border-border bg-card p-4",children:[qo("header",{className:"flex flex-wrap items-center justify-between gap-3",children:[qo("div",{children:[so("p",{className:"font-semibold text-sm uppercase tracking-wide",children:"Knowledge sources"}),so("p",{className:"text-muted-foreground text-sm",children:"Manage documentation, specs, and repos powering Studio RAG flows."})]}),qo("button",{type:"button",className:"btn-primary inline-flex items-center gap-2",onClick:r,children:[so(Hb,{className:"h-4 w-4"}),"Add source"]})]}),so("div",{className:"space-y-3",children:e.length?e.map((l)=>qo("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-xl border border-border bg-background p-4",children:[qo("div",{className:"flex items-center gap-3",children:[so(qb,{className:"h-8 w-8 text-muted-foreground"}),qo("div",{children:[so("p",{className:"font-semibold text-base",children:l.name}),so("p",{className:"text-muted-foreground text-sm",children:l.type}),so("p",{className:"text-muted-foreground text-xs",children:l.indexed?`Indexed ${l.lastIndexed?new Date(l.lastIndexed).toLocaleString():""}`:"Pending indexing"})]})]}),qo("div",{className:"flex items-center gap-2",children:[qo("button",{type:"button",className:"btn-ghost inline-flex items-center gap-1 text-sm",onClick:()=>t?.(l.id),children:[so(Vb,{className:"h-3.5 w-3.5"}),"Reindex"]}),so("button",{type:"button",className:"btn-ghost text-destructive text-sm",onClick:()=>a?.(l.id),children:"Remove"})]})]},l.id)):so("div",{className:"rounded-xl border border-border border-dashed p-6 text-center text-muted-foreground text-sm",children:"No knowledge sources added yet."})})]})}import{jsx as o,jsxs as d}from"react/jsx-runtime";var nD={title:"Privacy Policy | ContractSpec",description:"Learn how ContractSpec collects, uses, and protects your personal data in compliance with GDPR."};function Fb(){return o("main",{className:"flex grow flex-col items-center justify-center pt-24",children:o("section",{className:"section-padding",children:d("div",{className:"prose prose-invert mx-auto max-w-3xl",children:[o("h1",{className:"mb-4 font-bold text-4xl",children:"Privacy Policy"}),o("p",{className:"mb-8 text-muted-foreground",children:"Last updated: December 18, 2025"}),d("section",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"1. Who We Are"}),d("p",{className:"text-muted-foreground",children:[o("strong",{className:"text-foreground",children:"ContractSpec"})," is a brand of"," ",o("strong",{className:"text-foreground",children:"CHAMAN VENTURES"}),", a simplified joint-stock company (SASU) registered in France."]}),d("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:[o("p",{className:"mb-2",children:o("strong",{className:"text-foreground",children:"Data Controller:"})}),d("ul",{className:"list-none space-y-1 pl-0",children:[o("li",{children:"CHAMAN VENTURES, SASU"}),o("li",{children:"RCS Paris \u2022 SIREN 989 498 902"}),o("li",{children:"229 rue Saint-Honor\xE9, 75001 Paris, France"}),d("li",{children:["Contact:"," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"})]})]})]}),o("p",{className:"text-muted-foreground",children:"We are responsible for deciding how we hold and use personal data about you. We are required under data protection legislation to notify you of the information contained in this privacy policy."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"2. What This Policy Covers"}),o("p",{className:"text-muted-foreground",children:"This privacy policy explains:"}),d("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[o("li",{children:"What personal data we collect through the ContractSpec website and services"}),o("li",{children:"Why we collect and process your data"}),o("li",{children:"How we store and protect your data"}),o("li",{children:"Who we may share your data with"}),o("li",{children:"Your rights under the General Data Protection Regulation (GDPR)"})]}),o("p",{className:"text-muted-foreground",children:"This policy applies to visitors of our website, users who sign up for our waitlist or contact us, and customers who use our services."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"3. Data We Collect"}),o("p",{className:"text-muted-foreground",children:"We collect different types of data depending on how you interact with ContractSpec:"}),o("div",{className:"overflow-x-auto",children:d("table",{className:"w-full border-collapse text-muted-foreground text-sm",children:[o("thead",{children:d("tr",{className:"border-white/20 border-b",children:[o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Category"}),o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Data Collected"}),o("th",{className:"py-3 text-left font-semibold text-foreground",children:"When Collected"})]})}),d("tbody",{children:[d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Website Analytics"}),o("td",{className:"py-3 pr-4",children:"Page views, click events, device type, browser, approximate location (country level), session duration, referral source"}),o("td",{className:"py-3",children:"When browsing our website (with consent in EU/EEA)"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Contact / Waitlist"}),o("td",{className:"py-3 pr-4",children:"Name, email address, message content"}),o("td",{className:"py-3",children:"When you submit a form or join our waitlist"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Account Data"}),d("td",{className:"py-3 pr-4",children:[o("em",{children:"Not yet applicable"})," \u2014 We do not currently offer user accounts. This section will be updated when accounts are introduced."]}),o("td",{className:"py-3",children:"\u2014"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Billing Data"}),d("td",{className:"py-3 pr-4",children:[o("em",{children:"Not yet applicable"})," \u2014 We do not currently process payments. This section will be updated when billing is introduced."]}),o("td",{className:"py-3",children:"\u2014"})]})]})]})})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"4. Why We Process Data (Purposes & Legal Bases)"}),o("p",{className:"text-muted-foreground",children:"Under GDPR, we must have a lawful basis for processing your personal data. We rely on the following:"}),o("div",{className:"overflow-x-auto",children:d("table",{className:"w-full border-collapse text-muted-foreground text-sm",children:[o("thead",{children:d("tr",{className:"border-white/20 border-b",children:[o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Purpose"}),o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Legal Basis"}),o("th",{className:"py-3 text-left font-semibold text-foreground",children:"Details"})]})}),d("tbody",{children:[d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Website operation & security"}),o("td",{className:"py-3 pr-4",children:"Legitimate interest"}),o("td",{className:"py-3",children:"Ensuring our website functions correctly, preventing abuse, and maintaining security"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Analytics & improvement"}),o("td",{className:"py-3 pr-4",children:"Consent"}),o("td",{className:"py-3",children:"Understanding how users interact with our site to improve our services (gated behind consent in EU/EEA)"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Responding to enquiries"}),o("td",{className:"py-3 pr-4",children:"Legitimate interest / Contract"}),o("td",{className:"py-3",children:"Responding to your questions, processing waitlist requests, or pre-contractual discussions"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Service delivery"}),o("td",{className:"py-3 pr-4",children:"Contract"}),o("td",{className:"py-3",children:"If/when you become a customer, processing your data is necessary to fulfil our contractual obligations"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Legal compliance"}),o("td",{className:"py-3 pr-4",children:"Legal obligation"}),o("td",{className:"py-3",children:"Complying with applicable laws, regulations, or legal processes"})]})]})]})})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"5. Cookies & Tracking"}),d("p",{className:"text-muted-foreground",children:["We use ",o("strong",{className:"text-foreground",children:"PostHog"})," for product analytics to understand how visitors use our website. PostHog may use cookies or similar technologies to collect this information."]}),o("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"Consent in the EU/EEA"}),o("p",{className:"text-muted-foreground",children:"If you are located in the European Union or European Economic Area, we gate analytics tracking behind your explicit consent. Analytics cookies will not be set until you opt-in through our cookie consent mechanism."}),o("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"Withdrawing Consent / Opting Out"}),o("p",{className:"text-muted-foreground",children:"You can withdraw consent or opt out at any time:"}),d("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[d("li",{children:[o("strong",{children:"Cookie settings:"})," Use the cookie preferences link in our website footer to manage your consent"]}),d("li",{children:[o("strong",{children:"Browser settings:"})," Configure your browser to reject cookies or alert you when cookies are being set"]}),d("li",{children:[o("strong",{children:"PostHog opt-out:"}),' PostHog respects "Do Not Track" browser signals where applicable']})]}),o("p",{className:"text-muted-foreground",children:"Note: Rejecting analytics cookies will not affect your ability to use our website."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"6. Sub-processors & Recipients"}),o("p",{className:"text-muted-foreground",children:"We share data with the following third-party service providers who process data on our behalf:"}),o("div",{className:"overflow-x-auto",children:d("table",{className:"w-full border-collapse text-muted-foreground text-sm",children:[o("thead",{children:d("tr",{className:"border-white/20 border-b",children:[o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Provider"}),o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Purpose"}),o("th",{className:"py-3 text-left font-semibold text-foreground",children:"Location"})]})}),d("tbody",{children:[d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"PostHog"}),o("td",{className:"py-3 pr-4",children:"Product analytics"}),o("td",{className:"py-3",children:"EU (PostHog Cloud EU) or US"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Vercel"}),o("td",{className:"py-3 pr-4",children:"Website hosting & CDN"}),o("td",{className:"py-3",children:"Global (including EU regions)"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Scaleway"}),o("td",{className:"py-3 pr-4",children:"Cloud infrastructure"}),o("td",{className:"py-3",children:"France / EU"})]}),d("tr",{className:"border-white/10 border-b",children:[d("td",{className:"py-3 pr-4 font-medium",children:["Email provider ",o("em",{children:"(TBD)"})]}),o("td",{className:"py-3 pr-4",children:"Transactional & marketing emails"}),o("td",{className:"py-3",children:o("em",{children:"To be confirmed"})})]}),d("tr",{className:"border-white/10 border-b",children:[d("td",{className:"py-3 pr-4 font-medium",children:["Error tracking ",o("em",{children:"(TBD)"})]}),o("td",{className:"py-3 pr-4",children:"Application error monitoring"}),o("td",{className:"py-3",children:o("em",{children:"To be confirmed"})})]}),d("tr",{className:"border-white/10 border-b",children:[d("td",{className:"py-3 pr-4 font-medium",children:["Payment processor ",o("em",{children:"(TBD)"})]}),o("td",{className:"py-3 pr-4",children:"Billing & subscription management"}),o("td",{className:"py-3",children:o("em",{children:"To be confirmed"})})]})]})]})}),o("p",{className:"mt-4 text-muted-foreground",children:"We carefully select our sub-processors and require them to maintain appropriate security measures and only process data according to our instructions."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"7. International Data Transfers"}),o("p",{className:"text-muted-foreground",children:"As a France-based company, we aim to keep your data within the European Union wherever possible."}),o("p",{className:"text-muted-foreground",children:"However, some of our service providers may process data outside the EU/EEA. When this occurs, we ensure appropriate safeguards are in place, such as:"}),d("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[d("li",{children:[o("strong",{children:"Standard Contractual Clauses (SCCs)"})," approved by the European Commission"]}),d("li",{children:[o("strong",{children:"Adequacy decisions"})," where the recipient country has been deemed to provide adequate protection"]}),d("li",{children:[o("strong",{children:"Binding Corporate Rules"})," where applicable"]})]}),d("p",{className:"text-muted-foreground",children:["You may request more information about these safeguards by contacting us at"," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"}),"."]})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"8. Data Retention"}),o("p",{className:"text-muted-foreground",children:"We retain your personal data only for as long as necessary to fulfil the purposes for which it was collected:"}),o("div",{className:"overflow-x-auto",children:d("table",{className:"w-full border-collapse text-muted-foreground text-sm",children:[o("thead",{children:d("tr",{className:"border-white/20 border-b",children:[o("th",{className:"py-3 pr-4 text-left font-semibold text-foreground",children:"Data Type"}),o("th",{className:"py-3 text-left font-semibold text-foreground",children:"Retention Period"})]})}),d("tbody",{children:[d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Analytics data"}),o("td",{className:"py-3",children:"24 months from collection"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Waitlist / contact form data"}),o("td",{className:"py-3",children:"Until you request deletion or 24 months after last interaction"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Account data (when applicable)"}),o("td",{className:"py-3",children:"Duration of account plus 12 months after closure"})]}),d("tr",{className:"border-white/10 border-b",children:[o("td",{className:"py-3 pr-4 font-medium",children:"Billing records (when applicable)"}),o("td",{className:"py-3",children:"10 years (French legal requirement)"})]})]})]})}),o("p",{className:"mt-4 text-muted-foreground",children:"We may retain certain data longer if required by law or to establish, exercise, or defend legal claims."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"9. Your Rights Under GDPR"}),o("p",{className:"text-muted-foreground",children:"As a data subject in the EU, you have the following rights:"}),d("ul",{className:"list-disc space-y-3 pl-6 text-muted-foreground",children:[d("li",{children:[o("strong",{className:"text-foreground",children:"Right to access"})," \u2014 Request a copy of the personal data we hold about you"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to rectification"})," ","\u2014 Request correction of inaccurate or incomplete data"]}),d("li",{children:[o("strong",{className:"text-foreground",children:'Right to erasure ("right to be forgotten")'})," ","\u2014 Request deletion of your personal data in certain circumstances"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to restriction"})," ","\u2014 Request that we limit how we use your data"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to data portability"})," ","\u2014 Receive your data in a structured, machine-readable format"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to object"})," \u2014 Object to processing based on legitimate interests or direct marketing"]}),d("li",{children:[o("strong",{className:"text-foreground",children:"Right to withdraw consent"})," ","\u2014 Where processing is based on consent, withdraw it at any time"]})]}),d("p",{className:"mt-4 text-muted-foreground",children:["To exercise any of these rights, please contact us at"," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"}),". We will respond within one month as required by GDPR."]})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"10. Security"}),o("p",{className:"text-muted-foreground",children:"We implement appropriate technical and organisational measures to protect your personal data against unauthorised access, alteration, disclosure, or destruction. These measures include:"}),d("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[o("li",{children:"Encryption of data in transit (TLS/HTTPS)"}),o("li",{children:"Encryption of data at rest where appropriate"}),o("li",{children:"Access controls and authentication"}),o("li",{children:"Regular security reviews and updates"}),o("li",{children:"Careful vetting of sub-processors"})]}),o("p",{className:"text-muted-foreground",children:"While we strive to protect your data, no method of transmission over the Internet or electronic storage is 100% secure. We cannot guarantee absolute security but are committed to continuous improvement."})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"11. Contact & Complaints"}),o("p",{className:"text-muted-foreground",children:"If you have any questions, concerns, or requests regarding this privacy policy or our data practices, please contact us:"}),d("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:[d("p",{children:[o("strong",{className:"text-foreground",children:"Email:"})," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"})]}),d("p",{className:"mt-2",children:[o("strong",{className:"text-foreground",children:"Address:"})," CHAMAN VENTURES, 229 rue Saint-Honor\xE9, 75001 Paris, France"]})]}),o("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"Supervisory Authority"}),o("p",{className:"text-muted-foreground",children:"If you are not satisfied with our response or believe we are processing your data unlawfully, you have the right to lodge a complaint with a supervisory authority. In France, the relevant authority is:"}),d("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:[o("p",{children:o("strong",{className:"text-foreground",children:"Commission Nationale de l'Informatique et des Libert\xE9s (CNIL)"})}),o("p",{children:"3 Place de Fontenoy, TSA 80715, 75334 Paris Cedex 07"}),d("p",{children:["Website:"," ",o("a",{href:"https://www.cnil.fr",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"www.cnil.fr"})]})]})]}),d("section",{className:"mt-10 space-y-4",children:[o("h2",{className:"font-bold text-2xl text-foreground",children:"12. Changes to This Policy"}),o("p",{className:"text-muted-foreground",children:'We may update this privacy policy from time to time to reflect changes in our practices, technology, legal requirements, or for other operational reasons. We will notify you of any material changes by updating the "Last updated" date at the top of this page.'}),o("p",{className:"text-muted-foreground",children:"We encourage you to review this policy periodically to stay informed about how we protect your data."})]}),o("div",{className:"mt-12 border-white/10 border-t pt-8",children:d("p",{className:"text-muted-foreground text-sm",children:["For questions about this privacy policy, please contact us at"," ",o("a",{href:"mailto:privacy@contractspec.io",className:"text-primary hover:underline",children:"privacy@contractspec.io"})]})})]})})})}import{jsx as i,jsxs as p}from"react/jsx-runtime";var dD={title:"Terms of Service | ContractSpec",description:"Terms of Service for ContractSpec. Read our terms governing use of the ContractSpec website and services."};function Kb(){return i("main",{className:"flex grow flex-col items-center justify-center pt-24",children:i("section",{className:"section-padding",children:p("div",{className:"prose prose-invert mx-auto max-w-3xl",children:[i("h1",{className:"mb-4 font-bold text-4xl",children:"Terms of Service"}),i("p",{className:"mb-8 text-muted-foreground",children:"Last updated: December 18, 2025"}),p("section",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"1. Definitions"}),i("p",{className:"text-muted-foreground",children:'In these Terms of Service ("Terms"), the following definitions apply:'}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:'"ContractSpec"'}),","," ",i("strong",{className:"text-foreground",children:'"we"'}),","," ",i("strong",{className:"text-foreground",children:'"us"'}),", or"," ",i("strong",{className:"text-foreground",children:'"our"'})," refers to CHAMAN VENTURES, SASU, operating under the ContractSpec brand."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"Service"'})," or"," ",i("strong",{className:"text-foreground",children:'"Services"'})," refers to the ContractSpec website, ContractSpec Studio, APIs, documentation, and any related products or features we provide."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"User"'}),","," ",i("strong",{className:"text-foreground",children:'"you"'}),", or"," ",i("strong",{className:"text-foreground",children:'"your"'})," refers to any individual or entity accessing or using the Services."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"User Content"'})," ","refers to any data, specifications, configurations, or other materials you create, upload, or submit through the Services."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"ContractSpec Core"'})," ","refers to the open-source components of ContractSpec available under their respective open-source licenses."]}),p("li",{children:[i("strong",{className:"text-foreground",children:'"Design Partner"'})," ","refers to early users who have entered into a separate design partnership arrangement with us."]})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"2. Who We Are"}),p("p",{className:"text-muted-foreground",children:["ContractSpec is a brand of"," ",i("strong",{className:"text-foreground",children:"CHAMAN VENTURES"}),", a simplified joint-stock company (SASU) registered in France."]}),i("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:p("ul",{className:"list-none space-y-1 pl-0",children:[i("li",{children:"CHAMAN VENTURES, SASU"}),i("li",{children:"RCS Paris \u2022 SIREN 989 498 902"}),i("li",{children:"229 rue Saint-Honor\xE9, 75001 Paris, France"}),p("li",{children:["Contact:"," ",i("a",{href:"mailto:legal@contractspec.io",className:"text-primary hover:underline",children:"legal@contractspec.io"})]})]})})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"3. Acceptance of Terms"}),p("p",{className:"text-muted-foreground",children:["By accessing or using ContractSpec, you agree to be bound by these Terms and our"," ",i("a",{href:"/legal/privacy",className:"text-primary hover:underline",children:"Privacy Policy"}),". If you do not agree to these Terms, you must not use the Services."]}),i("p",{className:"text-muted-foreground",children:'We may update these Terms from time to time. We will notify you of material changes by updating the "Last updated" date. Continued use of the Services after changes constitutes acceptance of the updated Terms.'})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"4. Eligibility"}),i("p",{className:"text-muted-foreground",children:"To use the Services, you must:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Be at least 18 years old or the age of majority in your jurisdiction"}),i("li",{children:"Have the legal capacity to enter into binding contracts"}),i("li",{children:"Not be prohibited from using the Services under applicable laws"}),i("li",{children:"If acting on behalf of an organisation, have the authority to bind that organisation to these Terms"})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"5. Accounts"}),p("div",{className:"rounded-lg border border-yellow-500/20 bg-yellow-500/5 p-4 text-muted-foreground",children:[i("p",{className:"mb-2 font-medium text-yellow-500",children:"Note"}),i("p",{children:"User accounts are not yet available. When accounts are introduced, the following terms will apply:"})]}),p("ul",{className:"mt-4 list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"You are responsible for maintaining the confidentiality of your account credentials"}),i("li",{children:"You are responsible for all activities that occur under your account"}),i("li",{children:"You must notify us immediately of any unauthorised use of your account"}),i("li",{children:"We reserve the right to suspend or terminate accounts that violate these Terms"})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"6. License & Intellectual Property"}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"6.1 Our Intellectual Property"}),i("p",{className:"text-muted-foreground",children:"The ContractSpec name, logo, website design, proprietary software, documentation, and all associated intellectual property rights are owned by CHAMAN VENTURES. Subject to these Terms, we grant you a limited, non-exclusive, non-transferable, revocable license to access and use the Services for their intended purpose."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"6.2 Open-Source Components"}),i("p",{className:"text-muted-foreground",children:'Certain components of ContractSpec ("ContractSpec Core") are made available as open-source software under their respective licenses (e.g., MIT, Apache 2.0). Your use of open-source components is governed by those licenses, which may grant you additional rights not covered by these Terms. In case of conflict between these Terms and an open-source license, the open-source license prevails for the applicable component.'}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"6.3 Your Content"}),p("p",{className:"text-muted-foreground",children:[i("strong",{className:"text-foreground",children:"You retain ownership"})," ","of all User Content you create, upload, or submit through the Services. This includes your specifications, configurations, and any other materials you generate."]}),i("p",{className:"text-muted-foreground",children:"By using the Services, you grant us a limited, non-exclusive, worldwide, royalty-free license to host, store, process, and display your User Content solely to the extent necessary to provide and improve the Services. This license terminates when you delete your User Content or close your account, except where retention is required by law or for legitimate business purposes (e.g., backups, legal compliance)."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"6.4 Feedback"}),i("p",{className:"text-muted-foreground",children:"If you provide feedback, suggestions, or ideas about the Services, you grant us a perpetual, irrevocable, royalty-free license to use, modify, and incorporate such feedback without obligation to you."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"7. Acceptable Use"}),i("p",{className:"text-muted-foreground",children:"When using the Services, you agree not to:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"Abuse the Services:"})," ","Use the Services in a manner that disrupts, damages, or impairs our infrastructure or other users' experience"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Probe security:"})," ","Attempt to gain unauthorised access to our systems, networks, or data; perform security testing without prior written permission"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Distribute harmful content:"})," ","Upload, share, or distribute malware, viruses, or other malicious code"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Engage in illegal activity:"})," ","Use the Services for any purpose that is unlawful, fraudulent, or harmful"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Interfere with operations:"})," ","Attempt to interfere with, disrupt, or circumvent any security or access controls"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Violate rights:"})," ","Infringe upon the intellectual property, privacy, or other rights of third parties"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Misrepresent identity:"})," ","Impersonate any person or entity, or falsely claim affiliation with ContractSpec"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Circumvent limits:"})," ","Attempt to bypass any usage limits, rate limits, or access restrictions"]})]}),i("p",{className:"mt-4 text-muted-foreground",children:"We reserve the right to investigate violations and take appropriate action, including suspension or termination of access."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"8. Beta & Preview Services"}),p("div",{className:"rounded-lg border border-orange-500/20 bg-orange-500/5 p-4 text-muted-foreground",children:[i("p",{className:"mb-2 font-medium text-orange-400",children:"\u26A0\uFE0F Important"}),i("p",{children:'ContractSpec is currently in active development. Some features may be labelled as "Beta", "Preview", "Alpha", or similar designations.'})]}),i("p",{className:"mt-4 text-muted-foreground",children:"By using beta or preview features, you acknowledge:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"Things may break:"})," ","Beta features may contain bugs, errors, or unexpected behaviour"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"No availability guarantee:"})," ","We do not guarantee uptime, availability, or continuity of beta features"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Features may change or disappear:"})," ","We may modify, suspend, or discontinue beta features at any time without notice"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Not for production:"})," ","Beta features should not be relied upon for mission-critical or production workloads unless you accept these risks"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Data may be lost:"})," ","We cannot guarantee the preservation of data created using beta features"]})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"9. Design Partner Program"}),i("p",{className:"text-muted-foreground",children:"We offer a Design Partner program for early users who wish to collaborate closely with us to shape the product. If you participate as a Design Partner:"}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"9.1 Scope"}),i("p",{className:"text-muted-foreground",children:"Design Partners receive early access to features, provide feedback, and help validate product direction. The specific scope of your participation will be outlined in a separate agreement or communication."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"9.2 Feedback"}),i("p",{className:"text-muted-foreground",children:"We value your input. Feedback you provide may be used to improve the Services. See Section 6.4 for licensing terms regarding feedback."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"9.3 Confidentiality"}),i("p",{className:"text-muted-foreground",children:"Design Partners may receive access to confidential or pre-release information. Unless otherwise specified in a separate agreement, you agree to keep such information confidential and not share it publicly without our prior written consent."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"9.4 Mutual Expectations"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"From us:"})," Regular communications, responsiveness to feedback, and transparency about product direction"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"From you:"})," Timely and honest feedback, reasonable engagement, and adherence to these Terms"]})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"10. Fees & Billing"}),p("div",{className:"rounded-lg border border-yellow-500/20 bg-yellow-500/5 p-4 text-muted-foreground",children:[i("p",{className:"mb-2 font-medium text-yellow-500",children:"Note"}),i("p",{children:"Paid plans are not yet available. When paid plans are introduced, the following terms will apply:"})]}),p("ul",{className:"mt-4 list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Fees will be clearly communicated before you commit to a paid plan"}),i("li",{children:"Payment terms, billing cycles, and refund policies will be specified at that time"}),i("li",{children:"We reserve the right to change pricing with reasonable notice"}),i("li",{children:"Failure to pay may result in suspension or termination of paid features"})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"11. Third-Party Services"}),i("p",{className:"text-muted-foreground",children:"The Services may integrate with or contain links to third-party services, websites, or content. We do not control and are not responsible for third-party services."}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Your use of third-party services is governed by their respective terms and policies"}),i("li",{children:"We make no warranties or representations about third-party services"}),i("li",{children:"Links to third-party sites do not imply endorsement"}),i("li",{children:"You are responsible for reviewing the terms of any third-party services you use"})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"12. Disclaimer of Warranties"}),i("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:i("p",{className:"font-medium uppercase",children:'THE SERVICES ARE PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED.'})}),i("p",{className:"mt-4 text-muted-foreground",children:"To the fullest extent permitted by law, we disclaim:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Warranties of merchantability, fitness for a particular purpose, and non-infringement"}),i("li",{children:"Any warranty that the Services will be uninterrupted, secure, or error-free"}),i("li",{children:"Any warranty regarding the accuracy, reliability, or completeness of content"}),i("li",{children:"Any warranty that defects will be corrected or that the Services are free of viruses or harmful components"})]}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"No Professional Advice"}),i("p",{className:"text-muted-foreground",children:"The Services are tools for software development. Nothing in the Services constitutes legal, financial, technical, or other professional advice. You are solely responsible for evaluating the suitability of the Services for your needs and for any decisions you make based on the output."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"13. Limitation of Liability"}),i("p",{className:"text-muted-foreground",children:"To the maximum extent permitted by applicable law:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"No indirect damages:"})," ","We shall not be liable for any indirect, incidental, special, consequential, or punitive damages, including loss of profits, data, goodwill, or other intangible losses"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Limited direct liability:"})," ","Our total aggregate liability for any claims arising from or related to the Services shall not exceed the greater of: (a) the amount you paid us in the 12 months preceding the claim, or (b) \u20AC100"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Exceptions:"})," These limitations do not apply to liability that cannot be excluded under applicable law, including liability for fraud or wilful misconduct"]})]}),i("p",{className:"mt-4 text-muted-foreground",children:"You acknowledge that these limitations reflect a reasonable allocation of risk and are a fundamental basis of the agreement between us."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"14. Termination"}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"14.1 By You"}),i("p",{className:"text-muted-foreground",children:"You may stop using the Services at any time. When accounts are available, you may close your account through the account settings or by contacting us."}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"14.2 By Us"}),i("p",{className:"text-muted-foreground",children:"We may suspend or terminate your access to the Services at any time, with or without cause, with or without notice. Reasons for termination may include:"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[i("li",{children:"Violation of these Terms"}),i("li",{children:"Conduct that we believe is harmful to other users or our business"}),i("li",{children:"Extended inactivity"}),i("li",{children:"Discontinuation of the Services"})]}),i("h3",{className:"mt-6 font-semibold text-foreground text-xl",children:"14.3 Effect of Termination"}),i("p",{className:"text-muted-foreground",children:"Upon termination, your right to use the Services ceases immediately. Provisions that by their nature should survive termination will survive, including intellectual property rights, disclaimers, limitations of liability, and dispute resolution."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"15. Governing Law & Jurisdiction"}),p("p",{className:"text-muted-foreground",children:["These Terms are governed by and construed in accordance with the laws of ",i("strong",{className:"text-foreground",children:"France"}),", without regard to conflict of law principles."]}),p("p",{className:"text-muted-foreground",children:["Any disputes arising from or related to these Terms or the Services shall be subject to the exclusive jurisdiction of the courts of"," ",i("strong",{className:"text-foreground",children:"Paris, France"}),"."]}),i("p",{className:"text-muted-foreground",children:"If you are a consumer in the European Union, nothing in these Terms affects your rights under mandatory consumer protection laws of your country of residence."})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"16. Contact"}),i("p",{className:"text-muted-foreground",children:"If you have any questions about these Terms, please contact us:"}),p("div",{className:"rounded-lg border border-white/10 bg-white/5 p-4 text-muted-foreground",children:[p("p",{children:[i("strong",{className:"text-foreground",children:"Email:"})," ",i("a",{href:"mailto:legal@contractspec.io",className:"text-primary hover:underline",children:"legal@contractspec.io"})]}),p("p",{className:"mt-2",children:[i("strong",{className:"text-foreground",children:"Address:"})," CHAMAN VENTURES, 229 rue Saint-Honor\xE9, 75001 Paris, France"]})]})]}),p("section",{className:"mt-10 space-y-4",children:[i("h2",{className:"font-bold text-2xl text-foreground",children:"17. Miscellaneous"}),p("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[p("li",{children:[i("strong",{className:"text-foreground",children:"Entire Agreement:"})," ","These Terms, together with our Privacy Policy and any additional agreements, constitute the entire agreement between you and ContractSpec regarding the Services"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Severability:"})," If any provision of these Terms is found unenforceable, the remaining provisions will continue in effect"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Waiver:"})," Our failure to enforce any right or provision does not constitute a waiver of that right or provision"]}),p("li",{children:[i("strong",{className:"text-foreground",children:"Assignment:"})," You may not assign or transfer your rights under these Terms without our consent. We may assign our rights freely"]})]})]}),i("div",{className:"mt-12 border-white/10 border-t pt-8",children:p("p",{className:"text-muted-foreground text-sm",children:["For questions about these terms, please contact us at"," ",i("a",{href:"mailto:legal@contractspec.io",className:"text-primary hover:underline",children:"legal@contractspec.io"})]})})]})})})}import{Lock as Qb}from"lucide-react";import{jsx as ar,jsxs as Yb}from"react/jsx-runtime";function hD({title:e,description:t,actionLabel:a,onAction:r}){return Yb("div",{className:"text-center",children:[ar("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-muted/40",children:ar(Qb,{className:"h-5 w-5 text-muted-foreground"})}),ar("h3",{className:"mt-4 font-semibold text-lg",children:e}),ar("p",{className:"mt-2 text-muted-foreground text-sm",children:t}),a?ar("button",{type:"button",className:"btn-primary mt-4 inline-flex items-center justify-center",onClick:r,children:a}):null]})}import{Select as Jb,SelectContent as Zb,SelectItem as $b,SelectTrigger as Xb,SelectValue as xb}from"@contractspec/lib.ui-kit-web/ui/select";import*as Zd from"react";import{jsx as xa,jsxs as Mi}from"react/jsx-runtime";function Er({title:e,subtitle:t,workspaceSelect:a,projectSelect:r,environmentSelect:l,stickyHeaderOffsetPx:b,headerRight:h}){return xa("div",{className:"sticky top-0 z-10 border-border border-b bg-card",style:{top:b??0},children:Mi("div",{className:"mx-auto flex w-full max-w-7xl flex-col gap-3 px-4 py-3 md:flex-row md:items-center md:justify-between",children:[Mi("div",{className:"min-w-0",children:[Mi("div",{className:"flex items-center gap-2",children:[xa("p",{className:"truncate font-semibold text-base",children:e}),t?xa("p",{className:"hidden text-muted-foreground text-sm md:block",children:t}):null]}),Mi("div",{className:"mt-2 flex flex-wrap gap-2",children:[a?xa(Mn,{select:a}):null,r?xa(Mn,{select:r}):null,l?xa(Mn,{select:l}):null]})]}),xa("div",{className:"flex items-center justify-between gap-2 md:justify-end",children:h})]})})}function Mn({select:e}){let t=Zd.useId();return Mi("div",{className:"flex min-w-[220px] flex-col gap-1",children:[xa("span",{id:t,className:"text-muted-foreground text-xs",children:e.label}),Mi(Jb,{value:e.value,onValueChange:e.onChange,children:[xa(Xb,{"aria-labelledby":t,className:"w-full",children:xa(xb,{placeholder:e.placeholder??e.label})}),xa(Zb,{children:e.options.map((a)=>xa($b,{value:a.value,children:a.label},a.value))})]})]})}import{Sidebar as jb,SidebarContent as ev,SidebarFooter as tv,SidebarHeader as av,SidebarMenu as ov,SidebarMenuButton as $d,SidebarMenuItem as Xd,SidebarRail as iv}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{Settings as rv}from"lucide-react";import{jsx as Io,jsxs as Or}from"react/jsx-runtime";function Br({modules:e,activeModuleId:t,onModuleChange:a,sidebarFooter:r}){return Or(jb,{children:[Io(iv,{}),Io(av,{}),Io(ev,{children:Or(ov,{children:[e.map((l)=>Io(Xd,{children:Or($d,{isActive:l.id===t,onClick:()=>a(l.id),children:[l.icon,Io("span",{children:l.label}),l.badge!=null?Io("span",{className:"ml-auto text-muted-foreground text-xs",children:String(l.badge)}):null]})},l.id)),Io(Xd,{children:Or($d,{isActive:t==="settings",onClick:()=>a("settings"),children:[Io(rv,{className:"size-4"}),Io("span",{children:"Settings"})]})})]})}),Io(tv,{children:r})]})}import{SidebarInset as nv,SidebarProvider as cv}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{cn as lv}from"@contractspec/lib.ui-kit-web/ui/utils";import{jsx as Mr,jsxs as xd}from"react/jsx-runtime";function ED({title:e,subtitle:t,workspaceSelect:a,projectSelect:r,environmentSelect:l,stickyHeaderOffsetPx:b,headerRight:h,modules:v,activeModuleId:V,onModuleChange:g,sidebarFooter:tt,assistant:va,children:ye,className:Ke}){return xd(cv,{children:[Mr(Br,{modules:v,activeModuleId:V,onModuleChange:g,sidebarFooter:tt}),Mr(nv,{children:xd("div",{className:lv("min-h-svh bg-background",Ke),children:[Mr(Er,{title:e,subtitle:t,workspaceSelect:a,projectSelect:r,environmentSelect:l,stickyHeaderOffsetPx:b,headerRight:h}),Mr("main",{className:"m-4",children:ye})]})}),va]})}import{BundleProvider as dv,BundleRenderer as sv}from"@contractspec/lib.surface-runtime/react";import{SidebarProvider as pv}from"@contractspec/lib.ui-kit-web/ui/sidebar";import{jsx as bi}from"react/jsx-runtime";function zD({plan:e,title:t,subtitle:a,workspaceSelect:r,projectSelect:l,environmentSelect:b,stickyHeaderOffsetPx:h,headerRight:v,modules:V,activeModuleId:g,onModuleChange:tt,sidebarFooter:va,assistant:ye,children:Ke,className:Gi}){let Qe={header:bi(Er,{title:t,subtitle:a,workspaceSelect:r,projectSelect:l,environmentSelect:b,stickyHeaderOffsetPx:h,headerRight:v}),sidebar:bi(Br,{modules:V,activeModuleId:g,onModuleChange:tt,sidebarFooter:va}),primary:bi("main",{className:Gi?`m-4 ${Gi}`:"m-4",children:Ke})};if(ye!=null)Qe.assistant=ye;return bi(pv,{children:bi(dv,{plan:e,children:bi("div",{className:"min-h-svh bg-background",children:bi(sv,{slotContent:Qe})})})})}import{gql as mv}from"@apollo/client";import{useQuery as uv}from"@apollo/client/react";import{useTemplateRuntime as gv}from"@contractspec/lib.example-shared-ui";import{MessageCircle as fv,Users as hv}from"lucide-react";import{useMemo as yv}from"react";import{jsx as vi,jsxs as Ui}from"react/jsx-runtime";var bv=mv`
4801
4801
  query Conversations($projectId: ID!) {
4802
4802
  conversations(projectId: $projectId) {
4803
4803
  id
@@ -4832,7 +4832,7 @@ export const PaymentFlow = defineWorkflow({
4832
4832
  id
4833
4833
  }
4834
4834
  }
4835
- `;function _n({conversationId:e,viewerId:t="local-user",viewerName:a="You"}){let{projectId:r}=Pv(),[l,b]=Av(""),[h,{loading:v}]=Iv(Rv);return is("form",{onSubmit:async(g)=>{if(g.preventDefault(),!e||!l.trim())return;await h({variables:{input:{projectId:r,conversationId:e,senderId:t,senderName:a,content:l.trim()}},refetchQueries:[{query:Un,variables:{conversationId:e}}]}),b("")},className:"mt-3 flex items-center gap-2 rounded-2xl border border-border bg-card px-4 py-3",children:[os("input",{type:"text",className:"flex-1 bg-transparent text-foreground text-sm outline-none",placeholder:e?"Type a message\u2026":"Select a conversation to start",disabled:!e||v,value:l,onChange:(g)=>b(g.target.value)}),is("button",{type:"submit",className:"btn-primary inline-flex items-center gap-1 text-sm",disabled:!e||v||!l.trim(),children:[os(Tv,{className:"h-4 w-4"}),"Send"]})]})}import{registerTemplateComponents as Lv}from"@contractspec/lib.example-shared-ui";import{useState as Ev}from"react";import{jsx as zn,jsxs as rs}from"react/jsx-runtime";function Dv(){let[e,t]=Ev();return rs("div",{className:"grid gap-4 md:grid-cols-[280px,1fr]",children:[zn(jd,{selectedId:e,onSelect:t}),rs("div",{className:"flex flex-col gap-3",children:[zn(Wn,{conversationId:e}),zn(_n,{conversationId:e})]})]})}Lv("messaging-app",{list:Dv,detail:Wn,form:_n});import{jsx as ns}from"react/jsx-runtime";function cs({locale:e,onChange:t}){return ns("div",{className:"inline-flex rounded-full border border-border bg-card p-1 font-semibold text-muted-foreground text-xs",children:["EN","FR"].map((a)=>ns("button",{type:"button",className:`rounded-full px-3 py-1 transition ${e===a?"bg-violet-500 text-white":"hover:text-foreground"}`,onClick:()=>t(a),children:a==="EN"?"English":"Fran\xE7ais"},a))})}import{Heart as Ov}from"lucide-react";import{jsx as Wi,jsxs as wi}from"react/jsx-runtime";function ls({recipe:e,onSelect:t,onToggleFavorite:a}){return wi("button",{type:"button",onClick:()=>t?.(e),className:"flex flex-col gap-3 rounded-2xl border border-border bg-card text-left transition hover:border-violet-400",children:[e.heroImageUrl?Wi("img",{src:e.heroImageUrl,alt:e.name,className:"h-40 w-full rounded-t-2xl object-cover"}):Wi("div",{className:"h-40 rounded-t-2xl bg-muted"}),wi("div",{className:"space-y-2 p-4",children:[wi("div",{className:"flex items-center justify-between",children:[Wi("p",{className:"font-semibold text-base",children:e.name}),Wi("button",{type:"button",className:`inline-flex items-center justify-center rounded-full border border-transparent p-2 ${e.isFavorite?"text-red-400":"text-muted-foreground hover:text-red-400"}`,onClick:(r)=>{r.stopPropagation(),a?.(e)},children:Wi(Ov,{className:`h-4 w-4 ${e.isFavorite?"fill-red-400":""}`})})]}),Wi("p",{className:"line-clamp-2 text-muted-foreground text-sm",children:e.description}),wi("div",{className:"flex flex-wrap gap-3 text-muted-foreground text-xs",children:[e.prepTimeMinutes?wi("span",{children:["Prep ",e.prepTimeMinutes,"m"]}):null,e.cookTimeMinutes?wi("span",{children:["Cook ",e.cookTimeMinutes,"m"]}):null,e.servings?wi("span",{children:[e.servings," servings"]}):null]})]})]})}import{BookOpen as Bv}from"lucide-react";import{jsx as Po,jsxs as _i}from"react/jsx-runtime";function Gn({recipe:e}){if(!e)return Po("div",{className:"flex flex-1 items-center justify-center rounded-2xl border border-border border-dashed",children:Po("p",{className:"text-muted-foreground text-sm",children:"Select a recipe to view details."})});return _i("article",{className:"space-y-4 rounded-2xl border border-border bg-card p-6",children:[_i("header",{className:"flex flex-wrap items-center gap-3",children:[Po(Bv,{className:"h-5 w-5 text-muted-foreground"}),_i("div",{children:[Po("h2",{className:"font-semibold text-xl",children:e.name}),Po("p",{className:"text-muted-foreground text-sm",children:e.description})]})]}),_i("section",{children:[Po("h3",{className:"font-semibold text-muted-foreground text-sm uppercase tracking-wide",children:"Ingredients"}),Po("ul",{className:"mt-2 list-disc space-y-1 pl-6 text-foreground text-sm",children:e.ingredients.map((t)=>_i("li",{children:[t.name," \u2013 ",t.quantity]},t.id))})]}),_i("section",{children:[Po("h3",{className:"font-semibold text-muted-foreground text-sm uppercase tracking-wide",children:"Instructions"}),Po("ol",{className:"mt-2 list-decimal space-y-2 pl-6 text-foreground text-sm",children:e.instructions.map((t)=>Po("li",{children:t.content},t.id))})]})]})}import{gql as ss}from"@apollo/client";import{useMutation as Mv,useQuery as Uv}from"@apollo/client/react";import{registerTemplateComponents as Wv,useTemplateRuntime as _v}from"@contractspec/lib.example-shared-ui";import{useState as Hn}from"react";import{jsx as zi,jsxs as ds}from"react/jsx-runtime";var zv=ss`
4835
+ `;function _n({conversationId:e,viewerId:t="local-user",viewerName:a="You"}){let{projectId:r}=Pv(),[l,b]=Av(""),[h,{loading:v}]=Iv(Rv);return is("form",{onSubmit:async(g)=>{if(g.preventDefault(),!e||!l.trim())return;await h({variables:{input:{projectId:r,conversationId:e,senderId:t,senderName:a,content:l.trim()}},refetchQueries:[{query:Un,variables:{conversationId:e}}]}),b("")},className:"mt-3 flex items-center gap-2 rounded-2xl border border-border bg-card px-4 py-3",children:[os("input",{type:"text",className:"flex-1 bg-transparent text-foreground text-sm outline-none",placeholder:e?"Type a message\u2026":"Select a conversation to start",disabled:!e||v,value:l,onChange:(g)=>b(g.target.value)}),is("button",{type:"submit",className:"btn-primary inline-flex items-center gap-1 text-sm",disabled:!e||v||!l.trim(),children:[os(Tv,{className:"h-4 w-4"}),"Send"]})]})}import{registerTemplateComponents as Lv}from"@contractspec/lib.example-shared-ui";import{useState as Dv}from"react";import{jsx as zn,jsxs as rs}from"react/jsx-runtime";function Ev(){let[e,t]=Dv();return rs("div",{className:"grid gap-4 md:grid-cols-[280px,1fr]",children:[zn(jd,{selectedId:e,onSelect:t}),rs("div",{className:"flex flex-col gap-3",children:[zn(Wn,{conversationId:e}),zn(_n,{conversationId:e})]})]})}Lv("messaging-app",{list:Ev,detail:Wn,form:_n});import{jsx as ns}from"react/jsx-runtime";function cs({locale:e,onChange:t}){return ns("div",{className:"inline-flex rounded-full border border-border bg-card p-1 font-semibold text-muted-foreground text-xs",children:["EN","FR"].map((a)=>ns("button",{type:"button",className:`rounded-full px-3 py-1 transition ${e===a?"bg-violet-500 text-white":"hover:text-foreground"}`,onClick:()=>t(a),children:a==="EN"?"English":"Fran\xE7ais"},a))})}import{Heart as Ov}from"lucide-react";import{jsx as Wi,jsxs as wi}from"react/jsx-runtime";function ls({recipe:e,onSelect:t,onToggleFavorite:a}){return wi("button",{type:"button",onClick:()=>t?.(e),className:"flex flex-col gap-3 rounded-2xl border border-border bg-card text-left transition hover:border-violet-400",children:[e.heroImageUrl?Wi("img",{src:e.heroImageUrl,alt:e.name,className:"h-40 w-full rounded-t-2xl object-cover"}):Wi("div",{className:"h-40 rounded-t-2xl bg-muted"}),wi("div",{className:"space-y-2 p-4",children:[wi("div",{className:"flex items-center justify-between",children:[Wi("p",{className:"font-semibold text-base",children:e.name}),Wi("button",{type:"button",className:`inline-flex items-center justify-center rounded-full border border-transparent p-2 ${e.isFavorite?"text-red-400":"text-muted-foreground hover:text-red-400"}`,onClick:(r)=>{r.stopPropagation(),a?.(e)},children:Wi(Ov,{className:`h-4 w-4 ${e.isFavorite?"fill-red-400":""}`})})]}),Wi("p",{className:"line-clamp-2 text-muted-foreground text-sm",children:e.description}),wi("div",{className:"flex flex-wrap gap-3 text-muted-foreground text-xs",children:[e.prepTimeMinutes?wi("span",{children:["Prep ",e.prepTimeMinutes,"m"]}):null,e.cookTimeMinutes?wi("span",{children:["Cook ",e.cookTimeMinutes,"m"]}):null,e.servings?wi("span",{children:[e.servings," servings"]}):null]})]})]})}import{BookOpen as Bv}from"lucide-react";import{jsx as Po,jsxs as _i}from"react/jsx-runtime";function Gn({recipe:e}){if(!e)return Po("div",{className:"flex flex-1 items-center justify-center rounded-2xl border border-border border-dashed",children:Po("p",{className:"text-muted-foreground text-sm",children:"Select a recipe to view details."})});return _i("article",{className:"space-y-4 rounded-2xl border border-border bg-card p-6",children:[_i("header",{className:"flex flex-wrap items-center gap-3",children:[Po(Bv,{className:"h-5 w-5 text-muted-foreground"}),_i("div",{children:[Po("h2",{className:"font-semibold text-xl",children:e.name}),Po("p",{className:"text-muted-foreground text-sm",children:e.description})]})]}),_i("section",{children:[Po("h3",{className:"font-semibold text-muted-foreground text-sm uppercase tracking-wide",children:"Ingredients"}),Po("ul",{className:"mt-2 list-disc space-y-1 pl-6 text-foreground text-sm",children:e.ingredients.map((t)=>_i("li",{children:[t.name," \u2013 ",t.quantity]},t.id))})]}),_i("section",{children:[Po("h3",{className:"font-semibold text-muted-foreground text-sm uppercase tracking-wide",children:"Instructions"}),Po("ol",{className:"mt-2 list-decimal space-y-2 pl-6 text-foreground text-sm",children:e.instructions.map((t)=>Po("li",{children:t.content},t.id))})]})]})}import{gql as ss}from"@apollo/client";import{useMutation as Mv,useQuery as Uv}from"@apollo/client/react";import{registerTemplateComponents as Wv,useTemplateRuntime as _v}from"@contractspec/lib.example-shared-ui";import{useState as qn}from"react";import{jsx as zi,jsxs as ds}from"react/jsx-runtime";var zv=ss`
4836
4836
  query Recipes($projectId: ID!, $locale: RecipeLocale!) {
4837
4837
  recipes(projectId: $projectId, locale: $locale) {
4838
4838
  id
@@ -4868,14 +4868,14 @@ export const PaymentFlow = defineWorkflow({
4868
4868
  isFavorite
4869
4869
  }
4870
4870
  }
4871
- `;function Hv(){let{projectId:e}=_v(),[t,a]=Hn("EN"),[r,l]=Hn(),[b,h]=Hn(""),{data:v,loading:V}=Uv(zv,{variables:{projectId:e,locale:t},fetchPolicy:"cache-and-network"}),[g]=Mv(Gv),va=(v?.recipes??[]).filter((Ke)=>Ke.name.toLowerCase().includes(b.toLowerCase())),ye=async(Ke)=>{await g({variables:{id:Ke.id,isFavorite:!Ke.isFavorite},optimisticResponse:{favoriteRecipe:{__typename:"Recipe",id:Ke.id,isFavorite:!Ke.isFavorite}}})};return ds("div",{className:"space-y-4",children:[ds("div",{className:"flex flex-wrap items-center gap-3",children:[zi(cs,{locale:t,onChange:a}),zi("input",{type:"search",placeholder:t==="EN"?"Search recipes":"Rechercher des recettes",className:"flex-1 rounded-full border border-border bg-card px-4 py-2 text-sm",value:b,onChange:(Ke)=>h(Ke.target.value)})]}),V?zi("p",{className:"text-muted-foreground text-sm",children:"Loading recipes\u2026"}):zi("div",{className:"grid gap-4 md:grid-cols-3",children:va.map((Ke)=>zi(ls,{recipe:Ke,onSelect:l,onToggleFavorite:ye},Ke.id))}),zi(Gn,{recipe:r})]})}Wv("recipe-app-i18n",{list:Hv,detail:Gn});import{jsx as po,jsxs as ri}from"react/jsx-runtime";function ps({value:e,onChange:t,categories:a}){let r=(l,b)=>{t({...e,[l]:b})};return ri("div",{className:"grid gap-3 rounded-2xl border border-border bg-card p-4 md:grid-cols-4",children:[ri("label",{className:"flex flex-col text-muted-foreground text-xs uppercase tracking-wide",children:["Status",ri("select",{className:"mt-1 rounded-md border border-border bg-background px-3 py-2 text-foreground text-sm",value:e.status,onChange:(l)=>r("status",l.target.value),children:[po("option",{value:"all",children:"All tasks"}),po("option",{value:"active",children:"Active"}),po("option",{value:"completed",children:"Completed"})]})]}),ri("label",{className:"flex flex-col text-muted-foreground text-xs uppercase tracking-wide",children:["Priority",ri("select",{className:"mt-1 rounded-md border border-border bg-background px-3 py-2 text-foreground text-sm",value:e.priority,onChange:(l)=>r("priority",l.target.value),children:[po("option",{value:"all",children:"All"}),po("option",{value:"LOW",children:"Low"}),po("option",{value:"MEDIUM",children:"Medium"}),po("option",{value:"HIGH",children:"High"}),po("option",{value:"URGENT",children:"Urgent"})]})]}),ri("label",{className:"flex flex-col text-muted-foreground text-xs uppercase tracking-wide",children:["Category",ri("select",{className:"mt-1 rounded-md border border-border bg-background px-3 py-2 text-foreground text-sm",value:e.categoryId,onChange:(l)=>r("categoryId",l.target.value),children:[po("option",{value:"all",children:"All categories"}),a.map((l)=>po("option",{value:l.id,children:l.name},l.id))]})]}),ri("label",{className:"flex flex-col text-muted-foreground text-xs uppercase tracking-wide",children:["Search",po("input",{type:"search",className:"mt-1 rounded-md border border-border bg-background px-3 py-2 text-foreground text-sm",placeholder:"Search by title",value:e.search,onChange:(l)=>r("search",l.target.value)})]})]})}import{gql as qv}from"@apollo/client";import{useMutation as Vv}from"@apollo/client/react";import{useTemplateRuntime as Fv}from"@contractspec/lib.example-shared-ui";import{useState as or}from"react";import{jsx as ja,jsxs as qo}from"react/jsx-runtime";var Kv=qv`
4871
+ `;function qv(){let{projectId:e}=_v(),[t,a]=qn("EN"),[r,l]=qn(),[b,h]=qn(""),{data:v,loading:V}=Uv(zv,{variables:{projectId:e,locale:t},fetchPolicy:"cache-and-network"}),[g]=Mv(Gv),va=(v?.recipes??[]).filter((Ke)=>Ke.name.toLowerCase().includes(b.toLowerCase())),ye=async(Ke)=>{await g({variables:{id:Ke.id,isFavorite:!Ke.isFavorite},optimisticResponse:{favoriteRecipe:{__typename:"Recipe",id:Ke.id,isFavorite:!Ke.isFavorite}}})};return ds("div",{className:"space-y-4",children:[ds("div",{className:"flex flex-wrap items-center gap-3",children:[zi(cs,{locale:t,onChange:a}),zi("input",{type:"search",placeholder:t==="EN"?"Search recipes":"Rechercher des recettes",className:"flex-1 rounded-full border border-border bg-card px-4 py-2 text-sm",value:b,onChange:(Ke)=>h(Ke.target.value)})]}),V?zi("p",{className:"text-muted-foreground text-sm",children:"Loading recipes\u2026"}):zi("div",{className:"grid gap-4 md:grid-cols-3",children:va.map((Ke)=>zi(ls,{recipe:Ke,onSelect:l,onToggleFavorite:ye},Ke.id))}),zi(Gn,{recipe:r})]})}Wv("recipe-app-i18n",{list:qv,detail:Gn});import{jsx as po,jsxs as ri}from"react/jsx-runtime";function ps({value:e,onChange:t,categories:a}){let r=(l,b)=>{t({...e,[l]:b})};return ri("div",{className:"grid gap-3 rounded-2xl border border-border bg-card p-4 md:grid-cols-4",children:[ri("label",{className:"flex flex-col text-muted-foreground text-xs uppercase tracking-wide",children:["Status",ri("select",{className:"mt-1 rounded-md border border-border bg-background px-3 py-2 text-foreground text-sm",value:e.status,onChange:(l)=>r("status",l.target.value),children:[po("option",{value:"all",children:"All tasks"}),po("option",{value:"active",children:"Active"}),po("option",{value:"completed",children:"Completed"})]})]}),ri("label",{className:"flex flex-col text-muted-foreground text-xs uppercase tracking-wide",children:["Priority",ri("select",{className:"mt-1 rounded-md border border-border bg-background px-3 py-2 text-foreground text-sm",value:e.priority,onChange:(l)=>r("priority",l.target.value),children:[po("option",{value:"all",children:"All"}),po("option",{value:"LOW",children:"Low"}),po("option",{value:"MEDIUM",children:"Medium"}),po("option",{value:"HIGH",children:"High"}),po("option",{value:"URGENT",children:"Urgent"})]})]}),ri("label",{className:"flex flex-col text-muted-foreground text-xs uppercase tracking-wide",children:["Category",ri("select",{className:"mt-1 rounded-md border border-border bg-background px-3 py-2 text-foreground text-sm",value:e.categoryId,onChange:(l)=>r("categoryId",l.target.value),children:[po("option",{value:"all",children:"All categories"}),a.map((l)=>po("option",{value:l.id,children:l.name},l.id))]})]}),ri("label",{className:"flex flex-col text-muted-foreground text-xs uppercase tracking-wide",children:["Search",po("input",{type:"search",className:"mt-1 rounded-md border border-border bg-background px-3 py-2 text-foreground text-sm",placeholder:"Search by title",value:e.search,onChange:(l)=>r("search",l.target.value)})]})]})}import{gql as Hv}from"@apollo/client";import{useMutation as Vv}from"@apollo/client/react";import{useTemplateRuntime as Fv}from"@contractspec/lib.example-shared-ui";import{useState as or}from"react";import{jsx as ja,jsxs as Ho}from"react/jsx-runtime";var Kv=Hv`
4872
4872
  mutation CreateTask($input: CreateTaskInput!) {
4873
4873
  createTask(input: $input) {
4874
4874
  id
4875
4875
  title
4876
4876
  }
4877
4877
  }
4878
- `;function qn({categories:e}){let{projectId:t}=Fv(),[a,r]=or(""),[l,b]=or(""),[h,v]=or("MEDIUM"),[V,g]=or("none"),[tt,va]=or(""),[ye,{loading:Ke}]=Vv(Kv);return qo("form",{onSubmit:async(Qe)=>{if(Qe.preventDefault(),!a.trim())return;await ye({variables:{input:{projectId:t,title:a.trim(),description:l.trim()||void 0,priority:h,categoryId:V==="none"?void 0:V,tags:Qv(tt)}},refetchQueries:["Tasks"],awaitRefetchQueries:!0}),r(""),b(""),v("MEDIUM"),g("none"),va("")},className:"space-y-3 rounded-2xl border border-border bg-background/60 p-4",children:[ja("div",{children:qo("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Title",ja("input",{type:"text",className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",placeholder:"What needs to get done?",value:a,onChange:(Qe)=>r(Qe.target.value),required:!0})]})}),ja("div",{children:qo("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Description",ja("textarea",{className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",rows:3,placeholder:"Add context or policy notes",value:l,onChange:(Qe)=>b(Qe.target.value)})]})}),qo("div",{className:"grid gap-3 md:grid-cols-3",children:[qo("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Priority",qo("select",{className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",value:h,onChange:(Qe)=>v(Qe.target.value),children:[ja("option",{value:"LOW",children:"Low"}),ja("option",{value:"MEDIUM",children:"Medium"}),ja("option",{value:"HIGH",children:"High"}),ja("option",{value:"URGENT",children:"Urgent"})]})]}),qo("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Category",qo("select",{className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",value:V,onChange:(Qe)=>g(Qe.target.value),children:[ja("option",{value:"none",children:"None"}),e.map((Qe)=>ja("option",{value:Qe.id,children:Qe.name},Qe.id))]})]}),qo("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Tags",ja("input",{className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",placeholder:"Comma separated (optional)",value:tt,onChange:(Qe)=>va(Qe.target.value)})]})]}),ja("button",{type:"submit",className:"btn-primary w-full py-2 font-semibold text-sm",disabled:Ke,children:Ke?"Saving...":"Add task"})]})}function Qv(e){return e.split(",").map((t)=>t.trim()).filter(Boolean)}import{Check as Yv,Circle as Jv,Trash2 as $v}from"lucide-react";import{jsx as To,jsxs as ir}from"react/jsx-runtime";function ms({task:e,onToggle:t,onDelete:a}){let r=e.priority==="URGENT"?"text-red-200 bg-red-500/10 border-red-500/40":e.priority==="HIGH"?"text-amber-200 bg-amber-500/10 border-amber-500/40":e.priority==="LOW"?"text-emerald-200 bg-emerald-500/10 border-emerald-500/40":"text-violet-200 bg-violet-500/10 border-violet-500/40";return ir("div",{className:"flex items-start gap-4 rounded-2xl border border-border/70 bg-card/60 p-4 transition hover:border-border",children:[To("button",{type:"button",className:"rounded-full border border-border p-2 text-muted-foreground hover:bg-muted/40","aria-pressed":e.completed,onClick:()=>t?.(e),children:e.completed?To(Yv,{className:"h-4 w-4 text-emerald-400"}):To(Jv,{className:"h-4 w-4"})}),ir("div",{className:"flex-1 space-y-2",children:[ir("div",{className:"flex flex-wrap items-center gap-2",children:[To("p",{className:`font-medium ${e.completed?"text-muted-foreground line-through":"text-foreground"}`,children:e.title}),To("span",{className:`rounded-full border px-2 py-0.5 text-xs ${r}`,children:e.priority.charAt(0)+e.priority.slice(1).toLowerCase()}),e.category?To("span",{className:"rounded-full bg-muted/40 px-2 py-0.5 text-muted-foreground text-xs",children:e.category.name}):null,e.dueDate?ir("span",{className:"text-muted-foreground text-xs",children:["Due ",new Date(e.dueDate).toLocaleDateString()]}):null]}),e.description?To("p",{className:"text-muted-foreground text-sm",children:e.description}):null,e.tags.length?To("div",{className:"flex flex-wrap gap-1",children:e.tags.map((l)=>ir("span",{className:"rounded-full bg-muted/40 px-2 py-0.5 text-muted-foreground text-xs",children:["#",l]},l))}):null]}),To("button",{type:"button",className:"text-muted-foreground hover:text-destructive","aria-label":`Delete ${e.title}`,onClick:()=>a?.(e),children:To($v,{className:"h-4 w-4"})})]})}import{gql as Vn}from"@apollo/client";import{useMutation as us,useQuery as Zv}from"@apollo/client/react";import{registerTemplateComponents as Xv,useTemplateRuntime as xv}from"@contractspec/lib.example-shared-ui";import{useMemo as jv,useState as eN}from"react";import{jsx as ki,jsxs as oN}from"react/jsx-runtime";var gs=Vn`
4878
+ `;function Hn({categories:e}){let{projectId:t}=Fv(),[a,r]=or(""),[l,b]=or(""),[h,v]=or("MEDIUM"),[V,g]=or("none"),[tt,va]=or(""),[ye,{loading:Ke}]=Vv(Kv);return Ho("form",{onSubmit:async(Qe)=>{if(Qe.preventDefault(),!a.trim())return;await ye({variables:{input:{projectId:t,title:a.trim(),description:l.trim()||void 0,priority:h,categoryId:V==="none"?void 0:V,tags:Qv(tt)}},refetchQueries:["Tasks"],awaitRefetchQueries:!0}),r(""),b(""),v("MEDIUM"),g("none"),va("")},className:"space-y-3 rounded-2xl border border-border bg-background/60 p-4",children:[ja("div",{children:Ho("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Title",ja("input",{type:"text",className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",placeholder:"What needs to get done?",value:a,onChange:(Qe)=>r(Qe.target.value),required:!0})]})}),ja("div",{children:Ho("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Description",ja("textarea",{className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",rows:3,placeholder:"Add context or policy notes",value:l,onChange:(Qe)=>b(Qe.target.value)})]})}),Ho("div",{className:"grid gap-3 md:grid-cols-3",children:[Ho("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Priority",Ho("select",{className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",value:h,onChange:(Qe)=>v(Qe.target.value),children:[ja("option",{value:"LOW",children:"Low"}),ja("option",{value:"MEDIUM",children:"Medium"}),ja("option",{value:"HIGH",children:"High"}),ja("option",{value:"URGENT",children:"Urgent"})]})]}),Ho("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Category",Ho("select",{className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",value:V,onChange:(Qe)=>g(Qe.target.value),children:[ja("option",{value:"none",children:"None"}),e.map((Qe)=>ja("option",{value:Qe.id,children:Qe.name},Qe.id))]})]}),Ho("label",{className:"font-semibold text-muted-foreground text-xs uppercase",children:["Tags",ja("input",{className:"mt-1 w-full rounded-md border border-border bg-card px-3 py-2 text-sm",placeholder:"Comma separated (optional)",value:tt,onChange:(Qe)=>va(Qe.target.value)})]})]}),ja("button",{type:"submit",className:"btn-primary w-full py-2 font-semibold text-sm",disabled:Ke,children:Ke?"Saving...":"Add task"})]})}function Qv(e){return e.split(",").map((t)=>t.trim()).filter(Boolean)}import{Check as Yv,Circle as Jv,Trash2 as Zv}from"lucide-react";import{jsx as To,jsxs as ir}from"react/jsx-runtime";function ms({task:e,onToggle:t,onDelete:a}){let r=e.priority==="URGENT"?"text-red-200 bg-red-500/10 border-red-500/40":e.priority==="HIGH"?"text-amber-200 bg-amber-500/10 border-amber-500/40":e.priority==="LOW"?"text-emerald-200 bg-emerald-500/10 border-emerald-500/40":"text-violet-200 bg-violet-500/10 border-violet-500/40";return ir("div",{className:"flex items-start gap-4 rounded-2xl border border-border/70 bg-card/60 p-4 transition hover:border-border",children:[To("button",{type:"button",className:"rounded-full border border-border p-2 text-muted-foreground hover:bg-muted/40","aria-pressed":e.completed,onClick:()=>t?.(e),children:e.completed?To(Yv,{className:"h-4 w-4 text-emerald-400"}):To(Jv,{className:"h-4 w-4"})}),ir("div",{className:"flex-1 space-y-2",children:[ir("div",{className:"flex flex-wrap items-center gap-2",children:[To("p",{className:`font-medium ${e.completed?"text-muted-foreground line-through":"text-foreground"}`,children:e.title}),To("span",{className:`rounded-full border px-2 py-0.5 text-xs ${r}`,children:e.priority.charAt(0)+e.priority.slice(1).toLowerCase()}),e.category?To("span",{className:"rounded-full bg-muted/40 px-2 py-0.5 text-muted-foreground text-xs",children:e.category.name}):null,e.dueDate?ir("span",{className:"text-muted-foreground text-xs",children:["Due ",new Date(e.dueDate).toLocaleDateString()]}):null]}),e.description?To("p",{className:"text-muted-foreground text-sm",children:e.description}):null,e.tags.length?To("div",{className:"flex flex-wrap gap-1",children:e.tags.map((l)=>ir("span",{className:"rounded-full bg-muted/40 px-2 py-0.5 text-muted-foreground text-xs",children:["#",l]},l))}):null]}),To("button",{type:"button",className:"text-muted-foreground hover:text-destructive","aria-label":`Delete ${e.title}`,onClick:()=>a?.(e),children:To(Zv,{className:"h-4 w-4"})})]})}import{gql as Vn}from"@apollo/client";import{useMutation as us,useQuery as $v}from"@apollo/client/react";import{registerTemplateComponents as Xv,useTemplateRuntime as xv}from"@contractspec/lib.example-shared-ui";import{useMemo as jv,useState as eN}from"react";import{jsx as ki,jsxs as oN}from"react/jsx-runtime";var gs=Vn`
4879
4879
  query Tasks($projectId: ID!) {
4880
4880
  taskCategories(projectId: $projectId) {
4881
4881
  id
@@ -4908,4 +4908,4 @@ export const PaymentFlow = defineWorkflow({
4908
4908
  mutation DeleteTask($id: ID!) {
4909
4909
  deleteTask(id: $id)
4910
4910
  }
4911
- `;function fs(){let{projectId:e}=xv(),[t,a]=eN({status:"all",priority:"all",categoryId:"all",search:""}),{data:r,loading:l}=Zv(gs,{variables:{projectId:e},fetchPolicy:"cache-and-network"}),[b]=us(tN),[h]=us(aN),v=r?.taskCategories??[],V=r?.tasks??[],g=jv(()=>{return V.filter((ye)=>{if(t.status==="active"&&ye.completed)return!1;if(t.status==="completed"&&!ye.completed)return!1;if(t.priority!=="all"&&ye.priority!==t.priority)return!1;if(t.categoryId!=="all"&&ye.category?.id!==t.categoryId)return!1;if(t.search&&!ye.title.toLowerCase().includes(t.search.toLowerCase()))return!1;return!0})},[V,t]),tt=async(ye)=>{await b({variables:{id:ye.id,completed:!ye.completed},optimisticResponse:{toggleTask:{__typename:"Task",id:ye.id,completed:!ye.completed}},update(Ke){Ke.modify({fields:{tasks(Gi=[]){return Gi.map((Qe)=>Qe.__ref?.endsWith(ye.id)?{...Qe,completed:!ye.completed}:Qe)}}})}})},va=async(ye)=>{await h({variables:{id:ye.id},refetchQueries:[{query:gs,variables:{projectId:e}}]})};return oN("div",{className:"space-y-6",children:[ki(ps,{value:t,onChange:a,categories:v}),ki(qn,{categories:v}),l?ki("p",{className:"text-muted-foreground text-sm",children:"Loading tasks\u2026"}):g.length?ki("div",{className:"space-y-3",children:g.map((ye)=>ki(ms,{task:ye,onToggle:tt,onDelete:va},ye.id))}):ki("div",{className:"rounded-2xl border border-border border-dashed p-8 text-center",children:ki("p",{className:"text-muted-foreground",children:"No tasks match your filters. Create one above."})})]})}Xv("todos-app",{list:fs,detail:fs,form:qn});var Fn={appNameKey:"ContractSpec",assets:[{type:"logo",url:"/logo.svg",dimensions:{width:180,height:40}},{type:"logo-dark",url:"/logo-dark.svg",dimensions:{width:180,height:40}},{type:"favicon",url:"/favicon.ico",dimensions:{width:32,height:32}},{type:"og-image",url:"/og-image.png",dimensions:{width:1200,height:630}}],colorTokens:{primary:"#0ea5e9",secondary:"#6366f1"}},iN={appName:"ContractSpec",assets:{logo:"/logo.svg",logoDark:"/logo-dark.svg",favicon:"/favicon.ico",ogImage:"/og-image.png"},colors:{primary:"#0ea5e9",secondary:"#6366f1"},domain:"contractspec.io"};var Kn=[{path:"/",label:"Home"},{path:"/product",label:"Product"},{path:"/pricing",label:"Pricing"},{path:"/changelog",label:"Changelog"},{path:"/contact",label:"Contact"},{path:"/docs",label:"Documentation"},{path:"/docs/getting-started",label:"Getting Started"},{path:"/docs/architecture",label:"Architecture"},{path:"/docs/specs",label:"Specs"},{path:"/docs/integrations",label:"Integrations"},{path:"/docs/libraries",label:"Libraries"},{path:"/docs/advanced",label:"Advanced"},{path:"/features",label:"Feature Discovery",featureFlag:"feature-discovery-ui"},{path:"/sandbox",label:"Sandbox",featureFlag:"sandbox-enabled"}];var Ur=(e,t)=>({key:e,version:t}),Wr=(e)=>({key:e}),rN={meta:{key:"contractspec.app",version:"1.0.0",appId:"contractspec",title:"ContractSpec",description:"The deterministic, spec-first compiler for AI-coded systems",domain:"platform",owners:["@platform.core"],tags:["contracts","specs","ai-safety","code-generation"],stability:"beta"},capabilities:{enabled:[Ur("contracts.operations","1.0.0"),Ur("contracts.presentations","1.0.0"),Ur("contracts.mcp","1.0.0"),Ur("contracts.docs","1.0.0")]},features:{include:[Wr("contractspec.docs"),Wr("contractspec.mcp"),Wr("contractspec.presentations"),Wr("app-config")]},branding:Fn,featureFlags:[{key:"feature-discovery-ui",enabled:!0,description:"Show feature discovery UI"},{key:"dark-mode",enabled:!0,description:"Enable dark mode theming"},{key:"ai-assistant",enabled:!1,description:"AI-powered assistant integration"},{key:"sandbox-enabled",enabled:!0,description:"Enable sandbox playground"}],routes:Kn,notes:"ContractSpec platform blueprint - defines the app's capabilities, features, and configuration."};var Qn={meta:{key:"contractspec.docs",version:"1.0.0",title:"Documentation",description:"Comprehensive documentation system for ContractSpec",domain:"platform",owners:["@platform.docs"],tags:["documentation","guides","api-reference"],stability:"stable"},operations:[{key:"docs_search",version:"1.0.0"},{key:"docs.navigate",version:"1.0.0"}],events:[{key:"docs.page_viewed",version:"1.0.0"},{key:"docs.search_performed",version:"1.0.0"}],presentations:[{key:"docs.landing",version:"1.0.0"},{key:"docs.getting-started",version:"1.0.0"},{key:"docs.architecture",version:"1.0.0"}],capabilities:{provides:[{key:"contracts.docs",version:"1.0.0"}],requires:[]}};import{ContractReferenceQuery as nN,DocSummaryModel as cN,DocsIndexInput as lN,DocsIndexOutput as dN,DocsIndexQuery as sN,DocsIndexQuery as pN}from"@contractspec/lib.contracts-spec/docs";var Yn={meta:{key:"contractspec.mcp",version:"1.0.0",title:"MCP Integration",description:"Model Context Protocol server for AI agent integration",domain:"platform",owners:["@platform.mcp"],tags:["mcp","ai-agents","tooling"],stability:"beta"},operations:[{key:"mcp.tool.register",version:"1.0.0"},{key:"mcp.resource.register",version:"1.0.0"},{key:"mcp.prompt.register",version:"1.0.0"}],events:[{key:"mcp.tool_invoked",version:"1.0.0"},{key:"mcp.resource_accessed",version:"1.0.0"}],presentations:[],capabilities:{provides:[{key:"contracts.mcp",version:"1.0.0"}],requires:[{key:"contracts.operations",version:"1.0.0"}]}};var Jn={meta:{key:"contractspec.presentations",version:"1.0.0",title:"Presentation Runtime",description:"Cross-platform rendering of contract-driven UI",domain:"platform",owners:["@platform.presentations"],tags:["presentations","ui","rendering","cross-platform"],stability:"beta"},operations:[{key:"presentation.render",version:"1.0.0"},{key:"presentation.transform",version:"1.0.0"}],events:[{key:"presentation.rendered",version:"1.0.0"},{key:"presentation.transformed",version:"1.0.0"}],presentations:[{key:"form.standard",version:"1.0.0"},{key:"list.standard",version:"1.0.0"},{key:"detail.standard",version:"1.0.0"}],capabilities:{provides:[{key:"contracts.presentations",version:"1.0.0"}],requires:[]}};import{AppConfigFeature as mN}from"@contractspec/lib.contracts-spec/app-config";import{FeatureRegistry as uN}from"@contractspec/lib.contracts-spec/features";function hs(){let e=new uN;return e.register(Qn),e.register(Yn),e.register(Jn),e.register(mN),e}var _r=null;function gN(){if(!_r)_r=hs();return _r}function fN(){_r=null}import{FeatureRegistry as YO}from"@contractspec/lib.contracts-spec/features";export{Qs as resolveSerializedPresentationSpec,Fs as resolveSerializedOperationSpec,Js as resolveSerializedFormSpec,Ks as resolveSerializedEventSpec,Ys as resolveSerializedDataViewSpec,oc as resolvePresentationSpec,Xn as resolveOperationSpec,dc as resolveFormSpec,ec as resolveEventSpec,nc as resolveDataViewSpec,mc as resetContractSpecPresentationRegistry,sc as resetContractSpecOperationRegistry,gc as resetContractSpecFormRegistry,fN as resetContractSpecFeatureRegistry,pc as resetContractSpecEventRegistry,uc as resetContractSpecDataViewRegistry,$s as resetAllContractSpecRegistries,Wc as listGeneratedDocs,fc as getSecondaryDocsPages,xs as getPrimaryDocsTraversal,Xs as getPrimaryDocsSections,h2 as getGeneratedDocById,TN as getDocsPageByHref,AN as getDocsNextPrevious,f2 as getDocsIndexManifest,hc as getDocsHomeSections,ac as getContractSpecPresentationRegistry,Zn as getContractSpecOperationRegistry,lc as getContractSpecFormRegistry,gN as getContractSpecFeatureRegistry,jn as getContractSpecEventRegistry,rc as getContractSpecDataViewRegistry,sN as docsSearchSpec,tc as createContractSpecPresentationRegistry,$n as createContractSpecOperationRegistry,cc as createContractSpecFormRegistry,hs as createContractSpecFeatureRegistry,xn as createContractSpecEventRegistry,ic as createContractSpecDataViewRegistry,Kn as contractspecRoutes,iN as contractspecResolvedBranding,Fn as contractspecBrandingDefaults,rN as contractspecBlueprint,Br as WorkspaceSidebar,zE as WorkspaceShellRenderer,DE as WorkspaceProjectShellLayout,Dr as WorkspaceHeader,cS as VSCodeExtensionPage,Fm as TroubleshootingPage,Kb as TermsTemplate,fs as TaskList,ms as TaskItem,qn as TaskForm,Ib as StudioVisualBuilderPage,Sb as StudioOverviewPage,Nb as StudioIntegrationsPage,yb as StudioGettingStartedPage,gb as StudioDeploymentsPage,pb as StudioBYOKPage,Hm as StartHerePage,db as SpecsWorkflowsPage,cb as SpecsPolicyPage,rb as SpecsOverviewPage,ab as SpecsOverlaysPage,eb as SpecsModuleBundlesPage,Xy as SpecsDataViewsPage,Jy as SpecsConnectPage,qy as SpecsCapabilitiesPage,zy as SpecsBuilderControlPlanePage,Gg as SpecDrivenDevelopmentPage,Wg as SchemaValidationTypescriptPage,My as SafetyTenantIsolationPage,By as SafetySigningPage,Ey as SafetySecurityTrustPage,Ly as SafetyPDPPage,Ay as SafetyOverviewPage,Iy as SafetyMigrationsPage,Sy as SafetyAuditingPage,Hv as RecipeList,Gn as RecipeDetail,ls as RecipeCard,Fb as PrivacyTemplate,Jn as PresentationsFeature,Kh as OpsDistributedTracingPage,Fh as OpsAutoEvolutionPage,Bg as OpenapiAlternativePage,Dv as MessagingWorkspace,Wn as MessageThread,_n as MessageComposer,Vh as ManifestoPage,Un as MESSAGES_QUERY,Yn as MCPFeature,IN as LibraryBundle,qh as LibrariesWorkflowsPage,_h as LibrariesWorkflowComposerPage,Mh as LibrariesUIKitWebPage,Lh as LibrariesUIKitPage,Ih as LibrariesTestingPage,kh as LibrariesSupportBotPage,hh as LibrariesSchemaPage,vh as LibrariesSLOPage,uh as LibrariesRuntimePage,dh as LibrariesResiliencePage,nh as LibrariesProgressiveDeliveryPage,oh as LibrariesPersonalizationPage,eh as LibrariesOverviewPage,Zf as LibrariesOverlayEnginePage,Yf as LibrariesObservabilityPage,Ff as LibrariesMultiTenancyPage,Hf as LibrariesGrowthPage,_f as LibrariesGraphQLPage,Bf as LibrariesEvolutionPage,Ef as LibrariesDesignSystemPage,If as LibrariesDataViewsPage,kf as LibrariesDataBackendPage,vf as LibrariesCrossPlatformUIPage,yf as LibrariesCostTrackingPage,gf as LibrariesContractsPage,df as LibrariesContentGenPage,rf as LibrariesAnalyticsPage,af as LibrariesAiAgentPage,jg as LibrariesAccessibilityPage,cs as LanguageSwitcher,Zg as KnowledgeSpacesPage,Jg as KnowledgeSourcesPage,xL as KnowledgeSourceList,Qg as KnowledgeOverviewPage,Vg as KnowledgeExamplesPage,qg as KnowledgeCategoriesPage,kg as IntegrationsWhatsappTwilioPage,Ng as IntegrationsWhatsappMetaPage,bg as IntegrationsTwilioPage,yg as IntegrationsStripePage,fg as IntegrationsSpecModelPage,ug as IntegrationsSlackPage,pg as IntegrationsS3Page,dg as IntegrationsResendPage,cg as IntegrationsQdrantPage,rg as IntegrationsPowensPage,og as IntegrationsPostmarkPage,tg as IntegrationsOverviewPage,ju as IntegrationsOpenAIPage,Xu as IntegrationsMistralPage,$u as IntegrationsHealthRoutingPage,Ju as IntegrationsGoogleCalendarPage,Qu as IntegrationsGmailPage,Fu as IntegrationsGithubPage,qu as IntegrationsElevenLabsPage,Gu as IntegrationsCircuitBreakersPage,JL as IntegrationSettings,GL as IntegrationMarketplace,Hd as IntegrationCard,_m as InstallationPage,Mm as HelloWorldPage,Wu as GuidesIndexPage,Lu as GuideSpecValidationTypingPage,Au as GuideReleaseCapsulesPage,Iu as GuideNextjsOneEndpointPage,Su as GuideImportExistingCodebasesPage,yu as GuideHostBuilderWorkbenchPage,uu as GuideGenerateDocsClientsSchemasPage,pu as GuideFirstModuleBundlePage,du as GuideDocsPipelinePage,cu as GuideContractTypesPage,eu as GuideConnectInRepoPage,Xm as GuideCIDiffGatingPage,Eg as GenerateClientFromSchemaPage,ps as FilterBar,YO as FeatureRegistry,hE as FeatureGateNotice,sm as ExampleShowcasePage,Hp as EcosystemTemplatesPage,Wp as EcosystemRegistryPage,Mp as EcosystemPluginsPage,Op as EcosystemIntegrationsPage,Ny as DocsReferencePage,ay as DocsReferenceIndexPage,pN as DocsIndexQuery,rp as DocsIndexPage,Qn as DocsFeature,Zp as DocsExamplesPage,cN as DocSummaryModel,dN as DocSearchOutput,lN as DocSearchInput,M2 as DeveloperToolsPage,Ag as DeterministicCodegenPage,Pm as DataViewTutorialPage,zr as DOCS_PRIMARY_SECTIONS,sr as DOCS_PAGES,jd as ConversationList,nN as ContractReferenceQuery,Ig as ContractFirstApiPage,Sm as CompatibilityPage,Lp as ComparisonWorkflowEnginesPage,Rp as ComparisonWindmillPage,Ap as ComparisonOverviewPage,Tp as ComparisonInternalToolBuildersPage,Pp as ComparisonEnterprisePlatformsPage,Cp as ComparisonAutomationPlatformsPage,wm as CLIPage,Sp as ArchitectureOverviewPage,wp as ArchitectureMultiTenancyPage,bp as ArchitectureKnowledgeBindingPage,hp as ArchitectureIntegrationBindingPage,gp as ArchitectureControlPlanePage,mp as ArchitectureAppConfigPage,iw as AdvancedWorkflowMonitoringPage,tw as AdvancedTelemetryPage,ZN as AdvancedSpecExperimentsPage,YN as AdvancedRenderersPage,qN as AdvancedOverlayEditorPage,_N as AdvancedMCPPage};
4911
+ `;function fs(){let{projectId:e}=xv(),[t,a]=eN({status:"all",priority:"all",categoryId:"all",search:""}),{data:r,loading:l}=$v(gs,{variables:{projectId:e},fetchPolicy:"cache-and-network"}),[b]=us(tN),[h]=us(aN),v=r?.taskCategories??[],V=r?.tasks??[],g=jv(()=>{return V.filter((ye)=>{if(t.status==="active"&&ye.completed)return!1;if(t.status==="completed"&&!ye.completed)return!1;if(t.priority!=="all"&&ye.priority!==t.priority)return!1;if(t.categoryId!=="all"&&ye.category?.id!==t.categoryId)return!1;if(t.search&&!ye.title.toLowerCase().includes(t.search.toLowerCase()))return!1;return!0})},[V,t]),tt=async(ye)=>{await b({variables:{id:ye.id,completed:!ye.completed},optimisticResponse:{toggleTask:{__typename:"Task",id:ye.id,completed:!ye.completed}},update(Ke){Ke.modify({fields:{tasks(Gi=[]){return Gi.map((Qe)=>Qe.__ref?.endsWith(ye.id)?{...Qe,completed:!ye.completed}:Qe)}}})}})},va=async(ye)=>{await h({variables:{id:ye.id},refetchQueries:[{query:gs,variables:{projectId:e}}]})};return oN("div",{className:"space-y-6",children:[ki(ps,{value:t,onChange:a,categories:v}),ki(Hn,{categories:v}),l?ki("p",{className:"text-muted-foreground text-sm",children:"Loading tasks\u2026"}):g.length?ki("div",{className:"space-y-3",children:g.map((ye)=>ki(ms,{task:ye,onToggle:tt,onDelete:va},ye.id))}):ki("div",{className:"rounded-2xl border border-border border-dashed p-8 text-center",children:ki("p",{className:"text-muted-foreground",children:"No tasks match your filters. Create one above."})})]})}Xv("todos-app",{list:fs,detail:fs,form:Hn});var Fn={appNameKey:"ContractSpec",assets:[{type:"logo",url:"/logo.svg",dimensions:{width:180,height:40}},{type:"logo-dark",url:"/logo-dark.svg",dimensions:{width:180,height:40}},{type:"favicon",url:"/favicon.ico",dimensions:{width:32,height:32}},{type:"og-image",url:"/og-image.png",dimensions:{width:1200,height:630}}],colorTokens:{primary:"#0ea5e9",secondary:"#6366f1"}},iN={appName:"ContractSpec",assets:{logo:"/logo.svg",logoDark:"/logo-dark.svg",favicon:"/favicon.ico",ogImage:"/og-image.png"},colors:{primary:"#0ea5e9",secondary:"#6366f1"},domain:"contractspec.io"};var Kn=[{path:"/",label:"Home"},{path:"/product",label:"Product"},{path:"/pricing",label:"Pricing"},{path:"/changelog",label:"Changelog"},{path:"/contact",label:"Contact"},{path:"/docs",label:"Documentation"},{path:"/docs/getting-started",label:"Getting Started"},{path:"/docs/architecture",label:"Architecture"},{path:"/docs/specs",label:"Specs"},{path:"/docs/integrations",label:"Integrations"},{path:"/docs/libraries",label:"Libraries"},{path:"/docs/advanced",label:"Advanced"},{path:"/features",label:"Feature Discovery",featureFlag:"feature-discovery-ui"},{path:"/sandbox",label:"Sandbox",featureFlag:"sandbox-enabled"}];var Ur=(e,t)=>({key:e,version:t}),Wr=(e)=>({key:e}),rN={meta:{key:"contractspec.app",version:"1.0.0",appId:"contractspec",title:"ContractSpec",description:"The deterministic, spec-first compiler for AI-coded systems",domain:"platform",owners:["@platform.core"],tags:["contracts","specs","ai-safety","code-generation"],stability:"beta"},capabilities:{enabled:[Ur("contracts.operations","1.0.0"),Ur("contracts.presentations","1.0.0"),Ur("contracts.mcp","1.0.0"),Ur("contracts.docs","1.0.0")]},features:{include:[Wr("contractspec.docs"),Wr("contractspec.mcp"),Wr("contractspec.presentations"),Wr("app-config")]},branding:Fn,featureFlags:[{key:"feature-discovery-ui",enabled:!0,description:"Show feature discovery UI"},{key:"dark-mode",enabled:!0,description:"Enable dark mode theming"},{key:"ai-assistant",enabled:!1,description:"AI-powered assistant integration"},{key:"sandbox-enabled",enabled:!0,description:"Enable sandbox playground"}],routes:Kn,notes:"ContractSpec platform blueprint - defines the app's capabilities, features, and configuration."};var Qn={meta:{key:"contractspec.docs",version:"1.0.0",title:"Documentation",description:"Comprehensive documentation system for ContractSpec",domain:"platform",owners:["@platform.docs"],tags:["documentation","guides","api-reference"],stability:"stable"},operations:[{key:"docs_search",version:"1.0.0"},{key:"docs.navigate",version:"1.0.0"}],events:[{key:"docs.page_viewed",version:"1.0.0"},{key:"docs.search_performed",version:"1.0.0"}],presentations:[{key:"docs.landing",version:"1.0.0"},{key:"docs.getting-started",version:"1.0.0"},{key:"docs.architecture",version:"1.0.0"}],capabilities:{provides:[{key:"contracts.docs",version:"1.0.0"}],requires:[]}};import{ContractReferenceQuery as nN,DocSummaryModel as cN,DocsIndexInput as lN,DocsIndexOutput as dN,DocsIndexQuery as sN,DocsIndexQuery as pN}from"@contractspec/lib.contracts-spec/docs";var Yn={meta:{key:"contractspec.mcp",version:"1.0.0",title:"MCP Integration",description:"Model Context Protocol server for AI agent integration",domain:"platform",owners:["@platform.mcp"],tags:["mcp","ai-agents","tooling"],stability:"beta"},operations:[{key:"mcp.tool.register",version:"1.0.0"},{key:"mcp.resource.register",version:"1.0.0"},{key:"mcp.prompt.register",version:"1.0.0"}],events:[{key:"mcp.tool_invoked",version:"1.0.0"},{key:"mcp.resource_accessed",version:"1.0.0"}],presentations:[],capabilities:{provides:[{key:"contracts.mcp",version:"1.0.0"}],requires:[{key:"contracts.operations",version:"1.0.0"}]}};var Jn={meta:{key:"contractspec.presentations",version:"1.0.0",title:"Presentation Runtime",description:"Cross-platform rendering of contract-driven UI",domain:"platform",owners:["@platform.presentations"],tags:["presentations","ui","rendering","cross-platform"],stability:"beta"},operations:[{key:"presentation.render",version:"1.0.0"},{key:"presentation.transform",version:"1.0.0"}],events:[{key:"presentation.rendered",version:"1.0.0"},{key:"presentation.transformed",version:"1.0.0"}],presentations:[{key:"form.standard",version:"1.0.0"},{key:"list.standard",version:"1.0.0"},{key:"detail.standard",version:"1.0.0"}],capabilities:{provides:[{key:"contracts.presentations",version:"1.0.0"}],requires:[]}};import{AppConfigFeature as mN}from"@contractspec/lib.contracts-spec/app-config";import{FeatureRegistry as uN}from"@contractspec/lib.contracts-spec/features";function hs(){let e=new uN;return e.register(Qn),e.register(Yn),e.register(Jn),e.register(mN),e}var _r=null;function gN(){if(!_r)_r=hs();return _r}function fN(){_r=null}import{FeatureRegistry as YO}from"@contractspec/lib.contracts-spec/features";export{Qs as resolveSerializedPresentationSpec,Fs as resolveSerializedOperationSpec,Js as resolveSerializedFormSpec,Ks as resolveSerializedEventSpec,Ys as resolveSerializedDataViewSpec,oc as resolvePresentationSpec,Xn as resolveOperationSpec,dc as resolveFormSpec,ec as resolveEventSpec,nc as resolveDataViewSpec,mc as resetContractSpecPresentationRegistry,sc as resetContractSpecOperationRegistry,gc as resetContractSpecFormRegistry,fN as resetContractSpecFeatureRegistry,pc as resetContractSpecEventRegistry,uc as resetContractSpecDataViewRegistry,Zs as resetAllContractSpecRegistries,Wc as listGeneratedDocs,fc as getSecondaryDocsPages,xs as getPrimaryDocsTraversal,Xs as getPrimaryDocsSections,h2 as getGeneratedDocById,TN as getDocsPageByHref,AN as getDocsNextPrevious,f2 as getDocsIndexManifest,hc as getDocsHomeSections,ac as getContractSpecPresentationRegistry,$n as getContractSpecOperationRegistry,lc as getContractSpecFormRegistry,gN as getContractSpecFeatureRegistry,jn as getContractSpecEventRegistry,rc as getContractSpecDataViewRegistry,sN as docsSearchSpec,tc as createContractSpecPresentationRegistry,Zn as createContractSpecOperationRegistry,cc as createContractSpecFormRegistry,hs as createContractSpecFeatureRegistry,xn as createContractSpecEventRegistry,ic as createContractSpecDataViewRegistry,Kn as contractspecRoutes,iN as contractspecResolvedBranding,Fn as contractspecBrandingDefaults,rN as contractspecBlueprint,Br as WorkspaceSidebar,zD as WorkspaceShellRenderer,ED as WorkspaceProjectShellLayout,Er as WorkspaceHeader,cS as VSCodeExtensionPage,Fm as TroubleshootingPage,Kb as TermsTemplate,fs as TaskList,ms as TaskItem,Hn as TaskForm,Ib as StudioVisualBuilderPage,Sb as StudioOverviewPage,Nb as StudioIntegrationsPage,yb as StudioGettingStartedPage,gb as StudioDeploymentsPage,pb as StudioBYOKPage,qm as StartHerePage,db as SpecsWorkflowsPage,cb as SpecsPolicyPage,rb as SpecsOverviewPage,ab as SpecsOverlaysPage,eb as SpecsModuleBundlesPage,Xy as SpecsDataViewsPage,Jy as SpecsConnectPage,Hy as SpecsCapabilitiesPage,zy as SpecsBuilderControlPlanePage,Gg as SpecDrivenDevelopmentPage,Wg as SchemaValidationTypescriptPage,My as SafetyTenantIsolationPage,By as SafetySigningPage,Dy as SafetySecurityTrustPage,Ly as SafetyPDPPage,Ay as SafetyOverviewPage,Iy as SafetyMigrationsPage,Sy as SafetyAuditingPage,qv as RecipeList,Gn as RecipeDetail,ls as RecipeCard,Fb as PrivacyTemplate,Jn as PresentationsFeature,Kh as OpsDistributedTracingPage,Fh as OpsAutoEvolutionPage,Bg as OpenapiAlternativePage,Ev as MessagingWorkspace,Wn as MessageThread,_n as MessageComposer,Vh as ManifestoPage,Un as MESSAGES_QUERY,Yn as MCPFeature,IN as LibraryBundle,Hh as LibrariesWorkflowsPage,_h as LibrariesWorkflowComposerPage,Mh as LibrariesUIKitWebPage,Lh as LibrariesUIKitPage,Ih as LibrariesTestingPage,kh as LibrariesSupportBotPage,hh as LibrariesSchemaPage,vh as LibrariesSLOPage,uh as LibrariesRuntimePage,dh as LibrariesResiliencePage,nh as LibrariesProgressiveDeliveryPage,oh as LibrariesPersonalizationPage,eh as LibrariesOverviewPage,$f as LibrariesOverlayEnginePage,Yf as LibrariesObservabilityPage,Ff as LibrariesMultiTenancyPage,qf as LibrariesGrowthPage,_f as LibrariesGraphQLPage,Bf as LibrariesEvolutionPage,Df as LibrariesDesignSystemPage,If as LibrariesDataViewsPage,kf as LibrariesDataBackendPage,vf as LibrariesCrossPlatformUIPage,yf as LibrariesCostTrackingPage,gf as LibrariesContractsPage,df as LibrariesContentGenPage,rf as LibrariesAnalyticsPage,af as LibrariesAiAgentPage,jg as LibrariesAccessibilityPage,cs as LanguageSwitcher,$g as KnowledgeSpacesPage,Jg as KnowledgeSourcesPage,xL as KnowledgeSourceList,Qg as KnowledgeOverviewPage,Vg as KnowledgeExamplesPage,Hg as KnowledgeCategoriesPage,kg as IntegrationsWhatsappTwilioPage,Ng as IntegrationsWhatsappMetaPage,bg as IntegrationsTwilioPage,yg as IntegrationsStripePage,fg as IntegrationsSpecModelPage,ug as IntegrationsSlackPage,pg as IntegrationsS3Page,dg as IntegrationsResendPage,cg as IntegrationsQdrantPage,rg as IntegrationsPowensPage,og as IntegrationsPostmarkPage,tg as IntegrationsOverviewPage,ju as IntegrationsOpenAIPage,Xu as IntegrationsMistralPage,Zu as IntegrationsHealthRoutingPage,Ju as IntegrationsGoogleCalendarPage,Qu as IntegrationsGmailPage,Fu as IntegrationsGithubPage,Hu as IntegrationsElevenLabsPage,Gu as IntegrationsCircuitBreakersPage,JL as IntegrationSettings,GL as IntegrationMarketplace,qd as IntegrationCard,_m as InstallationPage,Mm as HelloWorldPage,Wu as GuidesIndexPage,Lu as GuideSpecValidationTypingPage,Au as GuideReleaseCapsulesPage,Iu as GuideNextjsOneEndpointPage,Su as GuideImportExistingCodebasesPage,yu as GuideHostBuilderWorkbenchPage,uu as GuideGenerateDocsClientsSchemasPage,pu as GuideFirstModuleBundlePage,du as GuideDocsPipelinePage,cu as GuideContractTypesPage,eu as GuideConnectInRepoPage,Xm as GuideCIDiffGatingPage,Dg as GenerateClientFromSchemaPage,ps as FilterBar,YO as FeatureRegistry,hD as FeatureGateNotice,sm as ExampleShowcasePage,qp as EcosystemTemplatesPage,Wp as EcosystemRegistryPage,Mp as EcosystemPluginsPage,Op as EcosystemIntegrationsPage,Ny as DocsReferencePage,ay as DocsReferenceIndexPage,pN as DocsIndexQuery,rp as DocsIndexPage,Qn as DocsFeature,$p as DocsExamplesPage,cN as DocSummaryModel,dN as DocSearchOutput,lN as DocSearchInput,M2 as DeveloperToolsPage,Ag as DeterministicCodegenPage,Pm as DataViewTutorialPage,zr as DOCS_PRIMARY_SECTIONS,sr as DOCS_PAGES,jd as ConversationList,nN as ContractReferenceQuery,Ig as ContractFirstApiPage,Sm as CompatibilityPage,Lp as ComparisonWorkflowEnginesPage,Rp as ComparisonWindmillPage,Ap as ComparisonOverviewPage,Tp as ComparisonInternalToolBuildersPage,Pp as ComparisonEnterprisePlatformsPage,Cp as ComparisonAutomationPlatformsPage,wm as CLIPage,Sp as ArchitectureOverviewPage,wp as ArchitectureMultiTenancyPage,bp as ArchitectureKnowledgeBindingPage,hp as ArchitectureIntegrationBindingPage,gp as ArchitectureControlPlanePage,mp as ArchitectureAppConfigPage,iw as AdvancedWorkflowMonitoringPage,tw as AdvancedTelemetryPage,$N as AdvancedSpecExperimentsPage,YN as AdvancedRenderersPage,HN as AdvancedOverlayEditorPage,_N as AdvancedMCPPage};