// @bun
import{ExampleCatalogDataView as d}from"@contractspec/lib.contracts-spec/docs";import{ButtonLink as m,DataViewList as h,StatusChip as b}from"@contractspec/lib.design-system";import{HStack as N,VStack as p}from"@contractspec/lib.ui-kit-web/ui/stack";import{H1 as v,Muted as g}from"@contractspec/lib.ui-kit-web/ui/typography";import{buildExampleDocsHref as w,listPublicExamples as k}from"@contractspec/module.examples";import{jsx as i,jsxs as l}from"react/jsx-runtime";function y(){let r=k().map((e)=>{let n=e.meta.title??e.meta.key;return{id:e.meta.key,title:n,summary:e.meta.summary??e.meta.description,route:w(e.meta.key),tags:e.meta.tags,sandboxEnabled:e.surfaces.sandbox.enabled}}).sort((e,n)=>e.title.localeCompare(n.title)),t={...d,view:{...d.view,kind:"list"}};return l(p,{gap:"xl",children:[l(p,{gap:"sm",children:[i(v,{children:"Examples"}),i(g,{children:"Reference implementations for real ContractSpec surfaces. Use them to study adoption patterns, inspect generated artifacts, and validate the OSS workflow against runnable systems."})]}),i(h,{spec:t,items:r,emptyState:i(g,{children:"No examples available."}),renderActions:(e)=>{return l(N,{gap:"xs",justify:"end",children:[e.sandboxEnabled?i(m,{href:`/sandbox?template=${e.id}`,size:"sm",variant:"outline",children:"Sandbox"}):null,i(m,{href:e.route,size:"sm",children:"Reference"}),e.tags?.[0]?i(b,{size:"sm",label:e.tags[0]}):null]})}})]})}import{buildExampleDocsHref as E,buildExampleReferenceHref as H,getExamplePreviewHref as P,getPublicExample as L}from"@contractspec/module.examples";var S={"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."},R={"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 f(r){let t=L(r);if(!t)return;let e=t.entrypoints.packageName.replace("@contractspec/example.",""),n=E(r),c=P(r);return{key:r,lead:S[r]??t.meta.summary??t.meta.description??"Public ContractSpec reference example.",sandboxHref:c,referenceHref:R[r]??H(r),llmsHref:`/llms/${t.entrypoints.packageName.replace("@contractspec/","")}`,repoHref:`https://github.com/lssm-tech/contractspec/tree/main/packages/examples/${e}`,localCommands:C(e,n,c)}}function C(r,t,e){let n=[`bun run --cwd packages/examples/${r} build`,"bun run --cwd packages/apps/web-landing dev","","# Open in the browser",`# http://localhost:3000${t}`];if(e)n.push(`# http://localhost:3000${e}`);return n.join(`
`)}import{ButtonLink as s,CodeBlock as z}from"@contractspec/lib.design-system";import B from"@contractspec/lib.ui-link";import{getExample as D}from"@contractspec/module.examples";import{FileCode2 as O,Play as $,TerminalSquare as F}from"lucide-react";import{jsx as a,jsxs as o}from"react/jsx-runtime";function A({exampleKey:r}){let t=f(r),e=D(r);if(!t||!e)return null;let n=e.meta.title??e.meta.key,c=e.meta.summary??e.meta.description??"",u=e.entrypoints.packageName;return o("div",{className:"space-y-10",children:[o("section",{className:"space-y-5",children:[a("p",{className:"editorial-kicker",children:"Meetup-ready example"}),a("h1",{className:"editorial-title max-w-5xl",children:n}),a("p",{className:"editorial-subtitle",children:t.lead}),a("p",{className:"editorial-copy max-w-4xl",children:c}),o("div",{className:"flex flex-wrap gap-3",children:[t.sandboxHref?a(s,{href:t.sandboxHref,children:"Open sandbox"}):null,a(s,{href:t.referenceHref,variant:"outline",children:"Generated reference"})]})]}),o("section",{className:"grid gap-5 lg:grid-cols-3",children:[t.sandboxHref?o("article",{className:"editorial-panel space-y-4",children:[o("div",{className:"flex items-center gap-3",children:[a("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:a($,{size:18})}),a("h2",{className:"font-semibold text-xl",children:"Sandbox preview"})]}),a("p",{className:"editorial-copy text-sm",children:"Load the same public browser surface used for the prepared live demo."}),a(s,{href:t.sandboxHref,size:"sm",children:"Open preview"})]}):null,o("article",{className:"editorial-panel space-y-4",children:[o("div",{className:"flex items-center gap-3",children:[a("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:a(O,{size:18})}),a("h2",{className:"font-semibold text-xl",children:"Reference docs"})]}),a("p",{className:"editorial-copy text-sm",children:"Inspect the generated contract-facing material instead of relying on marketing summaries."}),a(s,{href:t.referenceHref,size:"sm",variant:"outline",children:"Open reference"})]}),o("article",{className:"editorial-panel space-y-4",children:[o("div",{className:"flex items-center gap-3",children:[a("div",{className:"rounded-full border border-border/80 bg-background/85 p-2",children:a(F,{size:18})}),a("h2",{className:"font-semibold text-xl",children:"Package context"})]}),a("p",{className:"editorial-copy text-sm",children:"Use the agent-facing package page for fast repo orientation, then jump to the source directory."}),a("p",{className:"rounded-[18px] border border-border/70 bg-background/75 px-4 py-3 font-mono text-sm",children:u}),o("div",{className:"flex flex-wrap gap-2",children:[a(s,{href:t.llmsHref,size:"sm",variant:"outline",children:"LLMS page"}),a(s,{href:t.repoHref,size:"sm",variant:"outline",children:"GitHub source"})]})]})]}),o("section",{className:"editorial-panel space-y-5",children:[o("div",{className:"space-y-2",children:[a("p",{className:"editorial-kicker",children:"Talk commands"}),a("h2",{className:"editorial-panel-title",children:"Exact local commands for the meetup lane"}),a("p",{className:"editorial-copy text-sm",children:"Build the example package, then launch the web shell and open the prepared docs or sandbox route."})]}),a(z,{language:"bash",filename:`${r}-meetup-runbook`,code:t.localCommands}),o("p",{className:"text-muted-foreground text-sm",children:["For the full fallback order and safe live-edit workflow, use"," ",a(B,{href:"https://github.com/lssm-tech/contractspec/blob/main/docs/meetup-agent-examples-runbook.md",children:"the meetup runbook"}),"."]})]})]})}export{A as ExampleShowcasePage,y as DocsExamplesPage};
