@contractspec/bundle.library 3.9.8 → 3.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/.turbo/turbo-build.log +222 -214
  2. package/CHANGELOG.md +52 -0
  3. package/dist/components/docs/DocsIndexPage.js +2 -2
  4. package/dist/components/docs/docsManifest.js +1 -1
  5. package/dist/components/docs/getting-started/DataViewTutorialPage.js +81 -6
  6. package/dist/components/docs/getting-started/index.js +94 -19
  7. package/dist/components/docs/guides/GuideDataExchangeImportTemplatesPage.content.d.ts +6 -0
  8. package/dist/components/docs/guides/GuideDataExchangeImportTemplatesPage.content.js +176 -0
  9. package/dist/components/docs/guides/GuideDataExchangeImportTemplatesPage.d.ts +1 -0
  10. package/dist/components/docs/guides/GuideDataExchangeImportTemplatesPage.js +176 -0
  11. package/dist/components/docs/guides/GuidesIndexPage.js +2 -2
  12. package/dist/components/docs/guides/index.d.ts +1 -0
  13. package/dist/components/docs/guides/index.js +220 -46
  14. package/dist/components/docs/index.js +1003 -309
  15. package/dist/components/docs/libraries/LibrariesApplicationShellPage.content.d.ts +22 -5
  16. package/dist/components/docs/libraries/LibrariesApplicationShellPage.content.js +125 -37
  17. package/dist/components/docs/libraries/LibrariesApplicationShellPage.js +125 -37
  18. package/dist/components/docs/libraries/LibrariesDataViewsPage.js +120 -3
  19. package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +101 -2
  20. package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  21. package/dist/components/docs/libraries/LibrariesPersonalizationPage.js +58 -4
  22. package/dist/components/docs/libraries/LibrariesTranslationRuntimePage.content.d.ts +10 -0
  23. package/dist/components/docs/libraries/LibrariesTranslationRuntimePage.content.js +43 -0
  24. package/dist/components/docs/libraries/LibrariesTranslationRuntimePage.d.ts +1 -0
  25. package/dist/components/docs/libraries/LibrariesTranslationRuntimePage.js +43 -0
  26. package/dist/components/docs/libraries/index.d.ts +1 -0
  27. package/dist/components/docs/libraries/index.js +496 -97
  28. package/dist/components/docs/specs/SpecsDataViewsPage.js +49 -3
  29. package/dist/components/docs/specs/index.js +60 -14
  30. package/dist/index.js +1014 -320
  31. package/dist/node/components/docs/DocsIndexPage.js +2 -2
  32. package/dist/node/components/docs/docsManifest.js +1 -1
  33. package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +81 -6
  34. package/dist/node/components/docs/getting-started/index.js +94 -19
  35. package/dist/node/components/docs/guides/GuideDataExchangeImportTemplatesPage.content.js +175 -0
  36. package/dist/node/components/docs/guides/GuideDataExchangeImportTemplatesPage.js +175 -0
  37. package/dist/node/components/docs/guides/GuidesIndexPage.js +2 -2
  38. package/dist/node/components/docs/guides/index.js +220 -46
  39. package/dist/node/components/docs/index.js +1003 -309
  40. package/dist/node/components/docs/libraries/LibrariesApplicationShellPage.content.js +125 -37
  41. package/dist/node/components/docs/libraries/LibrariesApplicationShellPage.js +125 -37
  42. package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +120 -3
  43. package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +101 -2
  44. package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  45. package/dist/node/components/docs/libraries/LibrariesPersonalizationPage.js +58 -4
  46. package/dist/node/components/docs/libraries/LibrariesTranslationRuntimePage.content.js +42 -0
  47. package/dist/node/components/docs/libraries/LibrariesTranslationRuntimePage.js +42 -0
  48. package/dist/node/components/docs/libraries/index.js +496 -97
  49. package/dist/node/components/docs/specs/SpecsDataViewsPage.js +49 -3
  50. package/dist/node/components/docs/specs/index.js +60 -14
  51. package/dist/node/index.js +1014 -320
  52. package/package.json +74 -26
  53. package/src/components/docs/docsManifest.test.ts +87 -0
  54. package/src/components/docs/docsManifest.ts +90 -3
  55. package/src/components/docs/generated/docs-index.notifications.json +7 -7
  56. package/src/components/docs/getting-started/DataViewTutorialPage.tsx +181 -50
  57. package/src/components/docs/guides/GuideDataExchangeImportTemplatesPage.content.ts +185 -0
  58. package/src/components/docs/guides/GuideDataExchangeImportTemplatesPage.tsx +186 -0
  59. package/src/components/docs/guides/GuidesIndexPage.tsx +49 -42
  60. package/src/components/docs/guides/index.ts +1 -0
  61. package/src/components/docs/libraries/LibrariesApplicationShellPage.content.ts +148 -35
  62. package/src/components/docs/libraries/LibrariesApplicationShellPage.tsx +38 -5
  63. package/src/components/docs/libraries/LibrariesDataViewsPage.tsx +267 -64
  64. package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +235 -0
  65. package/src/components/docs/libraries/LibrariesOverviewPage.tsx +8 -2
  66. package/src/components/docs/libraries/LibrariesPersonalizationPage.tsx +141 -31
  67. package/src/components/docs/libraries/LibrariesTranslationRuntimePage.content.ts +78 -0
  68. package/src/components/docs/libraries/LibrariesTranslationRuntimePage.tsx +137 -0
  69. package/src/components/docs/libraries/index.ts +1 -0
  70. package/src/components/docs/specs/SpecsDataViewsPage.tsx +239 -113
@@ -1,4 +1,4 @@
1
- var Pt=Object.defineProperty;var Dt=(e)=>e;function Ot(e,S){this[e]=Dt.bind(null,S)}var Do=(e,S)=>{for(var be in S)Pt(e,be,{get:S[be],enumerable:!0,configurable:!0,set:Ot.bind(S,be)})};var Oo=(e,S)=>()=>(e&&(S=e(e=0)),S);import{CodeBlock as Ae,InstallCommand as Et}from"@contractspec/lib.design-system";import Pe from"@contractspec/lib.ui-link";import{ChevronRight as Bt}from"lucide-react";import{jsx as d,jsxs as v}from"react/jsx-runtime";function Mt(){return v("div",{className:"space-y-8",children:[v("div",{className:"space-y-4",children:[d("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.accessibility"}),d("p",{className:"text-muted-foreground",children:"Stable exports of accessibility primitives for LSSM web apps, ensuring WCAG compliance and inclusive design."})]}),v("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Installation"}),d(Et,{package:"@contractspec/lib.accessibility"})]}),v("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Exports"}),v("ul",{className:"space-y-2 text-muted-foreground",children:[v("li",{children:[d("code",{className:"rounded bg-background/50 px-2 py-1",children:"SkipLink"}),": A link to skip navigation, visible on focus"]}),v("li",{children:[d("code",{className:"rounded bg-background/50 px-2 py-1",children:"VisuallyHidden"}),": Hide content visually but keep it for screen readers"]}),v("li",{children:[d("code",{className:"rounded bg-background/50 px-2 py-1",children:"SRLiveRegionProvider"}),","," ",d("code",{className:"rounded bg-background/50 px-2 py-1",children:"useSRLiveRegion"}),": Manage live region announcements"]}),v("li",{children:[d("code",{className:"rounded bg-background/50 px-2 py-1",children:"RouteAnnouncer"}),": Announce page title/path changes on navigation"]}),v("li",{children:[d("code",{className:"rounded bg-background/50 px-2 py-1",children:"FocusOnRouteChange"}),": Reset focus to body or main content on navigation"]}),v("li",{children:[d("code",{className:"rounded bg-background/50 px-2 py-1",children:"useReducedMotion"}),": Detect if the user prefers reduced motion"]})]})]}),v("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Example: App Setup"}),d(Ae,{language:"tsx",code:`import {
1
+ var ca=Object.defineProperty;var sa=(a)=>a;function la(a,A){this[a]=sa.bind(null,A)}var Ii=(a,A)=>{for(var Ge in A)ca(a,Ge,{get:A[Ge],enumerable:!0,configurable:!0,set:la.bind(A,Ge)})};var Pi=(a,A)=>()=>(a&&(A=a(a=0)),A);import{CodeBlock as $e,InstallCommand as da}from"@contractspec/lib.design-system";import xe from"@contractspec/lib.ui-link";import{ChevronRight as pa}from"lucide-react";import{jsx as h,jsxs as k}from"react/jsx-runtime";function ma(){return k("div",{className:"space-y-8",children:[k("div",{className:"space-y-4",children:[h("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.accessibility"}),h("p",{className:"text-muted-foreground",children:"Stable exports of accessibility primitives for LSSM web apps, ensuring WCAG compliance and inclusive design."})]}),k("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Installation"}),h(da,{package:"@contractspec/lib.accessibility"})]}),k("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Exports"}),k("ul",{className:"space-y-2 text-muted-foreground",children:[k("li",{children:[h("code",{className:"rounded bg-background/50 px-2 py-1",children:"SkipLink"}),": A link to skip navigation, visible on focus"]}),k("li",{children:[h("code",{className:"rounded bg-background/50 px-2 py-1",children:"VisuallyHidden"}),": Hide content visually but keep it for screen readers"]}),k("li",{children:[h("code",{className:"rounded bg-background/50 px-2 py-1",children:"SRLiveRegionProvider"}),","," ",h("code",{className:"rounded bg-background/50 px-2 py-1",children:"useSRLiveRegion"}),": Manage live region announcements"]}),k("li",{children:[h("code",{className:"rounded bg-background/50 px-2 py-1",children:"RouteAnnouncer"}),": Announce page title/path changes on navigation"]}),k("li",{children:[h("code",{className:"rounded bg-background/50 px-2 py-1",children:"FocusOnRouteChange"}),": Reset focus to body or main content on navigation"]}),k("li",{children:[h("code",{className:"rounded bg-background/50 px-2 py-1",children:"useReducedMotion"}),": Detect if the user prefers reduced motion"]})]})]}),k("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Example: App Setup"}),h($e,{language:"tsx",code:`import {
2
2
  SRLiveRegionProvider,
3
3
  RouteAnnouncer,
4
4
  SkipLink
@@ -18,7 +18,7 @@ export function RootLayout({ children }) {
18
18
  </body>
19
19
  </html>
20
20
  );
21
- }`})]}),v("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"Example: Live Announcements"}),d(Ae,{language:"tsx",code:`import { useSRLiveRegion } from '@contractspec/lib.accessibility';
21
+ }`})]}),k("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"Example: Live Announcements"}),h($e,{language:"tsx",code:`import { useSRLiveRegion } from '@contractspec/lib.accessibility';
22
22
 
23
23
  export function TodoList() {
24
24
  const { announce } = useSRLiveRegion();
@@ -29,7 +29,7 @@ export function TodoList() {
29
29
  };
30
30
 
31
31
  return <button onClick={addTodo}>Add Todo</button>;
32
- }`})]}),v("div",{className:"space-y-4",children:[d("h2",{className:"font-bold text-2xl",children:"WCAG Compliance"}),v("p",{className:"text-muted-foreground",children:["These components map directly to WCAG 2.1 Level AA requirements documented in ",d("code",{children:"docs/accessibility_wcag_compliance_specs.md"}),":"]}),v("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[d("li",{children:"2.4.1 Bypass Blocks (SkipLink)"}),d("li",{children:"4.1.3 Status Messages (LiveRegion)"}),d("li",{children:"2.4.3 Focus Order (FocusOnRouteChange)"}),d("li",{children:"2.3.3 Animation from Interactions (useReducedMotion)"})]})]}),v("div",{className:"flex items-center gap-4 pt-4",children:[d(Pe,{href:"/docs/libraries/design-system",className:"btn-ghost",children:"Previous: Design System"}),v(Pe,{href:"/docs/libraries",className:"btn-primary",children:["Back to Libraries ",d(Bt,{size:16})]})]})]})}import{CodeBlock as De,InstallCommand as Wt}from"@contractspec/lib.design-system";import Oe from"@contractspec/lib.ui-link";import{ChevronRight as zt}from"lucide-react";import{jsx as y,jsxs as F}from"react/jsx-runtime";function Ut(){return F("div",{className:"space-y-8",children:[F("div",{className:"space-y-4",children:[y("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ai-agent"}),y("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."})]}),F("div",{className:"space-y-4",children:[y("h2",{className:"font-bold text-2xl",children:"Installation"}),y(Wt,{package:"@contractspec/lib.ai-agent"})]}),F("div",{className:"space-y-3",children:[y("h2",{className:"font-bold text-2xl",children:"Define & register"}),y(De,{language:"typescript",code:`import { defineAgent, AgentRegistry } from '@contractspec/lib.contracts-spec/agent';
32
+ }`})]}),k("div",{className:"space-y-4",children:[h("h2",{className:"font-bold text-2xl",children:"WCAG Compliance"}),k("p",{className:"text-muted-foreground",children:["These components map directly to WCAG 2.1 Level AA requirements documented in ",h("code",{children:"docs/accessibility_wcag_compliance_specs.md"}),":"]}),k("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[h("li",{children:"2.4.1 Bypass Blocks (SkipLink)"}),h("li",{children:"4.1.3 Status Messages (LiveRegion)"}),h("li",{children:"2.4.3 Focus Order (FocusOnRouteChange)"}),h("li",{children:"2.3.3 Animation from Interactions (useReducedMotion)"})]})]}),k("div",{className:"flex items-center gap-4 pt-4",children:[h(xe,{href:"/docs/libraries/design-system",className:"btn-ghost",children:"Previous: Design System"}),k(xe,{href:"/docs/libraries",className:"btn-primary",children:["Back to Libraries ",h(pa,{size:16})]})]})]})}import{CodeBlock as je,InstallCommand as ua}from"@contractspec/lib.design-system";import et from"@contractspec/lib.ui-link";import{ChevronRight as ha}from"lucide-react";import{jsx as S,jsxs as K}from"react/jsx-runtime";function ga(){return K("div",{className:"space-y-8",children:[K("div",{className:"space-y-4",children:[S("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ai-agent"}),S("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."})]}),K("div",{className:"space-y-4",children:[S("h2",{className:"font-bold text-2xl",children:"Installation"}),S(ua,{package:"@contractspec/lib.ai-agent"})]}),K("div",{className:"space-y-3",children:[S("h2",{className:"font-bold text-2xl",children:"Define & register"}),S(je,{language:"typescript",code:`import { defineAgent, AgentRegistry } from '@contractspec/lib.contracts-spec/agent';
33
33
 
34
34
  const SupportBot = defineAgent({
35
35
  meta: {
@@ -48,7 +48,7 @@ const SupportBot = defineAgent({
48
48
  },
49
49
  });
50
50
 
51
- const registry = new AgentRegistry().register(SupportBot);`})]}),F("div",{className:"space-y-3",children:[y("h2",{className:"font-bold text-2xl",children:"Run with approvals"}),y(De,{language:"typescript",code:`import { createUnifiedAgent, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
51
+ const registry = new AgentRegistry().register(SupportBot);`})]}),K("div",{className:"space-y-3",children:[S("h2",{className:"font-bold text-2xl",children:"Run with approvals"}),S(je,{language:"typescript",code:`import { createUnifiedAgent, ApprovalWorkflow } from '@contractspec/lib.ai-agent';
52
52
 
53
53
  const approvals = new ApprovalWorkflow();
54
54
  const agent = createUnifiedAgent(SupportBot, {
@@ -58,7 +58,7 @@ const agent = createUnifiedAgent(SupportBot, {
58
58
 
59
59
  const result = await agent.run(ticket.body);
60
60
  // Route low-confidence or manual-review flows through approvals when needed.
61
- `})]}),F("div",{className:"space-y-3",children:[y("h2",{className:"font-bold text-2xl",children:"What's inside"}),F("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[F("li",{children:[y("code",{children:"createUnifiedAgent"}),", ",y("code",{children:"ContractSpecAgent"}),","," ",y("code",{children:"UnifiedAgent"})]}),y("li",{children:"MCP, operation-backed, memory, and subagent tool adapters"}),F("li",{children:[y("code",{children:"InMemoryAgentMemory"})," plus interfaces for custom stores"]}),F("li",{children:[y("code",{children:"ApprovalWorkflow"})," + ",y("code",{children:"ApprovalStore"})," for human-in-the-loop reviews"]})]})]}),F("div",{className:"flex items-center gap-4 pt-4",children:[y(Oe,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),F(Oe,{href:"/docs/libraries/support-bot",className:"btn-primary",children:["Next: Support Bot ",y(zt,{size:16})]})]})]})}import{CodeBlock as ve,InstallCommand as Gt}from"@contractspec/lib.design-system";import{jsx as Q,jsxs as le}from"react/jsx-runtime";function Ft(){return le("div",{className:"space-y-8",children:[le("div",{className:"space-y-4",children:[Q("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.analytics"}),Q("p",{className:"text-lg text-muted-foreground",children:"Work directly with telemetry events to understand conversion, retention, churn, and growth opportunities."})]}),le("div",{className:"space-y-4",children:[Q("h2",{className:"font-bold text-2xl",children:"Installation"}),Q(Gt,{package:"@contractspec/lib.analytics"})]}),le("div",{className:"space-y-3",children:[Q("h2",{className:"font-bold text-2xl",children:"Funnels in memory"}),Q(ve,{language:"typescript",code:`import { FunnelAnalyzer } from '@contractspec/lib.analytics/funnel';
61
+ `})]}),K("div",{className:"space-y-3",children:[S("h2",{className:"font-bold text-2xl",children:"What's inside"}),K("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[K("li",{children:[S("code",{children:"createUnifiedAgent"}),", ",S("code",{children:"ContractSpecAgent"}),","," ",S("code",{children:"UnifiedAgent"})]}),S("li",{children:"MCP, operation-backed, memory, and subagent tool adapters"}),K("li",{children:[S("code",{children:"InMemoryAgentMemory"})," plus interfaces for custom stores"]}),K("li",{children:[S("code",{children:"ApprovalWorkflow"})," + ",S("code",{children:"ApprovalStore"})," for human-in-the-loop reviews"]})]})]}),K("div",{className:"flex items-center gap-4 pt-4",children:[S(et,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),K(et,{href:"/docs/libraries/support-bot",className:"btn-primary",children:["Next: Support Bot ",S(ha,{size:16})]})]})]})}import{CodeBlock as Fe,InstallCommand as fa}from"@contractspec/lib.design-system";import{jsx as X,jsxs as Re}from"react/jsx-runtime";function ba(){return Re("div",{className:"space-y-8",children:[Re("div",{className:"space-y-4",children:[X("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.analytics"}),X("p",{className:"text-lg text-muted-foreground",children:"Work directly with telemetry events to understand conversion, retention, churn, and growth opportunities."})]}),Re("div",{className:"space-y-4",children:[X("h2",{className:"font-bold text-2xl",children:"Installation"}),X(fa,{package:"@contractspec/lib.analytics"})]}),Re("div",{className:"space-y-3",children:[X("h2",{className:"font-bold text-2xl",children:"Funnels in memory"}),X(Fe,{language:"typescript",code:`import { FunnelAnalyzer } from '@contractspec/lib.analytics/funnel';
62
62
 
63
63
  const analyzer = new FunnelAnalyzer();
64
64
  const report = analyzer.analyze(events, {
@@ -68,23 +68,24 @@ const report = analyzer.analyze(events, {
68
68
  { id: 'submit', eventName: 'signup.submit' },
69
69
  { id: 'verified', eventName: 'account.verified' },
70
70
  ],
71
- });`})]}),le("div",{className:"space-y-3",children:[Q("h2",{className:"font-bold text-2xl",children:"Cohorts & churn"}),Q(ve,{language:"typescript",code:`import { CohortTracker } from '@contractspec/lib.analytics/cohort';
71
+ });`})]}),Re("div",{className:"space-y-3",children:[X("h2",{className:"font-bold text-2xl",children:"Cohorts & churn"}),X(Fe,{language:"typescript",code:`import { CohortTracker } from '@contractspec/lib.analytics/cohort';
72
72
  import { ChurnPredictor } from '@contractspec/lib.analytics/churn';
73
73
 
74
74
  const cohorts = new CohortTracker().analyze(events, { bucket: 'week', periods: 8 });
75
- const churn = new ChurnPredictor().score(events);`})]}),le("div",{className:"space-y-3",children:[Q("h2",{className:"font-bold text-2xl",children:"Growth hypotheses"}),Q(ve,{language:"typescript",code:`import { GrowthHypothesisGenerator } from '@contractspec/lib.analytics/growth';
75
+ const churn = new ChurnPredictor().score(events);`})]}),Re("div",{className:"space-y-3",children:[X("h2",{className:"font-bold text-2xl",children:"Growth hypotheses"}),X(Fe,{language:"typescript",code:`import { GrowthHypothesisGenerator } from '@contractspec/lib.analytics/growth';
76
76
 
77
77
  const ideas = new GrowthHypothesisGenerator().generate([
78
78
  { name: 'Activation rate', current: 0.42, previous: 0.55, target: 0.6 },
79
79
  { name: 'Expansion ARPU', current: 1.2, previous: 0.9 },
80
- ]);`})]})]})}var Ee=`import {
80
+ ]);`})]})]})}var tt=`import {
81
81
  AppShell,
82
- PageOutline,
83
- type AppShellNavigationSection,
82
+ type ShellCommandGroup,
83
+ type ShellNavSection,
84
+ type ShellNotificationCenter,
84
85
  type PageOutlineItem,
85
86
  } from "@contractspec/lib.design-system/shell";
86
87
 
87
- const navigation: AppShellNavigationSection[] = [
88
+ const navigation: ShellNavSection[] = [
88
89
  {
89
90
  title: "Workspace",
90
91
  items: [
@@ -101,6 +102,16 @@ const navigation: AppShellNavigationSection[] = [
101
102
  },
102
103
  ];
103
104
 
105
+ const commands: ShellCommandGroup[] = [
106
+ {
107
+ heading: "Quick actions",
108
+ items: [
109
+ { id: "new-contract", label: "New contract", shortcut: "N" },
110
+ { id: "import", label: "Import existing app" },
111
+ ],
112
+ },
113
+ ];
114
+
104
115
  const outline: PageOutlineItem[] = [
105
116
  {
106
117
  id: "architecture",
@@ -113,41 +124,104 @@ const outline: PageOutlineItem[] = [
113
124
  },
114
125
  ];
115
126
 
127
+ const notifications: ShellNotificationCenter = {
128
+ label: "Notifications",
129
+ loading: false,
130
+ unreadCount: 2,
131
+ items: [
132
+ {
133
+ id: "contract-approved",
134
+ title: "Contract approved",
135
+ body: "Billing.create is ready to publish.",
136
+ status: "unread",
137
+ createdAt: "2026-04-29T09:30:00Z",
138
+ actionUrl: "/contracts/billing.create",
139
+ category: "Review",
140
+ },
141
+ ],
142
+ onSelect: (item) => openNotificationTarget(item),
143
+ onMarkRead: (item) => markNotificationRead(item.id),
144
+ onMarkAllRead: () => markAllNotificationsRead(),
145
+ };
146
+
116
147
  export function WorkspacePage() {
117
148
  return (
118
149
  <AppShell
119
- brand={{ label: "ContractSpec", href: "/dashboard" }}
150
+ title="ContractSpec"
151
+ homeHref="/dashboard"
120
152
  navigation={navigation}
153
+ commands={commands}
121
154
  breadcrumbs={[
122
155
  { label: "Workspace", href: "/dashboard" },
123
156
  { label: "Contracts" },
124
157
  ]}
125
- command={{
126
- placeholder: "Search contracts or run an action",
127
- groups: [
128
- {
129
- title: "Quick actions",
130
- actions: [
131
- { id: "new-contract", label: "New contract" },
132
- { id: "import", label: "Import existing app" },
133
- ],
134
- },
135
- ],
136
- }}
137
- user={{
138
- name: "Ada Lovelace",
139
- email: "ada@example.com",
140
- actions: [{ label: "Sign out", onSelect: () => signOut() }],
141
- }}
142
- pageOutline={<PageOutline items={outline} activeId="desktop" />}
158
+ notifications={notifications}
159
+ pageOutline={outline}
160
+ activeHref="/contracts"
161
+ activeOutlineId="desktop"
162
+ userMenu={<UserMenu onSignOut={() => signOut()} />}
143
163
  >
144
164
  <main>{/* route content */}</main>
145
165
  </AppShell>
146
166
  );
147
- }`,Be=`You are implementing a modern application shell from scratch.
167
+ }`,at=`import {
168
+ ListNotificationsOutputModel,
169
+ MarkNotificationReadInputModel,
170
+ } from "@contractspec/lib.contracts-spec/notifications";
171
+ import {
172
+ notificationsSchemaContribution,
173
+ renderNotificationTemplate,
174
+ } from "@contractspec/lib.notification";
175
+ import type { ShellNotificationCenter } from "@contractspec/lib.design-system/shell";
176
+
177
+ type NotificationListResult = {
178
+ unreadCount: number;
179
+ notifications: Array<{
180
+ id: string;
181
+ title: string;
182
+ body: string;
183
+ type: string;
184
+ status: string;
185
+ readAt?: string | Date | null;
186
+ createdAt: string | Date;
187
+ actionUrl?: string;
188
+ metadata?: Record<string, unknown>;
189
+ }>;
190
+ };
191
+
192
+ export function toShellNotifications(
193
+ data: NotificationListResult,
194
+ actions: {
195
+ open: (id: string) => void;
196
+ markRead: (input: { notificationId: string }) => void;
197
+ markAllRead: () => void;
198
+ }
199
+ ): ShellNotificationCenter {
200
+ return {
201
+ unreadCount: data.unreadCount,
202
+ items: data.notifications.map((notification) => ({
203
+ id: notification.id,
204
+ title: notification.title,
205
+ body: notification.body,
206
+ status: notification.status,
207
+ createdAt: notification.createdAt,
208
+ actionUrl: notification.actionUrl,
209
+ category: notification.type,
210
+ metadata: notification.metadata,
211
+ })),
212
+ onSelect: (item) => actions.open(item.id),
213
+ onMarkRead: (item) => actions.markRead({ notificationId: item.id }),
214
+ onMarkAllRead: actions.markAllRead,
215
+ };
216
+ }
217
+
218
+ void ListNotificationsOutputModel;
219
+ void MarkNotificationReadInputModel;
220
+ void notificationsSchemaContribution;
221
+ void renderNotificationTemplate;`,ot=`You are implementing a modern application shell from scratch.
148
222
 
149
223
  Goal:
150
- Build a reusable application shell for a React/Next.js web app and an Expo React Native app. The shell must provide a desktop sidebar, desktop topbar, command search, breadcrumbs, nested navigation, user/auth actions, and an in-page section navigator called PageOutline.
224
+ Build a reusable application shell for a React/Next.js web app and an Expo React Native app. The shell must provide a desktop sidebar, desktop topbar, command search, breadcrumbs, nested navigation, user/auth actions, in-app notifications, and an in-page section navigator called PageOutline.
151
225
 
152
226
  Use this architecture:
153
227
  - Keep route content independent from navigation chrome.
@@ -155,29 +229,37 @@ Use this architecture:
155
229
  - Create a command model with search input, grouped suggestions, quick actions, keyboard shortcut labels, empty state, and loading state.
156
230
  - Create a breadcrumb model for the topbar.
157
231
  - Create a PageOutline model for right-side in-page navigation with exactly three supported levels. It should render anchors, support active section state, and degrade gracefully when no sections exist.
232
+ - Create a ShellNotificationCenter model with render-ready items, unread count, loading and empty states, onSelect, onMarkRead, onMarkAllRead, and optional custom item rendering.
158
233
  - Expose the system from the design system or a dedicated shell module, not from a single app route.
159
234
 
235
+ Notification boundary:
236
+ - Use @contractspec/lib.contracts-spec/notifications as the canonical source for notification contracts, operation models, and feature metadata.
237
+ - Use @contractspec/lib.notification for reusable notification entities, schema contribution, channels, templates, and i18n helpers.
238
+ - Keep persistence, polling/subscriptions, delivery providers, and optimistic mutations in the host application or notification runtime layer.
239
+ - Pass only render-ready ShellNotificationCenter state into AppShell so the design system does not import or own notification runtime behavior.
240
+
160
241
  Desktop behavior:
161
242
  - Persistent left sidebar with app logo/title, command trigger, grouped navigation, nested submenus, and current user/auth/logout area.
162
243
  - Topbar with breadcrumbs and an optional command trigger.
244
+ - Topbar notification trigger with unread badge, loading/empty states, mark-read actions, and item selection.
163
245
  - Content area with optional right PageOutline.
164
246
  - Keep dimensions stable. Navigation labels must not resize layout on hover or active state.
165
247
 
166
248
  Mobile web behavior:
167
249
  - Use bottom navigation for the primary destinations.
168
- - Put deeper navigation, command search, auth actions, and secondary actions behind a menu or drawer.
250
+ - Put deeper navigation, command search, notifications, auth actions, and secondary actions behind a menu or drawer when the topbar cannot safely hold them.
169
251
  - Keep route content first and make the shell controls reachable without covering important content.
170
252
 
171
253
  Native behavior:
172
254
  - Add .native.tsx entrypoints for Expo/React Native.
173
- - Prefer bottom tabs for primary destinations and a menu/sheet for deeper navigation and account actions.
174
- - Keep the same typed navigation, command, breadcrumb, and PageOutline data contracts across web and native.
255
+ - Prefer bottom tabs for primary destinations and a menu/sheet for deeper navigation, notifications, and account actions.
256
+ - Keep the same typed navigation, command, breadcrumb, notification, and PageOutline data contracts across web and native.
175
257
 
176
258
  Implementation constraints:
177
259
  - Reuse the existing design-system primitives, tokens, icons, and accessibility patterns.
178
260
  - Do not hardcode app-specific routes in the shell component.
179
261
  - Do not introduce a new dependency unless the repo already uses it for dialogs, menus, icons, or navigation.
180
- - Include tests for navigation rendering, nested items, command filtering, breadcrumbs, PageOutline level handling, active section state, and mobile/native adaptation contracts.
262
+ - Include tests for navigation rendering, nested items, command filtering, breadcrumbs, notification unread badge/loading/empty/callback behavior, PageOutline level handling, active section state, and mobile/native adaptation contracts.
181
263
  - Update docs and exports so developers can import the shell from a stable public API.
182
264
 
183
265
  Deliverables:
@@ -185,15 +267,18 @@ Deliverables:
185
267
  - Web shell components.
186
268
  - Native shell components or adapters.
187
269
  - PageOutline component with three-level support.
270
+ - ShellNotifications or equivalent notification center component for web and native shell placement.
188
271
  - Usage example.
189
- - Focused tests and typecheck/build evidence.`,Me=`You are refactoring an existing application to use the shared application shell system.
272
+ - Focused tests and typecheck/build evidence.`,it=`You are refactoring an existing application to use the shared application shell system.
190
273
 
191
274
  Goal:
192
- Replace app-specific sidebar, topbar, breadcrumb, command palette, account menu, mobile navigation, and in-page table-of-contents code with the shared AppShell and PageOutline system.
275
+ Replace app-specific sidebar, topbar, breadcrumb, command palette, notification badge/inbox, account menu, mobile navigation, and in-page table-of-contents code with the shared AppShell, ShellNotifications, and PageOutline system.
193
276
 
194
277
  Start by auditing:
195
278
  - Current layout wrappers and route groups.
196
279
  - Sidebar, topbar, breadcrumb, command/search, auth menu, and mobile navigation implementations.
280
+ - Existing notification badges, inbox panels, toasts that represent durable in-app items, unread count queries, mark-read actions, and delivery modules.
281
+ - Imports from @contractspec/module.notifications that should migrate to @contractspec/lib.contracts-spec/notifications or @contractspec/lib.notification.
197
282
  - Any duplicated navigation arrays, route labels, icon maps, access-control checks, and active-state logic.
198
283
  - Any in-page summary/table-of-contents components that should become PageOutline data.
199
284
  - Web-only assumptions that would block Expo/React Native adaptation.
@@ -202,28 +287,31 @@ Refactor plan:
202
287
  1. Define a single typed navigation source for primary nav, grouped sidebar nav, nested children, labels, icons, badges, disabled states, and permissions.
203
288
  2. Map existing command/search behavior into grouped command actions with search text and quick actions.
204
289
  3. Map existing route metadata into breadcrumbs.
205
- 4. Convert page table-of-contents or section summary data into PageOutline items with a maximum of three levels.
206
- 5. Wrap app routes in AppShell while keeping page content components route-local.
207
- 6. Move primary mobile destinations into bottom navigation and deeper/account actions into a menu or drawer.
208
- 7. Add or preserve .native.tsx adapters when the app targets Expo.
290
+ 4. Move canonical notification contracts to @contractspec/lib.contracts-spec/notifications and reusable helpers to @contractspec/lib.notification; keep the old module shim only for compatibility imports that still need the legacy module id.
291
+ 5. Convert notification query results into ShellNotificationCenter items with unreadCount, loading, empty state, onSelect, onMarkRead, and onMarkAllRead callbacks.
292
+ 6. Convert page table-of-contents or section summary data into PageOutline items with a maximum of three levels.
293
+ 7. Wrap app routes in AppShell while keeping page content components route-local.
294
+ 8. Move primary mobile destinations into bottom navigation and deeper/account/notification actions into a menu or drawer.
295
+ 9. Add or preserve .native.tsx adapters when the app targets Expo.
209
296
 
210
297
  Preserve behavior:
211
298
  - Existing route URLs and access rules.
212
299
  - Existing keyboard shortcuts where they are public behavior.
213
300
  - Existing analytics or telemetry events on navigation and command actions.
301
+ - Existing notification delivery semantics, unread count semantics, deep links, and mark-read behavior.
214
302
  - Existing auth/logout behavior.
215
303
  - Existing responsive breakpoints unless there is a documented design-system breakpoint to adopt.
216
304
 
217
305
  Quality gates:
218
306
  - Add regression tests around current visible navigation before removing old shell code when coverage is missing.
219
- - Test active nav state, nested nav expansion, command search/action invocation, breadcrumbs, auth menu, mobile bottom navigation, and PageOutline anchor behavior.
307
+ - Test active nav state, nested nav expansion, command search/action invocation, breadcrumbs, notification unread badge/loading/empty/callback behavior, auth menu, mobile bottom navigation, and PageOutline anchor behavior.
220
308
  - Run lint, typecheck, and the app's relevant test/build command.
221
309
  - Remove dead app-specific shell components only after the shared shell path is verified.
222
310
 
223
311
  Output:
224
312
  - List old shell files removed or simplified.
225
313
  - List new shared shell integration points.
226
- - Include before/after route coverage and verification commands.`,We=[{title:"Sidebar",body:"Desktop owns brand, command entry, grouped navigation, nested items, and account actions in one persistent scanning area."},{title:"Topbar",body:"Breadcrumbs stay visible while the current route changes. The command trigger can live here when the sidebar is collapsed or hidden."},{title:"PageOutline",body:"The right-side in-page navigator replaces ad hoc tables of contents. It supports three levels of section anchors and active state."},{title:"Mobile adapters",body:"Small web and native surfaces move primary destinations to bottom navigation and reserve drawers or menus for deep navigation and account actions."}];import{CodeBlock as ye,InstallCommand as _t}from"@contractspec/lib.design-system";import{Box as ze,HStack as Vt,VStack as te}from"@contractspec/lib.design-system/layout";import{Code as Ne,H1 as qt,H2 as de,H3 as Ht,P as pe,Text as Ue}from"@contractspec/lib.design-system/typography";import Ge from"@contractspec/lib.ui-link";import{ChevronRight as Qt}from"lucide-react";import{jsx as p,jsxs as M}from"react/jsx-runtime";function Kt(){return M(te,{className:"space-y-8",children:[M(te,{className:"space-y-4",children:[p(qt,{className:"font-bold text-4xl",children:"Application shell"}),M(pe,{className:"text-lg text-muted-foreground",children:["A reusable navigation system for product apps: desktop sidebar, topbar breadcrumbs, command search, account actions, mobile adapters, and a Notion-style ",p(Ne,{children:"PageOutline"})," for page sections."]})]}),M(te,{className:"space-y-4",children:[p(de,{className:"font-bold text-2xl",children:"Installation"}),p(_t,{package:"@contractspec/lib.design-system"})]}),M(te,{className:"space-y-4",children:[p(de,{className:"font-bold text-2xl",children:"What It Standardizes"}),p(ze,{className:"grid gap-4 md:grid-cols-2",children:We.map((e)=>M(ze,{className:"card-subtle p-4",children:[p(Ht,{className:"font-semibold",children:e.title}),p(pe,{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))})]}),M(te,{className:"space-y-4",children:[p(de,{className:"font-bold text-2xl",children:"Import Surface"}),p(pe,{className:"text-muted-foreground",children:"The shell is exposed as a focused design-system subpath so apps can adopt navigation chrome without pulling unrelated documentation or marketing helpers."}),p(ye,{language:"tsx",filename:"app-shell-example.tsx",code:Ee})]}),M(te,{className:"space-y-4",children:[p(de,{className:"font-bold text-2xl",children:"AI Prompt: Build From Scratch"}),p(pe,{className:"text-muted-foreground",children:"Use this prompt when the app does not already have a shell or when the design-system package needs the reusable primitive first."}),p(ye,{language:"markdown",filename:"implement-application-shell.md",code:Be})]}),M(te,{className:"space-y-4",children:[p(de,{className:"font-bold text-2xl",children:"AI Prompt: Refactor An App"}),p(pe,{className:"text-muted-foreground",children:"Use this prompt when an app already has custom navigation chrome and needs to migrate without breaking route behavior."}),p(ye,{language:"markdown",filename:"refactor-to-application-shell.md",code:Me})]}),M(te,{className:"card-subtle space-y-3 p-6",children:[p(de,{className:"font-bold text-2xl",children:"Naming"}),M(pe,{className:"text-muted-foreground",children:["Use ",p(Ne,{children:"AppShell"})," for the whole navigation frame and"," ",p(Ne,{children:"PageOutline"})," for the in-page navigation helper. The latter is the product-app equivalent of a table of contents, but it is intentionally named for live page sections rather than static documentation."]})]}),M(Vt,{className:"flex flex-wrap items-center gap-3 pt-2",children:[p(Ge,{href:"/docs/libraries/cross-platform-ui",className:"btn-ghost",children:p(Ue,{children:"Cross-platform UI"})}),M(Ge,{href:"/docs/libraries/design-system",className:"btn-primary",children:[p(Ue,{children:"Design System"})," ",p(Qt,{size:16})]})]})]})}import{CodeBlock as Jt,InstallCommand as Zt}from"@contractspec/lib.design-system";import Fe from"@contractspec/lib.ui-link";import{ChevronRight as Xt}from"lucide-react";import{jsx as W,jsxs as ae}from"react/jsx-runtime";function Yt(){return ae("div",{className:"space-y-8",children:[ae("div",{className:"space-y-4",children:[W("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.content-gen"}),W("p",{className:"text-lg text-muted-foreground",children:"Feed a single ContentBrief and produce cohesive marketing assets without touching a CMS."})]}),ae("div",{className:"space-y-4",children:[W("h2",{className:"font-bold text-2xl",children:"Installation"}),W(Zt,{package:"@contractspec/lib.content-gen"})]}),ae("div",{className:"space-y-3",children:[W("h2",{className:"font-bold text-2xl",children:"One brief, many assets"}),W(Jt,{language:"typescript",code:`import {
314
+ - Include before/after route coverage and verification commands.`,rt=[{title:"Contracts stay canonical",body:"Use @contractspec/lib.contracts-spec/notifications for operation models, feature metadata, and contract-level compatibility."},{title:"Runtime helpers stay reusable",body:"Use @contractspec/lib.notification for schema contribution, channel adapters, templates, and i18n without importing the deprecated module shim in new code."},{title:"Apps own live state",body:"Fetch, subscribe, persist, mutate, and reconcile notification state in the host app or runtime layer where auth and tenancy are known."},{title:"Shell receives view state",body:"Pass AppShell a ShellNotificationCenter with render-ready items, counts, loading state, and callbacks; the design system only renders affordances."}],nt=[{title:"Sidebar",body:"Desktop owns brand, command entry, grouped navigation, nested items, and account actions in one persistent scanning area."},{title:"Topbar",body:"Breadcrumbs stay visible while the current route changes. Command search and notification affordances can live here when the sidebar is collapsed or hidden."},{title:"PageOutline",body:"The right-side in-page navigator replaces ad hoc tables of contents. It supports three levels of section anchors and active state."},{title:"Notifications",body:"The shell renders unread badges, item lists, loading/empty states, mark-read actions, and deep-link selection from host-owned notification state."},{title:"Mobile adapters",body:"Small web and native surfaces move primary destinations to bottom navigation and reserve drawers or menus for deep navigation, notifications, and account actions."}];import{CodeBlock as De,InstallCommand as va}from"@contractspec/lib.design-system";import{Box as Me,HStack as ya,VStack as ae}from"@contractspec/lib.design-system/layout";import{Code as pe,H1 as Na,H2 as ve,H3 as ct,P as me,Text as st}from"@contractspec/lib.design-system/typography";import lt from"@contractspec/lib.ui-link";import{ChevronRight as wa}from"lucide-react";import{jsx as c,jsxs as L}from"react/jsx-runtime";function ka(){return L(ae,{className:"space-y-8",children:[L(ae,{className:"space-y-4",children:[c(Na,{className:"font-bold text-4xl",children:"Application shell"}),L(me,{className:"text-lg text-muted-foreground",children:["A reusable navigation system for product apps: desktop sidebar, topbar breadcrumbs, command search, account actions, mobile adapters, and a Notion-style ",c(pe,{children:"PageOutline"})," for page sections, with prop-driven in-app notifications for web and native shells."]})]}),L(ae,{className:"space-y-4",children:[c(ve,{className:"font-bold text-2xl",children:"Installation"}),c(va,{package:"@contractspec/lib.design-system"})]}),L(ae,{className:"space-y-4",children:[c(ve,{className:"font-bold text-2xl",children:"What It Standardizes"}),c(Me,{className:"grid gap-4 md:grid-cols-2",children:nt.map((a)=>L(Me,{className:"card-subtle p-4",children:[c(ct,{className:"font-semibold",children:a.title}),c(me,{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]},a.title))})]}),L(ae,{className:"space-y-4",children:[c(ve,{className:"font-bold text-2xl",children:"Import Surface"}),c(me,{className:"text-muted-foreground",children:"The shell is exposed as a focused design-system subpath so apps can adopt navigation chrome without pulling unrelated documentation or marketing helpers."}),c(De,{language:"tsx",filename:"app-shell-example.tsx",code:tt})]}),L(ae,{className:"space-y-4",children:[c(ve,{className:"font-bold text-2xl",children:"Notification Center Boundary"}),L(me,{className:"text-muted-foreground",children:["Notifications are part of the shell experience, but the design system only renders the affordance. Contracts, runtime helpers, persistence, delivery, auth, and subscriptions stay outside the shell and feed a render-ready ",c(pe,{children:"ShellNotificationCenter"})," into"," ",c(pe,{children:"AppShell"}),"."]}),c(Me,{className:"grid gap-4 md:grid-cols-2",children:rt.map((a)=>L(Me,{className:"card-subtle p-4",children:[c(ct,{className:"font-semibold",children:a.title}),c(me,{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]},a.title))}),c(De,{language:"tsx",filename:"notification-center-boundary.ts",code:at})]}),L(ae,{className:"space-y-4",children:[c(ve,{className:"font-bold text-2xl",children:"AI Prompt: Build From Scratch"}),c(me,{className:"text-muted-foreground",children:"Use this prompt when the app does not already have a shell, command surface, page outline, or in-app notification center."}),c(De,{language:"markdown",filename:"implement-application-shell.md",code:ot})]}),L(ae,{className:"space-y-4",children:[c(ve,{className:"font-bold text-2xl",children:"AI Prompt: Refactor An App"}),c(me,{className:"text-muted-foreground",children:"Use this prompt when an app already has custom navigation chrome and notification UI that need to migrate without breaking route behavior, unread counts, or delivery semantics."}),c(De,{language:"markdown",filename:"refactor-to-application-shell.md",code:it})]}),L(ae,{className:"card-subtle space-y-3 p-6",children:[c(ve,{className:"font-bold text-2xl",children:"Naming"}),L(me,{className:"text-muted-foreground",children:["Use ",c(pe,{children:"AppShell"})," for the whole navigation frame and"," ",c(pe,{children:"PageOutline"})," for the in-page navigation helper. The latter is the product-app equivalent of a table of contents, but it is intentionally named for live page sections rather than static documentation. Use ",c(pe,{children:"ShellNotifications"})," for the notification affordance when it is rendered directly, or pass the same data contract through ",c(pe,{children:"AppShell"})," with the"," ",c(pe,{children:"notifications"})," prop."]})]}),L(ya,{className:"flex flex-wrap items-center gap-3 pt-2",children:[c(lt,{href:"/docs/libraries/cross-platform-ui",className:"btn-ghost",children:c(st,{children:"Cross-platform UI"})}),L(lt,{href:"/docs/libraries/design-system",className:"btn-primary",children:[c(st,{children:"Design System"})," ",c(wa,{size:16})]})]})]})}import{CodeBlock as Sa,InstallCommand as Ra}from"@contractspec/lib.design-system";import dt from"@contractspec/lib.ui-link";import{ChevronRight as Ca}from"lucide-react";import{jsx as G,jsxs as ue}from"react/jsx-runtime";function Ta(){return ue("div",{className:"space-y-8",children:[ue("div",{className:"space-y-4",children:[G("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.content-gen"}),G("p",{className:"text-lg text-muted-foreground",children:"Feed a single ContentBrief and produce cohesive marketing assets without touching a CMS."})]}),ue("div",{className:"space-y-4",children:[G("h2",{className:"font-bold text-2xl",children:"Installation"}),G(Ra,{package:"@contractspec/lib.content-gen"})]}),ue("div",{className:"space-y-3",children:[G("h2",{className:"font-bold text-2xl",children:"One brief, many assets"}),G(Sa,{language:"typescript",code:`import {
227
315
  BlogGenerator,
228
316
  LandingPageGenerator,
229
317
  EmailCampaignGenerator,
@@ -243,7 +331,7 @@ const blog = await new BlogGenerator().generate(brief);
243
331
  const landing = await new LandingPageGenerator().generate(brief);
244
332
  const email = await new EmailCampaignGenerator().generate({ brief, variant: 'announcement' });
245
333
  const social = await new SocialPostGenerator().generate(brief);
246
- const seo = new SeoOptimizer().optimize(brief);`})]}),ae("div",{className:"space-y-3",children:[W("h2",{className:"font-bold text-2xl",children:"When to use"}),ae("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[W("li",{children:"Ship landing page refreshes whenever specs change."}),W("li",{children:"Automate release emails + nurture sequences per vertical."}),W("li",{children:"Create social snippets that stay on-message with the same brief."}),W("li",{children:"Generate SEO metadata + Schema.org markup alongside content."})]})]}),ae("div",{className:"flex items-center gap-4 pt-4",children:[W(Fe,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ae(Fe,{href:"/docs/libraries/support-bot",className:"btn-primary",children:["Next: Support Bot ",W(Xt,{size:16})]})]})]})}import{CodeBlock as $t,InstallCommand as xt}from"@contractspec/lib.design-system";import we from"@contractspec/lib.ui-link";import{ChevronRight as jt}from"lucide-react";import{jsx as r,jsxs as n}from"react/jsx-runtime";var ea=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
334
+ const seo = new SeoOptimizer().optimize(brief);`})]}),ue("div",{className:"space-y-3",children:[G("h2",{className:"font-bold text-2xl",children:"When to use"}),ue("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[G("li",{children:"Ship landing page refreshes whenever specs change."}),G("li",{children:"Automate release emails + nurture sequences per vertical."}),G("li",{children:"Create social snippets that stay on-message with the same brief."}),G("li",{children:"Generate SEO metadata + Schema.org markup alongside content."})]})]}),ue("div",{className:"flex items-center gap-4 pt-4",children:[G(dt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ue(dt,{href:"/docs/libraries/support-bot",className:"btn-primary",children:["Next: Support Bot ",G(Ca,{size:16})]})]})]})}import{CodeBlock as Aa,InstallCommand as La}from"@contractspec/lib.design-system";import _e from"@contractspec/lib.ui-link";import{ChevronRight as Ia}from"lucide-react";import{jsx as s,jsxs as l}from"react/jsx-runtime";var Pa=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
247
335
  import { ListDataGridShowcaseRowsQuery } from '@contractspec/example.data-grid-showcase/contracts/data-grid-showcase.operation';
248
336
 
249
337
  export const DataGridShowcaseDataView = defineDataView({
@@ -290,7 +378,7 @@ export const DataGridShowcaseDataView = defineDataView({
290
378
  { key: 'notes', label: 'Notes', dataPath: 'notes' },
291
379
  ],
292
380
  },
293
- });`;function ta(){return n("div",{className:"space-y-8",children:[n("div",{className:"space-y-4",children:[r("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.contracts-spec"}),r("p",{className:"text-lg text-muted-foreground",children:"The core library for defining what your application can do. Unified specifications for Operations, Events, Presentations, and Features."})]}),n("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Installation"}),r(xt,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.schema"]})]}),n("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"What lives where"}),n("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[n("li",{children:[r("strong",{children:"@contractspec/lib.contracts-spec"})," (root): The core contracts definitions (OperationSpec, PresentationSpec, Registry)."]}),n("li",{children:[r("strong",{children:"@contractspec/lib.contracts-runtime-client-react"}),": Browser-safe helpers (React renderers, client SDK). Import this for web/React Native."]}),n("li",{children:[r("strong",{children:"@contractspec/lib.contracts-runtime-server-rest"}),": HTTP/MCP adapters, registries, integrations (Node-only)."]}),n("li",{children:[r("strong",{children:"@contractspec/lib.schema"}),": Schema dictionary (SchemaModel, FieldType) for I/O definitions."]})]})]}),n("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Data table contract example"}),n("p",{className:"text-muted-foreground",children:["The canonical account-grid example starts here in"," ",r("code",{children:"@contractspec/lib.contracts-spec"}),". The contract declares table execution mode, selection, pinning, resizing, row expansion, and initial state before any renderer is chosen."]}),r($t,{language:"typescript",code:ea}),n("p",{className:"text-muted-foreground text-sm",children:["See the live version in"," ",r(we,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"/docs/examples/data-grid-showcase"}),"."]})]}),n("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Core Concepts"}),n("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[n("li",{children:[r("strong",{children:"OperationSpec"}),": Immutable description of an operation (Command or Query). Defines I/O, policy, and metadata."]}),n("li",{children:[r("strong",{children:"OperationSpecRegistry"}),": Registry of specs + handlers. Use ",r("code",{className:"font-mono text-xs",children:"installOp"})," ","to attach a handler."]}),n("li",{children:[r("strong",{children:"CapabilitySpec"}),": Canonical capability declaration (requires/provides)."]}),n("li",{children:[r("strong",{children:"PolicySpec"}),": Declarative policy rules (ABAC/ReBAC, rate limits)."]}),n("li",{children:[r("strong",{children:"TelemetrySpec"}),": Analytics definitions and privacy levels."]}),n("li",{children:[r("strong",{children:"PresentationSpec (V2)"}),": Describes how data is rendered (Web Components, Markdown, Data)."]}),n("li",{children:[r("strong",{children:"DataViewSpec"}),": Declarative list, table, grid, and detail contracts that the table showcase uses as its canonical account-grid example."]})]})]}),n("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Lifecycle"}),n("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[n("li",{children:[r("strong",{children:"Define"})," the spec (I/O via SchemaModel or Zod)."]}),n("li",{children:[r("strong",{children:"Register"})," it:"," ",r("code",{className:"font-mono text-xs",children:"installOp(registry, spec, handler)"}),"."]}),n("li",{children:[r("strong",{children:"Expose"})," it via an adapter (REST, GraphQL, MCP)."]}),n("li",{children:[r("strong",{children:"Validate"})," at runtime automatically."]})]})]}),n("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Adapters"}),n("ul",{className:"space-y-2 text-muted-foreground",children:[n("li",{children:[r("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/rest-next-app"}),": Next.js App Router adapter"]}),n("li",{children:[r("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/provider-mcp"}),": Model Context Protocol (MCP) for AI agents"]}),n("li",{children:[r("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/graphql-pothos"}),": GraphQL schema generator"]})]})]}),n("div",{className:"flex items-center gap-4 pt-4",children:[n(we,{href:"/docs/libraries/schema",className:"btn-primary",children:["Next: Schema ",r(jt,{size:16})]}),r(we,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Core Concepts"})]})]})}import{CodeBlock as _e,InstallCommand as aa}from"@contractspec/lib.design-system";import Ve from"@contractspec/lib.ui-link";import{ChevronRight as oa}from"lucide-react";import{jsx as _,jsxs as K}from"react/jsx-runtime";function ia(){return K("div",{className:"space-y-8",children:[K("div",{className:"space-y-4",children:[_("h1",{className:"font-bold text-4xl",children:"Cost Tracking Library"}),K("p",{className:"text-lg text-muted-foreground",children:[_("code",{children:"@contractspec/lib.cost-tracking"})," transforms raw telemetry into dollars: DB/API/compute costs per operation, budget alerts per tenant, and actionable optimization tips."]})]}),K("div",{className:"space-y-4",children:[_("h2",{className:"font-bold text-2xl",children:"Installation"}),_(aa,{package:"@contractspec/lib.cost-tracking"})]}),K("div",{className:"space-y-4",children:[_("h2",{className:"font-bold text-2xl",children:"Record Samples"}),_(_e,{language:"typescript",code:`const tracker = new CostTracker();
381
+ });`;function Oa(){return l("div",{className:"space-y-8",children:[l("div",{className:"space-y-4",children:[s("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.contracts-spec"}),s("p",{className:"text-lg text-muted-foreground",children:"The core library for defining what your application can do. Unified specifications for Operations, Events, Presentations, and Features."})]}),l("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Installation"}),s(La,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.schema"]})]}),l("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"What lives where"}),l("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[l("li",{children:[s("strong",{children:"@contractspec/lib.contracts-spec"})," (root): The core contracts definitions (OperationSpec, PresentationSpec, Registry)."]}),l("li",{children:[s("strong",{children:"@contractspec/lib.contracts-runtime-client-react"}),": Browser-safe helpers (React renderers, client SDK). Import this for web/React Native."]}),l("li",{children:[s("strong",{children:"@contractspec/lib.contracts-runtime-server-rest"}),": HTTP/MCP adapters, registries, integrations (Node-only)."]}),l("li",{children:[s("strong",{children:"@contractspec/lib.schema"}),": Schema dictionary (SchemaModel, FieldType) for I/O definitions."]})]})]}),l("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Data table contract example"}),l("p",{className:"text-muted-foreground",children:["The canonical account-grid example starts here in"," ",s("code",{children:"@contractspec/lib.contracts-spec"}),". The contract declares table execution mode, selection, pinning, resizing, row expansion, and initial state before any renderer is chosen."]}),s(Aa,{language:"typescript",code:Pa}),l("p",{className:"text-muted-foreground text-sm",children:["See the live version in"," ",s(_e,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"/docs/examples/data-grid-showcase"}),"."]})]}),l("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Core Concepts"}),l("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[l("li",{children:[s("strong",{children:"OperationSpec"}),": Immutable description of an operation (Command or Query). Defines I/O, policy, and metadata."]}),l("li",{children:[s("strong",{children:"OperationSpecRegistry"}),": Registry of specs + handlers. Use ",s("code",{className:"font-mono text-xs",children:"installOp"})," ","to attach a handler."]}),l("li",{children:[s("strong",{children:"CapabilitySpec"}),": Canonical capability declaration (requires/provides)."]}),l("li",{children:[s("strong",{children:"PolicySpec"}),": Declarative policy rules (ABAC/ReBAC, rate limits)."]}),l("li",{children:[s("strong",{children:"TelemetrySpec"}),": Analytics definitions and privacy levels."]}),l("li",{children:[s("strong",{children:"PresentationSpec (V2)"}),": Describes how data is rendered (Web Components, Markdown, Data)."]}),l("li",{children:[s("strong",{children:"DataViewSpec"}),": Declarative list, table, grid, and detail contracts that the table showcase uses as its canonical account-grid example."]})]})]}),l("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Lifecycle"}),l("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[l("li",{children:[s("strong",{children:"Define"})," the spec (I/O via SchemaModel or Zod)."]}),l("li",{children:[s("strong",{children:"Register"})," it:"," ",s("code",{className:"font-mono text-xs",children:"installOp(registry, spec, handler)"}),"."]}),l("li",{children:[s("strong",{children:"Expose"})," it via an adapter (REST, GraphQL, MCP)."]}),l("li",{children:[s("strong",{children:"Validate"})," at runtime automatically."]})]})]}),l("div",{className:"space-y-4",children:[s("h2",{className:"font-bold text-2xl",children:"Adapters"}),l("ul",{className:"space-y-2 text-muted-foreground",children:[l("li",{children:[s("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/rest-next-app"}),": Next.js App Router adapter"]}),l("li",{children:[s("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/provider-mcp"}),": Model Context Protocol (MCP) for AI agents"]}),l("li",{children:[s("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/graphql-pothos"}),": GraphQL schema generator"]})]})]}),l("div",{className:"flex items-center gap-4 pt-4",children:[l(_e,{href:"/docs/libraries/schema",className:"btn-primary",children:["Next: Schema ",s(Ia,{size:16})]}),s(_e,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Core Concepts"})]})]})}import{CodeBlock as pt,InstallCommand as Da}from"@contractspec/lib.design-system";import mt from"@contractspec/lib.ui-link";import{ChevronRight as Ma}from"lucide-react";import{jsx as Q,jsxs as $}from"react/jsx-runtime";function Ea(){return $("div",{className:"space-y-8",children:[$("div",{className:"space-y-4",children:[Q("h1",{className:"font-bold text-4xl",children:"Cost Tracking Library"}),$("p",{className:"text-lg text-muted-foreground",children:[Q("code",{children:"@contractspec/lib.cost-tracking"})," transforms raw telemetry into dollars: DB/API/compute costs per operation, budget alerts per tenant, and actionable optimization tips."]})]}),$("div",{className:"space-y-4",children:[Q("h2",{className:"font-bold text-2xl",children:"Installation"}),Q(Da,{package:"@contractspec/lib.cost-tracking"})]}),$("div",{className:"space-y-4",children:[Q("h2",{className:"font-bold text-2xl",children:"Record Samples"}),Q(pt,{language:"typescript",code:`const tracker = new CostTracker();
294
382
  tracker.recordSample({
295
383
  operation: 'orders.list',
296
384
  tenantId: 'acme',
@@ -298,12 +386,12 @@ tracker.recordSample({
298
386
  dbWrites: 4,
299
387
  computeMs: 180,
300
388
  externalCalls: [{ provider: 'stripe', cost: 0.02 }],
301
- });`})]}),K("div",{className:"space-y-4",children:[_("h2",{className:"font-bold text-2xl",children:"Budget Alerts"}),_(_e,{language:"typescript",code:`const budgets = new BudgetAlertManager({
389
+ });`})]}),$("div",{className:"space-y-4",children:[Q("h2",{className:"font-bold text-2xl",children:"Budget Alerts"}),Q(pt,{language:"typescript",code:`const budgets = new BudgetAlertManager({
302
390
  budgets: [{ tenantId: 'acme', monthlyLimit: 150 }],
303
391
  onAlert: ({ tenantId, total }) => notifyFinance(tenantId, total),
304
392
  });
305
393
 
306
- tracker.getTotals({ tenantId: 'acme' }).forEach((summary) => budgets.track(summary));`})]}),K("div",{className:"space-y-4",children:[_("h2",{className:"font-bold text-2xl",children:"Optimization Suggestions"}),K("p",{className:"text-muted-foreground text-sm",children:["Feed summaries into ",_("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."]})]}),K("div",{className:"flex items-center gap-4 pt-4",children:[_(Ve,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),K(Ve,{href:"/docs/libraries/slo",className:"btn-primary",children:["Next: SLO ",_(oa,{size:16})]})]})]})}var qe=[{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."}],He=[{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."}],Qe=[{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."}],Ke=[{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."}],Je=[{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"]}],Ze=["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."],Xe=["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 / .native.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."],Ye="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.",$e=`import { withPresentationTurbopackAliases } from '@contractspec/lib.presentation-runtime-core';
394
+ tracker.getTotals({ tenantId: 'acme' }).forEach((summary) => budgets.track(summary));`})]}),$("div",{className:"space-y-4",children:[Q("h2",{className:"font-bold text-2xl",children:"Optimization Suggestions"}),$("p",{className:"text-muted-foreground text-sm",children:["Feed summaries into ",Q("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."]})]}),$("div",{className:"flex items-center gap-4 pt-4",children:[Q(mt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),$(mt,{href:"/docs/libraries/slo",className:"btn-primary",children:["Next: SLO ",Q(Ma,{size:16})]})]})]})}var ut=[{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."}],ht=[{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."}],gt=[{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."}],ft=[{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."}],bt=[{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"]}],vt=["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."],yt=["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 / .native.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."],Nt="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.",wt=`import { withPresentationTurbopackAliases } from '@contractspec/lib.presentation-runtime-core';
307
395
 
308
396
  /** @type {import('next').NextConfig} */
309
397
  const nextConfig = withPresentationTurbopackAliases({
@@ -314,14 +402,14 @@ const nextConfig = withPresentationTurbopackAliases({
314
402
  },
315
403
  });
316
404
 
317
- export default nextConfig;`,xe=`import { withPresentationWebpackAliases } from '@contractspec/lib.presentation-runtime-core';
405
+ export default nextConfig;`,kt=`import { withPresentationWebpackAliases } from '@contractspec/lib.presentation-runtime-core';
318
406
 
319
407
  /** @type {import('next').NextConfig} */
320
408
  const nextConfig = {
321
409
  webpack: (config) => withPresentationWebpackAliases(config),
322
410
  };
323
411
 
324
- export default nextConfig;`,je=`const { getDefaultConfig } = require('expo/metro-config');
412
+ export default nextConfig;`,St=`const { getDefaultConfig } = require('expo/metro-config');
325
413
  const {
326
414
  withPresentationMetroAliases,
327
415
  } = require('@contractspec/lib.presentation-runtime-core');
@@ -329,8 +417,8 @@ const {
329
417
  const projectRoot = __dirname;
330
418
  const config = getDefaultConfig(projectRoot);
331
419
 
332
- module.exports = withPresentationMetroAliases(config);`,et=["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(`
333
- `),tt=`import { Box, HStack, VStack } from '@contractspec/lib.ui-kit-web/ui/stack';
420
+ module.exports = withPresentationMetroAliases(config);`,Rt=["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(`
421
+ `),Ct=`import { Box, HStack, VStack } from '@contractspec/lib.ui-kit-web/ui/stack';
334
422
 
335
423
  export function AccountSummaryHeader() {
336
424
  return (
@@ -351,7 +439,7 @@ export function AccountSummaryHeader() {
351
439
  // @contractspec/lib.ui-kit/ui/stack
352
440
  //
353
441
  // On web-only pages, VStack / HStack / Box also support:
354
- // <VStack as="section">...</VStack>`,at=`import { DataTable as DesignSystemTable } from '@contractspec/lib.design-system';
442
+ // <VStack as="section">...</VStack>`,Tt=`import { DataTable as DesignSystemTable } from '@contractspec/lib.design-system';
355
443
  import { DataTable as NativeTable } from '@contractspec/lib.ui-kit/ui/data-table';
356
444
  import { DataTable as WebTable } from '@contractspec/lib.ui-kit-web/ui/data-table';
357
445
  import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
@@ -387,7 +475,7 @@ export function ProductAccounts({ controller }) {
387
475
  }
388
476
 
389
477
  // If the table is spec-driven instead of hand-authored,
390
- // swap useContractTable for useDataViewTable.`,ot="# 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` / `.native.tsx` pairs as the standard design-system compatibility boundary.",it="# 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` / `.native.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 oe}from"@contractspec/lib.design-system";import ue from"@contractspec/lib.ui-link";import{ChevronRight as ra}from"lucide-react";import{jsx as t,jsxs as f}from"react/jsx-runtime";function na(){return f("div",{className:"space-y-8",children:[f("div",{className:"space-y-4",children:[t("h1",{className:"font-bold text-4xl",children:"Cross-platform UI"}),t("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."})]}),f("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"What cross-platform means here"}),t("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."}),t("div",{className:"grid gap-4 md:grid-cols-2",children:qe.map((e)=>f("div",{className:"rounded-[20px] border border-border/70 p-4",children:[t("h3",{className:"font-semibold text-base",children:e.title}),t("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),t("div",{className:"grid gap-4 md:grid-cols-3",children:He.map((e)=>f("div",{className:"card-subtle p-4",children:[t("h3",{className:"font-semibold",children:e.title}),t("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),f("div",{className:"grid gap-4 lg:grid-cols-[1.1fr_0.9fr]",children:[t("div",{className:"grid gap-4 md:grid-cols-2",children:Ke.map((e)=>f("div",{className:"card-subtle p-4",children:[t("h3",{className:"font-semibold",children:e.title}),t("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),t(oe,{language:"typescript",filename:"design-system-platform.ts",code:et})]})]}),f("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Resolver and alias setup"}),f("p",{className:"text-muted-foreground",children:["Teach the bundler what “web” and “native” mean before you try to share component code. These helpers are public from the root",t("code",{children:" @contractspec/lib.presentation-runtime-core "}),"entrypoint."]}),t("div",{className:"grid gap-4 md:grid-cols-2",children:Qe.map((e)=>f("div",{className:"card-subtle p-4",children:[t("h3",{className:"font-semibold",children:e.title}),t("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:e.body})]},e.title))}),f("div",{className:"grid gap-4 xl:grid-cols-3",children:[t(oe,{language:"typescript",filename:"next.config.mjs",code:$e}),t(oe,{language:"typescript",filename:"next.config.mjs",code:xe}),t(oe,{language:"javascript",filename:"metro.config.js",code:je})]})]}),f("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"How the remapping works"}),t("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."}),t("div",{className:"grid gap-4 xl:grid-cols-3",children:Je.map((e)=>f("div",{className:"card-subtle p-4",children:[t("h3",{className:"font-semibold",children:e.title}),t("ul",{className:"mt-2 space-y-2 text-muted-foreground text-sm leading-7",children:e.items.map((S)=>t("li",{children:S},S))})]},e.title))})]}),f("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Layout primitives"}),f("p",{className:"text-muted-foreground",children:[t("code",{children:"VStack"}),", ",t("code",{children:"HStack"}),", and ",t("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."]}),t("div",{className:"grid gap-4 md:grid-cols-2",children:Ze.map((e)=>t("div",{className:"card-subtle p-4 text-muted-foreground text-sm leading-7",children:e},e))}),t(oe,{language:"tsx",filename:"stack-layout.tsx",code:tt})]}),f("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Rendering patterns"}),t("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."}),t(oe,{language:"tsx",filename:"cross-platform-rendering.tsx",code:at}),f("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"," ",t("code",{children:"DataViewRenderer"}),", ",t("code",{children:"ListTablePage"}),", and"," ",t("code",{children:"DataTable"}),". The web and mobile files stay separate inside the package while your app imports one design-system boundary."]})]}),f("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Gotchas and boundaries"}),t("ul",{className:"space-y-2 text-muted-foreground leading-7",children:Xe.map((e)=>t("li",{children:e},e))})]}),f("div",{className:"space-y-4",children:[t("h2",{className:"font-bold text-2xl",children:"Customer markdown kit"}),t("p",{className:"text-muted-foreground",children:Ye}),f("div",{className:"grid gap-4 xl:grid-cols-2",children:[t(oe,{language:"markdown",filename:"cross-surface-policy.md",code:ot}),t(oe,{language:"markdown",filename:"cross-surface-checklist.md",code:it})]})]}),f("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[t(ue,{href:"/docs/libraries/runtime",className:"btn-ghost",children:"Runtime libraries"}),t(ue,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"UI Kit"}),t(ue,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"UI Kit Web"}),f(ue,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Design System ",t(ra,{size:16})]})]})]})}import{CodeBlock as ca}from"@contractspec/lib.design-system";import rt from"@contractspec/lib.ui-link";import{ChevronRight as sa}from"lucide-react";import{jsx as w,jsxs as k}from"react/jsx-runtime";function la(){return k("div",{className:"space-y-8",children:[k("div",{className:"space-y-4",children:[w("h1",{className:"font-bold text-4xl",children:"Data & Backend"}),w("p",{className:"text-muted-foreground",children:"A collection of robust, platform-agnostic libraries for building the backend infrastructure of your LSSM applications."})]}),k("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Libraries"}),k("div",{className:"space-y-6",children:[k("div",{className:"card-subtle p-6",children:[w("h3",{className:"font-bold text-lg",children:"@contractspec/app.cli-database"}),k("p",{className:"mt-2 text-muted-foreground text-sm",children:[w("strong",{children:"Prisma Wrapper & CLI"}),". Provides a unified way to manage database schemas, migrations, and clients. Includes seeders and factory patterns for testing."]})]}),k("div",{className:"card-subtle p-6",children:[w("h3",{className:"font-bold text-lg",children:"@contractspec/lib.bus"}),k("p",{className:"mt-2 text-muted-foreground text-sm",children:[w("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)."]})]}),k("div",{className:"card-subtle p-6",children:[w("h3",{className:"font-bold text-lg",children:"@contractspec/lib.logger"}),k("p",{className:"mt-2 text-muted-foreground text-sm",children:[w("strong",{children:"High-Performance Logging"}),". Optimized for Bun and structured JSON output. Includes plugins for ElysiaJS to log HTTP requests automatically."]})]}),k("div",{className:"card-subtle p-6",children:[w("h3",{className:"font-bold text-lg",children:"@contractspec/lib.error"}),k("p",{className:"mt-2 text-muted-foreground text-sm",children:[w("strong",{children:"Standardized Errors"}),". Use `AppError` with standard codes (NOT_FOUND, UNAUTHORIZED) to ensure consistent HTTP responses and error handling across services."]})]}),k("div",{className:"card-subtle p-6",children:[w("h3",{className:"font-bold text-lg",children:"@contractspec/lib.exporter"}),k("p",{className:"mt-2 text-muted-foreground text-sm",children:[w("strong",{children:"Data Export"}),". Generate CSV and XML files from your data. Platform-agnostic and streaming-friendly."]})]})]})]}),k("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Example: Unified Backend Flow"}),w(ca,{language:"typescript",code:`import { logger } from '@contractspec/lib.logger';
478
+ // swap useContractTable for useDataViewTable.`,At="# 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` / `.native.tsx` pairs as the standard design-system compatibility boundary.",Lt="# 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` / `.native.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 he}from"@contractspec/lib.design-system";import Ee from"@contractspec/lib.ui-link";import{ChevronRight as Ba}from"lucide-react";import{jsx as i,jsxs as N}from"react/jsx-runtime";function Ua(){return N("div",{className:"space-y-8",children:[N("div",{className:"space-y-4",children:[i("h1",{className:"font-bold text-4xl",children:"Cross-platform UI"}),i("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."})]}),N("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"What cross-platform means here"}),i("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."}),i("div",{className:"grid gap-4 md:grid-cols-2",children:ut.map((a)=>N("div",{className:"rounded-[20px] border border-border/70 p-4",children:[i("h3",{className:"font-semibold text-base",children:a.title}),i("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]},a.title))}),i("div",{className:"grid gap-4 md:grid-cols-3",children:ht.map((a)=>N("div",{className:"card-subtle p-4",children:[i("h3",{className:"font-semibold",children:a.title}),i("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]},a.title))}),N("div",{className:"grid gap-4 lg:grid-cols-[1.1fr_0.9fr]",children:[i("div",{className:"grid gap-4 md:grid-cols-2",children:ft.map((a)=>N("div",{className:"card-subtle p-4",children:[i("h3",{className:"font-semibold",children:a.title}),i("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]},a.title))}),i(he,{language:"typescript",filename:"design-system-platform.ts",code:Rt})]})]}),N("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Resolver and alias setup"}),N("p",{className:"text-muted-foreground",children:["Teach the bundler what “web” and “native” mean before you try to share component code. These helpers are public from the root",i("code",{children:" @contractspec/lib.presentation-runtime-core "}),"entrypoint."]}),i("div",{className:"grid gap-4 md:grid-cols-2",children:gt.map((a)=>N("div",{className:"card-subtle p-4",children:[i("h3",{className:"font-semibold",children:a.title}),i("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.body})]},a.title))}),N("div",{className:"grid gap-4 xl:grid-cols-3",children:[i(he,{language:"typescript",filename:"next.config.mjs",code:wt}),i(he,{language:"typescript",filename:"next.config.mjs",code:kt}),i(he,{language:"javascript",filename:"metro.config.js",code:St})]})]}),N("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"How the remapping works"}),i("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."}),i("div",{className:"grid gap-4 xl:grid-cols-3",children:bt.map((a)=>N("div",{className:"card-subtle p-4",children:[i("h3",{className:"font-semibold",children:a.title}),i("ul",{className:"mt-2 space-y-2 text-muted-foreground text-sm leading-7",children:a.items.map((A)=>i("li",{children:A},A))})]},a.title))})]}),N("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Layout primitives"}),N("p",{className:"text-muted-foreground",children:[i("code",{children:"VStack"}),", ",i("code",{children:"HStack"}),", and ",i("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."]}),i("div",{className:"grid gap-4 md:grid-cols-2",children:vt.map((a)=>i("div",{className:"card-subtle p-4 text-muted-foreground text-sm leading-7",children:a},a))}),i(he,{language:"tsx",filename:"stack-layout.tsx",code:Ct})]}),N("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Rendering patterns"}),i("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."}),i(he,{language:"tsx",filename:"cross-platform-rendering.tsx",code:Tt}),N("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"," ",i("code",{children:"DataViewRenderer"}),", ",i("code",{children:"ListTablePage"}),", and"," ",i("code",{children:"DataTable"}),". The web and mobile files stay separate inside the package while your app imports one design-system boundary."]})]}),N("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Gotchas and boundaries"}),i("ul",{className:"space-y-2 text-muted-foreground leading-7",children:yt.map((a)=>i("li",{children:a},a))})]}),N("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Customer markdown kit"}),i("p",{className:"text-muted-foreground",children:Nt}),N("div",{className:"grid gap-4 xl:grid-cols-2",children:[i(he,{language:"markdown",filename:"cross-surface-policy.md",code:At}),i(he,{language:"markdown",filename:"cross-surface-checklist.md",code:Lt})]})]}),N("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[i(Ee,{href:"/docs/libraries/runtime",className:"btn-ghost",children:"Runtime libraries"}),i(Ee,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"UI Kit"}),i(Ee,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"UI Kit Web"}),N(Ee,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Design System ",i(Ba,{size:16})]})]})]})}import{CodeBlock as Wa}from"@contractspec/lib.design-system";import It from"@contractspec/lib.ui-link";import{ChevronRight as za}from"lucide-react";import{jsx as R,jsxs as C}from"react/jsx-runtime";function Ga(){return C("div",{className:"space-y-8",children:[C("div",{className:"space-y-4",children:[R("h1",{className:"font-bold text-4xl",children:"Data & Backend"}),R("p",{className:"text-muted-foreground",children:"A collection of robust, platform-agnostic libraries for building the backend infrastructure of your LSSM applications."})]}),C("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Libraries"}),C("div",{className:"space-y-6",children:[C("div",{className:"card-subtle p-6",children:[R("h3",{className:"font-bold text-lg",children:"@contractspec/app.cli-database"}),C("p",{className:"mt-2 text-muted-foreground text-sm",children:[R("strong",{children:"Prisma Wrapper & CLI"}),". Provides a unified way to manage database schemas, migrations, and clients. Includes seeders and factory patterns for testing."]})]}),C("div",{className:"card-subtle p-6",children:[R("h3",{className:"font-bold text-lg",children:"@contractspec/lib.bus"}),C("p",{className:"mt-2 text-muted-foreground text-sm",children:[R("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)."]})]}),C("div",{className:"card-subtle p-6",children:[R("h3",{className:"font-bold text-lg",children:"@contractspec/lib.logger"}),C("p",{className:"mt-2 text-muted-foreground text-sm",children:[R("strong",{children:"High-Performance Logging"}),". Optimized for Bun and structured JSON output. Includes plugins for ElysiaJS to log HTTP requests automatically."]})]}),C("div",{className:"card-subtle p-6",children:[R("h3",{className:"font-bold text-lg",children:"@contractspec/lib.error"}),C("p",{className:"mt-2 text-muted-foreground text-sm",children:[R("strong",{children:"Standardized Errors"}),". Use `AppError` with standard codes (NOT_FOUND, UNAUTHORIZED) to ensure consistent HTTP responses and error handling across services."]})]}),C("div",{className:"card-subtle p-6",children:[R("h3",{className:"font-bold text-lg",children:"@contractspec/lib.exporter"}),C("p",{className:"mt-2 text-muted-foreground text-sm",children:[R("strong",{children:"Data Export"}),". Generate CSV and XML files from your data. Platform-agnostic and streaming-friendly."]})]})]})]}),C("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Example: Unified Backend Flow"}),R(Wa,{language:"typescript",code:`import { logger } from '@contractspec/lib.logger';
391
479
  import { AppError } from '@contractspec/lib.error';
392
480
  import { db } from '@contractspec/app.cli-database';
393
481
  import { EventBus } from '@contractspec/lib.bus';
@@ -405,7 +493,124 @@ export async function createUser(email: string) {
405
493
  await EventBus.publish('user.created', { userId: user.id });
406
494
 
407
495
  return user;
408
- }`})]}),k("div",{className:"flex items-center gap-4 pt-4",children:[k(rt,{href:"/docs/libraries/runtime",className:"btn-primary",children:["Next: Runtime ",w(sa,{size:16})]}),w(rt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"})]})]})}import{CodeBlock as nt,InstallCommand as da}from"@contractspec/lib.design-system";import ct from"@contractspec/lib.ui-link";import{ChevronRight as pa}from"lucide-react";import{jsx as c,jsxs as N}from"react/jsx-runtime";function ma(){return N("div",{className:"space-y-8",children:[N("div",{className:"space-y-4",children:[c("h1",{className:"font-bold text-4xl",children:"DataViews Runtime Library"}),N("p",{className:"text-lg text-muted-foreground",children:["The ",c("code",{children:"@contractspec/lib.contracts-spec/data-views"})," and"," ",c("code",{children:"@contractspec/lib.design-system"})," libraries provide the runtime logic and UI components to render DataViews in your application."]})]}),N("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Installation"}),c(da,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.design-system"]})]}),N("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"DataViewRenderer"}),c("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."}),c(nt,{language:"tsx",code:`import { DataViewRenderer } from '@contractspec/lib.design-system';
496
+ }`})]}),C("div",{className:"flex items-center gap-4 pt-4",children:[C(It,{href:"/docs/libraries/runtime",className:"btn-primary",children:["Next: Runtime ",R(za,{size:16})]}),R(It,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"})]})]})}import{CodeBlock as Pe,InstallCommand as Fa}from"@contractspec/lib.design-system";import{HStack as _a,VStack as ge}from"@contractspec/lib.design-system/layout";import{List as qa,ListItem as oe}from"@contractspec/lib.design-system/list";import{Code as d,H1 as Ha,H2 as Ce,H3 as Ka,P as Te,Text as J}from"@contractspec/lib.design-system/typography";import qe from"@contractspec/lib.ui-link";import{ChevronRight as Qa}from"lucide-react";import{jsx as t,jsxs as g}from"react/jsx-runtime";var Ja=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
497
+
498
+ export const AccountsDataView = defineDataView({
499
+ meta: {
500
+ key: 'crm.accounts',
501
+ version: '1.0.0',
502
+ title: 'Accounts',
503
+ description: 'Customer account workspace',
504
+ domain: 'crm',
505
+ entity: 'account',
506
+ owners: ['@crm'],
507
+ tags: ['crm', 'accounts'],
508
+ stability: 'stable',
509
+ },
510
+ source: {
511
+ primary: { key: 'crm.accounts.list', version: '1.0.0' },
512
+ },
513
+ view: {
514
+ kind: 'table',
515
+ fields: [
516
+ { key: 'name', label: 'Name', dataPath: 'name', sortable: true },
517
+ { key: 'owner', label: 'Owner', dataPath: 'owner' },
518
+ { key: 'arr', label: 'ARR', dataPath: 'arr', format: { type: 'currency', currency: 'EUR' } },
519
+ {
520
+ key: 'internalNotes',
521
+ label: 'Internal notes',
522
+ dataPath: 'internalNotes',
523
+ visibility: { minDataDepth: 'detailed' },
524
+ },
525
+ ],
526
+ columns: [
527
+ { field: 'name' },
528
+ { field: 'owner' },
529
+ { field: 'arr' },
530
+ { field: 'internalNotes' },
531
+ ],
532
+ collection: {
533
+ viewModes: {
534
+ defaultMode: 'table',
535
+ allowedModes: ['list', 'grid', 'table'],
536
+ },
537
+ pagination: {
538
+ pageSize: 25,
539
+ pageSizeOptions: [10, 25, 50],
540
+ },
541
+ toolbar: {
542
+ search: true,
543
+ viewMode: true,
544
+ filters: true,
545
+ density: true,
546
+ dataDepth: true,
547
+ },
548
+ density: 'comfortable',
549
+ dataDepth: 'standard',
550
+ personalization: {
551
+ enabled: true,
552
+ persist: {
553
+ viewMode: true,
554
+ density: true,
555
+ dataDepth: true,
556
+ pageSize: true,
557
+ },
558
+ },
559
+ },
560
+ },
561
+ });`,Za=`import { DataViewRenderer } from '@contractspec/lib.design-system';
562
+ import { resolveDataViewPreferences } from '@contractspec/lib.personalization/data-view-preferences';
563
+
564
+ const resolved = resolveDataViewPreferences({
565
+ spec: AccountsDataView,
566
+ preferences: profile.canonical,
567
+ insights,
568
+ record: savedDataViewPreference,
569
+ });
570
+
571
+ <DataViewRenderer
572
+ spec={AccountsDataView}
573
+ items={accounts}
574
+ defaultViewMode={resolved.viewMode}
575
+ defaultDensity={resolved.density}
576
+ defaultDataDepth={resolved.dataDepth}
577
+ pagination={{
578
+ page,
579
+ pageSize: resolved.pageSize ?? 25,
580
+ total,
581
+ }}
582
+ onViewModeChange={(viewMode) => {
583
+ tracker.trackDataViewInteraction({
584
+ dataViewKey: AccountsDataView.meta.key,
585
+ dataViewVersion: AccountsDataView.meta.version,
586
+ action: 'view_mode_changed',
587
+ viewMode,
588
+ });
589
+ }}
590
+ onDensityChange={(density) => {
591
+ tracker.trackDataViewInteraction({
592
+ dataViewKey: AccountsDataView.meta.key,
593
+ action: 'density_changed',
594
+ density,
595
+ });
596
+ }}
597
+ onDataDepthChange={(dataDepth) => {
598
+ tracker.trackDataViewInteraction({
599
+ dataViewKey: AccountsDataView.meta.key,
600
+ action: 'data_depth_changed',
601
+ dataDepth,
602
+ });
603
+ }}
604
+ />;
605
+ `,Va=`Implement a production DataView for <entity>.
606
+
607
+ Requirements:
608
+ - Define one canonical DataViewSpec with kind 'table', collection viewModes for list/grid/table, pagination defaults, toolbar search/filter/view mode/density/dataDepth controls, and personalization persist hints.
609
+ - Mark fields that should only appear in richer experiences with visibility.minDataDepth.
610
+ - Render it with DataViewRenderer using plain props from resolveDataViewPreferences.
611
+ - Track user interactions with trackDataViewInteraction for view mode, density, data depth, search, filters, sorting, and pagination.
612
+ - Keep @contractspec/lib.design-system independent from @contractspec/lib.personalization.
613
+ - Add focused tests for default resolution, invalid-mode fallback, data-depth projection, and behavior-derived preferred view mode.`;function Ya(){return g(ge,{className:"space-y-8",children:[g(ge,{className:"space-y-4",children:[t(Ha,{className:"font-bold text-4xl",children:"DataViews Runtime Library"}),g(Te,{className:"text-lg text-muted-foreground",children:["The ",t(d,{children:"@contractspec/lib.contracts-spec/data-views"})," and"," ",t(d,{children:"@contractspec/lib.design-system"})," libraries provide the runtime logic and UI components to render DataViews in your application."]})]}),g(ge,{className:"space-y-4",children:[t(Ce,{className:"font-bold text-2xl",children:"Installation"}),t(Fa,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.design-system"]})]}),g(ge,{className:"space-y-4",children:[t(Ce,{className:"font-bold text-2xl",children:"DataViewRenderer"}),t(Te,{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."}),t(Pe,{language:"tsx",code:`import { DataViewRenderer } from '@contractspec/lib.design-system';
409
614
  import { MyUserList } from './specs/users.data-view';
410
615
 
411
616
  export function UserPage() {
@@ -417,7 +622,7 @@ export function UserPage() {
417
622
  onPageChange={(page) => fetchPage(page)}
418
623
  />
419
624
  );
420
- }`}),c("h3",{className:"font-semibold text-xl",children:"Props"}),N("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[N("li",{children:[c("code",{children:"spec"}),": The DataViewSpec definition."]}),N("li",{children:[c("code",{children:"items"}),": Array of data items to render."]}),N("li",{children:[c("code",{children:"filters"}),": Current filter state object."]}),N("li",{children:[c("code",{children:"onFilterChange"}),": Callback when typed filters change. Renderers emit ",c("code",{children:"DataViewFilterValue"})," objects for numeric, percent, currency, temporal, duration, and boolean filters."]}),N("li",{children:[c("code",{children:"pagination"}),": Object with ",c("code",{children:"page"}),","," ",c("code",{children:"pageSize"}),", ",c("code",{children:"total"}),"."]}),N("li",{children:[c("code",{children:"onPageChange"}),": Callback when page changes."]}),N("li",{children:[c("code",{children:"viewMode"})," / ",c("code",{children:"defaultViewMode"}),": Controlled or initial collection mode for specs that allow ",c("code",{children:"list"}),","," ",c("code",{children:"grid"}),", or ",c("code",{children:"table"})," projections through"," ",c("code",{children:"view.collection.viewModes"}),"."]}),N("li",{children:[c("code",{children:"density"})," / ",c("code",{children:"defaultDensity"}),": Controlled or initial density for collection renderers, seeded by"," ",c("code",{children:"view.collection.density"})," and table"," ",c("code",{children:"view.density"}),"."]})]})]}),N("div",{className:"space-y-4",children:[c("h2",{className:"font-bold text-2xl",children:"Query Generation"}),N("p",{className:"text-muted-foreground",children:["The ",c("code",{children:"DataViewQueryGenerator"})," utility helps translate DataView parameters (filters, sorting, pagination) into query arguments for your backend."]}),c(nt,{language:"typescript",code:`import { DataViewQueryGenerator } from '@contractspec/lib.contracts-spec/data-views/query-generator';
625
+ }`}),t(Ka,{className:"font-semibold text-xl",children:"Props"}),g(qa,{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[t(oe,{children:g(J,{children:[t(d,{children:"spec"}),": The DataViewSpec definition."]})}),t(oe,{children:g(J,{children:[t(d,{children:"items"}),": Array of data items to render."]})}),t(oe,{children:g(J,{children:[t(d,{children:"filters"}),": Current filter state object."]})}),t(oe,{children:g(J,{children:[t(d,{children:"onFilterChange"}),": Callback when typed filters change. Renderers emit ",t(d,{children:"DataViewFilterValue"})," objects for numeric, percent, currency, temporal, duration, and boolean filters."]})}),t(oe,{children:g(J,{children:[t(d,{children:"pagination"}),": Object with ",t(d,{children:"page"}),","," ",t(d,{children:"pageSize"}),", ",t(d,{children:"total"}),"."]})}),t(oe,{children:g(J,{children:[t(d,{children:"onPageChange"}),": Callback when page changes."]})}),t(oe,{children:g(J,{children:[t(d,{children:"viewMode"})," / ",t(d,{children:"defaultViewMode"}),": Controlled or initial collection mode for specs that allow ",t(d,{children:"list"}),","," ",t(d,{children:"grid"}),", or ",t(d,{children:"table"})," projections through"," ",t(d,{children:"view.collection.viewModes"}),"."]})}),t(oe,{children:g(J,{children:[t(d,{children:"density"})," / ",t(d,{children:"defaultDensity"}),": Controlled or initial density for collection renderers. Host apps can seed this from ",t(d,{children:"@contractspec/lib.personalization"})," while specs can declare ",t(d,{children:"view.collection.density"})," and table"," ",t(d,{children:"view.density"})," defaults."]})}),t(oe,{children:g(J,{children:[t(d,{children:"dataDepth"})," / ",t(d,{children:"defaultDataDepth"}),": Controlled or initial summary/standard/detailed/exhaustive projection. Fields can declare ",t(d,{children:"visibility.minDataDepth"}),", and collection specs can opt into ",t(d,{children:"view.collection.personalization"})," ","persistence hints."]})})]})]}),g(ge,{className:"space-y-4",children:[t(Ce,{className:"font-bold text-2xl",children:"Collection Defaults And Data Depth"}),g(Te,{className:"text-muted-foreground",children:["Use one authored ",t(d,{children:"DataViewSpec"})," for list, grid, and table experiences. ",t(d,{children:"view.collection"})," declares allowed modes, toolbar controls, pagination defaults, density, data depth, and persistence hints. ",t(d,{children:"visibility.minDataDepth"})," lets a field appear only when the renderer is in a detailed or exhaustive mode."]}),t(Pe,{language:"typescript",code:Ja})]}),g(ge,{className:"space-y-4",children:[t(Ce,{className:"font-bold text-2xl",children:"Personalization Bridge"}),g(Te,{className:"text-muted-foreground",children:["Resolve user preferences in the host app, then pass ordinary renderer props into ",t(d,{children:"DataViewRenderer"}),". The bridge helper lives in"," ",t(d,{children:"@contractspec/lib.personalization"}),", so the design-system renderer stays portable for apps that do not use personalization. See the"," ",t(qe,{href:"/docs/libraries/personalization",className:"text-[color:var(--rust)] underline underline-offset-4",children:t(J,{children:"personalization library guide"})})," ","for the behavior tracker, analyzer, and DataView preference resolver."]}),t(Pe,{language:"tsx",code:Za})]}),g(ge,{className:"space-y-4",children:[t(Ce,{className:"font-bold text-2xl",children:"Agent Prompt"}),t(Te,{className:"text-muted-foreground",children:"Use this prompt when asking an implementation agent to add a preference-aware collection DataView without breaking package boundaries."}),t(Pe,{language:"markdown",code:Va})]}),g(ge,{className:"space-y-4",children:[t(Ce,{className:"font-bold text-2xl",children:"Query Generation"}),g(Te,{className:"text-muted-foreground",children:["The ",t(d,{children:"DataViewQueryGenerator"})," utility helps translate DataView parameters (filters, sorting, pagination) into query arguments for your backend."]}),t(Pe,{language:"typescript",code:`import { DataViewQueryGenerator } from '@contractspec/lib.contracts-spec/data-views/query-generator';
421
626
 
422
627
  const generator = new DataViewQueryGenerator(MyUserList);
423
628
  const params = {
@@ -432,7 +637,7 @@ const params = {
432
637
  const errors = generator.validateParams(params);
433
638
  const query = generator.generate(params);
434
639
 
435
- // query.input contains skip/take plus the typed filter payloads.`})]}),N("div",{className:"flex items-center gap-4 pt-4",children:[c(ct,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),N(ct,{href:"/docs/libraries/data-backend",className:"btn-primary",children:["Next: Data & Backend ",c(pa,{size:16})]})]})]})}import{CodeBlock as ke,InstallCommand as ua}from"@contractspec/lib.design-system";import me from"@contractspec/lib.ui-link";import{ChevronRight as ga}from"lucide-react";import{jsx as a,jsxs as s}from"react/jsx-runtime";var ha=`import { Button, DataTable } from '@contractspec/lib.design-system';
640
+ // query.input contains skip/take plus the typed filter payloads.`})]}),g(_a,{className:"items-center gap-4 pt-4",children:[t(qe,{href:"/docs/libraries",className:"btn-ghost",children:t(J,{children:"Back to Libraries"})}),g(qe,{href:"/docs/libraries/data-backend",className:"btn-primary",children:[t(J,{children:"Next: Data & Backend"})," ",t(Qa,{size:16})]})]})]})}import{CodeBlock as Ae,InstallCommand as Xa}from"@contractspec/lib.design-system";import Oe from"@contractspec/lib.ui-link";import{ChevronRight as $a}from"lucide-react";import{jsx as e,jsxs as o}from"react/jsx-runtime";var xa=`import { Button, DataTable } from '@contractspec/lib.design-system';
436
641
  import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
437
642
 
438
643
  import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
@@ -480,7 +685,7 @@ export function AccountHealthTable() {
480
685
  footer={\`Page \${controller.pageIndex + 1} of \${controller.pageCount}\`}
481
686
  />
482
687
  );
483
- }`,fa=`import {
688
+ }`,ja=`import {
484
689
  DesignSystemThemeProvider,
485
690
  resolveThemeModeTokens,
486
691
  themeSpecToCssVariables,
@@ -510,13 +715,112 @@ export function TenantSurface({ children }: { children: React.ReactNode }) {
510
715
  {children}
511
716
  </DesignSystemThemeProvider>
512
717
  );
513
- }`,ba=`import { themeSpecToTailwindPreset } from '@contractspec/lib.design-system/theme';
718
+ }`,eo=`import { themeSpecToTailwindPreset } from '@contractspec/lib.design-system/theme';
514
719
  import { Select } from '@contractspec/lib.design-system/controls';
515
720
  import { FormDialog } from '@contractspec/lib.design-system/forms';
516
721
  import { HStack } from '@contractspec/lib.design-system/layout';
722
+ import { AdaptivePanel } from '@contractspec/lib.design-system/components/overlays';
723
+ import { ObjectReferenceHandler } from '@contractspec/lib.design-system/components/object-reference';
517
724
 
518
725
  // Root imports remain supported:
519
- import { Button, DataTable } from '@contractspec/lib.design-system';`;function va(){return s("div",{className:"space-y-8",children:[s("div",{className:"space-y-4",children:[a("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.design-system"}),s("p",{className:"text-muted-foreground",children:["High-level design system components, patterns, and layouts for LSSM applications. Built on top of ",a("code",{children:"@contractspec/lib.ui-kit"}),"."]})]}),s("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Installation"}),a(ua,{package:"@contractspec/lib.design-system"})]}),s("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"What It Provides"}),s("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[s("li",{children:[a("strong",{children:"Composite Components"}),": Molecules and Organisms that solve common UI problems"]}),s("li",{children:[a("strong",{children:"Layouts"}),": Ready-to-use page structures for dashboards, marketing sites, and lists"]}),s("li",{children:[a("strong",{children:"Data Views"}),": Standardized renderers for lists, tables, and detail views"]}),s("li",{children:[a("strong",{children:"Forms"}),": Zod-integrated form layouts and components"]}),s("li",{children:[a("strong",{children:"Code Display"}),": Syntax-highlighted code blocks with package manager tabs"]}),s("li",{children:[a("strong",{children:"Platform Utilities"}),": Hooks for responsive and adaptive design"]}),s("li",{children:[a("strong",{children:"Theme Bridge"}),": ThemeSpec to Tailwind variables, presets, CSS text, and runtime light/dark mode"]}),s("li",{children:[a("strong",{children:"Legal Templates"}),": Compliant templates for Terms, Privacy, and GDPR"]})]})]}),s("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"ThemeSpec to Tailwind"}),s("p",{className:"text-muted-foreground",children:["The theme bridge keeps ",a("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."]}),a(ke,{language:"tsx",code:fa})]}),s("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Focused import surfaces"}),a("p",{className:"text-muted-foreground",children:"New code can use focused subpaths for theme, controls, forms, and layout while existing root imports remain compatible."}),a(ke,{language:"tsx",code:ba})]}),s("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Data table example"}),s("p",{className:"text-muted-foreground",children:["This is the composed lane from the canonical"," ",a(me,{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."]}),a(ke,{language:"tsx",code:ha})]}),s("div",{className:"space-y-4",children:[a("h2",{className:"font-bold text-2xl",children:"Key Exports"}),s("div",{className:"grid gap-4 md:grid-cols-2",children:[s("div",{className:"card-subtle p-4",children:[a("h3",{className:"mb-2 font-semibold",children:"Organisms"}),s("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[a("li",{children:"AppShell, PageOutline"}),a("li",{children:"AppLayout, AppHeader, AppSidebar"}),a("li",{children:"MarketingLayout, HeroSection"}),a("li",{children:"ListCardPage, ListTablePage"})]})]}),s("div",{className:"card-subtle p-4",children:[a("h3",{className:"mb-2 font-semibold",children:"Data & Forms"}),s("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[a("li",{children:"DataTable"}),a("li",{children:"DataViewTable"}),a("li",{children:"DataViewRenderer"}),a("li",{children:"ZodForm"}),a("li",{children:"FormLayout, FormDialog"})]})]}),s("div",{className:"card-subtle p-4",children:[a("h3",{className:"mb-2 font-semibold",children:"Code Display"}),s("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[a("li",{children:"CodeBlock (syntax highlighting)"}),a("li",{children:"CommandTabs (package manager tabs)"}),a("li",{children:"InstallCommand (convenience wrapper)"}),a("li",{children:"CopyButton"})]})]}),s("div",{className:"card-subtle p-4",children:[a("h3",{className:"mb-2 font-semibold",children:"Providers"}),a("ul",{className:"space-y-1 text-muted-foreground text-sm",children:a("li",{children:"PackageManagerProvider"})})]})]})]}),s("div",{className:"card-subtle space-y-3 p-6",children:[a("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),s("p",{className:"text-muted-foreground",children:["Read"," ",a(me,{href:"/docs/libraries/application-shell",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Application shell"})," ","for the shared sidebar, topbar, command search, mobile navigation, and"," ",a("code",{children:"PageOutline"})," pattern. Read"," ",a(me,{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."]})]}),s("div",{className:"flex items-center gap-4 pt-4",children:[a(me,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"Previous: UI Kit Web"}),s(me,{href:"/docs/libraries/accessibility",className:"btn-primary",children:["Next: Accessibility ",a(ga,{size:16})]})]})]})}import{CodeBlock as Se,InstallCommand as ya}from"@contractspec/lib.design-system";import st from"@contractspec/lib.ui-link";import{ChevronRight as Na}from"lucide-react";import{jsx as L,jsxs as $}from"react/jsx-runtime";function wa(){return $("div",{className:"space-y-8",children:[$("div",{className:"space-y-4",children:[L("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.evolution"}),L("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."})]}),$("div",{className:"space-y-4",children:[L("h2",{className:"font-bold text-2xl",children:"Installation"}),L(ya,{package:"@contractspec/lib.evolution"})]}),$("div",{className:"space-y-3",children:[L("h2",{className:"font-bold text-2xl",children:"From telemetry to intent"}),L(Se,{language:"typescript",code:`import { SpecAnalyzer } from '@contractspec/lib.evolution/analyzer';
726
+ import { Button, DataTable } from '@contractspec/lib.design-system';`,to=`import {
727
+ ObjectReferenceHandler,
728
+ createDefaultObjectReferenceActions,
729
+ createMapsReferenceActions,
730
+ type ObjectReferenceDescriptor,
731
+ type ObjectReferenceOpenHrefHandler,
732
+ } from '@contractspec/lib.design-system';
733
+
734
+ const customerContact: ObjectReferenceDescriptor = {
735
+ id: 'user.amina',
736
+ kind: 'user',
737
+ label: 'Amina Laurent',
738
+ description: 'Customer success owner',
739
+ href: '/customers/acme/users/amina',
740
+ properties: [
741
+ {
742
+ id: 'user.amina.email',
743
+ kind: 'email',
744
+ label: 'Email',
745
+ value: 'amina@example.com',
746
+ },
747
+ {
748
+ id: 'user.amina.phone',
749
+ kind: 'phone',
750
+ label: 'Phone',
751
+ value: '+33 1 23 45 67 89',
752
+ },
753
+ ],
754
+ sections: [
755
+ {
756
+ id: 'customer-site',
757
+ title: 'Primary site',
758
+ properties: [
759
+ {
760
+ id: 'customer-site.address',
761
+ kind: 'address',
762
+ label: 'Paris office',
763
+ value: '10 rue de Rivoli, 75001 Paris',
764
+ actions: createMapsReferenceActions({
765
+ id: 'customer-site.address',
766
+ kind: 'address',
767
+ label: 'Paris office',
768
+ value: '10 rue de Rivoli, 75001 Paris',
769
+ }),
770
+ },
771
+ ],
772
+ },
773
+ ],
774
+ };
775
+
776
+ const openHref: ObjectReferenceOpenHrefHandler = (href, _event, options) => {
777
+ if (options.target === 'new-page') {
778
+ window.open(href, '_blank', 'noopener,noreferrer');
779
+ return;
780
+ }
781
+
782
+ window.location.assign(href);
783
+ };
784
+
785
+ <ObjectReferenceHandler
786
+ reference={customerContact}
787
+ actions={createDefaultObjectReferenceActions(customerContact)}
788
+ interactivityVisibility="icon"
789
+ openTarget="same-page"
790
+ panelMode="responsive"
791
+ mobilePanelMode="drawer"
792
+ desktopPanelMode="sheet"
793
+ responsiveBreakpoint="md"
794
+ openHref={openHref}
795
+ />;`,ao=`import { AdaptivePanel } from '@contractspec/lib.design-system/components/overlays';
796
+
797
+ <AdaptivePanel
798
+ open={open}
799
+ onOpenChange={setOpen}
800
+ trigger={<button type="button">Edit</button>}
801
+ title="Edit customer"
802
+ description="Update contact and site details."
803
+ mode="responsive"
804
+ mobileMode="drawer"
805
+ desktopMode="sheet"
806
+ breakpoint="md"
807
+ sheetSide="right"
808
+ drawerDirection="bottom"
809
+ >
810
+ {content}
811
+ </AdaptivePanel>;`,oo=`Find every user-facing address, phone number, email, user, customer, file, URL, and tenant-specific object reference currently rendered as inert text.
812
+
813
+ Replace each one with ObjectReferenceHandler from @contractspec/lib.design-system. Keep descriptors data-only: id, kind, label, value, href, openTarget, properties, sections, metadata, iconKey, and ariaLabel are allowed; React callbacks belong in handler props only.
814
+
815
+ Use properties and sections for rich references. For example, a user reference can expose email, phone, address, files, and customer links in one panel instead of rendering separate disconnected strings.
816
+
817
+ Use panelMode="responsive" by default. Let desktop render a sheet and small screens render a bottom drawer through AdaptivePanel. Do not call Sheet or Drawer directly for this interaction unless a lower-level primitive is being implemented.
818
+
819
+ Use openTarget="same-page" unless product requirements explicitly require a new page. Put custom copy, navigation, analytics, permissions, or tenant-specific actions in copyHandler, openHref, actionHandlers, onAction, and onActionError.
820
+
821
+ For addresses, use createMapsReferenceActions so users can choose Google Maps, Apple Maps, or Waze. For email and phone references, prefer createDefaultObjectReferenceActions unless a product-specific action set is required.
822
+
823
+ After replacing references, verify keyboard access, visible affordance choice (none, underline, or icon), safe href behavior, mobile drawer layout, and desktop sheet layout.`;function io(){return o("div",{className:"space-y-8",children:[o("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.design-system"}),o("p",{className:"text-muted-foreground",children:["High-level design system components, patterns, and layouts for LSSM applications. Built on top of ",e("code",{children:"@contractspec/lib.ui-kit"}),"."]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(Xa,{package:"@contractspec/lib.design-system"})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"What It Provides"}),o("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[o("li",{children:[e("strong",{children:"Composite Components"}),": Molecules and Organisms that solve common UI problems"]}),o("li",{children:[e("strong",{children:"Layouts"}),": Ready-to-use page structures for dashboards, marketing sites, and lists"]}),o("li",{children:[e("strong",{children:"Data Views"}),": Standardized renderers for lists, tables, and detail views"]}),o("li",{children:[e("strong",{children:"Forms"}),": Zod-integrated form layouts and components"]}),o("li",{children:[e("strong",{children:"Code Display"}),": Syntax-highlighted code blocks with package manager tabs"]}),o("li",{children:[e("strong",{children:"Platform Utilities"}),": Hooks for responsive and adaptive design"]}),o("li",{children:[e("strong",{children:"Object References"}),": Clickable references for addresses, phone numbers, users, customers, files, URLs, and custom objects"]}),o("li",{children:[e("strong",{children:"Adaptive Panels"}),": One panel API that resolves to a desktop sheet or mobile drawer"]}),o("li",{children:[e("strong",{children:"Theme Bridge"}),": ThemeSpec to Tailwind variables, presets, CSS text, and runtime light/dark mode"]}),o("li",{children:[e("strong",{children:"Legal Templates"}),": Compliant templates for Terms, Privacy, and GDPR"]})]})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"ThemeSpec to Tailwind"}),o("p",{className:"text-muted-foreground",children:["The theme bridge keeps ",e("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."]}),e(Ae,{language:"tsx",code:ja})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Focused import surfaces"}),e("p",{className:"text-muted-foreground",children:"New code can use focused subpaths for theme, controls, forms, and layout while existing root imports remain compatible."}),e(Ae,{language:"tsx",code:eo})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Actionable object references"}),o("p",{className:"text-muted-foreground",children:["Use ",e("code",{children:"ObjectReferenceHandler"})," whenever a product surface renders an object that may need quick interaction: addresses, phone numbers, emails, users, customers, files, URLs, and tenant-specific objects. The goal is to avoid inert references while keeping the descriptor contract declarative enough for OSS consumers and future contract-generated surfaces."]}),o("div",{className:"grid gap-4 md:grid-cols-2",children:[o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Descriptor model"}),o("ul",{className:"list-inside list-disc space-y-1 text-muted-foreground text-sm",children:[o("li",{children:["References use data-only descriptors: ",e("code",{children:"id"}),","," ",e("code",{children:"kind"}),", ",e("code",{children:"label"}),", ",e("code",{children:"value"}),","," ",e("code",{children:"href"}),", ",e("code",{children:"openTarget"}),","," ",e("code",{children:"metadata"}),", ",e("code",{children:"iconKey"}),", and"," ",e("code",{children:"ariaLabel"}),"."]}),o("li",{children:["Rich references use nested ",e("code",{children:"properties"})," and"," ",e("code",{children:"sections"}),", so one user or customer can expose email, phone, address, files, and links inside the same panel."]}),o("li",{children:["Reference kinds are ",e("code",{children:"address"}),", ",e("code",{children:"email"}),","," ",e("code",{children:"phone"}),", ",e("code",{children:"user"}),", ",e("code",{children:"customer"}),","," ",e("code",{children:"file"}),", ",e("code",{children:"url"}),", and ",e("code",{children:"custom"}),"."]})]})]}),o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Runtime behavior"}),o("ul",{className:"list-inside list-disc space-y-1 text-muted-foreground text-sm",children:[o("li",{children:["Choose visibility with ",e("code",{children:"interactivityVisibility"}),":",e("code",{children:"none"}),", ",e("code",{children:"underline"}),", or ",e("code",{children:"icon"}),"."]}),o("li",{children:["Detail navigation defaults to ",e("code",{children:"same-page"}),"; set"," ",e("code",{children:'openTarget="new-page"'})," on the handler, reference, or action when a new page is required."]}),o("li",{children:["Host apps provide behavior through ",e("code",{children:"copyHandler"}),","," ",e("code",{children:"openHref"}),", ",e("code",{children:"actionHandlers"}),","," ",e("code",{children:"onAction"}),", and ",e("code",{children:"onActionError"}),"."]})]})]}),o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Default actions"}),o("ul",{className:"list-inside list-disc space-y-1 text-muted-foreground text-sm",children:[o("li",{children:[e("code",{children:"createDefaultObjectReferenceActions"})," adds copy, open, email, phone, and map actions when the descriptor supports them."]}),o("li",{children:[e("code",{children:"createMapsReferenceActions"})," creates Google Maps, Apple Maps, Waze, or geo actions for address references."]}),e("li",{children:"Safe href handling allows expected app, web, email, phone, and map URLs while rejecting unsafe schemes."})]})]}),o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Extension points"}),o("ul",{className:"list-inside list-disc space-y-1 text-muted-foreground text-sm",children:[o("li",{children:["Use ",e("code",{children:"renderTrigger"}),", ",e("code",{children:"renderDetail"}),","," ",e("code",{children:"renderAction"}),", ",e("code",{children:"renderProperty"}),","," ",e("code",{children:"renderSection"}),", and ",e("code",{children:"iconRenderer"})," to wrap or overload presentation."]}),e("li",{children:"Keep tenant-specific permissions, analytics, and integration side effects at the host boundary through runtime handlers."})]})]})]}),e(Ae,{language:"tsx",code:to})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Adaptive panels"}),o("p",{className:"text-muted-foreground",children:[e("code",{children:"AdaptivePanel"})," is the shared overlay decision for surfaces that should feel native on both desktop and small screens. Its default responsive mode renders a sheet at the configured desktop breakpoint and a drawer below it. ",e("code",{children:"ObjectReferenceHandler"})," uses this panel contract through ",e("code",{children:"panelMode"}),","," ",e("code",{children:"mobilePanelMode"}),", ",e("code",{children:"desktopPanelMode"}),", and"," ",e("code",{children:"responsiveBreakpoint"}),"."]}),e(Ae,{language:"tsx",code:ao})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Prompt for adoption work"}),e("p",{className:"text-muted-foreground",children:"Use this prompt when asking an agent or downstream OSS consumer to replace inert references across an application."}),e(Ae,{language:"text",code:oo})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Data table example"}),o("p",{className:"text-muted-foreground",children:["This is the composed lane from the canonical"," ",e(Oe,{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."]}),e(Ae,{language:"tsx",code:xa})]}),o("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Key Exports"}),o("div",{className:"grid gap-4 md:grid-cols-2",children:[o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Organisms"}),o("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"AppShell, PageOutline"}),e("li",{children:"AppLayout, AppHeader, AppSidebar"}),e("li",{children:"MarketingLayout, HeroSection"}),e("li",{children:"ListCardPage, ListTablePage"})]})]}),o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Data & Forms"}),o("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"DataTable"}),e("li",{children:"DataViewTable"}),e("li",{children:"DataViewRenderer"}),e("li",{children:"ZodForm"}),e("li",{children:"FormLayout, FormDialog"})]})]}),o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Code Display"}),o("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"CodeBlock (syntax highlighting)"}),e("li",{children:"CommandTabs (package manager tabs)"}),e("li",{children:"InstallCommand (convenience wrapper)"}),e("li",{children:"CopyButton"})]})]}),o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Providers"}),e("ul",{className:"space-y-1 text-muted-foreground text-sm",children:e("li",{children:"PackageManagerProvider"})})]}),o("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"References & Overlays"}),o("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"ObjectReferenceHandler"}),e("li",{children:"createDefaultObjectReferenceActions"}),e("li",{children:"createMapsReferenceActions"}),e("li",{children:"AdaptivePanel"})]})]})]})]}),o("div",{className:"card-subtle space-y-3 p-6",children:[e("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),o("p",{className:"text-muted-foreground",children:["Read"," ",e(Oe,{href:"/docs/libraries/application-shell",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Application shell"})," ","for the shared sidebar, topbar, command search, mobile navigation, and"," ",e("code",{children:"PageOutline"})," pattern. Read"," ",e(Oe,{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."]})]}),o("div",{className:"flex items-center gap-4 pt-4",children:[e(Oe,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"Previous: UI Kit Web"}),o(Oe,{href:"/docs/libraries/accessibility",className:"btn-primary",children:["Next: Accessibility ",e($a,{size:16})]})]})]})}import{CodeBlock as He,InstallCommand as ro}from"@contractspec/lib.design-system";import Pt from"@contractspec/lib.ui-link";import{ChevronRight as no}from"lucide-react";import{jsx as O,jsxs as ie}from"react/jsx-runtime";function co(){return ie("div",{className:"space-y-8",children:[ie("div",{className:"space-y-4",children:[O("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.evolution"}),O("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."})]}),ie("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Installation"}),O(ro,{package:"@contractspec/lib.evolution"})]}),ie("div",{className:"space-y-3",children:[O("h2",{className:"font-bold text-2xl",children:"From telemetry to intent"}),O(He,{language:"typescript",code:`import { SpecAnalyzer } from '@contractspec/lib.evolution/analyzer';
520
824
  import { EvolutionPipeline } from '@contractspec/lib.observability';
521
825
 
522
826
  const analyzer = new SpecAnalyzer();
@@ -531,7 +835,7 @@ pipeline.ingest({
531
835
  success: false,
532
836
  timestamp: new Date(),
533
837
  errorCode: 'VALIDATION_FAILED',
534
- });`})]}),$("div",{className:"space-y-3",children:[L("h2",{className:"font-bold text-2xl",children:"Generate & approve suggestions"}),L(Se,{language:"typescript",code:`import {
838
+ });`})]}),ie("div",{className:"space-y-3",children:[O("h2",{className:"font-bold text-2xl",children:"Generate & approve suggestions"}),O(He,{language:"typescript",code:`import {
535
839
  SpecGenerator,
536
840
  SpecSuggestionOrchestrator,
537
841
  InMemorySpecSuggestionRepository,
@@ -545,7 +849,7 @@ const suggestion = generator.generateFromIntent(intentPattern, {
545
849
  summary: 'Add PO number requirement for acme.corp',
546
850
  });
547
851
 
548
- await orchestrator.submit(suggestion, sessionState);`})]}),$("div",{className:"space-y-3",children:[L("h2",{className:"font-bold text-2xl",children:"Write approved specs back to git"}),L(Se,{language:"typescript",code:`import { FileSystemSuggestionWriter } from '@contractspec/lib.evolution/approval';
852
+ await orchestrator.submit(suggestion, sessionState);`})]}),ie("div",{className:"space-y-3",children:[O("h2",{className:"font-bold text-2xl",children:"Write approved specs back to git"}),O(He,{language:"typescript",code:`import { FileSystemSuggestionWriter } from '@contractspec/lib.evolution/approval';
549
853
 
550
854
  const writer = new FileSystemSuggestionWriter({
551
855
  outputDir:
@@ -556,7 +860,7 @@ await writer.write({
556
860
  ...suggestion,
557
861
  status: 'approved',
558
862
  approvals: { reviewer: 'ops@contractspec', decidedAt: new Date() },
559
- });`})]}),L("div",{className:"grid gap-4 md:grid-cols-2",children:[{title:"Approvals by default",description:"Every suggestion flows through @contractspec/lib.ai-agent's ApprovalWorkflow. Tune auto-approval thresholds per environment."},{title:"Pluggable storage",description:"Use the Prisma repository in production, in-memory for tests, or stream serialized suggestions into your own queue."}].map((e)=>$("div",{className:"card-subtle space-y-2 p-4",children:[L("h3",{className:"font-semibold text-lg",children:e.title}),L("p",{className:"text-muted-foreground text-sm",children:e.description})]},e.title))}),$("div",{className:"flex items-center gap-4 pt-4",children:[L(st,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),$(st,{href:"/docs/libraries/observability",className:"btn-primary",children:["Next: Observability ",L(Na,{size:16})]})]})]})}import{CodeBlock as ka,InstallCommand as Sa}from"@contractspec/lib.design-system";import lt from"@contractspec/lib.ui-link";import{ChevronRight as Ca}from"lucide-react";import{jsx as b,jsxs as C}from"react/jsx-runtime";function Ta(){return C("div",{className:"space-y-8",children:[C("div",{className:"space-y-4",children:[b("h1",{className:"font-bold text-4xl",children:"GraphQL Libraries"}),b("p",{className:"text-muted-foreground",children:"This suite of libraries enables seamless GraphQL integration, transforming your ContractSpecs into a type-safe Pothos schema, connecting with Prisma, and enabling Apollo Federation."})]}),C("div",{className:"space-y-4",children:[b("h2",{className:"font-bold text-2xl",children:"Libraries"}),C("div",{className:"grid gap-4 md:grid-cols-1",children:[C("div",{className:"card-subtle p-6",children:[b("h3",{className:"font-bold text-lg",children:"@contractspec/lib.graphql-core"}),b("p",{className:"mt-2 text-muted-foreground text-sm",children:"The foundation. Provides a configured Pothos builder, common scalars (JSON, DateTime), and utilities for mapping ContractSpec I/O to Pothos types."})]}),C("div",{className:"card-subtle p-6",children:[b("h3",{className:"font-bold text-lg",children:"@contractspec/lib.graphql-prisma"}),b("p",{className:"mt-2 text-muted-foreground text-sm",children:"Connects Pothos to Prisma. Automatically generates GraphQL types from your Prisma schema and optimizes queries to prevent N+1 issues."})]}),C("div",{className:"card-subtle p-6",children:[b("h3",{className:"font-bold text-lg",children:"@contractspec/lib.graphql-federation"}),b("p",{className:"mt-2 text-muted-foreground text-sm",children:"Adds Apollo Federation V2 support. Allows your subgraph to define keys and entities, making it ready for a supergraph."})]})]})]}),C("div",{className:"space-y-4",children:[b("h2",{className:"font-bold text-2xl",children:"Installation"}),b(Sa,{package:["@contractspec/lib.graphql-core","@contractspec/lib.graphql-prisma","@contractspec/lib.graphql-federation"]})]}),C("div",{className:"space-y-4",children:[b("h2",{className:"font-bold text-2xl",children:"Usage: Building a Schema"}),b("p",{className:"text-muted-foreground",children:"Here's how to assemble a federated GraphQL schema from your specs:"}),b(ka,{language:"typescript",code:`import { builder } from '@contractspec/lib.graphql-core';
863
+ });`})]}),O("div",{className:"grid gap-4 md:grid-cols-2",children:[{title:"Approvals by default",description:"Every suggestion flows through @contractspec/lib.ai-agent's ApprovalWorkflow. Tune auto-approval thresholds per environment."},{title:"Pluggable storage",description:"Use the Prisma repository in production, in-memory for tests, or stream serialized suggestions into your own queue."}].map((a)=>ie("div",{className:"card-subtle space-y-2 p-4",children:[O("h3",{className:"font-semibold text-lg",children:a.title}),O("p",{className:"text-muted-foreground text-sm",children:a.description})]},a.title))}),ie("div",{className:"flex items-center gap-4 pt-4",children:[O(Pt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ie(Pt,{href:"/docs/libraries/observability",className:"btn-primary",children:["Next: Observability ",O(no,{size:16})]})]})]})}import{CodeBlock as so,InstallCommand as lo}from"@contractspec/lib.design-system";import Ot from"@contractspec/lib.ui-link";import{ChevronRight as po}from"lucide-react";import{jsx as w,jsxs as I}from"react/jsx-runtime";function mo(){return I("div",{className:"space-y-8",children:[I("div",{className:"space-y-4",children:[w("h1",{className:"font-bold text-4xl",children:"GraphQL Libraries"}),w("p",{className:"text-muted-foreground",children:"This suite of libraries enables seamless GraphQL integration, transforming your ContractSpecs into a type-safe Pothos schema, connecting with Prisma, and enabling Apollo Federation."})]}),I("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Libraries"}),I("div",{className:"grid gap-4 md:grid-cols-1",children:[I("div",{className:"card-subtle p-6",children:[w("h3",{className:"font-bold text-lg",children:"@contractspec/lib.graphql-core"}),w("p",{className:"mt-2 text-muted-foreground text-sm",children:"The foundation. Provides a configured Pothos builder, common scalars (JSON, DateTime), and utilities for mapping ContractSpec I/O to Pothos types."})]}),I("div",{className:"card-subtle p-6",children:[w("h3",{className:"font-bold text-lg",children:"@contractspec/lib.graphql-prisma"}),w("p",{className:"mt-2 text-muted-foreground text-sm",children:"Connects Pothos to Prisma. Automatically generates GraphQL types from your Prisma schema and optimizes queries to prevent N+1 issues."})]}),I("div",{className:"card-subtle p-6",children:[w("h3",{className:"font-bold text-lg",children:"@contractspec/lib.graphql-federation"}),w("p",{className:"mt-2 text-muted-foreground text-sm",children:"Adds Apollo Federation V2 support. Allows your subgraph to define keys and entities, making it ready for a supergraph."})]})]})]}),I("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Installation"}),w(lo,{package:["@contractspec/lib.graphql-core","@contractspec/lib.graphql-prisma","@contractspec/lib.graphql-federation"]})]}),I("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Usage: Building a Schema"}),w("p",{className:"text-muted-foreground",children:"Here's how to assemble a federated GraphQL schema from your specs:"}),w(so,{language:"typescript",code:`import { builder } from '@contractspec/lib.graphql-core';
560
864
  import { registerContractsOnBuilder } from '@contractspec/lib.contracts-runtime-server-graphql/graphql-pothos';
561
865
  import { OperationSpecRegistry } from '@contractspec/lib.contracts-spec';
562
866
  import { MySpecs } from './specs';
@@ -570,7 +874,7 @@ registerContractsOnBuilder(builder, registry);
570
874
 
571
875
  // 3. Build and print schema
572
876
  const schema = builder.toSchema();
573
- console.log(printSchema(schema));`})]}),C("div",{className:"space-y-4",children:[b("h2",{className:"font-bold text-2xl",children:"Features"}),C("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[C("li",{children:[b("strong",{children:"Code-First"}),": Define schema in TypeScript (Pothos), get SDL as artifact."]}),C("li",{children:[b("strong",{children:"Spec Integration"}),": `registerContractsOnBuilder` automatically converts Command/Query specs into Mutations/Queries."]}),C("li",{children:[b("strong",{children:"Federation Ready"}),": Just add `provider: 'federation'` to your config."]})]})]}),C("div",{className:"flex items-center gap-4 pt-4",children:[C(lt,{href:"/docs/libraries/data-backend",className:"btn-primary",children:["Next: Data & Backend ",b(Ca,{size:16})]}),b(lt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"})]})]})}import{CodeBlock as dt,InstallCommand as La}from"@contractspec/lib.design-system";import pt from"@contractspec/lib.ui-link";import{ChevronRight as Ra}from"lucide-react";import{jsx as J,jsxs as ce}from"react/jsx-runtime";function Ia(){return ce("div",{className:"space-y-8",children:[ce("div",{className:"space-y-4",children:[J("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.growth"}),J("p",{className:"text-lg text-muted-foreground",children:"Launch experiments without third-party SDKs. Register variants, assign users deterministically, track exposures, and compute significance."})]}),ce("div",{className:"space-y-4",children:[J("h2",{className:"font-bold text-2xl",children:"Installation"}),J(La,{package:"@contractspec/lib.growth"})]}),ce("div",{className:"space-y-3",children:[J("h2",{className:"font-bold text-2xl",children:"Register + assign"}),J(dt,{language:"typescript",code:`import { ExperimentRegistry, ExperimentRunner } from '@contractspec/lib.growth/experiments';
877
+ console.log(printSchema(schema));`})]}),I("div",{className:"space-y-4",children:[w("h2",{className:"font-bold text-2xl",children:"Features"}),I("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[I("li",{children:[w("strong",{children:"Code-First"}),": Define schema in TypeScript (Pothos), get SDL as artifact."]}),I("li",{children:[w("strong",{children:"Spec Integration"}),": `registerContractsOnBuilder` automatically converts Command/Query specs into Mutations/Queries."]}),I("li",{children:[w("strong",{children:"Federation Ready"}),": Just add `provider: 'federation'` to your config."]})]})]}),I("div",{className:"flex items-center gap-4 pt-4",children:[I(Ot,{href:"/docs/libraries/data-backend",className:"btn-primary",children:["Next: Data & Backend ",w(po,{size:16})]}),w(Ot,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"})]})]})}import{CodeBlock as Dt,InstallCommand as uo}from"@contractspec/lib.design-system";import Mt from"@contractspec/lib.ui-link";import{ChevronRight as ho}from"lucide-react";import{jsx as x,jsxs as ye}from"react/jsx-runtime";function go(){return ye("div",{className:"space-y-8",children:[ye("div",{className:"space-y-4",children:[x("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.growth"}),x("p",{className:"text-lg text-muted-foreground",children:"Launch experiments without third-party SDKs. Register variants, assign users deterministically, track exposures, and compute significance."})]}),ye("div",{className:"space-y-4",children:[x("h2",{className:"font-bold text-2xl",children:"Installation"}),x(uo,{package:"@contractspec/lib.growth"})]}),ye("div",{className:"space-y-3",children:[x("h2",{className:"font-bold text-2xl",children:"Register + assign"}),x(Dt,{language:"typescript",code:`import { ExperimentRegistry, ExperimentRunner } from '@contractspec/lib.growth/experiments';
574
878
 
575
879
  const registry = new ExperimentRegistry().register({
576
880
  key: 'pricing.cta',
@@ -584,7 +888,7 @@ const registry = new ExperimentRegistry().register({
584
888
  });
585
889
 
586
890
  const runner = new ExperimentRunner();
587
- const assignment = runner.assign(registry.get('pricing.cta')!, 'user_123');`})]}),ce("div",{className:"space-y-3",children:[J("h2",{className:"font-bold text-2xl",children:"Track + analyze"}),J(dt,{language:"typescript",code:`import { ExperimentTracker } from '@contractspec/lib.growth/tracker';
891
+ const assignment = runner.assign(registry.get('pricing.cta')!, 'user_123');`})]}),ye("div",{className:"space-y-3",children:[x("h2",{className:"font-bold text-2xl",children:"Track + analyze"}),x(Dt,{language:"typescript",code:`import { ExperimentTracker } from '@contractspec/lib.growth/tracker';
588
892
  import { StatsEngine } from '@contractspec/lib.growth/stats';
589
893
 
590
894
  const tracker = new ExperimentTracker(new InMemoryTrackerStore());
@@ -600,11 +904,11 @@ await tracker.recordSample({
600
904
  const stats = new StatsEngine().summarize(
601
905
  await tracker.getSamples(assignment.experimentKey, 'demo_booked'),
602
906
  'demo_booked'
603
- );`})]}),ce("div",{className:"flex items-center gap-4 pt-4",children:[J(pt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ce(pt,{href:"/docs/libraries/analytics",className:"btn-primary",children:["Next: Analytics ",J(Ra,{size:16})]})]})]})}import{CodeBlock as mt,InstallCommand as Aa}from"@contractspec/lib.design-system";import ut from"@contractspec/lib.ui-link";import{ChevronRight as Pa}from"lucide-react";import{jsx as V,jsxs as x}from"react/jsx-runtime";function Da(){return x("div",{className:"space-y-8",children:[x("div",{className:"space-y-4",children:[V("h1",{className:"font-bold text-4xl",children:"Multi-Tenancy Library"}),x("p",{className:"text-lg text-muted-foreground",children:["The ",V("code",{children:"@contractspec/lib.multi-tenancy"})," library provides the core building blocks for secure SaaS applications."]})]}),x("div",{className:"space-y-4",children:[V("h2",{className:"font-bold text-2xl",children:"Installation"}),V(Aa,{package:"@contractspec/lib.multi-tenancy"})]}),x("div",{className:"space-y-4",children:[V("h2",{className:"font-bold text-2xl",children:"Prisma RLS Middleware"}),x("p",{className:"text-muted-foreground",children:["Automatically injects ",V("code",{children:"tenantId"})," into all queries."]}),V(mt,{language:"typescript",code:`import { createRlsMiddleware } from '@contractspec/lib.multi-tenancy/rls';
907
+ );`})]}),ye("div",{className:"flex items-center gap-4 pt-4",children:[x(Mt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ye(Mt,{href:"/docs/libraries/analytics",className:"btn-primary",children:["Next: Analytics ",x(ho,{size:16})]})]})]})}import{CodeBlock as Et,InstallCommand as fo}from"@contractspec/lib.design-system";import Bt from"@contractspec/lib.ui-link";import{ChevronRight as bo}from"lucide-react";import{jsx as Z,jsxs as re}from"react/jsx-runtime";function vo(){return re("div",{className:"space-y-8",children:[re("div",{className:"space-y-4",children:[Z("h1",{className:"font-bold text-4xl",children:"Multi-Tenancy Library"}),re("p",{className:"text-lg text-muted-foreground",children:["The ",Z("code",{children:"@contractspec/lib.multi-tenancy"})," library provides the core building blocks for secure SaaS applications."]})]}),re("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Installation"}),Z(fo,{package:"@contractspec/lib.multi-tenancy"})]}),re("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Prisma RLS Middleware"}),re("p",{className:"text-muted-foreground",children:["Automatically injects ",Z("code",{children:"tenantId"})," into all queries."]}),Z(Et,{language:"typescript",code:`import { createRlsMiddleware } from '@contractspec/lib.multi-tenancy/rls';
604
908
  import { prisma } from './db';
605
909
  import { getTenantId } from './context';
606
910
 
607
- prisma.$use(createRlsMiddleware(() => getTenantId()));`})]}),x("div",{className:"space-y-4",children:[V("h2",{className:"font-bold text-2xl",children:"Provisioning Service"}),V("p",{className:"text-muted-foreground",children:"Automates the creation of new tenants, including database setup and default user creation."}),V(mt,{language:"typescript",code:`import { TenantProvisioningService } from '@contractspec/lib.multi-tenancy/provisioning';
911
+ prisma.$use(createRlsMiddleware(() => getTenantId()));`})]}),re("div",{className:"space-y-4",children:[Z("h2",{className:"font-bold text-2xl",children:"Provisioning Service"}),Z("p",{className:"text-muted-foreground",children:"Automates the creation of new tenants, including database setup and default user creation."}),Z(Et,{language:"typescript",code:`import { TenantProvisioningService } from '@contractspec/lib.multi-tenancy/provisioning';
608
912
 
609
913
  const service = new TenantProvisioningService({ db: prisma });
610
914
  await service.provision({
@@ -612,20 +916,20 @@ await service.provision({
612
916
  name: 'Acme Corp',
613
917
  slug: 'acme',
614
918
  ownerEmail: 'admin@acme.com'
615
- });`})]}),x("div",{className:"flex items-center gap-4 pt-4",children:[V(ut,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),x(ut,{href:"/docs/libraries/progressive-delivery",className:"btn-primary",children:["Next: Progressive Delivery ",V(Pa,{size:16})]})]})]})}import{CodeBlock as ge,InstallCommand as Oa}from"@contractspec/lib.design-system";import gt from"@contractspec/lib.ui-link";import{ChevronRight as Ea}from"lucide-react";import{jsx as T,jsxs as Z}from"react/jsx-runtime";function Ba(){return Z("div",{className:"space-y-8",children:[Z("div",{className:"space-y-4",children:[T("h1",{className:"font-bold text-4xl",children:"Observability Library"}),Z("p",{className:"text-lg text-muted-foreground",children:["The ",T("code",{children:"@contractspec/lib.observability"})," library provides a thin wrapper around OpenTelemetry to simplify instrumentation."]})]}),Z("div",{className:"space-y-4",children:[T("h2",{className:"font-bold text-2xl",children:"Installation"}),T(Oa,{package:"@contractspec/lib.observability"})]}),Z("div",{className:"space-y-4",children:[T("h2",{className:"font-bold text-2xl",children:"Tracing"}),T(ge,{language:"typescript",code:`import { traceAsync, traceSync } from '@contractspec/lib.observability/tracing';
919
+ });`})]}),re("div",{className:"flex items-center gap-4 pt-4",children:[Z(Bt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),re(Bt,{href:"/docs/libraries/progressive-delivery",className:"btn-primary",children:["Next: Progressive Delivery ",Z(bo,{size:16})]})]})]})}import{CodeBlock as Be,InstallCommand as yo}from"@contractspec/lib.design-system";import Ut from"@contractspec/lib.ui-link";import{ChevronRight as No}from"lucide-react";import{jsx as P,jsxs as j}from"react/jsx-runtime";function wo(){return j("div",{className:"space-y-8",children:[j("div",{className:"space-y-4",children:[P("h1",{className:"font-bold text-4xl",children:"Observability Library"}),j("p",{className:"text-lg text-muted-foreground",children:["The ",P("code",{children:"@contractspec/lib.observability"})," library provides a thin wrapper around OpenTelemetry to simplify instrumentation."]})]}),j("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Installation"}),P(yo,{package:"@contractspec/lib.observability"})]}),j("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Tracing"}),P(Be,{language:"typescript",code:`import { traceAsync, traceSync } from '@contractspec/lib.observability/tracing';
616
920
 
617
921
  await traceAsync('process_order', async (span) => {
618
922
  span.setAttribute('order_id', order.id);
619
923
  await db.save(order);
620
- });`})]}),Z("div",{className:"space-y-4",children:[T("h2",{className:"font-bold text-2xl",children:"Metrics"}),T(ge,{language:"typescript",code:`import { createCounter, createHistogram } from '@contractspec/lib.observability/metrics';
924
+ });`})]}),j("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Metrics"}),P(Be,{language:"typescript",code:`import { createCounter, createHistogram } from '@contractspec/lib.observability/metrics';
621
925
 
622
926
  const ordersCounter = createCounter('orders_total');
623
927
  const latencyHistogram = createHistogram('request_duration_seconds');
624
928
 
625
929
  ordersCounter.add(1, { status: 'success' });
626
- latencyHistogram.record(0.123);`})]}),Z("div",{className:"space-y-4",children:[T("h2",{className:"font-bold text-2xl",children:"Middleware"}),T("p",{className:"text-muted-foreground",children:"Automatically instrument your HTTP handlers:"}),T(ge,{language:"typescript",code:`import { createTracingMiddleware } from '@contractspec/lib.observability/tracing/middleware';
930
+ latencyHistogram.record(0.123);`})]}),j("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Middleware"}),P("p",{className:"text-muted-foreground",children:"Automatically instrument your HTTP handlers:"}),P(Be,{language:"typescript",code:`import { createTracingMiddleware } from '@contractspec/lib.observability/tracing/middleware';
627
931
 
628
- app.use(createTracingMiddleware());`})]}),Z("div",{className:"space-y-4",children:[T("h2",{className:"font-bold text-2xl",children:"Anomaly Detection"}),T("p",{className:"text-muted-foreground text-sm",children:"Includes baseline calculation and anomaly detection helpers for auto-rollback without writing custom math."}),T(ge,{language:"typescript",code:`import { AnomalyDetector, RootCauseAnalyzer, AlertManager } from '@contractspec/lib.observability';
932
+ app.use(createTracingMiddleware());`})]}),j("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Anomaly Detection"}),P("p",{className:"text-muted-foreground text-sm",children:"Includes baseline calculation and anomaly detection helpers for auto-rollback without writing custom math."}),P(Be,{language:"typescript",code:`import { AnomalyDetector, RootCauseAnalyzer, AlertManager } from '@contractspec/lib.observability';
629
933
 
630
934
  const detector = new AnomalyDetector({ errorRateDelta: 0.4 });
631
935
  const analyzer = new RootCauseAnalyzer();
@@ -635,7 +939,7 @@ const signals = detector.evaluate(point);
635
939
  signals.forEach((signal) => {
636
940
  const analysis = analyzer.analyze(signal, recentDeployments);
637
941
  alertManager.notify(signal, analysis);
638
- });`})]}),Z("div",{className:"flex items-center gap-4 pt-4",children:[T(gt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Z(gt,{href:"/docs/libraries/slo",className:"btn-primary",children:["Next: SLO ",T(Ea,{size:16})]})]})]})}import{CodeBlock as Ce,InstallCommand as Ma}from"@contractspec/lib.design-system";import ht from"@contractspec/lib.ui-link";import{ChevronRight as Wa}from"lucide-react";import{jsx as E,jsxs as ie}from"react/jsx-runtime";function za(){return ie("div",{className:"space-y-8",children:[ie("div",{className:"space-y-4",children:[E("h1",{className:"font-bold text-4xl",children:"Overlay Engine"}),E("p",{className:"text-lg text-muted-foreground",children:"`@contractspec/lib.overlay-engine` keeps OverlaySpecs typed, signed, and auditable across tenants, roles, users, and devices."})]}),ie("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Installation"}),E(Ma,{package:"@contractspec/lib.overlay-engine"})]}),ie("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Define + Sign"}),E(Ce,{language:"typescript",code:`import { defineOverlay } from '@contractspec/lib.overlay-engine/spec';
942
+ });`})]}),j("div",{className:"flex items-center gap-4 pt-4",children:[P(Ut,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),j(Ut,{href:"/docs/libraries/slo",className:"btn-primary",children:["Next: SLO ",P(No,{size:16})]})]})]})}import{CodeBlock as Ke,InstallCommand as ko}from"@contractspec/lib.design-system";import Wt from"@contractspec/lib.ui-link";import{ChevronRight as So}from"lucide-react";import{jsx as W,jsxs as fe}from"react/jsx-runtime";function Ro(){return fe("div",{className:"space-y-8",children:[fe("div",{className:"space-y-4",children:[W("h1",{className:"font-bold text-4xl",children:"Overlay Engine"}),W("p",{className:"text-lg text-muted-foreground",children:"`@contractspec/lib.overlay-engine` keeps OverlaySpecs typed, signed, and auditable across tenants, roles, users, and devices."})]}),fe("div",{className:"space-y-4",children:[W("h2",{className:"font-bold text-2xl",children:"Installation"}),W(ko,{package:"@contractspec/lib.overlay-engine"})]}),fe("div",{className:"space-y-4",children:[W("h2",{className:"font-bold text-2xl",children:"Define + Sign"}),W(Ke,{language:"typescript",code:`import { defineOverlay } from '@contractspec/lib.overlay-engine/spec';
639
943
  import { signOverlay } from '@contractspec/lib.overlay-engine/signer';
640
944
 
641
945
  const overlay = defineOverlay({
@@ -645,7 +949,7 @@ const overlay = defineOverlay({
645
949
  modifications: [{ type: 'hideField', field: 'internalNotes' }],
646
950
  });
647
951
 
648
- const signed = await signOverlay(overlay, privateKeyPem);`})]}),ie("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Runtime"}),E("p",{className:"text-muted-foreground",children:"`OverlayRegistry` stores signed overlays with specificity scoring. `OverlayEngine` merges modifications and emits audit events."}),E(Ce,{language:"typescript",code:`const registry = new OverlayRegistry();
952
+ const signed = await signOverlay(overlay, privateKeyPem);`})]}),fe("div",{className:"space-y-4",children:[W("h2",{className:"font-bold text-2xl",children:"Runtime"}),W("p",{className:"text-muted-foreground",children:"`OverlayRegistry` stores signed overlays with specificity scoring. `OverlayEngine` merges modifications and emits audit events."}),W(Ke,{language:"typescript",code:`const registry = new OverlayRegistry();
649
953
  registry.register(signed);
650
954
 
651
955
  const engine = new OverlayEngine({
@@ -657,13 +961,61 @@ const result = engine.apply({
657
961
  target: { fields },
658
962
  capability: 'billing.createOrder',
659
963
  tenantId: 'acme',
660
- });`})]}),ie("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"React Hooks"}),E("p",{className:"text-muted-foreground",children:"Render overlays in React/React Native via `useOverlay`."}),E(Ce,{language:"typescript",code:`import { useOverlay } from '@contractspec/lib.overlay-engine/react';
964
+ });`})]}),fe("div",{className:"space-y-4",children:[W("h2",{className:"font-bold text-2xl",children:"React Hooks"}),W("p",{className:"text-muted-foreground",children:"Render overlays in React/React Native via `useOverlay`."}),W(Ke,{language:"typescript",code:`import { useOverlay } from '@contractspec/lib.overlay-engine/react';
661
965
 
662
966
  const { target } = useOverlay(engine, {
663
967
  target: { fields },
664
968
  capability: 'billing.createOrder',
665
969
  tenantId: 'acme',
666
- });`})]}),ie("div",{className:"flex items-center gap-4 pt-4",children:[E(ht,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ie(ht,{href:"/docs/libraries/workflow-composer",className:"btn-primary",children:["Next: Workflow Composer ",E(Wa,{size:16})]})]})]})}import Ua from"@contractspec/lib.ui-link";import{ChevronRight as Ga}from"lucide-react";import{jsx as z,jsxs as re}from"react/jsx-runtime";var Fa=[{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:"Application shell",description:"Adopt the shared sidebar, topbar, command search, mobile navigation, and PageOutline patterns for product apps.",href:"/docs/libraries/application-shell"},{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 _a(){return re("div",{className:"space-y-10",children:[re("div",{className:"space-y-3",children:[z("p",{className:"editorial-kicker",children:"Build"}),z("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"The OSS foundation is a library system, not a closed platform."}),z("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."})]}),re("div",{className:"editorial-proof-strip",children:[re("div",{className:"editorial-stat",children:[z("span",{className:"editorial-label",children:"Layering rule"}),z("span",{className:"editorial-stat-value",children:"libs → bundles → apps"})]}),z("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."})]}),z("div",{className:"space-y-6",children:Fa.map((e)=>re("section",{className:"editorial-panel space-y-5",children:[re("div",{className:"space-y-2",children:[z("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:e.title}),z("p",{className:"text-muted-foreground text-sm leading-7",children:e.body})]}),z("div",{className:"grid gap-4 md:grid-cols-2",children:e.items.map((S)=>re(Ua,{href:S.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:[z("h3",{className:"font-semibold text-lg",children:S.title}),z("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:S.description}),re("div",{className:"mt-3 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Learn more ",z(Ga,{size:14})]})]},S.title))})]},e.title))})]})}import{CodeBlock as Te,InstallCommand as Va}from"@contractspec/lib.design-system";import ft from"@contractspec/lib.ui-link";import{ChevronRight as qa}from"lucide-react";import{jsx as R,jsxs as ne}from"react/jsx-runtime";function Ha(){return ne("div",{className:"space-y-8",children:[ne("div",{className:"space-y-4",children:[R("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.personalization"}),R("p",{className:"text-lg text-muted-foreground",children:"Track field/feature/workflow usage, analyze drop-offs, and convert insights into OverlaySpecs or workflow tweaks."})]}),ne("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Installation"}),R(Va,{package:"@contractspec/lib.personalization"})]}),ne("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Tracker"}),R("p",{className:"text-muted-foreground",children:"Buffer events per tenant/user and emit OpenTelemetry counters automatically."}),R(Te,{language:"typescript",code:`import { createBehaviorTracker } from '@contractspec/lib.personalization';
970
+ });`})]}),fe("div",{className:"flex items-center gap-4 pt-4",children:[W(Wt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),fe(Wt,{href:"/docs/libraries/workflow-composer",className:"btn-primary",children:["Next: Workflow Composer ",W(So,{size:16})]})]})]})}import Co from"@contractspec/lib.ui-link";import{ChevronRight as To}from"lucide-react";import{jsx as F,jsxs as be}from"react/jsx-runtime";var Ao=[{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.translation-runtime",description:"Resolve ContractSpec TranslationSpec catalogs with ICU formatting, SSR snapshots, BCP 47 locales, overrides, and optional i18next projection.",href:"/docs/libraries/translation-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, actionable object references, adaptive panels, and documented marketing/docs primitives on top of the web and native UI packages.",href:"/docs/libraries/design-system"},{title:"Application shell",description:"Adopt the shared sidebar, topbar, command search, notifications, mobile navigation, and PageOutline patterns for product apps.",href:"/docs/libraries/application-shell"},{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 Lo(){return be("div",{className:"space-y-10",children:[be("div",{className:"space-y-3",children:[F("p",{className:"editorial-kicker",children:"Build"}),F("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"The OSS foundation is a library system, not a closed platform."}),F("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."})]}),be("div",{className:"editorial-proof-strip",children:[be("div",{className:"editorial-stat",children:[F("span",{className:"editorial-label",children:"Layering rule"}),F("span",{className:"editorial-stat-value",children:"libs → bundles → apps"})]}),F("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."})]}),F("div",{className:"space-y-6",children:Ao.map((a)=>be("section",{className:"editorial-panel space-y-5",children:[be("div",{className:"space-y-2",children:[F("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:a.title}),F("p",{className:"text-muted-foreground text-sm leading-7",children:a.body})]}),F("div",{className:"grid gap-4 md:grid-cols-2",children:a.items.map((A)=>be(Co,{href:A.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:[F("h3",{className:"font-semibold text-lg",children:A.title}),F("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:A.description}),be("div",{className:"mt-3 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Learn more ",F(To,{size:14})]})]},A.title))})]},a.title))})]})}import{CodeBlock as Le,InstallCommand as Io}from"@contractspec/lib.design-system";import{HStack as Po,VStack as ne}from"@contractspec/lib.design-system/layout";import{Code as zt,H1 as Oo,H2 as Ne,P as we,Text as Qe}from"@contractspec/lib.design-system/typography";import Je from"@contractspec/lib.ui-link";import{ChevronRight as Do}from"lucide-react";import{jsx as u,jsxs as _}from"react/jsx-runtime";var Mo=`import { DataViewRenderer } from '@contractspec/lib.design-system';
971
+ import { resolveDataViewPreferences } from '@contractspec/lib.personalization/data-view-preferences';
972
+
973
+ const resolved = resolveDataViewPreferences({
974
+ spec: AccountsDataView,
975
+ preferences: profile.canonical,
976
+ insights,
977
+ record: savedAccountViewPreference,
978
+ });
979
+
980
+ return (
981
+ <DataViewRenderer
982
+ spec={AccountsDataView}
983
+ items={accounts}
984
+ defaultViewMode={resolved.viewMode}
985
+ defaultDensity={resolved.density}
986
+ defaultDataDepth={resolved.dataDepth}
987
+ pagination={{
988
+ page,
989
+ pageSize: resolved.pageSize ?? 25,
990
+ total,
991
+ }}
992
+ />
993
+ );`,Eo=`tracker.trackDataViewInteraction({
994
+ dataViewKey: AccountsDataView.meta.key,
995
+ dataViewVersion: AccountsDataView.meta.version,
996
+ action: 'view_mode_changed',
997
+ viewMode: 'grid',
998
+ });
999
+
1000
+ tracker.trackDataViewInteraction({
1001
+ dataViewKey: AccountsDataView.meta.key,
1002
+ action: 'data_depth_changed',
1003
+ dataDepth: 'detailed',
1004
+ });
1005
+
1006
+ tracker.trackDataViewInteraction({
1007
+ dataViewKey: AccountsDataView.meta.key,
1008
+ action: 'filter_changed',
1009
+ filterKey: 'status',
1010
+ });`,Bo=`Add DataView personalization for <screen>.
1011
+
1012
+ Acceptance criteria:
1013
+ - Resolve viewMode, density, dataDepth, and pageSize with resolveDataViewPreferences.
1014
+ - Apply resolved values to DataViewRenderer as default or controlled props.
1015
+ - Track opened, view_mode_changed, density_changed, data_depth_changed, search_changed, filter_changed, sort_changed, and page_changed actions with trackDataViewInteraction.
1016
+ - Persist only the dimensions allowed by view.collection.personalization.persist.
1017
+ - Ignore behavior-derived modes that are not allowed by view.collection.viewModes.allowedModes.
1018
+ - Do not import React or design-system code into @contractspec/lib.personalization helpers.`;function Uo(){return _(ne,{className:"space-y-8",children:[_(ne,{className:"space-y-4",children:[u(Oo,{className:"font-bold text-4xl",children:"@contractspec/lib.personalization"}),u(we,{className:"text-lg text-muted-foreground",children:"Track field/feature/workflow usage, analyze drop-offs, and convert insights into OverlaySpecs or workflow tweaks."})]}),_(ne,{className:"space-y-4",children:[u(Ne,{className:"font-bold text-2xl",children:"Installation"}),u(Io,{package:"@contractspec/lib.personalization"})]}),_(ne,{className:"space-y-4",children:[u(Ne,{className:"font-bold text-2xl",children:"Tracker"}),u(we,{className:"text-muted-foreground",children:"Buffer events per tenant/user and emit OpenTelemetry counters automatically."}),u(Le,{language:"typescript",code:`import { createBehaviorTracker } from '@contractspec/lib.personalization';
667
1019
 
668
1020
  const tracker = createBehaviorTracker({
669
1021
  store,
@@ -671,17 +1023,23 @@ const tracker = createBehaviorTracker({
671
1023
  });
672
1024
 
673
1025
  tracker.trackFieldAccess({ operation: 'billing.createOrder', field: 'items' });
674
- tracker.trackWorkflowStep({ workflow: 'invoice', step: 'review', status: 'entered' });`})]}),ne("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Analyzer"}),R("p",{className:"text-muted-foreground",children:"Summarize events and highlight unused UI, frequent fields, and workflow bottlenecks."}),R(Te,{language:"typescript",code:`import { BehaviorAnalyzer } from '@contractspec/lib.personalization/analyzer';
1026
+ tracker.trackWorkflowStep({ workflow: 'invoice', step: 'review', status: 'entered' });`})]}),_(ne,{className:"space-y-4",children:[u(Ne,{className:"font-bold text-2xl",children:"DataView Preferences"}),_(we,{className:"text-muted-foreground",children:["Use ",u(zt,{children:"resolveDataViewPreferences"})," when a collection DataView should honor a user's preferred list/grid/table mode, compact or comfortable density, data depth, and page size. The helper returns plain values that can be passed into the renderer without coupling the design-system package to personalization. Start from the"," ",u(Je,{href:"/docs/libraries/data-views",className:"text-[color:var(--rust)] underline underline-offset-4",children:u(Qe,{children:"DataViews runtime guide"})})," ","when you need the contract and renderer shape."]}),u(Le,{language:"tsx",code:Mo})]}),_(ne,{className:"space-y-4",children:[u(Ne,{className:"font-bold text-2xl",children:"DataView Interaction Events"}),_(we,{className:"text-muted-foreground",children:["Track ",u(zt,{children:"data_view_interaction"})," events for view mode, density, data depth, search, filters, sorting, and pagination. The in-memory store summarizes those events, and the analyzer can derive a scoped preferred collection mode from valid interaction counts."]}),u(Le,{language:"typescript",code:Eo})]}),_(ne,{className:"space-y-4",children:[u(Ne,{className:"font-bold text-2xl",children:"Analyzer"}),u(we,{className:"text-muted-foreground",children:"Summarize events and highlight unused UI, frequent fields, and workflow bottlenecks."}),u(Le,{language:"typescript",code:`import { BehaviorAnalyzer } from '@contractspec/lib.personalization/analyzer';
675
1027
 
676
1028
  const analyzer = new BehaviorAnalyzer(store);
677
1029
  const insights = await analyzer.analyze({ tenantId: 'acme', userId: 'ops-42' });
678
- // { unusedFields: ['internalNotes'], workflowBottlenecks: [...] }`})]}),ne("div",{className:"space-y-4",children:[R("h2",{className:"font-bold text-2xl",children:"Adapter"}),R("p",{className:"text-muted-foreground",children:"Convert insights into overlays or workflow extension hints."}),R(Te,{language:"typescript",code:`import { insightsToOverlaySuggestion } from '@contractspec/lib.personalization/adapter';
1030
+ // {
1031
+ // unusedFields: ['internalNotes'],
1032
+ // workflowBottlenecks: [...],
1033
+ // dataViewPreferences: {
1034
+ // 'crm.accounts': { preferredViewMode: 'grid' }
1035
+ // }
1036
+ // }`})]}),_(ne,{className:"space-y-4",children:[u(Ne,{className:"font-bold text-2xl",children:"Adapter"}),u(we,{className:"text-muted-foreground",children:"Convert insights into overlays or workflow extension hints."}),u(Le,{language:"typescript",code:`import { insightsToOverlaySuggestion } from '@contractspec/lib.personalization/adapter';
679
1037
 
680
1038
  const overlay = insightsToOverlaySuggestion(insights, {
681
1039
  overlayId: 'acme-order-form',
682
1040
  tenantId: 'acme',
683
1041
  capability: 'billing.createOrder',
684
- });`})]}),ne("div",{className:"flex items-center gap-4 pt-4",children:[R(ft,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ne(ft,{href:"/docs/libraries/overlay-engine",className:"btn-primary",children:["Next: Overlay Engine ",R(qa,{size:16})]})]})]})}import{CodeBlock as bt,InstallCommand as Qa}from"@contractspec/lib.design-system";import vt from"@contractspec/lib.ui-link";import{ChevronRight as Ka}from"lucide-react";import{jsx as I,jsxs as q}from"react/jsx-runtime";function Ja(){return q("div",{className:"space-y-8",children:[q("div",{className:"space-y-4",children:[I("h1",{className:"font-bold text-4xl",children:"Progressive Delivery Library"}),q("p",{className:"text-lg text-muted-foreground",children:["The ",I("code",{children:"@contractspec/lib.progressive-delivery"})," package helps you ship new specs with confidence: canary + blue-green strategies, metric guardrails, and rollback hooks in one place."]})]}),q("div",{className:"space-y-4",children:[I("h2",{className:"font-bold text-2xl",children:"Installation"}),I(Qa,{package:"@contractspec/lib.progressive-delivery"})]}),q("div",{className:"space-y-4",children:[I("h2",{className:"font-bold text-2xl",children:"Define a Strategy"}),I(bt,{language:"typescript",code:`import { DeploymentCoordinator, createDefaultCanaryController, TrafficShifter, RollbackManager } from '@contractspec/lib.progressive-delivery';
1042
+ });`})]}),_(ne,{className:"space-y-4",children:[u(Ne,{className:"font-bold text-2xl",children:"Agent Prompt"}),u(we,{className:"text-muted-foreground",children:"Use this when asking an agent to wire DataView preferences while preserving the personalization/design-system boundary."}),u(Le,{language:"markdown",code:Bo})]}),_(Po,{className:"items-center gap-4 pt-4",children:[u(Je,{href:"/docs/libraries",className:"btn-ghost",children:u(Qe,{children:"Back to Libraries"})}),_(Je,{href:"/docs/libraries/overlay-engine",className:"btn-primary",children:[u(Qe,{children:"Next: Overlay Engine"})," ",u(Do,{size:16})]})]})]})}import{CodeBlock as Gt,InstallCommand as Wo}from"@contractspec/lib.design-system";import Ft from"@contractspec/lib.ui-link";import{ChevronRight as zo}from"lucide-react";import{jsx as D,jsxs as V}from"react/jsx-runtime";function Go(){return V("div",{className:"space-y-8",children:[V("div",{className:"space-y-4",children:[D("h1",{className:"font-bold text-4xl",children:"Progressive Delivery Library"}),V("p",{className:"text-lg text-muted-foreground",children:["The ",D("code",{children:"@contractspec/lib.progressive-delivery"})," package helps you ship new specs with confidence: canary + blue-green strategies, metric guardrails, and rollback hooks in one place."]})]}),V("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Installation"}),D(Wo,{package:"@contractspec/lib.progressive-delivery"})]}),V("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Define a Strategy"}),D(Gt,{language:"typescript",code:`import { DeploymentCoordinator, createDefaultCanaryController, TrafficShifter, RollbackManager } from '@contractspec/lib.progressive-delivery';
685
1043
 
686
1044
  const strategy = {
687
1045
  target: { name: 'billing.createInvoice', version: 7 },
@@ -691,7 +1049,7 @@ const strategy = {
691
1049
  latencyP99: 500,
692
1050
  latencyP95: 250,
693
1051
  },
694
- };`})]}),q("div",{className:"space-y-4",children:[I("h2",{className:"font-bold text-2xl",children:"Run the Coordinator"}),I(bt,{language:"typescript",code:`const eventBus = new DeploymentEventBus();
1052
+ };`})]}),V("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Run the Coordinator"}),D(Gt,{language:"typescript",code:`const eventBus = new DeploymentEventBus();
695
1053
  const controller = createDefaultCanaryController(strategy, fetchMetrics, eventBus);
696
1054
  const coordinator = new DeploymentCoordinator({
697
1055
  strategy,
@@ -702,7 +1060,7 @@ const coordinator = new DeploymentCoordinator({
702
1060
  eventBus,
703
1061
  });
704
1062
 
705
- const result = await coordinator.run();`}),q("p",{className:"text-muted-foreground text-sm",children:["The coordinator emits ",I("code",{children:"stage_started"}),","," ",I("code",{children:"stage_failed"}),", and ",I("code",{children:"rolled_back"})," events, making it easy to power dashboards or alerting workflows."]})]}),q("div",{className:"space-y-4",children:[I("h2",{className:"font-bold text-2xl",children:"Blue-Green Swap"}),q("p",{className:"text-muted-foreground text-sm",children:["Switch to ",I("code",{children:"mode: 'blue-green'"})," to warm up the new stack in parallel and cut over once smoke tests pass. The same guardrails apply before the final swap."]})]}),q("div",{className:"flex items-center gap-4 pt-4",children:[I(vt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),q(vt,{href:"/docs/libraries/resilience",className:"btn-primary",children:["Next: Resilience ",I(Ka,{size:16})]})]})]})}import{CodeBlock as Le,InstallCommand as Za}from"@contractspec/lib.design-system";import yt from"@contractspec/lib.ui-link";import{ChevronRight as Xa}from"lucide-react";import{jsx as A,jsxs as j}from"react/jsx-runtime";function Ya(){return j("div",{className:"space-y-8",children:[j("div",{className:"space-y-4",children:[A("h1",{className:"font-bold text-4xl",children:"Resilience Library"}),j("p",{className:"text-lg text-muted-foreground",children:["The ",A("code",{children:"@contractspec/lib.resilience"})," library provides primitives to handle failures gracefully."]})]}),j("div",{className:"space-y-4",children:[A("h2",{className:"font-bold text-2xl",children:"Installation"}),A(Za,{package:"@contractspec/lib.resilience"})]}),j("div",{className:"space-y-4",children:[A("h2",{className:"font-bold text-2xl",children:"Circuit Breaker"}),A("p",{className:"text-muted-foreground",children:"Prevent cascading failures by stopping calls to a failing dependency."}),A(Le,{language:"typescript",code:`import { CircuitBreaker } from '@contractspec/lib.resilience/circuit-breaker';
1063
+ const result = await coordinator.run();`}),V("p",{className:"text-muted-foreground text-sm",children:["The coordinator emits ",D("code",{children:"stage_started"}),","," ",D("code",{children:"stage_failed"}),", and ",D("code",{children:"rolled_back"})," events, making it easy to power dashboards or alerting workflows."]})]}),V("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Blue-Green Swap"}),V("p",{className:"text-muted-foreground text-sm",children:["Switch to ",D("code",{children:"mode: 'blue-green'"})," to warm up the new stack in parallel and cut over once smoke tests pass. The same guardrails apply before the final swap."]})]}),V("div",{className:"flex items-center gap-4 pt-4",children:[D(Ft,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),V(Ft,{href:"/docs/libraries/resilience",className:"btn-primary",children:["Next: Resilience ",D(zo,{size:16})]})]})]})}import{CodeBlock as Ze,InstallCommand as Fo}from"@contractspec/lib.design-system";import _t from"@contractspec/lib.ui-link";import{ChevronRight as _o}from"lucide-react";import{jsx as M,jsxs as ce}from"react/jsx-runtime";function qo(){return ce("div",{className:"space-y-8",children:[ce("div",{className:"space-y-4",children:[M("h1",{className:"font-bold text-4xl",children:"Resilience Library"}),ce("p",{className:"text-lg text-muted-foreground",children:["The ",M("code",{children:"@contractspec/lib.resilience"})," library provides primitives to handle failures gracefully."]})]}),ce("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Installation"}),M(Fo,{package:"@contractspec/lib.resilience"})]}),ce("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Circuit Breaker"}),M("p",{className:"text-muted-foreground",children:"Prevent cascading failures by stopping calls to a failing dependency."}),M(Ze,{language:"typescript",code:`import { CircuitBreaker } from '@contractspec/lib.resilience/circuit-breaker';
706
1064
 
707
1065
  const breaker = new CircuitBreaker({
708
1066
  failureThreshold: 5,
@@ -711,19 +1069,19 @@ const breaker = new CircuitBreaker({
711
1069
 
712
1070
  const result = await breaker.execute(async () => {
713
1071
  return await fetch('https://api.stripe.com/v1/charges');
714
- });`})]}),j("div",{className:"space-y-4",children:[A("h2",{className:"font-bold text-2xl",children:"Retry"}),A("p",{className:"text-muted-foreground",children:"Automatically retry transient failures with exponential backoff."}),A(Le,{language:"typescript",code:`import { retry } from '@contractspec/lib.resilience/retry';
1072
+ });`})]}),ce("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Retry"}),M("p",{className:"text-muted-foreground",children:"Automatically retry transient failures with exponential backoff."}),M(Ze,{language:"typescript",code:`import { retry } from '@contractspec/lib.resilience/retry';
715
1073
 
716
1074
  const result = await retry(
717
1075
  async () => fetchUser(id),
718
1076
  3, // retries
719
1077
  1000, // initial delay
720
1078
  true // backoff
721
- );`})]}),j("div",{className:"space-y-4",children:[A("h2",{className:"font-bold text-2xl",children:"Timeout & Fallback"}),A("p",{className:"text-muted-foreground",children:"Set hard limits on execution time and provide default values on failure."}),A(Le,{language:"typescript",code:`import { timeout, fallback } from '@contractspec/lib.resilience';
1079
+ );`})]}),ce("div",{className:"space-y-4",children:[M("h2",{className:"font-bold text-2xl",children:"Timeout & Fallback"}),M("p",{className:"text-muted-foreground",children:"Set hard limits on execution time and provide default values on failure."}),M(Ze,{language:"typescript",code:`import { timeout, fallback } from '@contractspec/lib.resilience';
722
1080
 
723
1081
  const result = await fallback(
724
1082
  () => timeout(slowOperation, 5000),
725
1083
  defaultValue
726
- );`})]}),j("div",{className:"flex items-center gap-4 pt-4",children:[A(yt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),j(yt,{href:"/docs/libraries/testing",className:"btn-primary",children:["Next: Testing ",A(Xa,{size:16})]})]})]})}import{CodeBlock as $a,InstallCommand as xa}from"@contractspec/lib.design-system";import Re from"@contractspec/lib.ui-link";import{ChevronRight as ja}from"lucide-react";import{jsx as m,jsxs as g}from"react/jsx-runtime";function eo(){return g("div",{className:"space-y-8",children:[g("div",{className:"space-y-4",children:[m("h1",{className:"font-bold text-4xl",children:"Runtime Libraries"}),m("p",{className:"text-muted-foreground",children:"The presentation runtime libraries provide the engine for rendering ContractSpec-defined UIs. They handle state management, validation, step navigation, and component rendering for Workflows and DataViews."})]}),g("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Installation"}),m(xa,{package:"@contractspec/lib.presentation-runtime-react"})]}),g("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Libraries"}),g("div",{className:"space-y-6",children:[g("div",{className:"card-subtle p-6",children:[m("h3",{className:"font-bold text-lg",children:"@contractspec/lib.presentation-runtime-core"}),g("p",{className:"mt-2 text-muted-foreground text-sm",children:[m("strong",{children:"Framework-Agnostic Core"}),". Contains the state machines, validation logic, and navigation rules for workflows. Can be used to build renderers for any platform (Vue, Svelte, CLI)."]})]}),g("div",{className:"card-subtle p-6",children:[m("h3",{className:"font-bold text-lg",children:"@contractspec/lib.presentation-runtime-react"}),g("p",{className:"mt-2 text-muted-foreground text-sm",children:[m("strong",{children:"React Bindings"}),". Hooks (`useWorkflow`) and components (`WorkflowStepper`, `WorkflowStepRenderer`) for React Web applications. Integrates with `ui-kit-web`."]})]}),g("div",{className:"card-subtle p-6",children:[m("h3",{className:"font-bold text-lg",children:"@contractspec/lib.presentation-runtime-react-native"}),g("p",{className:"mt-2 text-muted-foreground text-sm",children:[m("strong",{children:"React Native Bindings"}),". Optimized for mobile experiences. Handles native navigation integration and uses universal components from `ui-kit`."]})]})]})]}),g("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Example: React Workflow"}),m($a,{language:"tsx",code:`import { useWorkflow, WorkflowStepRenderer } from '@contractspec/lib.presentation-runtime-react';
1084
+ );`})]}),ce("div",{className:"flex items-center gap-4 pt-4",children:[M(_t,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ce(_t,{href:"/docs/libraries/testing",className:"btn-primary",children:["Next: Testing ",M(_o,{size:16})]})]})]})}import{CodeBlock as Ho,InstallCommand as Ko}from"@contractspec/lib.design-system";import Ve from"@contractspec/lib.ui-link";import{ChevronRight as Qo}from"lucide-react";import{jsx as f,jsxs as v}from"react/jsx-runtime";function Jo(){return v("div",{className:"space-y-8",children:[v("div",{className:"space-y-4",children:[f("h1",{className:"font-bold text-4xl",children:"Runtime Libraries"}),f("p",{className:"text-muted-foreground",children:"The presentation runtime libraries provide the engine for rendering ContractSpec-defined UIs. They handle state management, validation, step navigation, and component rendering for Workflows and DataViews."})]}),v("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Installation"}),f(Ko,{package:"@contractspec/lib.presentation-runtime-react"})]}),v("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Libraries"}),v("div",{className:"space-y-6",children:[v("div",{className:"card-subtle p-6",children:[f("h3",{className:"font-bold text-lg",children:"@contractspec/lib.presentation-runtime-core"}),v("p",{className:"mt-2 text-muted-foreground text-sm",children:[f("strong",{children:"Framework-Agnostic Core"}),". Contains the state machines, validation logic, and navigation rules for workflows. Can be used to build renderers for any platform (Vue, Svelte, CLI)."]})]}),v("div",{className:"card-subtle p-6",children:[f("h3",{className:"font-bold text-lg",children:"@contractspec/lib.presentation-runtime-react"}),v("p",{className:"mt-2 text-muted-foreground text-sm",children:[f("strong",{children:"React Bindings"}),". Hooks (`useWorkflow`) and components (`WorkflowStepper`, `WorkflowStepRenderer`) for React Web applications. Integrates with `ui-kit-web`."]})]}),v("div",{className:"card-subtle p-6",children:[f("h3",{className:"font-bold text-lg",children:"@contractspec/lib.presentation-runtime-react-native"}),v("p",{className:"mt-2 text-muted-foreground text-sm",children:[f("strong",{children:"React Native Bindings"}),". Optimized for mobile experiences. Handles native navigation integration and uses universal components from `ui-kit`."]})]})]})]}),v("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Example: React Workflow"}),f(Ho,{language:"tsx",code:`import { useWorkflow, WorkflowStepRenderer } from '@contractspec/lib.presentation-runtime-react';
727
1085
  import { OnboardingFlow } from './specs/onboarding';
728
1086
 
729
1087
  export function OnboardingPage() {
@@ -763,7 +1121,7 @@ export function OnboardingPage() {
763
1121
  </div>
764
1122
  </div>
765
1123
  );
766
- }`})]}),g("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Architecture"}),m("p",{className:"text-muted-foreground",children:'The runtime follows a "render-loop" pattern:'}),g("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[g("li",{children:[m("strong",{children:"Spec"}),": Defines the flow, fields, and validation rules."]}),g("li",{children:[m("strong",{children:"Core"}),": Tracks current step, data state, and validation errors."]}),g("li",{children:[m("strong",{children:"Renderer"}),": Maps spec fields to UI components (Input, Select, etc.)."]}),g("li",{children:[m("strong",{children:"User"}),": Interacts with components, updating core state."]}),g("li",{children:[m("strong",{children:"Policy"}),": (Optional) Re-evaluates visibility on every change."]})]})]}),g("div",{className:"card-subtle space-y-3 p-6",children:[m("h2",{className:"font-bold text-2xl",children:"Related reading"}),g("p",{className:"text-muted-foreground",children:["For the full React and React Native layering story across runtime, primitives, and composed components, read"," ",m(Re,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"}),"."]})]}),g("div",{className:"flex items-center gap-4 pt-4",children:[m(Re,{href:"/docs/libraries/data-backend",className:"btn-ghost",children:"Previous: Data & Backend"}),g(Re,{href:"/docs/libraries",className:"btn-primary",children:["Back to Libraries ",m(ja,{size:16})]})]})]})}import{CodeBlock as Nt,InstallCommand as to}from"@contractspec/lib.design-system";import wt from"@contractspec/lib.ui-link";import{ChevronRight as ao}from"lucide-react";import{jsx as o,jsxs as h}from"react/jsx-runtime";function oo(){return h("div",{className:"space-y-8",children:[h("div",{className:"space-y-4",children:[o("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.schema"}),o("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."})]}),h("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Installation"}),o(to,{package:"@contractspec/lib.schema"})]}),h("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Core Exports"}),h("ul",{className:"space-y-2 text-muted-foreground",children:[h("li",{children:[o("code",{className:"rounded bg-background/50 px-2 py-1",children:"SchemaModel"}),": Compose fields into typed object models"]}),h("li",{children:[o("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum"}),": Common scalar types (NonEmptyString, Email, DateTime, etc.)"]}),h("li",{children:[o("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum"}),": Create type-safe enums"]}),h("li",{children:[o("code",{className:"rounded bg-background/50 px-2 py-1",children:"FieldType"}),": Wrap scalars with Zod/GraphQL/JSON Schema"]})]})]}),h("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Example: Basic Schema"}),o(Nt,{language:"typescript",code:`import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
1124
+ }`})]}),v("div",{className:"space-y-4",children:[f("h2",{className:"font-bold text-2xl",children:"Architecture"}),f("p",{className:"text-muted-foreground",children:'The runtime follows a "render-loop" pattern:'}),v("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[v("li",{children:[f("strong",{children:"Spec"}),": Defines the flow, fields, and validation rules."]}),v("li",{children:[f("strong",{children:"Core"}),": Tracks current step, data state, and validation errors."]}),v("li",{children:[f("strong",{children:"Renderer"}),": Maps spec fields to UI components (Input, Select, etc.)."]}),v("li",{children:[f("strong",{children:"User"}),": Interacts with components, updating core state."]}),v("li",{children:[f("strong",{children:"Policy"}),": (Optional) Re-evaluates visibility on every change."]})]})]}),v("div",{className:"card-subtle space-y-3 p-6",children:[f("h2",{className:"font-bold text-2xl",children:"Related reading"}),v("p",{className:"text-muted-foreground",children:["For the full React and React Native layering story across runtime, primitives, and composed components, read"," ",f(Ve,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"}),"."]})]}),v("div",{className:"flex items-center gap-4 pt-4",children:[f(Ve,{href:"/docs/libraries/data-backend",className:"btn-ghost",children:"Previous: Data & Backend"}),v(Ve,{href:"/docs/libraries",className:"btn-primary",children:["Back to Libraries ",f(Qo,{size:16})]})]})]})}import{CodeBlock as qt,InstallCommand as Zo}from"@contractspec/lib.design-system";import Ht from"@contractspec/lib.ui-link";import{ChevronRight as Vo}from"lucide-react";import{jsx as r,jsxs as y}from"react/jsx-runtime";function Yo(){return y("div",{className:"space-y-8",children:[y("div",{className:"space-y-4",children:[r("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.schema"}),r("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."})]}),y("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Installation"}),r(Zo,{package:"@contractspec/lib.schema"})]}),y("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Core Exports"}),y("ul",{className:"space-y-2 text-muted-foreground",children:[y("li",{children:[r("code",{className:"rounded bg-background/50 px-2 py-1",children:"SchemaModel"}),": Compose fields into typed object models"]}),y("li",{children:[r("code",{className:"rounded bg-background/50 px-2 py-1",children:"ScalarTypeEnum"}),": Common scalar types (NonEmptyString, Email, DateTime, etc.)"]}),y("li",{children:[r("code",{className:"rounded bg-background/50 px-2 py-1",children:"defineEnum"}),": Create type-safe enums"]}),y("li",{children:[r("code",{className:"rounded bg-background/50 px-2 py-1",children:"FieldType"}),": Wrap scalars with Zod/GraphQL/JSON Schema"]})]})]}),y("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Example: Basic Schema"}),r(qt,{language:"typescript",code:`import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
767
1125
 
768
1126
  export const CreateSpotInput = new SchemaModel({
769
1127
  name: 'CreateSpotInput',
@@ -781,7 +1139,7 @@ const zodSchema = CreateSpotInput.getZod();
781
1139
  const pothosName = CreateSpotInput.getPothosInput();
782
1140
 
783
1141
  // Get JSON Schema
784
- const jsonSchema = CreateSpotInput.getJsonSchema();`})]}),h("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Example: Enums"}),o(Nt,{language:"typescript",code:`import { defineEnum, SchemaModel } from '@contractspec/lib.schema';
1142
+ const jsonSchema = CreateSpotInput.getJsonSchema();`})]}),y("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Example: Enums"}),r(qt,{language:"typescript",code:`import { defineEnum, SchemaModel } from '@contractspec/lib.schema';
785
1143
 
786
1144
  const Weekday = defineEnum('Weekday', [
787
1145
  'MO', 'TU', 'WE', 'TH', 'FR', 'SA', 'SU',
@@ -796,19 +1154,19 @@ const RecurrenceRule = new SchemaModel({
796
1154
  },
797
1155
  byWeekday: { type: Weekday, isOptional: true, isArray: true },
798
1156
  },
799
- });`})]}),h("div",{className:"space-y-4",children:[o("h2",{className:"font-bold text-2xl",children:"Available Scalars"}),h("div",{className:"grid gap-4 md:grid-cols-2",children:[h("div",{className:"card-subtle p-4",children:[o("h3",{className:"mb-2 font-semibold",children:"Strings"}),h("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[o("li",{children:o("code",{children:"NonEmptyString()"})}),o("li",{children:o("code",{children:"Email()"})}),o("li",{children:o("code",{children:"PhoneNumber()"})}),o("li",{children:o("code",{children:"CountryCode()"})}),o("li",{children:o("code",{children:"Locale()"})}),o("li",{children:o("code",{children:"TimeZone()"})})]})]}),h("div",{className:"card-subtle p-4",children:[o("h3",{className:"mb-2 font-semibold",children:"Numbers"}),h("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[o("li",{children:o("code",{children:"PositiveNumber()"})}),o("li",{children:o("code",{children:"Latitude()"})}),o("li",{children:o("code",{children:"Longitude()"})})]})]}),h("div",{className:"card-subtle p-4",children:[o("h3",{className:"mb-2 font-semibold",children:"Dates & Times"}),h("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[o("li",{children:o("code",{children:"Date()"})}),o("li",{children:o("code",{children:"DateTime()"})})]})]}),h("div",{className:"card-subtle p-4",children:[o("h3",{className:"mb-2 font-semibold",children:"Generic"}),h("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[o("li",{children:o("code",{children:"String()"})}),o("li",{children:o("code",{children:"JSON()"})})]})]})]})]}),h("div",{className:"flex items-center gap-4 pt-4",children:[o(wt,{href:"/docs/libraries/contracts",className:"btn-ghost",children:"Previous: Contracts"}),h(wt,{href:"/docs/libraries/ui-kit",className:"btn-primary",children:["Next: UI Kit ",o(ao,{size:16})]})]})]})}import{CodeBlock as kt,InstallCommand as io}from"@contractspec/lib.design-system";import St from"@contractspec/lib.ui-link";import{ChevronRight as ro}from"lucide-react";import{jsx as U,jsxs as X}from"react/jsx-runtime";function no(){return X("div",{className:"space-y-8",children:[X("div",{className:"space-y-4",children:[U("h1",{className:"font-bold text-4xl",children:"SLO Library"}),X("p",{className:"text-lg text-muted-foreground",children:[U("code",{children:"@contractspec/lib.slo"})," keeps service level objectives front and center—declarative definitions, rolling snapshots, burn-rate math, and automated incidents."]})]}),X("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"Installation"}),U(io,{package:"@contractspec/lib.slo"})]}),X("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"Define Targets"}),U(kt,{language:"typescript",code:`const definition: SLODefinition = {
1157
+ });`})]}),y("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"Available Scalars"}),y("div",{className:"grid gap-4 md:grid-cols-2",children:[y("div",{className:"card-subtle p-4",children:[r("h3",{className:"mb-2 font-semibold",children:"Strings"}),y("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[r("li",{children:r("code",{children:"NonEmptyString()"})}),r("li",{children:r("code",{children:"Email()"})}),r("li",{children:r("code",{children:"PhoneNumber()"})}),r("li",{children:r("code",{children:"CountryCode()"})}),r("li",{children:r("code",{children:"Locale()"})}),r("li",{children:r("code",{children:"TimeZone()"})})]})]}),y("div",{className:"card-subtle p-4",children:[r("h3",{className:"mb-2 font-semibold",children:"Numbers"}),y("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[r("li",{children:r("code",{children:"PositiveNumber()"})}),r("li",{children:r("code",{children:"Latitude()"})}),r("li",{children:r("code",{children:"Longitude()"})})]})]}),y("div",{className:"card-subtle p-4",children:[r("h3",{className:"mb-2 font-semibold",children:"Dates & Times"}),y("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[r("li",{children:r("code",{children:"Date()"})}),r("li",{children:r("code",{children:"DateTime()"})})]})]}),y("div",{className:"card-subtle p-4",children:[r("h3",{className:"mb-2 font-semibold",children:"Generic"}),y("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[r("li",{children:r("code",{children:"String()"})}),r("li",{children:r("code",{children:"JSON()"})})]})]})]})]}),y("div",{className:"flex items-center gap-4 pt-4",children:[r(Ht,{href:"/docs/libraries/contracts",className:"btn-ghost",children:"Previous: Contracts"}),y(Ht,{href:"/docs/libraries/ui-kit",className:"btn-primary",children:["Next: UI Kit ",r(Vo,{size:16})]})]})]})}import{CodeBlock as Kt,InstallCommand as Xo}from"@contractspec/lib.design-system";import Qt from"@contractspec/lib.ui-link";import{ChevronRight as $o}from"lucide-react";import{jsx as q,jsxs as ee}from"react/jsx-runtime";function xo(){return ee("div",{className:"space-y-8",children:[ee("div",{className:"space-y-4",children:[q("h1",{className:"font-bold text-4xl",children:"SLO Library"}),ee("p",{className:"text-lg text-muted-foreground",children:[q("code",{children:"@contractspec/lib.slo"})," keeps service level objectives front and center—declarative definitions, rolling snapshots, burn-rate math, and automated incidents."]})]}),ee("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Installation"}),q(Xo,{package:"@contractspec/lib.slo"})]}),ee("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Define Targets"}),q(Kt,{language:"typescript",code:`const definition: SLODefinition = {
800
1158
  id: 'billing.createInvoice.availability',
801
1159
  targetAvailability: 0.999,
802
1160
  latencyP99TargetMs: 500,
803
1161
  rollingWindowMs: 7 * 24 * 60 * 60 * 1000,
804
1162
  alerts: { fastBurnThreshold: 14, slowBurnThreshold: 6 },
805
- };`})]}),X("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"Monitor Burn Rate"}),U(kt,{language:"typescript",code:`const monitor = new SLOMonitor({ definition, incidentManager });
1163
+ };`})]}),ee("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"Monitor Burn Rate"}),q(Kt,{language:"typescript",code:`const monitor = new SLOMonitor({ definition, incidentManager });
806
1164
  const { snapshot, burnRate } = monitor.recordWindow({
807
1165
  good: 12500,
808
1166
  bad: 3,
809
1167
  latencyP99: 420,
810
1168
  latencyP95: 210,
811
- });`}),X("p",{className:"text-muted-foreground text-sm",children:["When burn rate exceeds the configured thresholds the monitor calls your",U("code",{children:"IncidentManager"}),", providing the snapshot that triggered the alert."]})]}),X("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"History & Reporting"}),U("p",{className:"text-muted-foreground text-sm",children:"`SLOTracker.getHistory()` returns the latest snapshots so dashboards can show trends without hitting a warehouse. Prisma models persist everything for long-term audits."})]}),X("div",{className:"flex items-center gap-4 pt-4",children:[U(St,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),X(St,{href:"/docs/libraries/cost-tracking",className:"btn-primary",children:["Next: Cost Tracking ",U(ro,{size:16})]})]})]})}import{CodeBlock as Ct,InstallCommand as co}from"@contractspec/lib.design-system";import Tt from"@contractspec/lib.ui-link";import{ChevronRight as so}from"lucide-react";import{jsx as P,jsxs as G}from"react/jsx-runtime";function lo(){return G("div",{className:"space-y-8",children:[G("div",{className:"space-y-4",children:[P("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.support-bot"}),P("p",{className:"text-lg text-muted-foreground",children:"Build AI-first support flows using drop-in classifiers, knowledge-grounded resolvers, and tone-aware responders—all wired into the agent runner."})]}),G("div",{className:"space-y-4",children:[P("h2",{className:"font-bold text-2xl",children:"Installation"}),P(co,{package:"@contractspec/lib.support-bot"})]}),G("div",{className:"space-y-3",children:[P("h2",{className:"font-bold text-2xl",children:"Wire the primitives"}),P(Ct,{language:"typescript",code:`import { TicketClassifier, TicketResolver, AutoResponder } from '@contractspec/lib.support-bot';
1169
+ });`}),ee("p",{className:"text-muted-foreground text-sm",children:["When burn rate exceeds the configured thresholds the monitor calls your",q("code",{children:"IncidentManager"}),", providing the snapshot that triggered the alert."]})]}),ee("div",{className:"space-y-4",children:[q("h2",{className:"font-bold text-2xl",children:"History & Reporting"}),q("p",{className:"text-muted-foreground text-sm",children:"`SLOTracker.getHistory()` returns the latest snapshots so dashboards can show trends without hitting a warehouse. Prisma models persist everything for long-term audits."})]}),ee("div",{className:"flex items-center gap-4 pt-4",children:[q(Qt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ee(Qt,{href:"/docs/libraries/cost-tracking",className:"btn-primary",children:["Next: Cost Tracking ",q($o,{size:16})]})]})]})}import{CodeBlock as Jt,InstallCommand as jo}from"@contractspec/lib.design-system";import Zt from"@contractspec/lib.ui-link";import{ChevronRight as ei}from"lucide-react";import{jsx as E,jsxs as H}from"react/jsx-runtime";function ti(){return H("div",{className:"space-y-8",children:[H("div",{className:"space-y-4",children:[E("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.support-bot"}),E("p",{className:"text-lg text-muted-foreground",children:"Build AI-first support flows using drop-in classifiers, knowledge-grounded resolvers, and tone-aware responders—all wired into the agent runner."})]}),H("div",{className:"space-y-4",children:[E("h2",{className:"font-bold text-2xl",children:"Installation"}),E(jo,{package:"@contractspec/lib.support-bot"})]}),H("div",{className:"space-y-3",children:[E("h2",{className:"font-bold text-2xl",children:"Wire the primitives"}),E(Jt,{language:"typescript",code:`import { TicketClassifier, TicketResolver, AutoResponder } from '@contractspec/lib.support-bot';
812
1170
 
813
1171
  const classifier = new TicketClassifier();
814
1172
  const resolver = new TicketResolver({ knowledge });
@@ -816,10 +1174,10 @@ const responder = new AutoResponder();
816
1174
 
817
1175
  const classification = await classifier.classify(ticket);
818
1176
  const resolution = await resolver.resolve(ticket);
819
- const draft = await responder.draft(ticket, resolution, classification);`})]}),G("div",{className:"space-y-3",children:[P("h2",{className:"font-bold text-2xl",children:"Expose as agent tools"}),P(Ct,{language:"typescript",code:`import { createSupportTools } from '@contractspec/lib.support-bot/bot';
1177
+ const draft = await responder.draft(ticket, resolution, classification);`})]}),H("div",{className:"space-y-3",children:[E("h2",{className:"font-bold text-2xl",children:"Expose as agent tools"}),E(Jt,{language:"typescript",code:`import { createSupportTools } from '@contractspec/lib.support-bot/bot';
820
1178
 
821
1179
  const tools = createSupportTools({ resolver, classifier, responder });
822
- // Pass these tools into your host runtime or agent adapter.`})]}),G("div",{className:"space-y-3",children:[P("h2",{className:"font-bold text-2xl",children:"Included modules"}),G("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[G("li",{children:[P("strong",{children:"TicketClassifier"}),": heuristics + optional LLM validation for category/priority."]}),G("li",{children:[P("strong",{children:"TicketResolver"}),": RAG resolver that can plug into any knowledge retriever."]}),G("li",{children:[P("strong",{children:"AutoResponder"}),": generates drafts, citations, and tone-aware copy."]}),G("li",{children:[P("strong",{children:"SupportFeedbackLoop"}),": track auto-resolution rates and sentiment trends."]})]})]}),G("div",{className:"flex items-center gap-4 pt-4",children:[P(Tt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),G(Tt,{href:"/docs/libraries/growth",className:"btn-primary",children:["Next: Growth ",P(so,{size:16})]})]})]})}import{CodeBlock as Ie,InstallCommand as po}from"@contractspec/lib.design-system";import Lt from"@contractspec/lib.ui-link";import{ChevronRight as mo}from"lucide-react";import{jsx as D,jsxs as ee}from"react/jsx-runtime";function uo(){return ee("div",{className:"space-y-8",children:[ee("div",{className:"space-y-4",children:[D("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.testing"}),D("p",{className:"text-lg text-muted-foreground",children:"Golden tests ensure new rollouts behave exactly like the traffic that inspired them. Record requests in production, replay them locally, and ship with confidence."})]}),ee("div",{className:"space-y-4",children:[D("h2",{className:"font-bold text-2xl",children:"Installation"}),D(po,{package:"@contractspec/lib.testing"})]}),ee("div",{className:"space-y-3",children:[D("h2",{className:"font-bold text-2xl",children:"Record traffic"}),D(Ie,{language:"typescript",code:`import {
1180
+ // Pass these tools into your host runtime or agent adapter.`})]}),H("div",{className:"space-y-3",children:[E("h2",{className:"font-bold text-2xl",children:"Included modules"}),H("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[H("li",{children:[E("strong",{children:"TicketClassifier"}),": heuristics + optional LLM validation for category/priority."]}),H("li",{children:[E("strong",{children:"TicketResolver"}),": RAG resolver that can plug into any knowledge retriever."]}),H("li",{children:[E("strong",{children:"AutoResponder"}),": generates drafts, citations, and tone-aware copy."]}),H("li",{children:[E("strong",{children:"SupportFeedbackLoop"}),": track auto-resolution rates and sentiment trends."]})]})]}),H("div",{className:"flex items-center gap-4 pt-4",children:[E(Zt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),H(Zt,{href:"/docs/libraries/growth",className:"btn-primary",children:["Next: Growth ",E(ei,{size:16})]})]})]})}import{CodeBlock as Ye,InstallCommand as ai}from"@contractspec/lib.design-system";import Vt from"@contractspec/lib.ui-link";import{ChevronRight as oi}from"lucide-react";import{jsx as B,jsxs as se}from"react/jsx-runtime";function ii(){return se("div",{className:"space-y-8",children:[se("div",{className:"space-y-4",children:[B("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.testing"}),B("p",{className:"text-lg text-muted-foreground",children:"Golden tests ensure new rollouts behave exactly like the traffic that inspired them. Record requests in production, replay them locally, and ship with confidence."})]}),se("div",{className:"space-y-4",children:[B("h2",{className:"font-bold text-2xl",children:"Installation"}),B(ai,{package:"@contractspec/lib.testing"})]}),se("div",{className:"space-y-3",children:[B("h2",{className:"font-bold text-2xl",children:"Record traffic"}),B(Ye,{language:"typescript",code:`import {
823
1181
  TrafficRecorder,
824
1182
  InMemoryTrafficStore,
825
1183
  } from '@contractspec/lib.testing/recorder';
@@ -839,7 +1197,7 @@ await recorder.record({
839
1197
  output,
840
1198
  success: true,
841
1199
  tenantId: ctx.organizationId ?? undefined,
842
- });`})]}),ee("div",{className:"space-y-3",children:[D("h2",{className:"font-bold text-2xl",children:"Generate suites"}),D(Ie,{language:"typescript",code:`import { GoldenTestGenerator } from '@contractspec/lib.testing';
1200
+ });`})]}),se("div",{className:"space-y-3",children:[B("h2",{className:"font-bold text-2xl",children:"Generate suites"}),B(Ye,{language:"typescript",code:`import { GoldenTestGenerator } from '@contractspec/lib.testing';
843
1201
 
844
1202
  const generator = new GoldenTestGenerator();
845
1203
  const code = generator.generate(snapshots, {
@@ -847,7 +1205,48 @@ const code = generator.generate(snapshots, {
847
1205
  runnerImport: './tests/run-operation',
848
1206
  runnerFunction: 'runOrdersCommand',
849
1207
  framework: 'vitest',
850
- });`})]}),ee("div",{className:"space-y-3",children:[D("h2",{className:"font-bold text-2xl",children:"CLI workflow"}),D(Ie,{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"})]}),D("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)=>ee("div",{className:"card-subtle space-y-2 p-4",children:[D("h3",{className:"font-semibold text-lg",children:e.title}),D("p",{className:"text-muted-foreground text-sm",children:e.description})]},e.title))}),ee("div",{className:"flex items-center gap-4 pt-4",children:[D(Lt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),ee(Lt,{href:"/docs/libraries/resilience",className:"btn-primary",children:["Next: Resilience ",D(mo,{size:16})]})]})]})}import{CodeBlock as go,InstallCommand as ho}from"@contractspec/lib.design-system";import he from"@contractspec/lib.ui-link";import{ChevronRight as fo}from"lucide-react";import{jsx as i,jsxs as u}from"react/jsx-runtime";var bo=`import { DataTable } from '@contractspec/lib.ui-kit/ui/data-table';
1208
+ });`})]}),se("div",{className:"space-y-3",children:[B("h2",{className:"font-bold text-2xl",children:"CLI workflow"}),B(Ye,{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"})]}),B("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((a)=>se("div",{className:"card-subtle space-y-2 p-4",children:[B("h3",{className:"font-semibold text-lg",children:a.title}),B("p",{className:"text-muted-foreground text-sm",children:a.description})]},a.title))}),se("div",{className:"flex items-center gap-4 pt-4",children:[B(Vt,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),se(Vt,{href:"/docs/libraries/resilience",className:"btn-primary",children:["Next: Resilience ",B(oi,{size:16})]})]})]})}var Yt=["@contractspec/lib.contracts-spec","@contractspec/lib.translation-runtime"],Xt=`import { createTranslationRuntime } from '@contractspec/lib.translation-runtime';
1209
+ import { checkoutMessages } from './translations/checkout.messages';
1210
+
1211
+ const runtime = createTranslationRuntime({
1212
+ catalogs: [checkoutMessages],
1213
+ locale: 'fr-FR',
1214
+ fallbackLocales: ['fr', 'en-US'],
1215
+ onDiagnostic: (diagnostic) => reportTranslationIssue(diagnostic),
1216
+ });
1217
+
1218
+ const label = runtime.t('checkout.pay', {
1219
+ amount: 4200,
1220
+ currency: 'EUR',
1221
+ });`,$t=`import { createInstance } from 'i18next';
1222
+ import {
1223
+ createI18nextInitOptions,
1224
+ exportContractSpecToI18next,
1225
+ } from '@contractspec/lib.translation-runtime/i18next';
1226
+
1227
+ const exported = exportContractSpecToI18next([checkoutMessages], {
1228
+ locale: 'en-US',
1229
+ assumeIcuFormatter: true,
1230
+ });
1231
+ const { options, diagnostics } = createI18nextInitOptions(exported, {
1232
+ lng: 'en-US',
1233
+ });
1234
+
1235
+ const i18next = createInstance();
1236
+ await i18next.init(options);
1237
+ reportAdapterDiagnostics(diagnostics);`,xt=`// Server: negotiate once, preload catalogs, and serialize the runtime snapshot.
1238
+ const runtime = createTranslationRuntime({
1239
+ catalogs,
1240
+ locale: negotiatedLocale,
1241
+ fallbackLocales,
1242
+ });
1243
+ const snapshot = runtime.createSnapshot();
1244
+
1245
+ // Client: hydrate from the same snapshot so locale, resources, and fallback state match.
1246
+ const hydratedRuntime = createTranslationRuntime({ snapshot });`,jt=["Keep TranslationSpec as the source of truth; do not flatten metadata into i18next JSON as the canonical model.","Keep stable bundle identity in TranslationSpec.meta.key and keep BCP 47 language tags in TranslationSpec.locale.","Use ICU messages for plural, select, selectordinal, number, date, currency, list, and relative-time formatting.","Create one runtime per SSR request when tenant, project, or user overrides are involved.","Serialize the same runtime snapshot or exported adapter resources used by the server for hydration.","Configure an ICU-capable i18next formatter plugin when rendering ContractSpec ICU messages through i18next.","Treat adapter diagnostics as release blockers in production pipelines instead of silently rendering raw keys."],ea=`You are integrating ContractSpec translations into a production app.
1247
+ Use @contractspec/lib.contracts-spec/translations as the canonical contract layer and @contractspec/lib.translation-runtime as the runtime layer.
1248
+ Keep locale variants separate from stable bundle keys, support BCP 47 tags, preserve ICU plural/select/selectordinal messages, and use request-scoped runtime instances for SSR.
1249
+ If the app already uses i18next, use @contractspec/lib.translation-runtime/i18next only as a downstream adapter. Do not make i18next the canonical translation model. Include diagnostics, fallback behavior, tenant/user override isolation, and hydration snapshot handling in the implementation and tests.`,ta=[{title:"Spec layer",body:"TranslationSpec owns keys, locales, domains, versions, owners, fallback declarations, direction, and validation metadata."},{title:"Runtime layer",body:"Runtime instances negotiate locales, apply fallback chains, resolve overrides, cache compiled messages, report diagnostics, and serialize SSR snapshots."},{title:"Adapter layer",body:"The i18next adapter projects ContractSpec specs or snapshots to resources and manifests for caller-owned i18next instances."}];import{CodeBlock as Ue,InstallCommand as ri}from"@contractspec/lib.design-system";import{HStack as aa,VStack as le}from"@contractspec/lib.design-system/layout";import{List as ni,ListItem as ci}from"@contractspec/lib.design-system/list";import{Code as Xe,H1 as si,H2 as Ie,H3 as li,P as ke,Text as de}from"@contractspec/lib.design-system/typography";import oa from"@contractspec/lib.ui-link";import{ChevronRight as di}from"lucide-react";import{jsx as p,jsxs as T}from"react/jsx-runtime";function pi(){return T(le,{className:"space-y-8",children:[T(le,{className:"space-y-4",children:[p(de,{className:"editorial-kicker",children:"Runtime and adapters"}),p(si,{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Translation runtime and i18next adapter"}),p(ke,{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"Use ContractSpec as the canonical translation contract layer, then resolve and format messages through a framework-independent runtime. i18next is supported as an optional downstream adapter, not as the source of truth."})]}),T(le,{className:"space-y-4",children:[p(Ie,{className:"font-bold text-2xl",children:"Install the runtime"}),p(ri,{package:Yt}),T(ke,{className:"text-muted-foreground",children:[p(de,{children:"Add "}),p(Xe,{children:"i18next"}),T(de,{children:[" ","only when an app imports the adapter subpath. Core server, React, React Native, CLI, and test code can use the runtime without loading i18next."]})]})]}),p(aa,{className:"grid gap-4 md:grid-cols-3",children:ta.map((a)=>T(le,{className:"card-subtle space-y-2 p-5",children:[p(li,{className:"font-semibold text-lg",children:a.title}),p(ke,{className:"text-muted-foreground text-sm leading-7",children:a.body})]},a.title))}),T(le,{className:"space-y-4",children:[p(Ie,{className:"font-bold text-2xl",children:"Use the ContractSpec runtime"}),T(ke,{className:"text-muted-foreground",children:[p(de,{children:"The runtime consumes canonical "}),p(Xe,{children:"TranslationSpec[]"}),T(de,{children:[" ","catalogs, supports BCP 47 tags such as en-US, ar-EG, and zh-Hans, and delegates ICU parsing/formatting to a mature formatter engine instead of a custom parser."]})]}),p(Ue,{language:"typescript",code:Xt})]}),T(le,{className:"space-y-4",children:[p(Ie,{className:"font-bold text-2xl",children:"Project to i18next when needed"}),T(ke,{className:"text-muted-foreground",children:[p(de,{children:"Import from "}),p(Xe,{children:"@contractspec/lib.translation-runtime/i18next"}),T(de,{children:[" ","to export resources by locale, namespace, and message key. The namespace defaults to the stable bundle key, dotted message keys stay flat with keySeparator false, and metadata remains in a sidecar manifest."]})]}),p(Ue,{language:"typescript",code:$t})]}),T(le,{className:"space-y-4",children:[p(Ie,{className:"font-bold text-2xl",children:"SSR, streaming, and hydration"}),p(ke,{className:"text-muted-foreground",children:"Negotiate locale on the server, preload catalogs needed for streamed content, and hydrate the client from the same serialized state. Never let client-only language detection choose a different locale after the server has rendered."}),p(Ue,{language:"typescript",code:xt})]}),T(le,{className:"space-y-4",children:[p(Ie,{className:"font-bold text-2xl",children:"Production checklist"}),p(ni,{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:jt.map((a)=>p(ci,{children:a},a))})]}),T(le,{className:"space-y-4 rounded-xl border border-border p-6",children:[p(Ie,{className:"font-bold text-2xl",children:"Agent implementation prompt"}),p(ke,{className:"text-muted-foreground",children:"Use this prompt when asking an agent to wire translations into a web, server, or React Native surface without losing ContractSpec ownership."}),p(Ue,{language:"markdown",code:ea})]}),T(aa,{className:"flex flex-wrap items-center gap-4 pt-4",children:[p(oa,{href:"/docs/libraries/contracts",className:"btn-ghost",children:p(de,{children:"Translation contracts"})}),T(oa,{href:"/docs/libraries/design-system",className:"btn-primary",children:[p(de,{children:"Design-system integration"}),p(di,{size:16})]})]})]})}import{CodeBlock as mi,InstallCommand as ui}from"@contractspec/lib.design-system";import We from"@contractspec/lib.ui-link";import{ChevronRight as hi}from"lucide-react";import{jsx as n,jsxs as b}from"react/jsx-runtime";var gi=`import { DataTable } from '@contractspec/lib.ui-kit/ui/data-table';
851
1250
  import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
852
1251
 
853
1252
  import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
@@ -891,7 +1290,7 @@ export function NativeAccountGrid() {
891
1290
  footer={\`Rows \${controller.rows.length}\`}
892
1291
  />
893
1292
  );
894
- }`;function vo(){return u("div",{className:"space-y-8",children:[u("div",{className:"space-y-4",children:[i("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit"}),u("p",{className:"text-muted-foreground",children:["Universal UI components for React Native and Web, built on top of",i("code",{children:"nativewind"})," and ",i("code",{children:"@rn-primitives"}),"."]})]}),u("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Installation"}),i(ho,{package:"@contractspec/lib.ui-kit"})]}),u("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Key Features"}),u("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[u("li",{children:[i("strong",{children:"Universal"}),": Components render natively on iOS/Android and as standard HTML on web"]}),u("li",{children:[i("strong",{children:"Styled with NativeWind"}),": Uses Tailwind CSS classes for styling"]}),u("li",{children:[i("strong",{children:"Accessible"}),": Leverages ",i("code",{children:"@rn-primitives"})," ","(Radix UI for Native)"]}),u("li",{children:[i("strong",{children:"Atomic Design"}),": Exports atoms, molecules, and organisms"]})]})]}),u("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Data table example"}),u("p",{className:"text-muted-foreground",children:["The canonical"," ",i(he,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"})," ","uses ",i("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."]}),i(go,{language:"tsx",code:bo})]}),u("div",{className:"space-y-4",children:[i("h2",{className:"font-bold text-2xl",children:"Core Components"}),u("div",{className:"grid gap-4 md:grid-cols-3",children:[u("div",{className:"card-subtle p-4",children:[i("h3",{className:"mb-2 font-semibold",children:"Form Controls"}),u("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[i("li",{children:"Button"}),i("li",{children:"Input"}),i("li",{children:"Checkbox"}),i("li",{children:"Switch"}),i("li",{children:"Select"})]})]}),u("div",{className:"card-subtle p-4",children:[i("h3",{className:"mb-2 font-semibold",children:"Layout"}),u("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[i("li",{children:"Card"}),i("li",{children:"Stack"}),i("li",{children:"Separator"}),i("li",{children:"Sheet"})]})]}),u("div",{className:"card-subtle p-4",children:[i("h3",{className:"mb-2 font-semibold",children:"Feedback"}),u("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[i("li",{children:"Alert"}),i("li",{children:"Skeleton"}),i("li",{children:"Progress"}),i("li",{children:"Tooltip"})]})]})]})]}),u("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),u("p",{className:"text-muted-foreground",children:["Read"," ",i(he,{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."]})]}),u("div",{className:"flex items-center gap-4 pt-4",children:[i(he,{href:"/docs/libraries/schema",className:"btn-ghost",children:"Previous: Schema"}),u(he,{href:"/docs/libraries/ui-kit-web",className:"btn-primary",children:["Next: UI Kit Web ",i(fo,{size:16})]})]})]})}import{CodeBlock as yo,InstallCommand as No}from"@contractspec/lib.design-system";import fe from"@contractspec/lib.ui-link";import{ChevronRight as wo}from"lucide-react";import{jsx as O,jsxs as H}from"react/jsx-runtime";var ko=`import { DataTable } from '@contractspec/lib.ui-kit-web/ui/data-table';
1293
+ }`;function fi(){return b("div",{className:"space-y-8",children:[b("div",{className:"space-y-4",children:[n("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit"}),b("p",{className:"text-muted-foreground",children:["Universal UI components for React Native and Web, built on top of",n("code",{children:"nativewind"})," and ",n("code",{children:"@rn-primitives"}),"."]})]}),b("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Installation"}),n(ui,{package:"@contractspec/lib.ui-kit"})]}),b("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Key Features"}),b("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[b("li",{children:[n("strong",{children:"Universal"}),": Components render natively on iOS/Android and as standard HTML on web"]}),b("li",{children:[n("strong",{children:"Styled with NativeWind"}),": Uses Tailwind CSS classes for styling"]}),b("li",{children:[n("strong",{children:"Accessible"}),": Leverages ",n("code",{children:"@rn-primitives"})," ","(Radix UI for Native)"]}),b("li",{children:[n("strong",{children:"Atomic Design"}),": Exports atoms, molecules, and organisms"]})]})]}),b("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Data table example"}),b("p",{className:"text-muted-foreground",children:["The canonical"," ",n(We,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"})," ","uses ",n("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."]}),n(mi,{language:"tsx",code:gi})]}),b("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Core Components"}),b("div",{className:"grid gap-4 md:grid-cols-3",children:[b("div",{className:"card-subtle p-4",children:[n("h3",{className:"mb-2 font-semibold",children:"Form Controls"}),b("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[n("li",{children:"Button"}),n("li",{children:"Input"}),n("li",{children:"Checkbox"}),n("li",{children:"Switch"}),n("li",{children:"Select"})]})]}),b("div",{className:"card-subtle p-4",children:[n("h3",{className:"mb-2 font-semibold",children:"Layout"}),b("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[n("li",{children:"Card"}),n("li",{children:"Stack"}),n("li",{children:"Separator"}),n("li",{children:"Sheet"})]})]}),b("div",{className:"card-subtle p-4",children:[n("h3",{className:"mb-2 font-semibold",children:"Feedback"}),b("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[n("li",{children:"Alert"}),n("li",{children:"Skeleton"}),n("li",{children:"Progress"}),n("li",{children:"Tooltip"})]})]})]})]}),b("div",{className:"card-subtle space-y-3 p-6",children:[n("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),b("p",{className:"text-muted-foreground",children:["Read"," ",n(We,{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."]})]}),b("div",{className:"flex items-center gap-4 pt-4",children:[n(We,{href:"/docs/libraries/schema",className:"btn-ghost",children:"Previous: Schema"}),b(We,{href:"/docs/libraries/ui-kit-web",className:"btn-primary",children:["Next: UI Kit Web ",n(hi,{size:16})]})]})]})}import{CodeBlock as bi,InstallCommand as vi}from"@contractspec/lib.design-system";import ze from"@contractspec/lib.ui-link";import{ChevronRight as yi}from"lucide-react";import{jsx as U,jsxs as Y}from"react/jsx-runtime";var Ni=`import { DataTable } from '@contractspec/lib.ui-kit-web/ui/data-table';
895
1294
  import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
896
1295
 
897
1296
  import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
@@ -936,7 +1335,7 @@ export function WebAccountGrid() {
936
1335
  footer={\`Rows \${controller.totalItems}\`}
937
1336
  />
938
1337
  );
939
- }`;function So(){return H("div",{className:"space-y-8",children:[H("div",{className:"space-y-4",children:[O("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit-web"}),O("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."})]}),H("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Installation"}),O(No,{package:"@contractspec/lib.ui-kit-web"})]}),H("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"Data table example"}),H("p",{className:"text-muted-foreground",children:["This is the raw browser lane from the canonical"," ",O(fe,{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."]}),O(yo,{language:"tsx",filename:"web-account-grid.tsx",code:ko})]}),H("div",{className:"space-y-4",children:[O("h2",{className:"font-bold text-2xl",children:"What this layer owns"}),H("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[O("li",{children:"The raw table renderer and browser interaction model."}),O("li",{children:"Pagination, column visibility menus, pin menus, resize handles, and empty/loading states."}),O("li",{children:"Accessibility helpers and other web-specific primitives that stay outside the native-first package."})]})]}),H("div",{className:"card-subtle space-y-3 p-6",children:[O("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),H("p",{className:"text-muted-foreground",children:["Read"," ",O(fe,{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."]})]}),H("div",{className:"flex items-center gap-4 pt-4",children:[O(fe,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"Previous: UI Kit"}),H(fe,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Next: Design System ",O(wo,{size:16})]})]})]})}import{CodeBlock as Rt,InstallCommand as Co}from"@contractspec/lib.design-system";import It from"@contractspec/lib.ui-link";import{ChevronRight as To}from"lucide-react";import{jsx as Y,jsxs as se}from"react/jsx-runtime";function Lo(){return se("div",{className:"space-y-8",children:[se("div",{className:"space-y-4",children:[Y("h1",{className:"font-bold text-4xl",children:"Workflow Composer"}),Y("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."})]}),se("div",{className:"space-y-4",children:[Y("h2",{className:"font-bold text-2xl",children:"Installation"}),Y(Co,{package:"@contractspec/lib.workflow-composer"})]}),se("div",{className:"space-y-4",children:[Y("h2",{className:"font-bold text-2xl",children:"Register extensions"}),Y(Rt,{language:"typescript",code:`const composer = new WorkflowComposer();
1338
+ }`;function wi(){return Y("div",{className:"space-y-8",children:[Y("div",{className:"space-y-4",children:[U("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit-web"}),U("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."})]}),Y("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"Installation"}),U(vi,{package:"@contractspec/lib.ui-kit-web"})]}),Y("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"Data table example"}),Y("p",{className:"text-muted-foreground",children:["This is the raw browser lane from the canonical"," ",U(ze,{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."]}),U(bi,{language:"tsx",filename:"web-account-grid.tsx",code:Ni})]}),Y("div",{className:"space-y-4",children:[U("h2",{className:"font-bold text-2xl",children:"What this layer owns"}),Y("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[U("li",{children:"The raw table renderer and browser interaction model."}),U("li",{children:"Pagination, column visibility menus, pin menus, resize handles, and empty/loading states."}),U("li",{children:"Accessibility helpers and other web-specific primitives that stay outside the native-first package."})]})]}),Y("div",{className:"card-subtle space-y-3 p-6",children:[U("h2",{className:"font-bold text-2xl",children:"Where this layer fits"}),Y("p",{className:"text-muted-foreground",children:["Read"," ",U(ze,{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."]})]}),Y("div",{className:"flex items-center gap-4 pt-4",children:[U(ze,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"Previous: UI Kit"}),Y(ze,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Next: Design System ",U(yi,{size:16})]})]})]})}import{CodeBlock as ia,InstallCommand as ki}from"@contractspec/lib.design-system";import ra from"@contractspec/lib.ui-link";import{ChevronRight as Si}from"lucide-react";import{jsx as te,jsxs as Se}from"react/jsx-runtime";function Ri(){return Se("div",{className:"space-y-8",children:[Se("div",{className:"space-y-4",children:[te("h1",{className:"font-bold text-4xl",children:"Workflow Composer"}),te("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."})]}),Se("div",{className:"space-y-4",children:[te("h2",{className:"font-bold text-2xl",children:"Installation"}),te(ki,{package:"@contractspec/lib.workflow-composer"})]}),Se("div",{className:"space-y-4",children:[te("h2",{className:"font-bold text-2xl",children:"Register extensions"}),te(ia,{language:"typescript",code:`const composer = new WorkflowComposer();
940
1339
 
941
1340
  composer.register({
942
1341
  workflow: 'billing.invoiceApproval',
@@ -953,12 +1352,12 @@ composer.register({
953
1352
  },
954
1353
  ],
955
1354
  hiddenSteps: ['internal-audit'],
956
- });`})]}),se("div",{className:"space-y-4",children:[Y("h2",{className:"font-bold text-2xl",children:"Compose at runtime"}),Y(Rt,{language:"typescript",code:`const tenantWorkflow = composer.compose({
1355
+ });`})]}),Se("div",{className:"space-y-4",children:[te("h2",{className:"font-bold text-2xl",children:"Compose at runtime"}),te(ia,{language:"typescript",code:`const tenantWorkflow = composer.compose({
957
1356
  base: BaseInvoiceWorkflow,
958
1357
  tenantId: 'acme',
959
1358
  });
960
1359
 
961
- workflowRunner.execute(tenantWorkflow, ctx);`})]}),se("div",{className:"flex items-center gap-4 pt-4",children:[Y(It,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),se(It,{href:"/docs/libraries/workflows",className:"btn-primary",children:["Next: Workflow Runtime ",Y(To,{size:16})]})]})]})}import{CodeBlock as Ro,InstallCommand as Io}from"@contractspec/lib.design-system";import At from"@contractspec/lib.ui-link";import{ChevronRight as Ao}from"lucide-react";import{jsx as l,jsxs as B}from"react/jsx-runtime";function Po(){return B("div",{className:"space-y-8",children:[B("div",{className:"space-y-4",children:[l("h1",{className:"font-bold text-4xl",children:"Workflow Runtime Library"}),B("p",{className:"text-lg text-muted-foreground",children:["The ",l("code",{children:"@contractspec/lib.contracts-spec/workflow"})," library provides the core ",l("code",{children:"WorkflowRunner"})," for executing stateful, durable workflows."]})]}),B("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"Installation"}),l(Io,{package:"@contractspec/lib.contracts-spec"})]}),B("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"WorkflowRunner"}),l("p",{className:"text-muted-foreground",children:"The runner manages execution state, step transitions, retries, and compensation."}),l(Ro,{language:"typescript",code:`import { WorkflowRunner } from '@contractspec/lib.contracts-spec/workflow/runner';
1360
+ workflowRunner.execute(tenantWorkflow, ctx);`})]}),Se("div",{className:"flex items-center gap-4 pt-4",children:[te(ra,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),Se(ra,{href:"/docs/libraries/workflows",className:"btn-primary",children:["Next: Workflow Runtime ",te(Si,{size:16})]})]})]})}import{CodeBlock as Ci,InstallCommand as Ti}from"@contractspec/lib.design-system";import na from"@contractspec/lib.ui-link";import{ChevronRight as Ai}from"lucide-react";import{jsx as m,jsxs as z}from"react/jsx-runtime";function Li(){return z("div",{className:"space-y-8",children:[z("div",{className:"space-y-4",children:[m("h1",{className:"font-bold text-4xl",children:"Workflow Runtime Library"}),z("p",{className:"text-lg text-muted-foreground",children:["The ",m("code",{children:"@contractspec/lib.contracts-spec/workflow"})," library provides the core ",m("code",{children:"WorkflowRunner"})," for executing stateful, durable workflows."]})]}),z("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Installation"}),m(Ti,{package:"@contractspec/lib.contracts-spec"})]}),z("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"WorkflowRunner"}),m("p",{className:"text-muted-foreground",children:"The runner manages execution state, step transitions, retries, and compensation."}),m(Ci,{language:"typescript",code:`import { WorkflowRunner } from '@contractspec/lib.contracts-spec/workflow/runner';
962
1361
  import { InMemoryStateStore } from '@contractspec/lib.contracts-spec/workflow/adapters/memory-store';
963
1362
  import { WorkflowRegistry } from '@contractspec/lib.contracts-spec/workflow/spec';
964
1363
 
@@ -978,4 +1377,4 @@ const runner = new WorkflowRunner({
978
1377
  const workflowId = await runner.start('my.workflow', 1, { userId: '123' });
979
1378
 
980
1379
  // Execute next step (usually called by a worker or queue consumer)
981
- await runner.executeStep(workflowId);`})]}),B("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"State Persistence"}),B("p",{className:"text-muted-foreground",children:["The runner relies on a ",l("code",{children:"StateStore"})," to persist workflow execution history. ContractSpec ships with:"]}),B("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[B("li",{children:[l("code",{children:"InMemoryStateStore"})," - for testing and development."]}),B("li",{children:[l("code",{children:"PrismaStateStore"})," - for production using Prisma ORM."]})]})]}),B("div",{className:"space-y-4",children:[l("h2",{className:"font-bold text-2xl",children:"Events"}),l("p",{className:"text-muted-foreground",children:"The runner emits events that you can subscribe to for monitoring:"}),B("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[l("li",{children:l("code",{children:"workflow.started"})}),l("li",{children:l("code",{children:"workflow.step_completed"})}),l("li",{children:l("code",{children:"workflow.step_failed"})}),l("li",{children:l("code",{children:"workflow.step_retrying"})}),l("li",{children:l("code",{children:"workflow.completed"})}),l("li",{children:l("code",{children:"workflow.cancelled"})}),l("li",{children:l("code",{children:"workflow.compensation_step_completed"})})]})]}),B("div",{className:"flex items-center gap-4 pt-4",children:[l(At,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),B(At,{href:"/docs/libraries/data-views",className:"btn-primary",children:["Next: Data Views ",l(Ao,{size:16})]})]})]})}export{Po as LibrariesWorkflowsPage,Lo as LibrariesWorkflowComposerPage,So as LibrariesUIKitWebPage,vo as LibrariesUIKitPage,uo as LibrariesTestingPage,lo as LibrariesSupportBotPage,oo as LibrariesSchemaPage,no as LibrariesSLOPage,eo as LibrariesRuntimePage,Ya as LibrariesResiliencePage,Ja as LibrariesProgressiveDeliveryPage,Ha as LibrariesPersonalizationPage,_a as LibrariesOverviewPage,za as LibrariesOverlayEnginePage,Ba as LibrariesObservabilityPage,Da as LibrariesMultiTenancyPage,Ia as LibrariesGrowthPage,Ta as LibrariesGraphQLPage,wa as LibrariesEvolutionPage,va as LibrariesDesignSystemPage,ma as LibrariesDataViewsPage,la as LibrariesDataBackendPage,na as LibrariesCrossPlatformUIPage,ia as LibrariesCostTrackingPage,ta as LibrariesContractsPage,Yt as LibrariesContentGenPage,Kt as LibrariesApplicationShellPage,Ft as LibrariesAnalyticsPage,Ut as LibrariesAiAgentPage,Mt as LibrariesAccessibilityPage};
1380
+ await runner.executeStep(workflowId);`})]}),z("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"State Persistence"}),z("p",{className:"text-muted-foreground",children:["The runner relies on a ",m("code",{children:"StateStore"})," to persist workflow execution history. ContractSpec ships with:"]}),z("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[z("li",{children:[m("code",{children:"InMemoryStateStore"})," - for testing and development."]}),z("li",{children:[m("code",{children:"PrismaStateStore"})," - for production using Prisma ORM."]})]})]}),z("div",{className:"space-y-4",children:[m("h2",{className:"font-bold text-2xl",children:"Events"}),m("p",{className:"text-muted-foreground",children:"The runner emits events that you can subscribe to for monitoring:"}),z("ul",{className:"list-disc space-y-2 pl-6 text-muted-foreground",children:[m("li",{children:m("code",{children:"workflow.started"})}),m("li",{children:m("code",{children:"workflow.step_completed"})}),m("li",{children:m("code",{children:"workflow.step_failed"})}),m("li",{children:m("code",{children:"workflow.step_retrying"})}),m("li",{children:m("code",{children:"workflow.completed"})}),m("li",{children:m("code",{children:"workflow.cancelled"})}),m("li",{children:m("code",{children:"workflow.compensation_step_completed"})})]})]}),z("div",{className:"flex items-center gap-4 pt-4",children:[m(na,{href:"/docs/libraries",className:"btn-ghost",children:"Back to Libraries"}),z(na,{href:"/docs/libraries/data-views",className:"btn-primary",children:["Next: Data Views ",m(Ai,{size:16})]})]})]})}export{Li as LibrariesWorkflowsPage,Ri as LibrariesWorkflowComposerPage,wi as LibrariesUIKitWebPage,fi as LibrariesUIKitPage,pi as LibrariesTranslationRuntimePage,ii as LibrariesTestingPage,ti as LibrariesSupportBotPage,Yo as LibrariesSchemaPage,xo as LibrariesSLOPage,Jo as LibrariesRuntimePage,qo as LibrariesResiliencePage,Go as LibrariesProgressiveDeliveryPage,Uo as LibrariesPersonalizationPage,Lo as LibrariesOverviewPage,Ro as LibrariesOverlayEnginePage,wo as LibrariesObservabilityPage,vo as LibrariesMultiTenancyPage,go as LibrariesGrowthPage,mo as LibrariesGraphQLPage,co as LibrariesEvolutionPage,io as LibrariesDesignSystemPage,Ya as LibrariesDataViewsPage,Ga as LibrariesDataBackendPage,Ua as LibrariesCrossPlatformUIPage,Ea as LibrariesCostTrackingPage,Oa as LibrariesContractsPage,Ta as LibrariesContentGenPage,ka as LibrariesApplicationShellPage,ba as LibrariesAnalyticsPage,ga as LibrariesAiAgentPage,ma as LibrariesAccessibilityPage};