executable-stories-react 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/result.ts","../src/context/ReportRoot.tsx","../src/context/ReportContext.ts","../src/components/ui/badge.tsx","../src/lib/utils.ts","../src/components/doc/NarrativeBlocks.tsx","../src/hooks/useReport.ts","../src/components/ReportScenario.tsx","../src/lib/step-params.tsx","../src/components/ReportSteps.tsx","../src/components/doc/DocNote.tsx","../src/components/doc/DocTag.tsx","../src/components/doc/DocKv.tsx","../src/hooks/useRenderers.ts","../src/components/doc/DocCode.tsx","../src/components/doc/DocTable.tsx","../src/components/doc/DocLink.tsx","../src/lib/markdown.ts","../src/lib/url.ts","../src/components/doc/DocSection.tsx","../src/components/doc/DocMermaid.tsx","../src/components/doc/DocScreenshot.tsx","../src/components/doc/DocVideo.tsx","../src/components/doc/DocHtml.tsx","../src/components/doc/DocState.tsx","../src/components/doc/DocCustom.tsx","../src/components/doc/DocEntry.tsx","../src/components/ReportDocEntries.tsx","../src/components/ReportStoryboard.tsx","../src/components/ReportAttachments.tsx","../src/components/ReportTrace.tsx","../src/lib/trace.ts","../src/interactive/scenario-history-context.ts","../src/lib/run-history.ts","../src/components/ScenarioRunHistory.tsx","../src/components/ScenarioStaleness.tsx","../src/lib/provenance.ts","../src/interactive/scenario-freshness-context.tsx","../src/interactive/collapse-context.ts","../src/interactive/scenario-actions.tsx","../src/components/ui/card.tsx","../src/components/ui/dropdown-menu.tsx","../src/components/ReportScenarioList.tsx","../src/components/ReportFeatureIntro.tsx","../src/components/ReportFeature.tsx","../src/components/ReportFeatureList.tsx","../src/components/ui/empty.tsx","../src/components/ReportEmpty.tsx","../src/components/ReportSummary.tsx","../src/components/ReportMeta.tsx","../src/components/ReportSchemaError.tsx","../src/components/ReportShell.tsx","../src/components/Report.tsx","../src/components/doc/MermaidView.tsx","../src/components/doc/MermaidDiagram.tsx","../src/components/ScenarioExplorer.tsx","../src/components/ui/command.tsx","../src/schema/story-report.schema.ts","../../executable-stories-core/schemas/story-report-v1.json","../src/schema/version.ts","../src/schema/parse.ts"],"sourcesContent":["/**\n * Result<T> — explicit success/error type matching the cookbook convention.\n *\n * Used at the boundary where a StoryReport is parsed: the consumer hands us\n * an unknown value (file contents, fetch body, prop) and we return a Result.\n */\nimport type { StoryReport } from \"executable-stories-core\";\n\nexport type Result<T, E = ReportParseError> =\n | { ok: true; data: T }\n | { ok: false; error: E };\n\nexport interface ReportParseError {\n message: string;\n code: ReportParseErrorCode;\n issues?: readonly { path: string; message: string }[];\n}\n\nexport type ReportParseErrorCode =\n | \"INVALID_INPUT\"\n | \"SCHEMA_VERSION_MISMATCH\"\n | \"VALIDATION_FAILED\";\n\nexport const ok = <T>(data: T): Result<T> => ({ ok: true, data });\nexport const err = (error: ReportParseError): Result<never> => ({ ok: false, error });\n\n/**\n * Normalize the `StoryReport | Result<StoryReport>` prop accepted across the\n * render entrypoints (`Report`, `ReportInteractive`, `renderReportToHtml`) into\n * a single `Result`. A bare report becomes `ok(report)`; an already-wrapped\n * value passes through. One place owns the \"is this a Result?\" discrimination.\n */\nexport function unwrapReport(value: StoryReport | Result<StoryReport>): Result<StoryReport> {\n if (\n typeof value === \"object\" &&\n value !== null &&\n \"ok\" in value &&\n typeof (value as { ok: unknown }).ok === \"boolean\"\n ) {\n return value as Result<StoryReport>;\n }\n return ok(value as StoryReport);\n}\n","import { useMemo, type ReactNode } from \"react\";\nimport type { StoryReport } from \"executable-stories-core\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\nimport { ReportContext, type ReportContextValue } from \"./ReportContext\";\nimport { narrativeBlockRenderers } from \"../components/doc/NarrativeBlocks\";\n\nexport interface ReportRootProps {\n report: StoryReport;\n customRenderers?: CustomRenderers;\n renderers?: BuiltinRenderers;\n children: ReactNode;\n}\n\nconst EMPTY_RENDERERS: BuiltinRenderers = {};\n\nexport function ReportRoot({\n report,\n customRenderers,\n renderers,\n children,\n}: ReportRootProps) {\n const value = useMemo<ReportContextValue>(\n () => ({\n report,\n // Narrative blocks render everywhere the report does (static SSR, the\n // island, Astro) without every host wiring them up. A host renderer for\n // the same type still wins.\n customRenderers: { ...narrativeBlockRenderers, ...customRenderers },\n renderers: renderers ?? EMPTY_RENDERERS,\n }),\n [report, customRenderers, renderers],\n );\n return <ReportContext.Provider value={value}>{children}</ReportContext.Provider>;\n}\n","import { createContext } from \"react\";\nimport type { StoryReport } from \"executable-stories-core\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\n\nexport interface ReportContextValue {\n report: StoryReport;\n customRenderers: CustomRenderers;\n renderers: BuiltinRenderers;\n}\n\nexport const ReportContext = createContext<ReportContextValue | null>(null);\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { useRender } from \"@base-ui/react/use-render\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90\",\n outline:\n \"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n ghost: \"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 [a&]:hover:underline\",\n // Pass/skip/pending are the quiet states: outline + coloured text, no\n // fill, so a green report reads calm. Only `failed` keeps a tinted\n // fill, making it the single loud badge on the page, so red pops the\n // instant something breaks. Colour-as-accent, matching the KPI cards.\n passed: \"border-pass-border text-pass font-mono uppercase\",\n failed: \"border-fail-border bg-fail-bg text-fail font-mono uppercase\",\n skipped: \"border-skip-border text-skip font-mono uppercase\",\n pending: \"border-pend-border text-pend font-mono uppercase\",\n tag: \"border-border text-muted-foreground font-mono font-medium [a&]:hover:bg-muted\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Badge({\n className,\n variant = \"default\",\n render,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & {\n // Base UI composition: pass `render={<a … />}` to swap the underlying tag —\n // replaces Radix's `asChild`. See rules/base-vs-radix.md.\n render?: useRender.RenderProp\n }) {\n return useRender({\n defaultTagName: \"span\",\n render,\n props: {\n \"data-slot\": \"badge\",\n \"data-variant\": variant,\n className: cn(badgeVariants({ variant }), className),\n ...props,\n },\n })\n}\n\nexport { Badge, badgeVariants }\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/** Merge class names with Tailwind-aware conflict resolution (shadcn `cn`). */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * Renderers for the two narrative block types an agent reaches for when it\n * explains a change: a file map and a data shape.\n *\n * They ride on `story.custom({ type, data })`, so every adapter can already\n * emit them with no API change; only the renderer is new. Register them with\n * `customRenderers` (the standalone report island does this by default).\n *\n * These blocks describe, they do not prove. Nothing here executed, so a block\n * whose `data.authored` says an agent wrote it renders a visible marker. A\n * picture that looks as trustworthy as a passing test, without being one, is\n * the failure mode this whole report exists to avoid.\n */\n\nimport type { ReportDocCustom } from \"executable-stories-core\";\nimport { Badge } from \"../ui/badge\";\nimport { cn } from \"../../lib/utils\";\n\nexport const FILE_TREE_TYPE = \"file-tree\";\nexport const DATA_MODEL_TYPE = \"data-model\";\n\n/** Change annotation shared by both blocks. */\ntype ChangeKind = \"added\" | \"modified\" | \"removed\" | \"renamed\";\n\nfunction isChangeKind(value: unknown): value is ChangeKind {\n return value === \"added\" || value === \"modified\" || value === \"removed\" || value === \"renamed\";\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === \"string\" && value !== \"\" ? value : undefined;\n}\n\n/**\n * \"Written by an agent, not verified by a run.\" Only rendered when the author\n * says so; there is no way to detect it after the fact, which is exactly why\n * the authoring skills are told to set it.\n */\nfunction AuthoredMarker({ authored }: { authored?: string }) {\n if (authored !== \"agent\") return null;\n return (\n <Badge variant=\"outline\" className=\"border-border text-[10px] text-muted-foreground\">\n AI-authored, not verified by a run\n </Badge>\n );\n}\n\nfunction BlockFrame({\n title,\n authored,\n children,\n}: {\n title?: string;\n authored?: string;\n children: React.ReactNode;\n}) {\n return (\n <figure className=\"my-3\">\n {title || authored === \"agent\" ? (\n <figcaption className=\"mb-1.5 flex flex-wrap items-center gap-2\">\n {title ? <span className=\"text-xs font-medium text-muted-foreground\">{title}</span> : null}\n <AuthoredMarker authored={authored} />\n </figcaption>\n ) : null}\n {children}\n </figure>\n );\n}\n\n/**\n * Deliberately uncoloured. In this report colour carries test status, so a\n * green \"added\" badge beside a failing scenario would read as a pass. The word\n * does the work.\n */\nfunction ChangeBadge({ change }: { change: ChangeKind }) {\n return (\n <Badge variant=\"tag\" className=\"text-[10px]\">\n {change}\n </Badge>\n );\n}\n\n// ---------------------------------------------------------------------------\n// file-tree\n// ---------------------------------------------------------------------------\n\ninterface FileEntry {\n path: string;\n change?: ChangeKind;\n note?: string;\n}\n\nexport interface FileTreeData {\n title?: string;\n authored?: string;\n files: FileEntry[];\n}\n\nexport function parseFileTree(data: unknown): FileTreeData | undefined {\n if (!isRecord(data) || !Array.isArray(data.files)) return undefined;\n const files: FileEntry[] = [];\n for (const raw of data.files) {\n // A bare string is a path; anything without one is not a file.\n if (typeof raw === \"string\") {\n if (raw) files.push({ path: raw });\n continue;\n }\n if (!isRecord(raw)) continue;\n const path = str(raw.path);\n if (!path) continue;\n files.push({\n path,\n change: isChangeKind(raw.change) ? raw.change : undefined,\n note: str(raw.note),\n });\n }\n if (files.length === 0) return undefined;\n return { title: str(data.title), authored: str(data.authored), files };\n}\n\ninterface TreeNode {\n name: string;\n children: Map<string, TreeNode>;\n file?: FileEntry;\n}\n\n/** Flat paths in, nested directories out. Sorting puts folders before files. */\nfunction buildTree(files: FileEntry[]): TreeNode {\n const root: TreeNode = { name: \"\", children: new Map() };\n for (const file of files) {\n const segments = file.path.split(\"/\").filter(Boolean);\n let node = root;\n segments.forEach((segment, index) => {\n let child = node.children.get(segment);\n if (!child) {\n child = { name: segment, children: new Map() };\n node.children.set(segment, child);\n }\n if (index === segments.length - 1) child.file = file;\n node = child;\n });\n }\n return root;\n}\n\nfunction sortedChildren(node: TreeNode): TreeNode[] {\n return [...node.children.values()].sort((a, b) => {\n const aDir = a.children.size > 0;\n const bDir = b.children.size > 0;\n if (aDir !== bDir) return aDir ? -1 : 1;\n return a.name.localeCompare(b.name);\n });\n}\n\nfunction TreeBranch({ node, depth }: { node: TreeNode; depth: number }) {\n const children = sortedChildren(node);\n return (\n <ul className={cn(\"space-y-0.5\", depth > 0 && \"ml-3 border-l border-border/60 pl-3\")}>\n {children.map((child) => {\n const isDir = child.children.size > 0;\n return (\n <li key={child.name}>\n <div className=\"flex flex-wrap items-baseline gap-2\">\n <span\n className={cn(\n \"font-mono text-xs\",\n isDir ? \"text-muted-foreground\" : \"text-foreground\",\n )}\n >\n {isDir ? `${child.name}/` : child.name}\n </span>\n {child.file?.change ? <ChangeBadge change={child.file.change} /> : null}\n {child.file?.note ? (\n <span className=\"text-xs text-muted-foreground\">{child.file.note}</span>\n ) : null}\n </div>\n {isDir ? <TreeBranch node={child} depth={depth + 1} /> : null}\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport function FileTreeBlock({ entry }: { entry: ReportDocCustom }) {\n const data = parseFileTree(entry.data);\n if (!data) return <UnreadableBlock entry={entry} />;\n return (\n <BlockFrame title={data.title ?? \"Files changed\"} authored={data.authored}>\n <div tabIndex={0} className=\"overflow-x-auto rounded-md border border-border bg-card p-3\">\n <TreeBranch node={buildTree(data.files)} depth={0} />\n </div>\n </BlockFrame>\n );\n}\n\n// ---------------------------------------------------------------------------\n// data-model\n// ---------------------------------------------------------------------------\n\ninterface ModelField {\n name: string;\n type?: string;\n note?: string;\n change?: ChangeKind;\n}\n\nexport interface DataModelData {\n title?: string;\n authored?: string;\n name?: string;\n fields: ModelField[];\n}\n\nexport function parseDataModel(data: unknown): DataModelData | undefined {\n if (!isRecord(data) || !Array.isArray(data.fields)) return undefined;\n const fields: ModelField[] = [];\n for (const raw of data.fields) {\n if (!isRecord(raw)) continue;\n const name = str(raw.name);\n if (!name) continue;\n fields.push({\n name,\n type: str(raw.type),\n note: str(raw.note),\n change: isChangeKind(raw.change) ? raw.change : undefined,\n });\n }\n if (fields.length === 0) return undefined;\n return {\n title: str(data.title),\n authored: str(data.authored),\n name: str(data.name),\n fields,\n };\n}\n\nexport function DataModelBlock({ entry }: { entry: ReportDocCustom }) {\n const data = parseDataModel(entry.data);\n if (!data) return <UnreadableBlock entry={entry} />;\n const hasNotes = data.fields.some((f) => f.note);\n return (\n <BlockFrame title={data.title ?? data.name ?? \"Data model\"} authored={data.authored}>\n <div tabIndex={0} className=\"overflow-x-auto rounded-md border border-border\">\n <table className=\"w-full border-collapse text-sm\">\n <thead>\n <tr className=\"bg-muted/50\">\n <th scope=\"col\" className=\"border-b border-border px-3 py-2 text-left font-semibold\">\n Field\n </th>\n <th scope=\"col\" className=\"border-b border-border px-3 py-2 text-left font-semibold\">\n Type\n </th>\n {hasNotes ? (\n <th scope=\"col\" className=\"border-b border-border px-3 py-2 text-left font-semibold\">\n Note\n </th>\n ) : null}\n </tr>\n </thead>\n <tbody>\n {data.fields.map((field) => (\n <tr key={field.name}>\n <td className=\"border-b border-border px-3 py-2\">\n <span className=\"flex flex-wrap items-center gap-2\">\n <span className=\"font-mono text-xs text-foreground\">{field.name}</span>\n {field.change ? <ChangeBadge change={field.change} /> : null}\n </span>\n </td>\n <td className=\"border-b border-border px-3 py-2 font-mono text-xs text-muted-foreground\">\n {field.type ?? \"\"}\n </td>\n {hasNotes ? (\n <td className=\"border-b border-border px-3 py-2 text-foreground\">\n {field.note ?? \"\"}\n </td>\n ) : null}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </BlockFrame>\n );\n}\n\n// ---------------------------------------------------------------------------\n\n/**\n * Shape we could not read. Show the raw data rather than nothing: a malformed\n * block is a bug in whatever wrote it, and hiding it hides the bug.\n */\nfunction UnreadableBlock({ entry }: { entry: ReportDocCustom }) {\n return (\n <div className=\"my-2\" data-type={entry.type}>\n <p className=\"mb-1 text-xs font-medium text-muted-foreground\">\n {entry.type} (unrecognised shape)\n </p>\n <pre\n tabIndex={0}\n className=\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\"\n >\n {safeStringify(entry.data)}\n </pre>\n </div>\n );\n}\n\nfunction safeStringify(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n\n/**\n * The narrative block renderers, ready to spread into `customRenderers`.\n * Consumer-supplied renderers for the same type win, so a project can swap\n * either one out.\n */\nexport const narrativeBlockRenderers = {\n [FILE_TREE_TYPE]: (entry: ReportDocCustom) => <FileTreeBlock entry={entry} />,\n [DATA_MODEL_TYPE]: (entry: ReportDocCustom) => <DataModelBlock entry={entry} />,\n};\n","import { useContext } from \"react\";\nimport { ReportContext } from \"../context/ReportContext\";\n\nexport function useReport() {\n const ctx = useContext(ReportContext);\n if (!ctx) {\n throw new Error(\n \"useReport must be used inside <ReportRoot> or <Report>. Wrap your tree with one of those.\",\n );\n }\n return ctx.report;\n}\n","import type { ReportScenario as ReportScenarioT } from \"executable-stories-core\";\nimport { formatDuration } from \"executable-stories-core/utils/duration\";\nimport { ReportSteps } from \"./ReportSteps\";\nimport { ReportStoryboard } from \"./ReportStoryboard\";\nimport { ReportDocEntries } from \"./ReportDocEntries\";\nimport { ReportAttachments } from \"./ReportAttachments\";\nimport { ReportTrace } from \"./ReportTrace\";\nimport { ScenarioRunHistory } from \"./ScenarioRunHistory\";\nimport { ScenarioStaleness } from \"./ScenarioStaleness\";\nimport { useCollapse } from \"../interactive/collapse-context\";\nimport { useScenarioActions } from \"../interactive/scenario-actions\";\nimport { Card, CardContent, CardHeader } from \"@/components/ui/card\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { LinkIcon, FileTextIcon, SparklesIcon, MoreHorizontalIcon } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReportScenarioProps {\n scenario: ReportScenarioT;\n /**\n * Omit the card's own title row (status badge + tags still render). Use when\n * the surrounding page already shows the scenario title as its heading — e.g.\n * the Astro detail page, where Starlight renders the title as the page `h1`.\n */\n hideTitle?: boolean;\n}\n\ntype Status = ReportScenarioT[\"status\"];\n\ninterface StatusMeta {\n label: string;\n glyph: string;\n glyphColor: string;\n badgeVariant: \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n /**\n * Whether to render the status as a visible pill. Passing scenarios drop it:\n * the green ✓ glyph + title already carry the status, so the pill would be\n * pure redundancy on every (usually passing) row, and dropping it keeps a\n * green run calm while the failure pill stays the one loud badge. A\n * non-showPill status still exposes an sr-only label for screen readers.\n */\n showPill: boolean;\n}\n\nconst STATUS_META: Record<Status, StatusMeta> = {\n passed: { label: \"Passed\", glyph: \"✓\", glyphColor: \"text-pass\", badgeVariant: \"passed\", showPill: false },\n failed: { label: \"Failed\", glyph: \"✗\", glyphColor: \"text-fail\", badgeVariant: \"failed\", showPill: true },\n skipped: { label: \"Skipped\", glyph: \"○\", glyphColor: \"text-skip\", badgeVariant: \"skipped\", showPill: true },\n pending: { label: \"Pending\", glyph: \"○\", glyphColor: \"text-pend\", badgeVariant: \"pending\", showPill: true },\n};\n\nexport function ReportScenario({ scenario, hideTitle = false }: ReportScenarioProps) {\n const titleId = `${scenario.id}-title`;\n const bodyId = `${scenario.id}-body`;\n const meta = STATUS_META[scenario.status];\n // A planned scenario (it.todo) is canonically \"pending\", but the reader\n // should see intent, not limbo.\n const label = scenario.planned ? \"Planned\" : meta.label;\n const collapse = useCollapse();\n const collapsible = collapse !== null && !hideTitle;\n const collapsed = collapsible ? collapse!.isCollapsed(scenario.id) : false;\n const actions = useScenarioActions();\n return (\n <Card\n id={scenario.id}\n data-status={scenario.status}\n {...(hideTitle\n ? { \"aria-label\": `${scenario.title}, ${label}` }\n : { \"aria-labelledby\": titleId })}\n className=\"gap-0 py-0\"\n >\n <CardHeader className=\"px-4 py-3\">\n <div\n className={cn(\n // Wraps rather than squeezing: on a phone the status/duration group\n // is ~160px, which leaves a title column a few characters wide.\n \"flex flex-wrap items-start gap-x-4 gap-y-1\",\n hideTitle ? \"justify-end\" : \"justify-between\",\n )}\n >\n {hideTitle ? null : (\n <h3 id={titleId} className=\"flex min-w-0 flex-1 basis-48 items-center gap-2 text-sm font-medium text-foreground\">\n {collapsible ? (\n <button\n type=\"button\"\n onClick={() => collapse!.toggle(scenario.id)}\n aria-expanded={!collapsed}\n aria-controls={bodyId}\n aria-label={`Toggle ${scenario.title}`}\n className=\"shrink-0 cursor-pointer text-muted-foreground hover:text-foreground\"\n >\n <span aria-hidden className={cn(\"inline-block text-xs transition-transform\", !collapsed && \"rotate-90\")}>▸</span>\n </button>\n ) : null}\n <span aria-hidden className={cn(\"text-sm leading-none\", meta.glyphColor)}>\n {meta.glyph}\n </span>\n <span>{scenario.title}</span>\n </h3>\n )}\n <div className=\"flex shrink-0 items-center gap-2\">\n <ScenarioRunHistory scenarioId={scenario.id} />\n <ScenarioStaleness scenario={scenario} />\n {scenario.durationMs > 0 ? (\n <span className=\"whitespace-nowrap font-mono text-[0.6875rem] text-muted-foreground\">\n {formatDuration(scenario.durationMs)}\n </span>\n ) : null}\n {meta.showPill ? (\n <Badge variant={meta.badgeVariant} aria-label={`Status: ${label}`}>\n {label}\n </Badge>\n ) : (\n <span className=\"sr-only\">{`Status: ${label}`}</span>\n )}\n {actions ? (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label={`Actions for ${scenario.title}`}\n className=\"cursor-pointer rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground [&_svg]:size-4\"\n >\n <MoreHorizontalIcon aria-hidden />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={() => actions.copyLink(scenario)}>\n <LinkIcon /> Copy link\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => actions.copyMarkdown(scenario)}>\n <FileTextIcon /> Copy as Markdown\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => actions.copyPrompt(scenario)}>\n <SparklesIcon /> Explain with AI\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </div>\n </div>\n {scenario.tags.length > 0 || (scenario.tickets?.length ?? 0) > 0 ? (\n <ul aria-label=\"Tags and tickets\" className=\"flex flex-wrap gap-1.5\">\n {scenario.tags.map((t) => (\n <li key={`tag-${t}`}>\n <Badge variant=\"tag\">{t}</Badge>\n </li>\n ))}\n {(scenario.tickets ?? []).map((ticket) => (\n <li key={`ticket-${ticket.id}`}>\n {ticket.url ? (\n <a href={ticket.url} target=\"_blank\" rel=\"noreferrer noopener\" className=\"inline-flex min-h-6 items-center\">\n <Badge variant=\"outline\">{ticket.id}</Badge>\n </a>\n ) : (\n <Badge variant=\"outline\">{ticket.id}</Badge>\n )}\n </li>\n ))}\n </ul>\n ) : null}\n </CardHeader>\n <CardContent id={bodyId} hidden={collapsed} className=\"px-4 pt-0 pb-4\">\n {scenario.errorMessage ? (\n <pre\n role=\"alert\"\n className=\"mb-1 overflow-x-auto rounded-md border border-fail-border bg-fail-bg px-4 py-3.5 font-mono text-xs leading-relaxed whitespace-pre-wrap text-fail\"\n >\n {scenario.errorMessage}\n </pre>\n ) : null}\n <ReportStoryboard scenario={scenario} />\n <ReportSteps scenario={scenario} />\n {scenario.docEntries.length > 0 ? (\n <div data-es-docs className=\"mt-3\">\n <ReportDocEntries entries={scenario.docEntries} />\n </div>\n ) : null}\n <ReportAttachments attachments={scenario.attachments} />\n <ReportTrace spans={scenario.otelSpans} />\n </CardContent>\n </Card>\n );\n}\n","import type { ReactNode } from \"react\";\n\n/**\n * Highlight step parameters (double-quoted strings, standalone numbers) in step\n * text — the React equivalent of the report's highlightStepParams. Returns a\n * node array so the matched params can be wrapped in a styled <span> without\n * dangerouslySetInnerHTML.\n *\n * Regex mirrors the string renderer exactly:\n * - `\"[^\"]*\"` double-quoted strings (numbers inside quotes stay part of the string)\n * - `(?<![\\w.-])\\d+(?:\\.\\d+)?(?![\\w.-])` standalone numbers, dot/word-boundary aware\n */\nconst STEP_PARAM_PATTERN = /\"[^\"]*\"|(?<![\\w.-])\\d+(?:\\.\\d+)?(?![\\w.-])/g;\n\nexport function highlightStepParams(text: string): ReactNode {\n const matches = Array.from(text.matchAll(STEP_PARAM_PATTERN));\n if (matches.length === 0) return text;\n\n const nodes: ReactNode[] = [];\n let lastIndex = 0;\n matches.forEach((match, i) => {\n const start = match.index;\n const end = start + match[0].length;\n if (start > lastIndex) nodes.push(text.slice(lastIndex, start));\n nodes.push(\n <span key={i} className=\"font-medium text-step-param italic\">\n {match[0]}\n </span>,\n );\n lastIndex = end;\n });\n if (lastIndex < text.length) nodes.push(text.slice(lastIndex));\n return nodes;\n}\n","import { highlightStepParams } from '@/lib/step-params';\nimport { cn } from '@/lib/utils';\nimport type { ReportScenario, ReportStep } from 'executable-stories-core';\nimport {\n assertionState,\n assertiveSteps,\n} from 'executable-stories-core/utils/assertive-steps';\nimport { formatDuration } from 'executable-stories-core/utils/duration';\nimport { ReportDocEntries } from './ReportDocEntries';\n\nexport interface ReportStepsProps {\n scenario: ReportScenario;\n}\n\nconst STEP_GLYPH: Record<string, string> = {\n passed: '✓',\n failed: '✗',\n skipped: '○',\n pending: '○',\n};\n\nconst STEP_GLYPH_COLOR: Record<string, string> = {\n passed: 'text-pass',\n failed: 'text-fail',\n skipped: 'text-skip',\n pending: 'text-pend',\n};\n\nexport function ReportSteps({ scenario }: ReportStepsProps) {\n if (scenario.steps.length === 0) return null;\n const unasserted = new Set(\n assertionState(scenario.steps) === 'unasserted'\n ? assertiveSteps(scenario.steps).map((step) => step.id)\n : [],\n );\n return (\n <ol data-slot=\"steps\" className=\"flex flex-col\">\n {scenario.steps.map((step) => (\n <ReportStepItem\n key={step.id}\n step={step}\n unasserted={unasserted.has(step.id)}\n />\n ))}\n </ol>\n );\n}\n\nexport function ReportStepItem({\n step,\n unasserted = false,\n}: {\n step: ReportStep;\n unasserted?: boolean;\n}) {\n // And/But (incl. auto-And repeats) read as continuations of the prior step —\n // indented with a muted keyword, matching the report's `.step.continuation`.\n const kw = step.keyword.toLowerCase();\n const continuation = kw === 'and' || kw === 'but';\n return (\n <li\n id={step.id}\n data-status={step.status}\n className={cn(\n 'py-1.5 text-[0.8125rem] leading-normal',\n continuation && 'pl-5',\n )}\n >\n <div className=\"flex items-baseline gap-2\">\n <span\n aria-hidden\n className={cn(\n 'w-4 shrink-0 text-center text-xs',\n STEP_GLYPH_COLOR[step.status],\n )}\n >\n {STEP_GLYPH[step.status] ?? '○'}\n </span>\n <span\n className={cn(\n 'min-w-[52px] shrink-0 font-mono text-xs font-semibold capitalize',\n continuation ? 'font-medium text-muted-foreground' : 'text-keyword',\n )}\n >\n {step.keyword}\n </span>\n <span className=\"flex-1 text-foreground\">\n {highlightStepParams(step.text)}\n </span>\n {unasserted ? (\n <span className=\"shrink-0 rounded-full border border-pend-border bg-pend-bg px-2 py-0.5 text-[0.6875rem] font-medium text-pend\">\n No assertion\n </span>\n ) : null}\n {step.durationMs > 0 ? (\n <span className=\"shrink-0 whitespace-nowrap font-mono text-[0.6875rem] text-muted-foreground\">\n {formatDuration(step.durationMs)}\n </span>\n ) : null}\n </div>\n {step.errorMessage ? (\n <pre\n role=\"alert\"\n className=\"mt-2.5 ml-6 overflow-x-auto rounded-md border border-fail-border bg-fail-bg px-4 py-3.5 font-mono text-xs leading-relaxed whitespace-pre-wrap text-fail\"\n >\n {step.errorMessage}\n </pre>\n ) : null}\n {step.docEntries.length > 0 ? (\n <div data-es-docs className=\"mt-2 ml-6\">\n <ReportDocEntries entries={step.docEntries} />\n </div>\n ) : null}\n </li>\n );\n}\n","import type { ReportDocNote } from \"executable-stories-core\";\n\nexport function DocNote({ entry }: { entry: ReportDocNote }) {\n return <p className=\"my-2 text-sm text-muted-foreground\">{entry.text}</p>;\n}\n","import type { ReportDocTag } from \"executable-stories-core\";\nimport { Badge } from \"@/components/ui/badge\";\n\nexport function DocTag({ entry }: { entry: ReportDocTag }) {\n return (\n <ul className=\"my-2 flex flex-wrap gap-1.5\" aria-label=\"Tags\">\n {entry.names.map((n) => (\n <li key={n}>\n <Badge variant=\"tag\">{n}</Badge>\n </li>\n ))}\n </ul>\n );\n}\n","import type { ReportDocKv } from \"executable-stories-core\";\n\nfunction formatValue(value: unknown): string {\n if (value === null) return \"null\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\nexport function DocKv({ entry }: { entry: ReportDocKv }) {\n return (\n <dl className=\"my-2 flex flex-wrap items-baseline gap-x-2 text-sm\">\n <dt className=\"font-semibold text-muted-foreground\">{entry.label}</dt>\n <dd className=\"min-w-0 break-words font-mono text-foreground\">{formatValue(entry.value)}</dd>\n </dl>\n );\n}\n","import { useContext } from \"react\";\nimport { ReportContext } from \"../context/ReportContext\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\n\nconst EMPTY_CUSTOM: CustomRenderers = {};\nconst EMPTY_RENDERERS: BuiltinRenderers = {};\n\nexport function useCustomRenderers(): CustomRenderers {\n const ctx = useContext(ReportContext);\n return ctx?.customRenderers ?? EMPTY_CUSTOM;\n}\n\nexport function useBuiltinRenderers(): BuiltinRenderers {\n const ctx = useContext(ReportContext);\n return ctx?.renderers ?? EMPTY_RENDERERS;\n}\n","import type { ReactNode } from \"react\";\nimport type { ReportDocCode } from \"executable-stories-core\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * Shared shell for code blocks: optional label + the scrollable `<pre>`. Both\n * the static `DocCode` and the island's CDN-highlighted variant render their\n * `<code>` into this so the two can never drift in spacing or chrome.\n */\nexport function CodeFigure({ label, children }: { label?: string; children: ReactNode }) {\n return (\n <figure className=\"my-3\">\n {label ? (\n <figcaption className=\"mb-1.5 text-xs font-medium text-muted-foreground\">{label}</figcaption>\n ) : null}\n <pre tabIndex={0} className=\"overflow-x-auto rounded-md bg-muted p-3\">\n {children}\n </pre>\n </figure>\n );\n}\n\nexport function DocCode({ entry }: { entry: ReportDocCode }) {\n const renderers = useBuiltinRenderers();\n if (renderers.code) {\n return <>{renderers.code(entry)}</>;\n }\n return (\n <CodeFigure label={entry.label}>\n <code className={cn(\"font-mono text-xs\", entry.lang && `language-${entry.lang}`)}>\n {entry.content}\n </code>\n </CodeFigure>\n );\n}\n","import type { ReportDocTable } from \"executable-stories-core\";\n\nexport function DocTable({ entry }: { entry: ReportDocTable }) {\n return (\n <figure className=\"my-3\">\n {entry.label ? (\n <figcaption className=\"mb-1.5 text-xs font-medium text-muted-foreground\">\n {entry.label}\n </figcaption>\n ) : null}\n <div tabIndex={0} className=\"overflow-x-auto rounded-md border border-border\">\n <table className=\"w-full border-collapse text-sm\">\n <thead>\n <tr className=\"bg-muted/50\">\n {entry.columns.map((c) => (\n <th key={c} scope=\"col\" className=\"border-b border-border px-3 py-2 text-left font-semibold\">\n {c}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {entry.rows.map((row, i) => (\n <tr key={i}>\n {row.map((cell, j) => (\n <td key={j} className=\"border-b border-border px-3 py-2 text-foreground\">\n {cell}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </figure>\n );\n}\n","import type { ReportDocLink } from \"executable-stories-core\";\n\nexport function DocLink({ entry }: { entry: ReportDocLink }) {\n return (\n <a\n className=\"text-sm font-medium text-primary underline underline-offset-2 hover:no-underline\"\n href={entry.url}\n rel=\"noreferrer noopener\"\n target=\"_blank\"\n >\n {entry.label}\n </a>\n );\n}\n","import { marked } from \"marked\";\nimport { safeUrl } from \"./url\";\n\n/**\n * Best-effort sanitizer for marked-generated HTML. The markdown we render is\n * authored in test source (developer-trusted), so this is defense-in-depth,\n * not a hard boundary against hostile input. It:\n * - drops <script>/<style> and other active elements (iframe/object/embed/form)\n * - strips on* event-handler attributes\n * - neutralizes any non-http(s) scheme on href/src via the shared `safeUrl`\n * allow-list (covers javascript:/data:/vbscript:/file:, not just javascript:)\n *\n * It is NOT a substitute for a full HTML sanitizer (it won't catch entity-\n * obfuscated schemes). For untrusted markdown, supply your own renderer.\n */\nexport function safeMarkdownHtml(markdown: string): string {\n const raw = marked.parse(markdown, { async: false }) as string;\n return raw\n .replace(/<script\\b[^>]*>[\\s\\S]*?<\\/script>/gi, \"\")\n .replace(/<style\\b[^>]*>[\\s\\S]*?<\\/style>/gi, \"\")\n .replace(/<\\/?(?:iframe|object|embed|form|base)\\b[^>]*>/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*\"[^\"]*\"/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*'[^']*'/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*[^\\s>]+/gi, \"\")\n .replace(/(href|src)\\s*=\\s*\"([^\"]*)\"/gi, (_m, attr, val) => `${attr}=\"${neutralizeUrl(val)}\"`)\n .replace(/(href|src)\\s*=\\s*'([^']*)'/gi, (_m, attr, val) => `${attr}='${neutralizeUrl(val)}'`);\n}\n\n/**\n * Strip the leading indentation a template literal picks up from its source.\n *\n * Narratives are written inline in test files, so they arrive indented to match\n * the surrounding code. Left alone, four spaces make Markdown render the whole\n * paragraph as a code block.\n */\nexport function dedent(text: string): string {\n const lines = text.replace(/\\t/g, \" \").split(\"\\n\");\n const indents = lines\n .filter((line) => line.trim().length > 0)\n .map((line) => line.length - line.trimStart().length);\n const shortest = indents.length > 0 ? Math.min(...indents) : 0;\n return lines\n .map((line) => line.slice(shortest))\n .join(\"\\n\")\n .trim();\n}\n\nfunction neutralizeUrl(value: string): string {\n return safeUrl(value) ?? \"#\";\n}\n","/**\n * URL trust boundary for report-sourced strings reaching the DOM. The\n * implementation lives in executable-stories-core/utils/url (shared with the\n * Astro state-catalog thumbnails); this module stays as the package-local\n * import point. Subpath import: the core package root pulls in Node-only\n * converters, which breaks browser bundles.\n */\nexport { safeUrl, safeImageUrl, isLocalFsPath } from \"executable-stories-core/utils/url\";\n","import type { ReportDocSection } from \"executable-stories-core\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\nimport { safeMarkdownHtml } from \"../../lib/markdown\";\n\nexport function DocSection({ entry }: { entry: ReportDocSection }) {\n const renderers = useBuiltinRenderers();\n if (renderers.section) {\n return <>{renderers.section(entry)}</>;\n }\n const html = safeMarkdownHtml(entry.markdown);\n return (\n <section className=\"my-3 text-sm\" aria-label={entry.title}>\n {entry.title ? <h4 className=\"mb-1 font-semibold text-foreground\">{entry.title}</h4> : null}\n <div\n className=\"es-doc-prose prose prose-sm max-w-none\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </section>\n );\n}\n","import type { Ref } from \"react\";\nimport type { ReportDocMermaid } from \"executable-stories-core\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\n\n/**\n * The raw mermaid source as a semantic `<pre data-mermaid>`. This is the\n * default render and the universal fallback: AI agents, screen readers, and\n * no-JS views all get the readable source. `<MermaidDiagram>` upgrades this to\n * a drawn diagram on the client.\n */\nexport function MermaidSource({ entry, ref }: { entry: ReportDocMermaid; ref?: Ref<HTMLElement> }) {\n return (\n <figure ref={ref} className=\"my-3\" aria-label={entry.title ?? \"Diagram\"}>\n {entry.title ? (\n <figcaption className=\"mb-1.5 text-xs font-medium text-muted-foreground\">{entry.title}</figcaption>\n ) : null}\n <pre\n data-mermaid\n tabIndex={0}\n className=\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\"\n >\n {entry.code}\n </pre>\n </figure>\n );\n}\n\n/**\n * Renders mermaid source as a semantic `<pre data-mermaid>` by default.\n *\n * To draw the diagram, supply a `renderers.mermaid` prop — e.g. the shipped\n * `MermaidDiagram` (`renderers={{ mermaid: (e) => <MermaidDiagram entry={e} /> }}`).\n */\nexport function DocMermaid({ entry }: { entry: ReportDocMermaid }) {\n const renderers = useBuiltinRenderers();\n if (renderers.mermaid) {\n return <>{renderers.mermaid(entry)}</>;\n }\n return <MermaidSource entry={entry} />;\n}\n","import type { ReportDocScreenshot } from \"executable-stories-core\";\nimport { isLocalFsPath, safeImageUrl } from \"../../lib/url\";\n\n/**\n * A screenshot that's still an absolute local filesystem path by the time it\n * reaches this component means the report's asset bundler couldn't find the\n * file to inline/copy it (deleted, moved, or never captured — see\n * inlineScreenshotIfPossible in executable-stories-playwright). `<img src>`\n * would 404 against a path from the machine that generated the report, so\n * show a placeholder instead of a broken image.\n */\nexport function DocScreenshot({ entry }: { entry: ReportDocScreenshot }) {\n const src = isLocalFsPath(entry.path) ? undefined : safeImageUrl(entry.path);\n\n if (!src) {\n return (\n <figure className=\"my-3 rounded-md border border-dashed border-border p-3 text-sm text-muted-foreground\">\n <div className=\"font-medium\">Screenshot unavailable</div>\n <div className=\"mt-1 break-all font-mono text-xs\">{entry.path}</div>\n {entry.alt ? <figcaption className=\"mt-1.5 text-xs\">{entry.alt}</figcaption> : null}\n </figure>\n );\n }\n\n return (\n <figure className=\"my-3\">\n <img\n src={src}\n alt={entry.alt ?? \"\"}\n loading=\"lazy\"\n className=\"max-w-full rounded-md border border-border\"\n />\n {entry.alt ? <figcaption className=\"mt-1.5 text-xs text-muted-foreground\">{entry.alt}</figcaption> : null}\n </figure>\n );\n}\n","import type { ReportDocVideo } from \"executable-stories-core\";\nimport { isLocalFsPath, safeUrl } from \"../../lib/url\";\n\n/**\n * Renders a video doc entry. Video bytes are large and never inlined; `path` is\n * a URL or a path that resolves alongside the report. Both `path` and `poster`\n * are adapter-supplied, so they go through the same scheme allow-list as the\n * DocHtml iframe src (no `javascript:`/`data:` URLs reach the DOM).\n *\n * An absolute local filesystem path means the report's asset bundler\n * couldn't find/copy the file — a `<video src>` pointed at a runner-local\n * path would just fail to load, so show a placeholder instead.\n */\nexport function DocVideo({ entry }: { entry: ReportDocVideo }) {\n if (isLocalFsPath(entry.path)) {\n return (\n <figure className=\"my-3 rounded-md border border-dashed border-border p-3 text-sm text-muted-foreground\">\n <div className=\"font-medium\">Video unavailable</div>\n <div className=\"mt-1 break-all font-mono text-xs\">{entry.path}</div>\n {entry.caption ? <figcaption className=\"mt-1.5 text-xs\">{entry.caption}</figcaption> : null}\n </figure>\n );\n }\n\n const src = safeUrl(entry.path);\n const poster = safeUrl(entry.poster);\n return (\n <figure className=\"my-3\">\n <video\n controls\n preload=\"metadata\"\n {...(src ? { src } : {})}\n {...(poster ? { poster } : {})}\n className=\"max-w-full rounded-md border border-border\"\n />\n {entry.caption ? (\n <figcaption className=\"mt-1 text-xs text-muted-foreground\">{entry.caption}</figcaption>\n ) : null}\n </figure>\n );\n}\n","import type { ReportDocHtml } from \"executable-stories-core\";\nimport { safeUrl } from \"../../lib/url\";\n\n/**\n * Renders an embedded-HTML doc entry inside a SANDBOXED iframe. All embedded\n * HTML is untrusted, so the frame is `sandbox=\"allow-scripts\"` only (no\n * allow-same-origin) — embedded scripts run (charts work) but can't touch the\n * report DOM, cookies, or storage. Inline `content` → srcdoc (keeps the report\n * self-contained); `url`/`path` → src (scheme-validated).\n */\nexport function DocHtml({ entry }: { entry: ReportDocHtml }) {\n const height = typeof entry.height === \"number\" ? `${entry.height}px` : (entry.height ?? \"400px\");\n const title = entry.title ?? \"Embedded HTML\";\n const safeHref = safeUrl(entry.url ?? entry.path);\n\n // Exactly one of content / url / path is set. A url/path with an unsafe\n // scheme yields no src (the figure still renders, just empty).\n const frameProps = entry.content !== undefined ? { srcDoc: entry.content } : { src: safeHref ?? \"\" };\n\n return (\n <figure className=\"my-3 overflow-hidden rounded-md border border-border\">\n <figcaption className=\"flex items-center justify-between border-b border-border bg-muted/40 px-3 py-1.5 text-xs font-medium text-muted-foreground\">\n <span>{entry.title ?? \"HTML\"}</span>\n {safeHref ? (\n <a\n href={safeHref}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n aria-label=\"Open in new tab\"\n title=\"Open in new tab\"\n className=\"text-primary\"\n >\n ↗\n </a>\n ) : null}\n </figcaption>\n <iframe\n {...frameProps}\n sandbox=\"allow-scripts\"\n loading=\"lazy\"\n title={title}\n className=\"block w-full border-0\"\n // Embedded HTML is authored standalone, so it assumes a light page. An\n // iframe with no background inherits the host's dark canvas (via the\n // report's `color-scheme`), leaving that authored dark text unreadable.\n style={{ height, colorScheme: \"light\", background: \"#fff\" }}\n />\n </figure>\n );\n}\n","import type { ReportDocState } from \"executable-stories-core\";\nimport { CodeFigure } from \"./DocCode\";\n\n/**\n * A `story.state()` snapshot in the step detail: label + pretty JSON, same\n * chrome as `code(json)`. Frame-to-frame diffs are the storyboard's job —\n * here the entry just shows what was captured at this step.\n */\nexport function DocState({ entry }: { entry: ReportDocState }) {\n let json: string;\n try {\n json = JSON.stringify(entry.value, null, 2) ?? String(entry.value);\n } catch {\n json = String(entry.value);\n }\n return (\n <CodeFigure label={entry.label ?? \"State\"}>\n <code className=\"font-mono text-xs language-json\">{json}</code>\n </CodeFigure>\n );\n}\n","import type { ReportDocCustom } from \"executable-stories-core\";\nimport { useCustomRenderers } from \"../../hooks/useRenderers\";\n\nexport function DocCustom({ entry }: { entry: ReportDocCustom }) {\n const renderers = useCustomRenderers();\n const renderer = renderers[entry.type];\n if (renderer) {\n return <>{renderer(entry)}</>;\n }\n return (\n <div className=\"my-2\" data-type={entry.type}>\n <p className=\"mb-1 text-xs font-medium text-muted-foreground\">{entry.type}</p>\n <pre tabIndex={0} className=\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\">\n {safeStringify(entry.data)}\n </pre>\n </div>\n );\n}\n\nfunction safeStringify(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n","import type { ReportDocEntry } from \"executable-stories-core\";\nimport { DocNote } from \"./DocNote\";\nimport { DocTag } from \"./DocTag\";\nimport { DocKv } from \"./DocKv\";\nimport { DocCode } from \"./DocCode\";\nimport { DocTable } from \"./DocTable\";\nimport { DocLink } from \"./DocLink\";\nimport { DocSection } from \"./DocSection\";\nimport { DocMermaid } from \"./DocMermaid\";\nimport { DocScreenshot } from \"./DocScreenshot\";\nimport { DocVideo } from \"./DocVideo\";\nimport { DocHtml } from \"./DocHtml\";\nimport { DocState } from \"./DocState\";\nimport { DocCustom } from \"./DocCustom\";\n\nexport function DocEntry({ entry }: { entry: ReportDocEntry }) {\n switch (entry.kind) {\n case \"note\":\n return <DocNote entry={entry} />;\n case \"tag\":\n return <DocTag entry={entry} />;\n case \"kv\":\n return <DocKv entry={entry} />;\n case \"code\":\n return <DocCode entry={entry} />;\n case \"table\":\n return <DocTable entry={entry} />;\n case \"link\":\n return <DocLink entry={entry} />;\n case \"section\":\n return <DocSection entry={entry} />;\n case \"mermaid\":\n return <DocMermaid entry={entry} />;\n case \"screenshot\":\n return <DocScreenshot entry={entry} />;\n case \"video\":\n return <DocVideo entry={entry} />;\n case \"html\":\n return <DocHtml entry={entry} />;\n case \"state\":\n return <DocState entry={entry} />;\n case \"custom\":\n return <DocCustom entry={entry} />;\n }\n}\n","import type { ReportDocEntry } from \"executable-stories-core\";\nimport { DocEntry } from \"./doc/DocEntry\";\n\nexport interface ReportDocEntriesProps {\n entries: readonly ReportDocEntry[];\n}\n\nexport function ReportDocEntries({ entries }: ReportDocEntriesProps) {\n if (entries.length === 0) return null;\n return (\n <>\n {entries.map((entry, i) => (\n <DocEntry key={i} entry={entry} />\n ))}\n </>\n );\n}\n","import type { ReportScenario } from \"executable-stories-core\";\n// Subpath import: the core package root pulls in Node-only converters\n// (node:crypto), which breaks browser bundles — see formatDuration's import.\nimport { extractStoryboardFrames } from \"executable-stories-core/storyboard\";\nimport type { StoryboardFrame, StoryboardStateCard } from \"executable-stories-core/storyboard\";\nimport { summarizeStateChanges } from \"executable-stories-core/state-diff\";\nimport type { StateChangeKind } from \"executable-stories-core/state-diff\";\nimport { isLocalFsPath, safeImageUrl } from \"executable-stories-core/utils/url\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReportStoryboardProps {\n scenario: ReportScenario;\n}\n\nconst FRAME_GLYPH: Record<string, string> = {\n passed: \"✓\",\n failed: \"✗\",\n skipped: \"○\",\n pending: \"○\",\n};\n\nconst FRAME_GLYPH_COLOR: Record<string, string> = {\n passed: \"text-pass\",\n failed: \"text-fail\",\n skipped: \"text-skip\",\n pending: \"text-pend\",\n};\n\n/**\n * Storyboard — a horizontal filmstrip of the scenario's step evidence\n * (Given → When → Then), derived from the same step docs the vertical step\n * list renders. A frame is a container: the step's screenshot (when present)\n * plus its `story.state()` snapshot cards, so data-only scenarios get\n * filmstrips too. Each frame links to its step's anchor.\n *\n * Renders nothing below 2 frames: a single capture is evidence, not a\n * walkthrough, and it already shows under its step.\n *\n * Must stay hydration-free: the Astro story pages render this inside a static\n * (no client JS) island, so navigation is plain anchors and snapshot expansion\n * is a native <details> — no lightbox or toggle state.\n */\nexport function ReportStoryboard({ scenario }: ReportStoryboardProps) {\n const frames = extractStoryboardFrames(scenario);\n if (frames.length < 2) return null;\n return (\n <section data-slot=\"storyboard\" aria-label=\"Storyboard\" className=\"mb-3\">\n <h4 className=\"mb-1.5 text-xs font-semibold tracking-wide text-muted-foreground uppercase\">\n Storyboard\n </h4>\n <ol className=\"flex items-start gap-3 overflow-x-auto pb-2\">\n {frames.map((frame) => (\n <StoryboardFrameItem key={frame.stepId} frame={frame} />\n ))}\n </ol>\n </section>\n );\n}\n\nfunction StoryboardFrameItem({ frame }: { frame: StoryboardFrame }) {\n const label = `${frame.keyword} ${frame.text}`;\n const hasStates = frame.states.length > 0;\n const caption = (\n <p className=\"mt-1 flex items-baseline gap-1.5 text-[0.6875rem] leading-snug\">\n <span aria-hidden className={cn(\"shrink-0\", FRAME_GLYPH_COLOR[frame.status])}>\n {FRAME_GLYPH[frame.status] ?? \"○\"}\n </span>\n <span className=\"min-w-0\">\n <span className=\"font-mono font-semibold text-keyword\">{frame.keyword}</span>{\" \"}\n <span className=\"text-muted-foreground\">{frame.screenshot?.alt ?? frame.text}</span>\n </span>\n </p>\n );\n return (\n // State cards need room for diff rows; screenshot-only frames keep the\n // original narrow film-cell width (and DOM) unchanged.\n <li className={cn(\"shrink-0\", hasStates ? \"w-64\" : \"w-40\")}>\n {frame.screenshot ? (\n <FrameScreenshot frame={frame} label={label} />\n ) : null}\n {hasStates ? (\n <div className={cn(\"flex flex-col gap-1.5\", frame.screenshot && \"mt-1.5\")}>\n {frame.states.map((card, i) => (\n <StateCardView key={card.label ?? i} card={card} />\n ))}\n </div>\n ) : null}\n {frame.screenshot ? (\n caption\n ) : (\n // No screenshot means no image anchor, so the caption carries the\n // jump-to-step link instead.\n <a href={`#${frame.stepId}`} aria-label={`Jump to step: ${label}`} className=\"block hover:underline\">\n {caption}\n </a>\n )}\n </li>\n );\n}\n\nfunction FrameScreenshot({ frame, label }: { frame: StoryboardFrame; label: string }) {\n const path = frame.screenshot?.path ?? \"\";\n const src = isLocalFsPath(path) ? undefined : safeImageUrl(path);\n return (\n <a\n href={`#${frame.stepId}`}\n aria-label={`Jump to step: ${label}`}\n className=\"block overflow-hidden rounded-md border border-border transition-colors hover:border-ring\"\n >\n {src ? (\n <img\n src={src}\n alt={frame.screenshot?.alt ?? label}\n loading=\"lazy\"\n className=\"h-24 w-full bg-muted object-cover object-top\"\n />\n ) : (\n <span className=\"flex h-24 w-full items-center justify-center border-b border-dashed border-border bg-muted px-2 text-center text-[0.6875rem] text-muted-foreground\">\n Screenshot unavailable\n </span>\n )}\n </a>\n );\n}\n\n// Same accent scheme as the status badges/KPI cards: green = new, red = gone,\n// amber (skip tokens) = changed. Text + bg pairs are the AA-audited --es-*\n// combinations from tailwind.css.\nconst CHANGE_TONE: Record<StateChangeKind, string> = {\n added: \"bg-pass-bg text-pass\",\n removed: \"bg-fail-bg text-fail\",\n changed: \"bg-skip-bg text-skip\",\n};\n\nfunction prettyJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2) ?? String(value);\n } catch {\n return String(value);\n }\n}\n\n/**\n * One `story.state()` snapshot card: label chip, then what changed since the\n * previous frame's snapshot of the same label (changed fields first, full\n * snapshot behind a disclosure). First appearance shows the snapshot itself\n * with a \"first capture\" hint — there is nothing to diff against yet.\n */\nfunction StateCardView({ card }: { card: StoryboardStateCard }) {\n const json = prettyJson(card.value);\n const firstCapture = card.changes === undefined;\n return (\n <div data-slot=\"state-card\" className=\"rounded-md border border-border bg-card p-2\">\n <p className=\"flex flex-wrap items-baseline gap-1.5\">\n <span className=\"inline-flex rounded-full border border-border px-1.5 font-mono text-[0.625rem] font-medium text-muted-foreground\">\n {card.label ?? \"State\"}\n </span>\n {firstCapture ? (\n <span className=\"text-[0.625rem] text-muted-foreground italic\">first capture</span>\n ) : null}\n </p>\n {!firstCapture &&\n (card.changes && card.changes.length > 0 ? (\n <ul className=\"mt-1.5 flex flex-col gap-0.5\">\n {card.changes.map((change, i) => (\n <li\n key={i}\n className={cn(\n \"rounded-sm px-1.5 py-0.5 font-mono text-[0.625rem] leading-snug break-all\",\n CHANGE_TONE[change.kind]\n )}\n >\n {summarizeStateChanges([change])[0]}\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"mt-1.5 text-[0.625rem] text-muted-foreground\">No changes</p>\n ))}\n <details\n // First capture opens short snapshots by default: it IS the card's\n // content. Diff cards keep the snapshot collapsed — the rows above\n // already tell the story.\n open={firstCapture && json.length <= 240}\n className={cn(firstCapture ? \"mt-1.5\" : \"mt-1\")}\n >\n <summary className=\"cursor-pointer text-[0.625rem] text-muted-foreground hover:text-foreground\">\n Snapshot\n </summary>\n <pre tabIndex={0} className=\"mt-1 max-h-48 overflow-auto rounded-sm bg-muted p-1.5 font-mono text-[0.625rem] leading-snug\">\n {json}\n </pre>\n </details>\n </div>\n );\n}\n","import type { ReportAttachment } from \"executable-stories-core\";\n\n/**\n * Renders scenario attachments. Base64 images embed inline; everything else\n * becomes a labelled data-URI download link. Mirrors the report's attachments\n * block (which also inlines images and links other media).\n */\nexport function ReportAttachments({ attachments }: { attachments: ReportAttachment[] }) {\n if (attachments.length === 0) return null;\n return (\n // role=\"group\" (not a labelled <section>) so multiple scenarios' attachment\n // blocks don't create duplicate \"Attachments\" region landmarks.\n <div role=\"group\" aria-label=\"Attachments\" className=\"mt-3 flex flex-col gap-2\">\n {attachments.map((att, i) => {\n const dataUri =\n att.contentEncoding === \"BASE64\"\n ? `data:${att.mediaType};base64,${att.body}`\n : `data:${att.mediaType},${encodeURIComponent(att.body)}`;\n const isImage = att.mediaType.startsWith(\"image/\");\n return (\n <figure key={`${att.name}-${i}`} className=\"m-0\">\n {isImage ? (\n <>\n <img\n src={dataUri}\n alt={att.name}\n loading=\"lazy\"\n className=\"max-w-full rounded-md border border-border\"\n />\n <figcaption className=\"mt-1 text-xs text-muted-foreground\">{att.name}</figcaption>\n </>\n ) : (\n <a\n href={dataUri}\n download={att.name}\n className=\"text-xs text-link underline underline-offset-2\"\n >\n {att.name} <span className=\"text-muted-foreground\">({att.mediaType})</span>\n </a>\n )}\n </figure>\n );\n })}\n </div>\n );\n}\n","import type { OtelSpan } from \"executable-stories-core/types/otel\";\nimport { formatDuration } from \"executable-stories-core/utils/duration\";\nimport { toTraceRows, traceWindow } from \"@/lib/trace\";\nimport { cn } from \"@/lib/utils\";\n\nconst BAR_COLOR: Record<string, string> = {\n ok: \"bg-pass\",\n error: \"bg-fail\",\n unset: \"bg-skip\",\n};\n\n/**\n * OTel trace waterfall. Collapsed by default (native <details>, no JS) so it\n * renders in both the static and interactive reports. Each span is a row with a\n * depth-indented name and a bar positioned/sized by its time window.\n */\nexport function ReportTrace({ spans }: { spans: readonly OtelSpan[] | undefined }) {\n if (!spans || spans.length === 0) return null;\n const rows = toTraceRows(spans);\n if (rows.length === 0) return null;\n const { minStartMs, totalMs } = traceWindow(rows);\n\n return (\n <details className=\"mt-3 rounded-md border border-border bg-muted/30\">\n <summary className=\"cursor-pointer px-3 py-2 text-xs font-medium text-muted-foreground\">\n Trace ({rows.length} span{rows.length === 1 ? \"\" : \"s\"}, {formatDuration(totalMs)})\n </summary>\n <ul className=\"flex flex-col gap-0.5 px-3 pb-3 font-mono text-[0.6875rem]\">\n {rows.map((row, i) => {\n const leftPct = ((row.startTimeMs - minStartMs) / totalMs) * 100;\n const widthPct = Math.max((row.durationMs / totalMs) * 100, 0.5);\n return (\n <li key={`${row.spanId}-${i}`} className=\"flex items-center gap-2\">\n <span\n className=\"min-w-0 flex-1 truncate text-foreground\"\n style={{ paddingLeft: `${row.depth * 12}px` }}\n title={row.statusMessage ? `${row.name}: ${row.statusMessage}` : row.name}\n >\n {row.name}\n </span>\n <span className=\"relative h-3 w-1/2 shrink-0 overflow-hidden rounded-sm bg-border/40\">\n <span\n className={cn(\"absolute top-0 h-full rounded-sm\", BAR_COLOR[row.status])}\n style={{ left: `${leftPct}%`, width: `${widthPct}%` }}\n />\n </span>\n <span className=\"w-16 shrink-0 text-right text-muted-foreground\">\n {formatDuration(row.durationMs)}\n </span>\n </li>\n );\n })}\n </ul>\n </details>\n );\n}\n","/**\n * Pure span normalization + tree building for the OTel trace waterfall.\n * Ported from the formatters trace-view renderer so the React waterfall shows\n * the same structure. Side-effect-free for unit testing.\n */\n\nimport type { OtelSpan } from \"executable-stories-core/types/otel\";\n\nexport interface NormalizedSpan {\n spanId: string;\n parentSpanId?: string;\n name: string;\n startTimeMs: number;\n durationMs: number;\n status: \"ok\" | \"error\" | \"unset\";\n statusMessage?: string;\n}\n\nexport interface TraceRow extends NormalizedSpan {\n depth: number;\n}\n\nconst VALID = new Set([\"ok\", \"error\", \"unset\"]);\nconst safeStatus = (s: string): NormalizedSpan[\"status\"] => (VALID.has(s) ? (s as NormalizedSpan[\"status\"]) : \"unset\");\n\nexport function normalizeSpans(spans: readonly OtelSpan[]): NormalizedSpan[] {\n const out: NormalizedSpan[] = [];\n for (const span of spans) {\n if (!span || typeof span.spanId !== \"string\" || typeof span.name !== \"string\") continue;\n let startTimeMs: number;\n let durationMs: number;\n if (span.startTimeMs != null && span.durationMs != null) {\n startTimeMs = span.startTimeMs;\n durationMs = span.durationMs;\n } else if (span.startTimeUnixNano != null && span.endTimeUnixNano != null) {\n startTimeMs = span.startTimeUnixNano / 1e6;\n durationMs = (span.endTimeUnixNano - span.startTimeUnixNano) / 1e6;\n } else {\n continue;\n }\n durationMs = Math.max(0, durationMs);\n if (!isFinite(startTimeMs) || !isFinite(durationMs)) continue;\n out.push({\n spanId: span.spanId,\n parentSpanId: span.parentSpanId,\n name: span.name,\n startTimeMs,\n durationMs,\n status: safeStatus(span.status),\n statusMessage: span.statusMessage,\n });\n }\n return out;\n}\n\n/** Flatten spans into rows in tree order with a depth, parent before children. */\nexport function toTraceRows(spans: readonly OtelSpan[]): TraceRow[] {\n const normalized = normalizeSpans(spans);\n if (normalized.length === 0) return [];\n\n interface Node {\n span: NormalizedSpan;\n children: Node[];\n depth: number;\n }\n const byId = new Map<string, Node>();\n for (const span of normalized) {\n let key = span.spanId;\n let suffix = 2;\n while (byId.has(key)) key = `${span.spanId}__dup${suffix++}`;\n byId.set(key, { span: { ...span, spanId: key }, children: [], depth: 0 });\n }\n\n const roots: Node[] = [];\n for (const node of byId.values()) {\n const parent = node.span.parentSpanId ? byId.get(node.span.parentSpanId) : undefined;\n if (parent && parent !== node) parent.children.push(node);\n else roots.push(node);\n }\n for (const node of byId.values()) node.children.sort((a, b) => a.span.startTimeMs - b.span.startTimeMs);\n roots.sort((a, b) => a.span.startTimeMs - b.span.startTimeMs);\n\n const rows: TraceRow[] = [];\n const seen = new Set<string>();\n const walk = (node: Node, depth: number): void => {\n if (seen.has(node.span.spanId)) return;\n seen.add(node.span.spanId);\n rows.push({ ...node.span, depth });\n for (const child of node.children) walk(child, depth + 1);\n };\n for (const root of roots) walk(root, 0);\n // Orphans from cycles: promote to depth 0.\n for (const node of byId.values()) {\n if (!seen.has(node.span.spanId)) walk(node, 0);\n }\n return rows;\n}\n\nexport interface TraceWindow {\n minStartMs: number;\n totalMs: number;\n}\n\nexport function traceWindow(rows: readonly TraceRow[]): TraceWindow {\n let min = Infinity;\n let max = -Infinity;\n for (const r of rows) {\n min = Math.min(min, r.startTimeMs);\n max = Math.max(max, r.startTimeMs + r.durationMs);\n }\n const total = max - min;\n return { minStartMs: isFinite(min) ? min : 0, totalMs: total > 0 ? total : 1 };\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { ScenarioHistoryMap } from \"../lib/run-history\";\n\n/**\n * Provided only inside <ReportInteractive> when the CLI embedded a run\n * history (--history-file). When null (the static <Report/> render,\n * Storybook, Astro), scenario cards simply omit the history strip.\n */\nconst ScenarioHistoryContext = createContext<ScenarioHistoryMap | null>(null);\n\nexport const ScenarioHistoryProvider = ScenarioHistoryContext.Provider;\n\nexport function useScenarioHistory(): ScenarioHistoryMap | null {\n return useContext(ScenarioHistoryContext);\n}\n","export type ScenarioRunStatus = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\n/** One historical run of a scenario, oldest → newest in a history array. */\nexport interface ScenarioRunEvent {\n /** Epoch ms the run started. */\n timestamp: number;\n status: ScenarioRunStatus;\n runId?: string;\n durationMs?: number;\n commitSha?: string;\n branch?: string;\n}\n\n/** Recent run events keyed by ReportScenario.id. */\nexport type ScenarioHistoryMap = Record<string, ScenarioRunEvent[]>;\n\nexport interface RunStreak {\n status: ScenarioRunStatus;\n /** How many consecutive trailing runs share that status (≥1). */\n count: number;\n}\n\n/** The trailing same-status streak — \"passing for 5 runs\", \"failing for 2\". */\nexport function currentStreak(entries: readonly ScenarioRunEvent[]): RunStreak | undefined {\n const last = entries[entries.length - 1];\n if (!last) return undefined;\n let count = 0;\n for (let i = entries.length - 1; i >= 0 && entries[i]!.status === last.status; i--) count++;\n return { status: last.status, count };\n}\n\nconst STREAK_VERB: Record<ScenarioRunStatus, string> = {\n passed: \"Passing\",\n failed: \"Failing\",\n skipped: \"Skipped\",\n pending: \"Pending\",\n};\n\n/** Short human summary of a history window, used for the strip's tooltip. */\nexport function describeRunHistory(entries: readonly ScenarioRunEvent[]): string {\n const passed = entries.filter((e) => e.status === \"passed\").length;\n const base = `${passed}/${entries.length} runs passed`;\n const streak = currentStreak(entries);\n if (!streak || entries.length < 2) return base;\n return `${base} · ${STREAK_VERB[streak.status]} for the last ${streak.count === 1 ? \"run\" : `${streak.count} runs`}`;\n}\n\nexport type FlakinessLevel = \"stable\" | \"unstable\" | \"flaky\";\n\n/**\n * Below this many pass/fail samples a scenario is always \"stable\" — mirrors\n * MIN_FLAKINESS_SAMPLES in the formatters history module, which owns the\n * canonical thresholds. Keep the two in sync.\n */\nconst MIN_FLAKINESS_SAMPLES = 3;\n\n/**\n * Status-transition flakiness over a scenario's recent runs. Same\n * classification as the CLI history module (`calculateFlakiness`), ported so\n * the island stays self-sufficient on the embedded history JSON.\n */\nexport function flakinessOf(entries: readonly ScenarioRunEvent[]): FlakinessLevel {\n const countable = entries.filter((e) => e.status === \"passed\" || e.status === \"failed\");\n if (countable.length < MIN_FLAKINESS_SAMPLES) return \"stable\";\n\n let transitions = 0;\n for (let i = 1; i < countable.length; i++) {\n if (countable[i]!.status !== countable[i - 1]!.status) transitions++;\n }\n const transitionScore = transitions / (countable.length - 1);\n const failureRate = countable.filter((e) => e.status === \"failed\").length / countable.length;\n\n if (transitionScore > 0.5 || (transitionScore > 0.3 && failureRate > 0.2)) return \"flaky\";\n if (transitionScore > 0.2 || failureRate > 0.3) return \"unstable\";\n return \"stable\";\n}\n\nexport interface ScenarioRef {\n id: string;\n title: string;\n}\n\nexport interface LastRunDelta {\n /** Failed in this run, not failed in the previous one. */\n newlyFailing: ScenarioRef[];\n /** Passed in this run, failed in the previous one. */\n newlyPassing: ScenarioRef[];\n /** First appearance in the history window — no previous run to compare. */\n added: ScenarioRef[];\n}\n\n/**\n * What changed between the previous run and this one, for the report-header\n * strip. The history store appends the current run before the report is\n * generated, so each scenario's last entry IS this run and the entry before\n * it is the previous run. Returns undefined when no scenario has a previous\n * run to compare against (first run with history enabled).\n */\nexport function diffSinceLastRun(\n history: ScenarioHistoryMap,\n scenarios: readonly ScenarioRef[],\n): LastRunDelta | undefined {\n let hasPreviousRun = false;\n const delta: LastRunDelta = { newlyFailing: [], newlyPassing: [], added: [] };\n\n for (const scenario of scenarios) {\n const entries = history[scenario.id];\n if (!entries || entries.length === 0) continue;\n const last = entries[entries.length - 1]!;\n const prev = entries[entries.length - 2];\n if (!prev) {\n delta.added.push(scenario);\n continue;\n }\n hasPreviousRun = true;\n if (last.status === \"failed\" && prev.status !== \"failed\") delta.newlyFailing.push(scenario);\n else if (last.status === \"passed\" && prev.status === \"failed\") delta.newlyPassing.push(scenario);\n }\n\n return hasPreviousRun ? delta : undefined;\n}\n","import { useScenarioHistory } from \"../interactive/scenario-history-context\";\nimport { describeRunHistory, flakinessOf, type ScenarioRunEvent, type ScenarioRunStatus } from \"../lib/run-history\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/lib/utils\";\n\n/** How many trailing runs the strip shows; older entries stay in the tooltip count. */\nconst MAX_DOTS = 10;\n\nconst DOT_COLOR: Record<ScenarioRunStatus, string> = {\n passed: \"bg-pass\",\n failed: \"bg-fail\",\n skipped: \"bg-skip\",\n pending: \"bg-pend\",\n};\n\nfunction dotTitle(e: ScenarioRunEvent): string {\n const parts = [new Date(e.timestamp).toLocaleString(), e.status];\n if (e.commitSha) parts.push(e.commitSha.slice(0, 8));\n return parts.join(\" · \");\n}\n\n/**\n * Compact run-over-run timeline for one scenario: a dot per recent run,\n * oldest → newest. Renders nothing outside <ReportInteractive> or when the\n * report was generated without --history-file — history is presentation-layer\n * data and never part of the StoryReport contract.\n */\nexport function ScenarioRunHistory({ scenarioId }: { scenarioId: string }) {\n const history = useScenarioHistory();\n const entries = history?.[scenarioId];\n if (!entries || entries.length < 2) return null; // one run = no timeline yet\n\n const recent = entries.slice(-MAX_DOTS);\n // Judge flakiness on the same window the dots show, so the badge never\n // contradicts the strip next to it.\n const flaky = flakinessOf(recent) === \"flaky\";\n const summary = flaky ? `${describeRunHistory(recent)} · Flaky` : describeRunHistory(recent);\n\n return (\n <>\n {flaky ? (\n <Badge variant=\"pending\" aria-label=\"Flaky: status flips between recent runs\" title={summary}>\n Flaky\n </Badge>\n ) : null}\n <span\n role=\"img\"\n aria-label={`Run history: ${summary}`}\n title={summary}\n className=\"flex shrink-0 items-center gap-[3px]\"\n >\n {recent.map((e, i) => (\n <span\n key={`${e.timestamp}-${i}`}\n aria-hidden\n title={dotTitle(e)}\n className={cn(\n \"inline-block size-1.5 rounded-full\",\n DOT_COLOR[e.status],\n // The newest run (rightmost dot) is the one the card's status\n // badge already describes; ring it so the timeline reads as\n // \"…leading up to now\".\n i === recent.length - 1 && \"ring-1 ring-border ring-offset-1 ring-offset-card\",\n )}\n />\n ))}\n </span>\n </>\n );\n}\n","\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { formatRelativeAge, isReportStale } from \"../lib/provenance\";\nimport { useScenarioFreshness } from \"../interactive/scenario-freshness-context\";\nimport { Badge } from \"@/components/ui/badge\";\n\n/**\n * Per-scenario age signal.\n *\n * A report assembled from accumulated runs can be freshly rendered while some\n * of its scenarios last ran weeks ago. The report-level banner speaks for the\n * run, not for those scenarios, so without this the carried-over ones borrow a\n * freshness they have not earned.\n *\n * Only scenarios that are actually old say anything: a scenario that ran in\n * this run is the normal case and adds no badge. Age is computed on mount for\n * the same reason the report banner does it — static HTML is generated once and\n * read later, so an age baked in at build time would lie.\n */\nexport function ScenarioStaleness({ scenario }: { scenario: { lastRunAtMs?: number } }) {\n const freshness = useScenarioFreshness();\n const fixedNow = freshness?.nowMs;\n const [now, setNow] = useState<number | undefined>(fixedNow);\n\n useEffect(() => {\n if (fixedNow === undefined) setNow(Date.now());\n }, [fixedNow]);\n\n if (!freshness || now === undefined) return null;\n\n // No stamp means the report predates stamping, or came straight from one run.\n // Either way the report-level signal already speaks for it.\n const lastRunAtMs = scenario.lastRunAtMs;\n if (!lastRunAtMs || lastRunAtMs <= 0) return null;\n if (!isReportStale(lastRunAtMs, freshness.staleAfterDays, now)) return null;\n\n return (\n <Badge variant=\"outline\" aria-label=\"Scenario freshness\">\n Last ran {formatRelativeAge(lastRunAtMs, now)}\n </Badge>\n );\n}\n","import type { StoryReport } from \"executable-stories-core\";\n\ntype ReportCI = NonNullable<StoryReport[\"ci\"]>;\n\n/**\n * Epoch ms of the run the report documents — the staleness reference.\n * Prefers finishedAtMs; falls back to startedAtMs for reports from adapters\n * that only stamp a start time.\n */\nexport function reportLastRunMs(\n report: Pick<StoryReport, \"startedAtMs\" | \"finishedAtMs\">,\n): number | undefined {\n if (report.finishedAtMs && report.finishedAtMs > 0) return report.finishedAtMs;\n if (report.startedAtMs && report.startedAtMs > 0) return report.startedAtMs;\n return undefined;\n}\n\n/**\n * Epoch ms of the run that produced one scenario.\n *\n * A report assembled from accumulated runs holds scenarios that last ran at\n * different times, so the run-level timestamp overstates how fresh most of them\n * are. Falls back to the report for scenarios recorded before stamping, and for\n * reports rendered straight from a single run.\n */\nexport function scenarioLastRunMs(\n scenario: { lastRunAtMs?: number },\n report: Pick<StoryReport, \"startedAtMs\" | \"finishedAtMs\">,\n): number | undefined {\n if (scenario.lastRunAtMs && scenario.lastRunAtMs > 0) return scenario.lastRunAtMs;\n return reportLastRunMs(report);\n}\n\n/**\n * Human-readable age like \"just now\", \"5 minutes ago\", \"3 hours ago\",\n * \"12 days ago\". Clock skew (thenMs in the future) reads as \"just now\".\n */\nexport function formatRelativeAge(thenMs: number, nowMs: number): string {\n const deltaMs = Math.max(0, nowMs - thenMs);\n const minutes = Math.floor(deltaMs / 60_000);\n if (minutes < 1) return \"just now\";\n if (minutes < 60) return `${minutes} minute${minutes === 1 ? \"\" : \"s\"} ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours} hour${hours === 1 ? \"\" : \"s\"} ago`;\n const days = Math.floor(hours / 24);\n return `${days} day${days === 1 ? \"\" : \"s\"} ago`;\n}\n\n/**\n * A report is stale once its run is `staleAfterDays` or more days old.\n * A threshold of 0 (or negative) disables staleness entirely.\n */\nexport function isReportStale(\n lastRunMs: number | undefined,\n staleAfterDays: number,\n nowMs: number,\n): boolean {\n if (lastRunMs === undefined || staleAfterDays <= 0) return false;\n return nowMs - lastRunMs >= staleAfterDays * 86_400_000;\n}\n\n/**\n * StoryReport.ci.name carries the raw transport name — lowercase provider\n * keys (\"github\") from env detection, or a free-form string from older\n * adapters (\"GitHub Actions\"). Map the known keys to display names and pass\n * everything else through.\n */\nconst CI_DISPLAY_NAMES: Record<string, string> = {\n github: \"GitHub Actions\",\n gitlab: \"GitLab CI\",\n circleci: \"CircleCI\",\n jenkins: \"Jenkins\",\n azure: \"Azure DevOps\",\n buildkite: \"Buildkite\",\n travis: \"Travis CI\",\n ci: \"CI\",\n};\n\nexport function ciDisplayName(name: string): string {\n return CI_DISPLAY_NAMES[name] ?? name;\n}\n\n/**\n * Derive a browsable commit URL from the CI run URL, for the providers whose\n * URL structure makes that safe:\n * GitHub Actions …/owner/repo/actions/runs/123 -> …/owner/repo/commit/<sha>\n * GitLab CI …/group/project/-/pipelines/123 -> …/group/project/-/commit/<sha>\n * Other providers return undefined (a wrong link is worse than none).\n */\nexport function commitUrl(ci: ReportCI | undefined, sha: string | undefined): string | undefined {\n const commitSha = ci?.commitSha ?? sha;\n if (!ci?.url || !commitSha) return undefined;\n\n const github = ci.url.match(/^(https?:\\/\\/[^/]+\\/[^/]+\\/[^/]+)\\/actions\\/runs\\//);\n if (github) return `${github[1]}/commit/${commitSha}`;\n\n const gitlab = ci.url.match(/^(https?:\\/\\/.+)\\/-\\/pipelines\\//);\n if (gitlab) return `${gitlab[1]}/-/commit/${commitSha}`;\n\n return undefined;\n}\n\n/**\n * Derive a pull-request URL for GitHub-shaped CI run URLs. GitLab and the\n * rest return undefined for the same wrong-link-is-worse-than-none reason.\n */\nexport function prUrl(ci: ReportCI | undefined): string | undefined {\n if (!ci?.url || !ci.prNumber) return undefined;\n const github = ci.url.match(/^(https?:\\/\\/[^/]+\\/[^/]+\\/[^/]+)\\/actions\\/runs\\//);\n if (github) return `${github[1]}/pull/${ci.prNumber}`;\n return undefined;\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { StoryReport } from \"executable-stories-core\";\n\nexport interface ScenarioFreshness {\n /** Days before a scenario counts as stale; 0 disables the signal. */\n staleAfterDays: number;\n /** The run being rendered, used for scenarios carrying no stamp of their own. */\n report: Pick<StoryReport, \"startedAtMs\" | \"finishedAtMs\">;\n /** Test seam: fixed \"now\". Left undefined, the badge reads the clock on mount. */\n nowMs?: number;\n}\n\n/**\n * Provided only where a report knows its staleness threshold. When null (a bare\n * <Report/> render, Storybook), scenario cards simply omit the age signal —\n * same shape as the run-history context.\n */\nconst ScenarioFreshnessContext = createContext<ScenarioFreshness | null>(null);\n\nexport const ScenarioFreshnessProvider = ScenarioFreshnessContext.Provider;\n\nexport function useScenarioFreshness(): ScenarioFreshness | null {\n return useContext(ScenarioFreshnessContext);\n}\n","\"use client\";\n\nimport { createContext, useCallback, useContext, useState } from \"react\";\n\nexport interface CollapseApi {\n isCollapsed: (id: string) => boolean;\n toggle: (id: string) => void;\n}\n\n/**\n * Provided only inside <ReportInteractive>. When null (the static <Report/>\n * render, Storybook, Astro), components render fully expanded with no toggle\n * affordance — so the static path and component-tier tests are unaffected.\n */\nconst CollapseContext = createContext<CollapseApi | null>(null);\n\nexport const CollapseProvider = CollapseContext.Provider;\n\nexport function useCollapse(): CollapseApi | null {\n return useContext(CollapseContext);\n}\n\nconst STORAGE_KEY = \"es-collapsed-ids\";\n\n/** Returns the persisted collapsed set, or null when the user has never set one\n * (so the caller can fall back to a data-driven default like failures-first). */\nfunction readPersisted(): Set<string> | null {\n if (typeof localStorage === \"undefined\") return null;\n try {\n const raw = localStorage.getItem(STORAGE_KEY);\n return raw ? new Set(JSON.parse(raw) as string[]) : null;\n } catch {\n return null;\n }\n}\n\nfunction persist(ids: Set<string>): void {\n if (typeof localStorage === \"undefined\") return;\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify([...ids]));\n } catch {\n /* quota / disabled — collapse still works for the session */\n }\n}\n\n/**\n * Collapse state for the interactive report: a persisted set of collapsed\n * feature/scenario ids, plus expand-all / collapse-all. `computeDefault` seeds\n * the initial set the FIRST time (nothing persisted yet) — the report uses it\n * to open failures and collapse the rest, so a broken run reveals what failed\n * without a click. Once the user toggles anything, their choice persists and\n * wins over the default.\n */\nexport function useCollapseState(computeDefault?: () => Set<string>) {\n const [collapsed, setCollapsed] = useState<Set<string>>(\n () => readPersisted() ?? computeDefault?.() ?? new Set<string>(),\n );\n\n const isCollapsed = useCallback((id: string) => collapsed.has(id), [collapsed]);\n\n const toggle = useCallback((id: string) => {\n setCollapsed((prev) => {\n const next = new Set(prev);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n persist(next);\n return next;\n });\n }, []);\n\n const collapseAll = useCallback((ids: string[]) => {\n setCollapsed(() => {\n const next = new Set(ids);\n persist(next);\n return next;\n });\n }, []);\n\n const expandAll = useCallback(() => {\n setCollapsed(() => {\n const next = new Set<string>();\n persist(next);\n return next;\n });\n }, []);\n\n return { api: { isCollapsed, toggle } as CollapseApi, collapseAll, expandAll };\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { ReportScenario } from \"executable-stories-core\";\n// Deep import, NOT the package barrel: core's index pulls in Node-only modules\n// (attachment resolution reads the filesystem), which a browser bundler cannot\n// resolve. Types erase at compile time, so the type-only import above is safe;\n// this one is a value and must stay on the fs-free subpath.\nimport { scenarioToMarkdown as coreScenarioToMarkdown } from \"executable-stories-core/utils/scenario-markdown\";\n\nexport interface ScenarioActions {\n copyLink: (scenario: ReportScenario) => void;\n copyMarkdown: (scenario: ReportScenario) => void;\n copyPrompt: (scenario: ReportScenario) => void;\n}\n\n/**\n * Provided only inside <ReportInteractive>. When null (static render), scenarios\n * show no per-scenario action buttons.\n */\nconst ScenarioActionsContext = createContext<ScenarioActions | null>(null);\nexport const ScenarioActionsProvider = ScenarioActionsContext.Provider;\nexport function useScenarioActions(): ScenarioActions | null {\n return useContext(ScenarioActionsContext);\n}\n\n/**\n * A scenario rendered as Markdown — for pasting into PRs / issues / docs.\n *\n * Delegates to the shared serializer in core (`variant: \"compact\"`), the same\n * one behind the Astro site's `<slug>.md` twin endpoints, so what you copy here\n * and what an agent fetches there can never drift.\n */\nexport function scenarioToMarkdown(scenario: ReportScenario): string {\n return coreScenarioToMarkdown(scenario, { variant: \"compact\" });\n}\n\n/**\n * A failed scenario rendered as an investigation prompt for an AI agent — the\n * \"cheap to verify\" loop: hand the agent the failing behaviour + error verbatim.\n */\nexport function scenarioToPrompt(scenario: ReportScenario): string {\n const lines: string[] = [\n `A test scenario is ${scenario.status}. Investigate the likely cause and propose a fix.`,\n \"\",\n `Scenario: ${scenario.title}`,\n \"Steps:\",\n ];\n for (const step of scenario.steps) {\n const mark = step.status === \"failed\" ? \" ⟵ failed here\" : \"\";\n lines.push(` ${step.keyword} ${step.text}${mark}`);\n }\n if (scenario.errorMessage) {\n lines.push(\"\", \"Error:\", scenario.errorMessage.trim());\n }\n if (scenario.errorStack) {\n lines.push(\"\", \"Stack:\", scenario.errorStack.trim());\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Every failure in the run as ONE prompt. A red run is rarely one broken thing,\n * and copying scenarios one at a time loses the shape of the breakage — the\n * agent that sees all three at once can spot the shared cause.\n */\nexport function failuresToPrompt(scenarios: readonly ReportScenario[]): string {\n if (scenarios.length === 0) return \"\";\n const noun = scenarios.length === 1 ? \"test scenario is\" : \"test scenarios are\";\n const lines: string[] = [\n `${scenarios.length} ${noun} failing. Investigate the likely cause (they may share one) and propose a fix.`,\n ];\n scenarios.forEach((scenario, i) => {\n lines.push(\"\", `${i + 1}. ${scenario.title}`, \"Steps:\");\n for (const step of scenario.steps) {\n const mark = step.status === \"failed\" ? \" ⟵ failed here\" : \"\";\n lines.push(` ${step.keyword} ${step.text}${mark}`);\n }\n if (scenario.errorMessage) {\n lines.push(\"Error:\", scenario.errorMessage.trim());\n }\n });\n return lines.join(\"\\n\");\n}\n\n/** Absolute permalink to a scenario in the current document. */\nexport function scenarioPermalink(scenario: ReportScenario): string {\n if (typeof location === \"undefined\") return `#${scenario.id}`;\n return `${location.href.split(\"#\")[0]}#${scenario.id}`;\n}\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n \"flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\"leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-6\", className)}\n {...props}\n />\n )\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center px-6 [.border-t]:pt-6\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { CheckIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst itemClasses =\n \"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground\"\n\nfunction DropdownMenu(props: React.ComponentProps<typeof MenuPrimitive.Root>) {\n return <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuTrigger(\n props: React.ComponentProps<typeof MenuPrimitive.Trigger>,\n) {\n return <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />\n}\n\nfunction DropdownMenuContent({\n className,\n align = \"end\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.Popup> & {\n align?: MenuPrimitive.Positioner.Props[\"align\"]\n sideOffset?: MenuPrimitive.Positioner.Props[\"sideOffset\"]\n}) {\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Positioner\n data-slot=\"dropdown-menu-positioner\"\n className=\"z-50\"\n align={align}\n sideOffset={sideOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n \"z-50 min-w-[11rem] origin-[var(--transform-origin)] overflow-hidden rounded-md border border-border bg-popover p-1 font-sans text-sm text-popover-foreground shadow-md transition-[opacity,transform] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuItem({\n className,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.Item>) {\n return (\n <MenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n className={cn(itemClasses, className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.GroupLabel>) {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"dropdown-menu-label\"\n className={cn(\"px-2 py-1.5 text-xs font-medium text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\n// Base UI's Menu has no Separator part; a plain divider row is equivalent.\nfunction DropdownMenuSeparator({ className }: { className?: string }) {\n return <div role=\"separator\" className={cn(\"-mx-1 my-1 h-px bg-border\", className)} />\n}\n\nfunction DropdownMenuRadioGroup(\n props: React.ComponentProps<typeof MenuPrimitive.RadioGroup>,\n) {\n return <MenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.RadioItem>) {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(itemClasses, \"pl-8\", className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <MenuPrimitive.RadioItemIndicator>\n <CheckIcon className=\"size-4 text-foreground\" />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.CheckboxItem>) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(itemClasses, \"pl-8\", className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <MenuPrimitive.CheckboxItemIndicator>\n <CheckIcon className=\"size-4\" />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuCheckboxItem,\n}\n","import type { ReportFeature } from \"executable-stories-core\";\nimport { ReportScenario } from \"./ReportScenario\";\n\nexport interface ReportScenarioListProps {\n feature: ReportFeature;\n}\n\nexport function ReportScenarioList({ feature }: ReportScenarioListProps) {\n return (\n <>\n {feature.scenarios.map((scenario) => (\n <ReportScenario key={scenario.id} scenario={scenario} />\n ))}\n </>\n );\n}\n","import type { ReportFeature } from \"executable-stories-core\";\nimport { dedent, safeMarkdownHtml } from \"../lib/markdown\";\n\nexport interface ReportFeatureIntroProps {\n feature: ReportFeature;\n}\n\n/**\n * What the feature is for, ahead of the scenarios that prove it.\n *\n * Scenarios answer \"what does it do\". A reader arriving cold needs \"why does\n * this exist and who is it for\" first, which is what `story.feature(...)`\n * records. Renders nothing when a file never declared one, so existing reports\n * look exactly as they did.\n */\nexport function ReportFeatureIntro({ feature }: ReportFeatureIntroProps) {\n const hasNarrative = Boolean(feature.narrative?.trim());\n const hasGlossary = Boolean(feature.glossary?.length);\n if (!hasNarrative && !hasGlossary) return null;\n\n return (\n <div className=\"flex flex-col gap-3 border-l-2 border-border pl-4 text-sm\">\n {hasNarrative ? (\n <div\n className=\"es-doc-prose prose prose-sm max-w-none text-muted-foreground\"\n dangerouslySetInnerHTML={{ __html: safeMarkdownHtml(dedent(feature.narrative!)) }}\n />\n ) : null}\n\n {hasGlossary ? (\n <dl className=\"grid gap-1.5\" aria-label=\"Glossary\">\n {feature.glossary!.map((entry) => (\n <div key={entry.term} className=\"flex flex-wrap gap-x-2 text-xs\">\n <dt className=\"font-medium text-foreground\">{entry.term}</dt>\n <dd className=\"flex-1 text-muted-foreground\">{entry.definition}</dd>\n </div>\n ))}\n </dl>\n ) : null}\n </div>\n );\n}\n\n/**\n * Label the feature the way it was declared.\n *\n * An ability reads as something a person can now do; a business need covers the\n * cross-cutting concerns nobody asks for by name, like security or performance.\n * Naming the kind keeps that distinction visible to a reader who never sees the\n * test code. A derived title gets no badge, since nobody claimed anything.\n */\nexport function featureKindLabel(kind: ReportFeature[\"kind\"]): string | null {\n if (kind === \"ability\") return \"Ability\";\n if (kind === \"business-need\") return \"Business need\";\n if (kind === \"feature\") return \"Feature\";\n return null;\n}\n","import type { ReportFeature as ReportFeatureT } from \"executable-stories-core\";\nimport { ReportScenarioList } from \"./ReportScenarioList\";\nimport { ReportFeatureIntro, featureKindLabel } from \"./ReportFeatureIntro\";\nimport { useCollapse } from \"../interactive/collapse-context\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReportFeatureProps {\n feature: ReportFeatureT;\n}\n\n/**\n * Feature group — the report's `.feature` card: a header bar with the feature\n * title + mono source path and ✓/✗/○ status counts on the right, over a stack\n * of scenario cards. Kept a semantic <section> (a region), not a shadcn Card\n * div, so it stays a landmark and doesn't collide with the scenario cards'\n * `[data-slot=\"card\"]`.\n */\nexport function ReportFeature({ feature }: ReportFeatureProps) {\n const titleId = `${feature.id}-title`;\n const bodyId = `${feature.id}-body`;\n const s = feature.summary;\n const skipped = s.skipped + s.pending;\n const collapse = useCollapse();\n const collapsed = collapse?.isCollapsed(feature.id) ?? false;\n const kindLabel = featureKindLabel(feature.kind);\n return (\n // Suite = a section heading + a divider, NOT another bordered card. Drops a\n // layer of nesting so the scenario cards below read as the primary unit.\n <section\n id={feature.id}\n data-slot=\"feature\"\n aria-labelledby={titleId}\n className=\"flex flex-col gap-3\"\n >\n <div className=\"flex items-end justify-between gap-4 border-b border-border pb-2\">\n <div className=\"min-w-0\">\n {/* The heading itself is the toggle — a wide, obvious hit area rather\n than a lone caret. Kept inside <h2> so it stays a landmark. */}\n <h2 id={titleId} className=\"text-base font-semibold tracking-tight text-foreground\">\n {collapse ? (\n <button\n type=\"button\"\n onClick={() => collapse.toggle(feature.id)}\n aria-expanded={!collapsed}\n aria-controls={bodyId}\n className=\"flex w-full cursor-pointer items-center gap-2 text-left hover:text-foreground/80\"\n >\n <span aria-hidden className={cn(\"shrink-0 text-xs text-muted-foreground transition-transform\", !collapsed && \"rotate-90\")}>▸</span>\n <span className=\"truncate\">{feature.title}</span>\n </button>\n ) : (\n feature.title\n )}\n </h2>\n <p className={cn(\"mt-0.5 flex items-center gap-2 text-xs text-muted-foreground\", collapse && \"pl-5\")}>\n {kindLabel ? (\n <span className=\"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-medium text-foreground\">\n {kindLabel}\n </span>\n ) : null}\n <span className=\"truncate font-mono\">{feature.sourceFile}</span>\n </p>\n </div>\n {/* Readable, failure-weighted counts — only the failure count carries\n colour, so a broken suite reads at a glance without a colour salad. */}\n <p\n className=\"flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground\"\n aria-label={`${s.passed} passed, ${s.failed} failed, ${skipped} skipped`}\n >\n <span>{s.passed} passed</span>\n <span aria-hidden>·</span>\n <span className={cn(s.failed > 0 && \"font-medium text-fail\")}>{s.failed} failed</span>\n {skipped > 0 ? (\n <>\n <span aria-hidden>·</span>\n <span>{skipped} skipped</span>\n </>\n ) : null}\n </p>\n </div>\n <div id={bodyId} hidden={collapsed} className=\"flex flex-col gap-3\">\n <ReportFeatureIntro feature={feature} />\n <ReportScenarioList feature={feature} />\n </div>\n </section>\n );\n}\n","import { useReport } from \"../hooks/useReport\";\nimport { ReportFeature } from \"./ReportFeature\";\n\nexport function ReportFeatureList() {\n const report = useReport();\n // Roomy gap between features — they're now divider-led sections rather than\n // self-contained cards, so they need clear air to read as separate suites.\n return (\n <div className=\"flex flex-col gap-8\">\n {report.features.map((feature) => (\n <ReportFeature key={feature.id} feature={feature} />\n ))}\n </div>\n );\n}\n","import { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Empty({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty\"\n className={cn(\n \"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction EmptyHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-header\"\n className={cn(\n \"flex max-w-sm flex-col items-center gap-2 text-center\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst emptyMediaVariants = cva(\n \"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n icon: \"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction EmptyMedia({\n className,\n variant = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof emptyMediaVariants>) {\n return (\n <div\n data-slot=\"empty-icon\"\n data-variant={variant}\n className={cn(emptyMediaVariants({ variant, className }))}\n {...props}\n />\n )\n}\n\nfunction EmptyTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-title\"\n className={cn(\"text-lg font-medium tracking-tight\", className)}\n {...props}\n />\n )\n}\n\nfunction EmptyDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <div\n data-slot=\"empty-description\"\n className={cn(\n \"text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction EmptyContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-content\"\n className={cn(\n \"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Empty,\n EmptyHeader,\n EmptyTitle,\n EmptyDescription,\n EmptyContent,\n EmptyMedia,\n}\n","import { Empty, EmptyHeader, EmptyTitle } from \"@/components/ui/empty\";\n\nexport interface ReportEmptyProps {\n message?: string;\n}\n\nexport function ReportEmpty({ message }: ReportEmptyProps) {\n return (\n <Empty aria-live=\"polite\" className=\"border\">\n <EmptyHeader>\n <EmptyTitle>{message ?? \"No scenarios in this report.\"}</EmptyTitle>\n </EmptyHeader>\n </Empty>\n );\n}\n","import type { ReportSummary as ReportSummaryT } from \"executable-stories-core\";\nimport { useReport } from \"../hooks/useReport\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReportSummaryProps {\n className?: string;\n}\n\nexport function ReportSummary({ className }: ReportSummaryProps) {\n const report = useReport();\n return (\n <ReportSummaryView\n summary={report.summary}\n {...(className !== undefined && { className })}\n ariaLabel=\"Run summary\"\n />\n );\n}\n\nexport interface ReportSummaryViewProps {\n summary: ReportSummaryT;\n className?: string;\n ariaLabel?: string;\n}\n\n/**\n * A single stat card. All cards share the neutral card surface; the status\n * *number* carries the colour (`--es-pass/fail/skip/pend`, mapped to Tailwind\n * in tailwind.css) and a matching leading dot. This drops the earlier pastel\n * fills for the flatter, dashboard-style KPI treatment — a mono micro-label\n * above an oversized tabular number.\n */\nconst TONE = {\n total: { num: \"text-foreground\", dot: \"bg-muted-foreground/50\" },\n passed: { num: \"text-pass\", dot: \"bg-pass\" },\n failed: { num: \"text-fail\", dot: \"bg-fail\" },\n skipped: { num: \"text-skip\", dot: \"bg-skip\" },\n pending: { num: \"text-pend\", dot: \"bg-pend\" },\n} as const;\n\nexport function ReportSummaryView({ summary, className, ariaLabel }: ReportSummaryViewProps) {\n const cards: Array<{ status: keyof typeof TONE; label: string; value: number }> = [\n { status: \"total\", label: \"Total\", value: summary.total },\n { status: \"passed\", label: \"Passed\", value: summary.passed },\n { status: \"failed\", label: \"Failed\", value: summary.failed },\n { status: \"skipped\", label: \"Skipped\", value: summary.skipped },\n ];\n if (summary.pending > 0) {\n cards.push({ status: \"pending\", label: \"Pending\", value: summary.pending });\n }\n return (\n <dl\n className={cn(\n \"grid grid-cols-2 gap-3\",\n // Columns follow the card count so the row is always full — 5 statuses\n // (pending present) never leave a lone orphan card below a row of four.\n cards.length === 5 ? \"sm:grid-cols-5\" : \"sm:grid-cols-4\",\n className,\n )}\n aria-label={ariaLabel}\n >\n {cards.map((c) => {\n const tone = TONE[c.status];\n return (\n <div\n key={c.status}\n data-status={c.status}\n className=\"rounded-lg border bg-card px-4 py-3\"\n >\n <dt className=\"flex items-center gap-1.5 font-mono text-[11px] font-medium uppercase tracking-wider text-muted-foreground\">\n <span className={cn(\"size-1.5 shrink-0 rounded-full\", tone.dot)} aria-hidden=\"true\" />\n {c.label}\n </dt>\n <dd className={cn(\"mt-2 text-3xl font-semibold leading-none tracking-tight tabular-nums\", tone.num)}>\n {c.value}\n </dd>\n </div>\n );\n })}\n </dl>\n );\n}\n","import { formatDuration } from \"executable-stories-core/utils/duration\";\nimport { slowestScenarios } from \"executable-stories-core/report-queries\";\nimport { useReport } from \"../hooks/useReport\";\nimport { ciDisplayName, commitUrl, prUrl } from \"../lib/provenance\";\n\n/**\n * Run metadata line (started, duration, version, branch, git SHA, CI, PR) —\n * the React equivalent of the report's `.meta-info` block. Reads the top-level\n * StoryReport fields from context. Commit and PR become links when the CI run\n * URL lets us derive them safely (GitHub/GitLab shapes only).\n */\nexport function ReportMeta() {\n const report = useReport();\n\n const items: Array<{ label: string; value: React.ReactNode }> = [];\n const linkClass = \"text-primary underline underline-offset-2\";\n\n if (report.startedAtMs) {\n items.push({ label: \"Started\", value: new Date(report.startedAtMs).toLocaleString() });\n }\n if (report.durationMs) {\n items.push({ label: \"Duration\", value: formatDuration(report.durationMs) });\n }\n if (report.packageVersion) {\n items.push({ label: \"Version\", value: report.packageVersion });\n }\n if (report.ci?.branch) {\n items.push({ label: \"Branch\", value: report.ci.branch });\n }\n const sha = report.ci?.commitSha ?? report.gitSha;\n if (sha) {\n const url = commitUrl(report.ci, report.gitSha);\n const short = sha.slice(0, 8);\n items.push({\n label: \"Commit\",\n value: url ? (\n <a href={url} target=\"_blank\" rel=\"noreferrer noopener\" className={linkClass}>\n {short}\n </a>\n ) : (\n short\n ),\n });\n }\n if (report.ci) {\n items.push({\n label: \"CI\",\n value: report.ci.url ? (\n <a href={report.ci.url} target=\"_blank\" rel=\"noreferrer noopener\" className={linkClass}>\n {ciDisplayName(report.ci.name)}\n {report.ci.buildNumber ? ` #${report.ci.buildNumber}` : \"\"}\n </a>\n ) : (\n `${ciDisplayName(report.ci.name)}${report.ci.buildNumber ? ` #${report.ci.buildNumber}` : \"\"}`\n ),\n });\n }\n if (report.ci?.prNumber) {\n const url = prUrl(report.ci);\n const label = `#${report.ci.prNumber}`;\n items.push({\n label: \"PR\",\n value: url ? (\n <a href={url} target=\"_blank\" rel=\"noreferrer noopener\" className={linkClass}>\n {label}\n </a>\n ) : (\n label\n ),\n });\n }\n\n // A \"slowest\" list needs a field to rank: below a handful of timed scenarios\n // it just repeats the run in a different order.\n const slowest = slowestScenarios(report, 5);\n const showSlowest = slowest.length >= 3;\n\n if (items.length === 0 && !showSlowest) return null;\n\n return (\n // Run metadata is useful but secondary to \"what failed\" — tuck it into a\n // collapsed disclosure so it doesn't push the result down. Native <details>\n // so it works with no JS (the SSR/no-hydration report still toggles).\n <details data-es-meta-card className=\"es-run-details group rounded-lg border border-border bg-card text-xs\">\n <summary className=\"flex cursor-pointer list-none select-none items-center gap-1.5 px-4 py-2 font-medium text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <span aria-hidden className=\"text-xs transition-transform group-open:rotate-90\">▸</span>\n Run details\n </summary>\n <dl className=\"flex flex-wrap gap-x-5 gap-y-2 border-t border-border px-4 py-3 text-muted-foreground\" aria-label=\"Run metadata\">\n {items.map((item) => (\n <div key={item.label} className=\"flex items-baseline gap-1.5\">\n <dt className=\"font-medium\">{item.label}</dt>\n <dd className=\"font-mono text-foreground\">{item.value}</dd>\n </div>\n ))}\n </dl>\n {showSlowest ? (\n <div className=\"border-t border-border px-4 py-3\">\n <div className=\"mb-1.5 font-medium text-muted-foreground\">Slowest scenarios</div>\n <ol className=\"flex flex-col gap-1\" aria-label=\"Slowest scenarios\">\n {slowest.map((s) => (\n <li key={s.id} className=\"flex items-baseline justify-between gap-4\">\n <a href={`#${s.id}`} className=\"min-w-0 text-primary underline underline-offset-2\">\n {s.title}\n </a>\n <span className=\"shrink-0 font-mono tabular-nums text-muted-foreground\">\n {formatDuration(s.durationMs)}\n </span>\n </li>\n ))}\n </ol>\n </div>\n ) : null}\n </details>\n );\n}\n","import type { ReportParseError } from \"../result\";\n\nexport interface ReportSchemaErrorProps {\n error: ReportParseError;\n}\n\nexport function ReportSchemaError({ error }: ReportSchemaErrorProps) {\n return (\n <section className=\"es-schema-error\" role=\"alert\" aria-live=\"assertive\">\n <p>\n <strong>Report could not be displayed.</strong>\n </p>\n <p>{error.message}</p>\n {error.code === \"SCHEMA_VERSION_MISMATCH\" ? (\n <p>\n The report bundle is newer than this version of <code>executable-stories-react</code>.\n Upgrade the package, or regenerate the report with an older formatters CLI.\n </p>\n ) : null}\n {error.issues && error.issues.length > 0 ? (\n <details>\n <summary>{error.issues.length} validation issue{error.issues.length === 1 ? \"\" : \"s\"}</summary>\n <pre>\n {error.issues\n .slice(0, 20)\n .map((i) => `${i.path}: ${i.message}`)\n .join(\"\\n\")}\n </pre>\n </details>\n ) : null}\n </section>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { ReportParseError } from \"../result\";\nimport { cn } from \"../lib/utils\";\nimport { ReportSummary } from \"./ReportSummary\";\nimport { ReportMeta } from \"./ReportMeta\";\nimport { ReportSchemaError } from \"./ReportSchemaError\";\n\n/**\n * The report's title block — `<h1>` + summary + meta. Shared by the static\n * `Report` header and the interactive `ReportInteractive` header so the two\n * views can't drift on the no-JS fallback.\n */\nexport function ReportTitleBlock({ title }: { title?: string }) {\n return (\n <>\n <h1>{title ?? \"Story Report\"}</h1>\n <ReportSummary />\n <ReportMeta />\n </>\n );\n}\n\n/**\n * The `<main>` landmark shown when the report failed to parse. Both entrypoints\n * render the identical shell on a `Result` error, so it lives here once.\n */\nexport function ReportErrorShell({\n error,\n className,\n title,\n dataTheme,\n}: {\n error: ReportParseError;\n className?: string;\n title?: string;\n dataTheme?: \"light\" | \"dark\";\n}): ReactNode {\n return (\n <main className={cn(\"es-report\", className)} aria-label={title ?? \"Test report\"} data-theme={dataTheme}>\n <ReportSchemaError error={error} />\n </main>\n );\n}\n","import type { StoryReport } from \"executable-stories-core\";\nimport type { Result } from \"../result\";\nimport { unwrapReport } from \"../result\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\nimport { ReportRoot } from \"../context/ReportRoot\";\nimport { ReportFeatureList } from \"./ReportFeatureList\";\nimport { ReportEmpty } from \"./ReportEmpty\";\nimport { ReportTitleBlock, ReportErrorShell } from \"./ReportShell\";\nimport { cn } from \"../lib/utils\";\n\nexport interface ReportProps {\n /** A StoryReport, or a Result-wrapped one (e.g., from parseStoryReport). */\n report: StoryReport | Result<StoryReport>;\n /** Renderers keyed by `story.custom({ type })` strings. */\n customRenderers?: CustomRenderers;\n /** Optional overrides for the heavy built-ins (mermaid, code, section). */\n renderers?: BuiltinRenderers;\n /** Optional class on the <main> landmark for layout positioning. */\n className?: string;\n /** Optional override title. */\n title?: string;\n /** Optional theme attribute scope. Use to force \"light\" or \"dark\". */\n dataTheme?: \"light\" | \"dark\";\n}\n\nexport function Report(props: ReportProps) {\n const { report, customRenderers, renderers, className, title, dataTheme } = props;\n const result = unwrapReport(report);\n if (!result.ok) {\n return <ReportErrorShell error={result.error} className={className} title={title} dataTheme={dataTheme} />;\n }\n const data = result.data;\n const hasContent = data.features.length > 0;\n return (\n <ReportRoot report={data} customRenderers={customRenderers} renderers={renderers}>\n <main className={cn(\"es-report\", className)} aria-label={title ?? \"Test report\"} data-theme={dataTheme}>\n <header className=\"es-report-header\">\n <ReportTitleBlock title={title} />\n </header>\n {hasContent ? <ReportFeatureList /> : <ReportEmpty />}\n </main>\n </ReportRoot>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport type { ReportDocMermaid } from \"executable-stories-core\";\nimport { MermaidSource } from \"./DocMermaid\";\n\nexport type MermaidApi = typeof import(\"mermaid\").default;\nexport type MermaidLoader = () => Promise<MermaidApi>;\n\nfunction prefersDark(el: HTMLElement | null): boolean {\n const themed = el?.closest<HTMLElement>(\"[data-theme]\");\n if (themed?.dataset.theme === \"dark\") return true;\n if (themed?.dataset.theme === \"light\") return false;\n return typeof window !== \"undefined\" && !!window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches;\n}\n\n/**\n * Presentational mermaid renderer with the loader INJECTED — it contains no\n * literal `import(\"mermaid\")`, so a bundler following this module never pulls\n * mermaid in. `MermaidDiagram` wraps this with the installed-package loader;\n * the standalone report island wraps it with a CDN loader so the heavy library\n * never bloats the inlined island bundle.\n *\n * Draws the diagram to inline SVG (React-owned via state, so an island\n * re-render can't clobber it), redraws when the report's `data-theme` flips,\n * and falls back to `<MermaidSource>` (the readable, agent-friendly code) on\n * the server, before load, and on any error.\n */\nexport function MermaidView({ entry, load }: { entry: ReportDocMermaid; load: MermaidLoader }) {\n const ref = useRef<HTMLElement>(null);\n const [svg, setSvg] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n const draw = async () => {\n let mermaid: MermaidApi;\n try {\n mermaid = await load();\n } catch {\n // No library (offline, blocked CDN). Not the diagram's fault, so keep\n // the quiet source fallback rather than accusing the author.\n if (!cancelled) {\n setSvg(null);\n setError(null);\n }\n return;\n }\n try {\n mermaid.initialize({\n startOnLoad: false,\n securityLevel: \"strict\",\n theme: prefersDark(ref.current) ? \"dark\" : \"default\",\n });\n // mermaid.parse is the library's own syntax check. Running it first\n // turns a broken diagram into a message naming the problem, and keeps\n // mermaid from injecting its own error graphic into the document.\n await mermaid.parse(entry.code);\n const id = `es-mermaid-${Math.random().toString(36).slice(2)}`;\n const { svg: rendered } = await mermaid.render(id, entry.code);\n if (!cancelled) {\n setSvg(rendered);\n setError(null);\n }\n } catch (err) {\n if (!cancelled) {\n setSvg(null);\n setError(err instanceof Error ? err.message : String(err));\n }\n }\n };\n void draw();\n\n // Redraw when the report toggles theme on an ancestor.\n const themed = ref.current?.closest<HTMLElement>(\"[data-theme]\");\n const observer = themed ? new MutationObserver(() => void draw()) : undefined;\n observer?.observe(themed!, { attributes: true, attributeFilter: [\"data-theme\"] });\n\n return () => {\n cancelled = true;\n observer?.disconnect();\n };\n }, [entry.code, load]);\n\n if (svg) {\n return (\n <figure ref={ref} className=\"my-3\">\n {entry.title ? (\n <figcaption className=\"mb-1.5 text-xs font-medium text-muted-foreground\">{entry.title}</figcaption>\n ) : null}\n {/* role=\"img\" presents the diagram as a single labelled graphic. */}\n <div\n role=\"img\"\n aria-label={entry.title ?? \"Mermaid diagram\"}\n className=\"overflow-x-auto rounded-md border border-border bg-card p-3 [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full\"\n dangerouslySetInnerHTML={{ __html: svg }}\n />\n </figure>\n );\n }\n\n // Pre-render / fallback: the readable source. The ref lets the effect locate\n // the themed ancestor from the same DOM position before the SVG swaps in.\n // A syntax error shows above it, because a diagram that silently degrades to\n // a code block is a diagram nobody ever fixes.\n return (\n <>\n {error ? (\n <p\n role=\"alert\"\n data-es-mermaid-error\n className=\"mt-3 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive\"\n >\n Diagram failed to render: {error}\n </p>\n ) : null}\n <MermaidSource entry={entry} ref={ref} />\n </>\n );\n}\n","\"use client\";\n\nimport type { ReportDocMermaid } from \"executable-stories-core\";\nimport { MermaidView, type MermaidApi, type MermaidLoader } from \"./MermaidView\";\n\nexport type { MermaidApi, MermaidLoader };\n\n// Mermaid is heavy, so it's loaded only when a diagram actually renders (an\n// optional peer dependency, dynamically imported) and cached for the page.\nlet mermaidLoader: Promise<MermaidApi> | undefined;\nfunction loadMermaid(): Promise<MermaidApi> {\n // Intentional dynamic import: mermaid is an optional peer dep loaded on demand\n // so it never lands in the base bundle (see tsup external + peerDeps). This\n // literal lives ONLY here, not in MermaidView, so the standalone island —\n // which imports MermaidView with a CDN loader — never bundles mermaid.\n // eslint-disable-next-line no-restricted-syntax\n mermaidLoader ??= import(\"mermaid\").then((m) => m.default);\n return mermaidLoader;\n}\n\n/**\n * Client renderer for `story.mermaid(...)` entries. Dynamically imports the\n * installed `mermaid` package and draws the diagram to inline SVG, falling back\n * to the readable source on the server / before load / on error.\n *\n * Opt in via `<Report renderers={{ mermaid: (e) => <MermaidDiagram entry={e} /> }} />`.\n * Requires `mermaid` to be installed (an optional peer dependency). Pass `load`\n * to override how mermaid is obtained (the standalone report island injects a\n * CDN loader via `MermaidView` directly).\n */\nexport function MermaidDiagram({ entry, load = loadMermaid }: { entry: ReportDocMermaid; load?: MermaidLoader }) {\n return <MermaidView entry={entry} load={load} />;\n}\n","import { useState } from \"react\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/components/ui/command\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ExplorerStatus = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\nexport interface ExplorerScenario {\n id: string;\n title: string;\n status: ExplorerStatus;\n tags: string[];\n /** Source file / feature label shown on the right. */\n feature: string;\n /** Resolved href to the scenario detail page. */\n href: string;\n}\n\nexport interface ScenarioExplorerProps {\n scenarios: ExplorerScenario[];\n summary?: { total: number; passed: number; failed: number };\n}\n\nconst STATUS_FILTERS: Array<{ value: \"all\" | ExplorerStatus; label: string }> = [\n { value: \"all\", label: \"All\" },\n { value: \"passed\", label: \"Passed\" },\n { value: \"failed\", label: \"Failed\" },\n { value: \"skipped\", label: \"Skipped\" },\n { value: \"pending\", label: \"Pending\" },\n];\n\n/**\n * Scenario Explorer surface — a shadcn `Command` palette rendered inline. cmdk\n * filters by the item value (title + feature + tags) as you type; the status\n * pills pre-filter the list. Each row is a real `<a>` to the detail page.\n */\nexport function ScenarioExplorer({ scenarios, summary }: ScenarioExplorerProps) {\n const [status, setStatus] = useState<\"all\" | ExplorerStatus>(\"all\");\n const visible = status === \"all\" ? scenarios : scenarios.filter((s) => s.status === status);\n\n return (\n <div className=\"font-sans text-foreground\">\n {summary ? (\n <p className=\"mb-3 text-sm text-muted-foreground\">\n {summary.total} scenarios · <span className=\"text-pass\">{summary.passed} passed</span> ·{\" \"}\n <span className=\"text-fail\">{summary.failed} failed</span>\n </p>\n ) : null}\n\n <div className=\"mb-2 flex flex-wrap gap-1.5\" role=\"group\" aria-label=\"Filter by status\">\n {STATUS_FILTERS.map((f) => (\n <button\n key={f.value}\n type=\"button\"\n aria-pressed={status === f.value}\n onClick={() => setStatus(f.value)}\n className={cn(\n \"rounded-full border px-2.5 py-1 text-xs font-medium transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n status === f.value\n ? \"border-primary bg-primary text-primary-foreground\"\n : \"border-border bg-card text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n )}\n >\n {f.label}\n </button>\n ))}\n </div>\n\n <Command\n className=\"rounded-lg border border-border bg-card\"\n filter={(value, search) => (value.toLowerCase().includes(search.toLowerCase()) ? 1 : 0)}\n >\n <CommandInput placeholder=\"Search scenarios…\" />\n <CommandList className=\"max-h-none\">\n <CommandEmpty>No scenarios match your filters.</CommandEmpty>\n <CommandGroup>\n {visible.map((s) => (\n <CommandItem\n key={s.id}\n value={`${s.title} ${s.feature} ${s.tags.join(\" \")}`}\n asChild\n className=\"cursor-pointer\"\n >\n <a href={s.href} className=\"flex items-center gap-3\">\n <Badge variant={s.status}>{s.status}</Badge>\n <span className=\"min-w-0 flex-1 truncate font-medium\">{s.title}</span>\n {s.tags.slice(0, 3).map((t) => (\n <Badge key={t} variant=\"tag\" className=\"hidden sm:inline-flex\">\n {t}\n </Badge>\n ))}\n <code className=\"hidden font-mono text-xs text-muted-foreground md:inline\">{s.feature}</code>\n </a>\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </div>\n );\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { SearchIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\"\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandDialog({\n title = \"Command Palette\",\n description = \"Search for a command to run...\",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string\n description?: string\n className?: string\n showCloseButton?: boolean\n // Base UI's Dialog.Root permits function-as-children; cmdk's Command wants a\n // plain node, so narrow it back here.\n children?: React.ReactNode\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn(\"overflow-hidden p-0\", className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"flex h-9 items-center gap-2 border-b px-3\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn(\n \"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n )\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n}\n","/**\n * StoryReport runtime Zod schema, derived from the canonical JSON Schema\n * at executable-stories-core/schemas/story-report-v1.json.\n *\n * Uses z.fromJSONSchema (experimental in Zod 4.x). If the API changes upstream,\n * only this file needs updating — the rest of the package consumes\n * `storyReportSchema` and `StoryReportSchemaShape` via parse.ts.\n *\n * The JSON Schema is bundled at build time by tsup (resolveJsonModule).\n */\n\nimport { z } from \"zod\";\nimport schemaJson from \"executable-stories-core/schemas/story-report-v1.json\" with { type: \"json\" };\n\nexport { STORY_REPORT_SCHEMA_MAJOR } from \"./version\";\n\n// z.fromJSONSchema (experimental in Zod 4.x) can't translate DocHtml's nested\n// `oneOf` (the exactly-one-of path/url/content constraint) and rejects every\n// html doc entry. The on-disk schema keeps that constraint for Ajv + the\n// machine contract; here we drop it from the in-memory copy the runtime\n// validator is built from. The React DocHtml component already resolves\n// precedence (content → url → path), so the looser runtime check is safe.\nconst schemaForZod = structuredClone(schemaJson) as {\n $defs?: { DocHtml?: { oneOf?: unknown } };\n};\nif (schemaForZod.$defs?.DocHtml) {\n delete schemaForZod.$defs.DocHtml.oneOf;\n}\n\nconst compiled = z.fromJSONSchema(schemaForZod as Parameters<typeof z.fromJSONSchema>[0]);\n\nexport const storyReportSchema = compiled;\nexport type StoryReportSchemaShape = z.infer<typeof compiled>;\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://executable-stories.dev/schemas/story-report-v1.schema.json\",\n \"title\": \"StoryReport\",\n \"description\": \"Pre-grouped, denormalized report shape consumed by UI renderers (React, Svelte, Vue, etc.). Stable public contract \\u2014 additive-only within a major. Distinct from internal TestRunResult.\",\n \"type\": \"object\",\n \"$ref\": \"#/$defs/StoryReport\",\n \"$defs\": {\n \"StoryReport\": {\n \"type\": \"object\",\n \"description\": \"Top-level report containing all features, runtime metadata, and a pre-computed summary.\",\n \"properties\": {\n \"schemaVersion\": {\n \"type\": \"string\",\n \"pattern\": \"^1\\\\.[0-9]+$\",\n \"description\": \"Schema version as 'major.minor'. Major bumps are breaking; minors are additive-only. UI packages must accept any 1.x.\"\n },\n \"runId\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Unique deterministic identifier for this run.\"\n },\n \"startedAtMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Run start time as Unix epoch milliseconds.\"\n },\n \"finishedAtMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Run finish time as Unix epoch milliseconds.\"\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Total run duration in milliseconds.\"\n },\n \"projectRoot\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Absolute path to the project root (for context only; relative paths in features.sourceFile are preferred).\"\n },\n \"packageVersion\": {\n \"type\": \"string\",\n \"description\": \"Version of the package under test, if known.\"\n },\n \"gitSha\": {\n \"type\": \"string\",\n \"description\": \"Git commit SHA at the time of the run.\"\n },\n \"ci\": {\n \"$ref\": \"#/$defs/CIInfo\"\n },\n \"coverage\": {\n \"$ref\": \"#/$defs/CoverageSummary\"\n },\n \"summary\": {\n \"$ref\": \"#/$defs/Summary\",\n \"description\": \"Pre-computed counts across all features and scenarios.\"\n },\n \"features\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Feature\"\n },\n \"description\": \"Features grouped by sourceFile, sorted by title.\"\n }\n },\n \"required\": [\n \"schemaVersion\",\n \"runId\",\n \"startedAtMs\",\n \"finishedAtMs\",\n \"durationMs\",\n \"projectRoot\",\n \"summary\",\n \"features\"\n ],\n \"additionalProperties\": false\n },\n \"Summary\": {\n \"type\": \"object\",\n \"description\": \"Counts by status. Sums equal 'total'.\",\n \"properties\": {\n \"total\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"passed\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"failed\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"skipped\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"pending\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"total\",\n \"passed\",\n \"failed\",\n \"skipped\",\n \"pending\",\n \"durationMs\"\n ],\n \"additionalProperties\": false\n },\n \"Feature\": {\n \"type\": \"object\",\n \"description\": \"A group of scenarios from the same source file.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Stable slug derived from the relative source path. Suitable for use as a deep-link anchor.\"\n },\n \"title\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Display title. Comes from story.feature(...) when declared, otherwise the describe block or file basename.\"\n },\n \"sourceFile\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Source path, relative to projectRoot when possible.\"\n },\n \"summary\": {\n \"$ref\": \"#/$defs/Summary\"\n },\n \"scenarios\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Scenario\"\n },\n \"description\": \"Scenarios in this feature, in declaration order.\"\n },\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\"feature\", \"ability\", \"business-need\"],\n \"description\": \"How the feature was declared. Absent when the title was derived rather than declared.\"\n },\n \"narrative\": {\n \"type\": \"string\",\n \"description\": \"Markdown explaining why the feature exists and who it serves.\"\n },\n \"glossary\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/GlossaryTerm\"\n },\n \"description\": \"Terms this feature defines, linked wherever they appear in scenario text.\"\n }\n },\n \"required\": [\"id\", \"title\", \"sourceFile\", \"summary\", \"scenarios\"],\n \"additionalProperties\": false\n },\n \"Scenario\": {\n \"type\": \"object\",\n \"description\": \"A single scenario with its steps, story-level doc entries, and attachments.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Stable identifier: '<feature.id>--<slug-of-title>'. Suitable for use as a deep-link anchor.\"\n },\n \"title\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"status\": {\n \"$ref\": \"#/$defs/TestStatus\"\n },\n \"planned\": {\n \"type\": \"boolean\",\n \"description\": \"True for scenarios authored with the framework's todo modifier (e.g. it.todo): specified behavior with no implementation yet. Canonical status stays 'pending'; this flags why.\"\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Normalized tags, deduplicated, lowercased.\"\n },\n \"tickets\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Ticket\"\n }\n },\n \"covers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Product-code paths/globs this scenario exercises.\"\n },\n \"sourceLine\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"errorMessage\": {\n \"type\": \"string\"\n },\n \"errorStack\": {\n \"type\": \"string\"\n },\n \"retry\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"retries\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"docEntries\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n },\n \"description\": \"Story-level doc entries (rendered before steps).\"\n },\n \"steps\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Step\"\n }\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Attachment\"\n }\n },\n \"otelSpans\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/OtelSpan\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"title\",\n \"status\",\n \"durationMs\",\n \"tags\",\n \"retry\",\n \"retries\",\n \"docEntries\",\n \"steps\",\n \"attachments\"\n ],\n \"additionalProperties\": false\n },\n \"Step\": {\n \"type\": \"object\",\n \"description\": \"A single BDD step.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"index\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"keyword\": {\n \"$ref\": \"#/$defs/StepKeyword\"\n },\n \"text\": {\n \"type\": \"string\"\n },\n \"status\": {\n \"$ref\": \"#/$defs/TestStatus\"\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"assertions\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Assertions observed or declared for this step. Omit when the adapter cannot observe assertions; zero means observed none.\"\n },\n \"errorMessage\": {\n \"type\": \"string\"\n },\n \"mode\": {\n \"$ref\": \"#/$defs/StepMode\"\n },\n \"docEntries\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n },\n \"description\": \"Doc entries attached to this step.\"\n }\n },\n \"required\": [\n \"id\",\n \"index\",\n \"keyword\",\n \"text\",\n \"status\",\n \"durationMs\",\n \"docEntries\"\n ],\n \"additionalProperties\": false\n },\n \"StepKeyword\": {\n \"type\": \"string\",\n \"enum\": [\"Given\", \"When\", \"Then\", \"And\", \"But\"]\n },\n \"StepMode\": {\n \"type\": \"string\",\n \"enum\": [\"normal\", \"skip\", \"only\", \"todo\", \"fails\", \"concurrent\"]\n },\n \"TestStatus\": {\n \"type\": \"string\",\n \"enum\": [\"passed\", \"failed\", \"skipped\", \"pending\"]\n },\n \"Ticket\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"url\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\"],\n \"additionalProperties\": false\n },\n \"Attachment\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"mediaType\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"body\": {\n \"type\": \"string\"\n },\n \"contentEncoding\": {\n \"type\": \"string\",\n \"enum\": [\"BASE64\", \"IDENTITY\"]\n }\n },\n \"required\": [\"name\", \"mediaType\", \"body\", \"contentEncoding\"],\n \"additionalProperties\": false\n },\n \"CIInfo\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n },\n \"buildNumber\": {\n \"type\": \"string\"\n },\n \"branch\": {\n \"type\": \"string\"\n },\n \"commitSha\": {\n \"type\": \"string\"\n },\n \"prNumber\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"name\"],\n \"additionalProperties\": false\n },\n \"CoverageSummary\": {\n \"type\": \"object\",\n \"properties\": {\n \"linesPct\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100\n },\n \"branchesPct\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100\n },\n \"functionsPct\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100\n },\n \"statementsPct\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100\n }\n },\n \"additionalProperties\": false\n },\n \"DocPhase\": {\n \"type\": \"string\",\n \"enum\": [\"static\", \"runtime\"]\n },\n \"DocEntry\": {\n \"oneOf\": [\n {\n \"$ref\": \"#/$defs/DocNote\"\n },\n {\n \"$ref\": \"#/$defs/DocTag\"\n },\n {\n \"$ref\": \"#/$defs/DocKv\"\n },\n {\n \"$ref\": \"#/$defs/DocCode\"\n },\n {\n \"$ref\": \"#/$defs/DocTable\"\n },\n {\n \"$ref\": \"#/$defs/DocLink\"\n },\n {\n \"$ref\": \"#/$defs/DocSection\"\n },\n {\n \"$ref\": \"#/$defs/DocMermaid\"\n },\n {\n \"$ref\": \"#/$defs/DocScreenshot\"\n },\n {\n \"$ref\": \"#/$defs/DocVideo\"\n },\n {\n \"$ref\": \"#/$defs/DocHtml\"\n },\n {\n \"$ref\": \"#/$defs/DocState\"\n },\n {\n \"$ref\": \"#/$defs/DocCustom\"\n }\n ]\n },\n \"DocNote\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"note\"\n },\n \"text\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"text\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocTag\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"tag\"\n },\n \"names\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"names\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocKv\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"kv\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"value\": {},\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"label\", \"value\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocCode\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"code\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\"\n },\n \"lang\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"label\", \"content\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocTable\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"table\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"columns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"rows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"label\", \"columns\", \"rows\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocLink\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"link\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"label\", \"url\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocSection\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"section\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"markdown\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"title\", \"markdown\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocMermaid\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"mermaid\"\n },\n \"code\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"code\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocScreenshot\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"screenshot\"\n },\n \"path\": {\n \"type\": \"string\"\n },\n \"alt\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"path\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocVideo\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"video\"\n },\n \"path\": {\n \"type\": \"string\"\n },\n \"caption\": {\n \"type\": \"string\"\n },\n \"poster\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"path\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocHtml\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"html\"\n },\n \"path\": {\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"height\": {\n \"oneOf\": [\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"phase\"],\n \"additionalProperties\": false,\n \"oneOf\": [\n {\n \"required\": [\"path\"]\n },\n {\n \"required\": [\"url\"]\n },\n {\n \"required\": [\"content\"]\n }\n ]\n },\n \"DocState\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"state\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"value\": {},\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"value\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocCustom\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"custom\"\n },\n \"type\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"data\": {},\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"type\", \"data\", \"phase\"],\n \"additionalProperties\": false\n },\n \"OtelSpan\": {\n \"type\": \"object\",\n \"required\": [\"spanId\", \"name\", \"status\"],\n \"properties\": {\n \"spanId\": {\n \"type\": \"string\"\n },\n \"parentSpanId\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"startTimeMs\": {\n \"type\": \"number\"\n },\n \"durationMs\": {\n \"type\": \"number\"\n },\n \"startTimeUnixNano\": {\n \"type\": \"number\"\n },\n \"endTimeUnixNano\": {\n \"type\": \"number\"\n },\n \"status\": {\n \"enum\": [\"ok\", \"error\", \"unset\"]\n },\n \"statusMessage\": {\n \"type\": \"string\"\n },\n \"attributes\": {\n \"type\": \"object\"\n }\n },\n \"additionalProperties\": false\n },\n \"GlossaryTerm\": {\n \"type\": \"object\",\n \"description\": \"One glossary entry: a term the scenarios use and what it means.\",\n \"properties\": {\n \"term\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"definition\": {\n \"type\": \"string\",\n \"minLength\": 1\n }\n },\n \"required\": [\"term\", \"definition\"],\n \"additionalProperties\": false\n }\n }\n}\n","/**\n * The supported StoryReport schema major version, factored out of\n * story-report.schema.ts so the client island can do a cheap version check\n * WITHOUT importing the Zod schema module (which evaluates z.fromJSONSchema at\n * module load and pulls ~315kb of zod + locales into the bundle).\n */\nexport const STORY_REPORT_SCHEMA_MAJOR = 1 as const;\n","/**\n * parseStoryReport — boundary validator. Accepts unknown input (file contents,\n * fetch body, prop) and returns a Result-typed StoryReport.\n */\n\nimport type { StoryReport } from \"executable-stories-core\";\nimport type { Result } from \"../result\";\nimport { ok, err } from \"../result\";\nimport { storyReportSchema, STORY_REPORT_SCHEMA_MAJOR } from \"./story-report.schema\";\n\nexport function parseStoryReport(input: unknown): Result<StoryReport> {\n if (input === null || typeof input !== \"object\") {\n return err({\n message: \"Expected a StoryReport object.\",\n code: \"INVALID_INPUT\",\n });\n }\n\n const versionRaw = (input as { schemaVersion?: unknown }).schemaVersion;\n if (typeof versionRaw === \"string\") {\n const major = versionRaw.split(\".\")[0];\n if (major !== String(STORY_REPORT_SCHEMA_MAJOR)) {\n return err({\n message: `Schema major ${major} is not supported by this version of executable-stories-react (expected ${STORY_REPORT_SCHEMA_MAJOR}.x). Upgrade the package.`,\n code: \"SCHEMA_VERSION_MISMATCH\",\n });\n }\n }\n\n const parsed = storyReportSchema.safeParse(input);\n if (parsed.success) {\n return ok(parsed.data as StoryReport);\n }\n\n const issues = parsed.error.issues.map((i) => ({\n path: i.path.join(\".\") || \"/\",\n message: i.message,\n }));\n\n return err({\n message: `StoryReport failed validation (${issues.length} issue${issues.length === 1 ? \"\" : \"s\"}).`,\n code: \"VALIDATION_FAILED\",\n issues,\n });\n}\n"],"mappings":";;;AAuBO,IAAM,KAAK,CAAI,UAAwB,EAAE,IAAI,MAAM,KAAK;AACxD,IAAM,MAAM,CAAC,WAA4C,EAAE,IAAI,OAAO,MAAM;AAQ5E,SAAS,aAAa,OAA+D;AAC1F,MACE,OAAO,UAAU,YACjB,UAAU,QACV,QAAQ,SACR,OAAQ,MAA0B,OAAO,WACzC;AACA,WAAO;AAAA,EACT;AACA,SAAO,GAAG,KAAoB;AAChC;;;AC1CA,SAAS,eAA+B;;;ACAxC,SAAS,qBAAqB;AAUvB,IAAM,gBAAgB,cAAyC,IAAI;;;ACV1E,OAAuB;AACvB,SAAS,WAA8B;AACvC,SAAS,iBAAiB;;;ACF1B,SAAS,YAA6B;AACtC,SAAS,eAAe;AAGjB,SAAS,MAAM,QAA8B;AAClD,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADAA,IAAM,gBAAgB;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,WACE;AAAA,QACF,aACE;AAAA,QACF,SACE;AAAA,QACF,OAAO;AAAA,QACP,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,QAKN,QAAQ;AAAA,QACR,QAAQ;AAAA,QACR,SAAS;AAAA,QACT,SAAS;AAAA,QACT,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AAAA,IACH;AAAA,EACF;AAEA,QAAM,SAAS,kBAAkB,UAAU,KAAK;AAChD,MAAI,OAAO,SAAS;AAClB,WAAO,GAAG,OAAO,IAAmB;AAAA,EACtC;AAEA,QAAM,SAAS,OAAO,MAAM,OAAO,IAAI,CAAC,OAAO;AAAA,IAC7C,MAAM,EAAE,KAAK,KAAK,GAAG,KAAK;AAAA,IAC1B,SAAS,EAAE;AAAA,EACb,EAAE;AAEF,SAAO,IAAI;AAAA,IACT,SAAS,kCAAkC,OAAO,MAAM,SAAS,OAAO,WAAW,IAAI,KAAK,GAAG;AAAA,IAC/F,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AACH;","names":["jsx","formatDuration","jsx","jsx","jsx","jsx","jsxs","useContext","EMPTY_RENDERERS","useContext","jsx","jsxs","jsx","jsxs","jsx","Fragment","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","Fragment","jsx","jsxs","safeStringify","jsx","Fragment","jsx","jsx","jsxs","isLocalFsPath","safeImageUrl","jsx","jsxs","isLocalFsPath","safeImageUrl","Fragment","jsx","jsxs","formatDuration","jsx","jsxs","formatDuration","createContext","useContext","Fragment","jsx","jsxs","createContext","useContext","jsxs","createContext","useContext","useState","createContext","useContext","jsx","jsx","jsx","jsxs","jsx","jsxs","formatDuration","Fragment","jsx","jsx","jsxs","Fragment","jsx","jsxs","jsx","cva","jsx","cva","jsx","jsx","jsx","jsxs","formatDuration","jsx","jsxs","formatDuration","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsxs","useEffect","useState","Fragment","jsx","jsxs","useState","useEffect","err","jsx","useState","jsx","jsxs","jsxs","jsx","jsx","jsx","jsxs","useState"]}
1
+ {"version":3,"sources":["../src/result.ts","../src/context/ReportRoot.tsx","../src/context/ReportContext.ts","../src/components/ui/badge.tsx","../src/lib/utils.ts","../src/components/doc/NarrativeBlocks.tsx","../src/hooks/useReport.ts","../src/components/ReportScenario.tsx","../src/lib/step-params.tsx","../src/components/ReportSteps.tsx","../src/components/doc/DocNote.tsx","../src/components/doc/DocTag.tsx","../src/components/doc/DocKv.tsx","../src/hooks/useRenderers.ts","../src/components/doc/DocCode.tsx","../src/components/doc/DocTable.tsx","../src/components/doc/DocLink.tsx","../src/lib/markdown.ts","../src/lib/url.ts","../src/components/doc/DocSection.tsx","../src/components/doc/DocMermaid.tsx","../src/components/doc/DocScreenshot.tsx","../src/components/doc/DocVideo.tsx","../src/components/doc/DocHtml.tsx","../src/components/doc/DocState.tsx","../src/components/doc/DocCustom.tsx","../src/components/doc/DocEntry.tsx","../src/components/ReportDocEntries.tsx","../src/components/ReportStoryboard.tsx","../src/components/ReportAttachments.tsx","../src/components/ReportTrace.tsx","../src/lib/trace.ts","../src/interactive/scenario-history-context.ts","../src/lib/run-history.ts","../src/components/ScenarioRunHistory.tsx","../src/components/ScenarioStaleness.tsx","../src/lib/provenance.ts","../src/interactive/scenario-freshness-context.tsx","../src/interactive/collapse-context.ts","../src/interactive/scenario-actions.tsx","../src/components/ui/card.tsx","../src/components/ui/dropdown-menu.tsx","../src/components/ReportScenarioList.tsx","../src/components/ReportFeatureIntro.tsx","../src/components/ReportFeature.tsx","../src/components/ReportFeatureList.tsx","../src/components/ui/empty.tsx","../src/components/ReportEmpty.tsx","../src/components/ReportSummary.tsx","../src/components/ReportMeta.tsx","../src/components/ReportSchemaError.tsx","../src/components/ReportShell.tsx","../src/components/ReportSpanGraph.tsx","../src/components/Report.tsx","../src/components/doc/MermaidView.tsx","../src/components/doc/MermaidDiagram.tsx","../src/components/ScenarioExplorer.tsx","../src/components/ui/command.tsx","../src/schema/story-report.schema.ts","../../executable-stories-core/schemas/story-report-v1.json","../src/schema/version.ts","../src/schema/parse.ts"],"sourcesContent":["/**\n * Result<T> — explicit success/error type matching the cookbook convention.\n *\n * Used at the boundary where a StoryReport is parsed: the consumer hands us\n * an unknown value (file contents, fetch body, prop) and we return a Result.\n */\nimport type { StoryReport } from \"executable-stories-core\";\n\nexport type Result<T, E = ReportParseError> =\n | { ok: true; data: T }\n | { ok: false; error: E };\n\nexport interface ReportParseError {\n message: string;\n code: ReportParseErrorCode;\n issues?: readonly { path: string; message: string }[];\n}\n\nexport type ReportParseErrorCode =\n | \"INVALID_INPUT\"\n | \"SCHEMA_VERSION_MISMATCH\"\n | \"VALIDATION_FAILED\";\n\nexport const ok = <T>(data: T): Result<T> => ({ ok: true, data });\nexport const err = (error: ReportParseError): Result<never> => ({ ok: false, error });\n\n/**\n * Normalize the `StoryReport | Result<StoryReport>` prop accepted across the\n * render entrypoints (`Report`, `ReportInteractive`, `renderReportToHtml`) into\n * a single `Result`. A bare report becomes `ok(report)`; an already-wrapped\n * value passes through. One place owns the \"is this a Result?\" discrimination.\n */\nexport function unwrapReport(value: StoryReport | Result<StoryReport>): Result<StoryReport> {\n if (\n typeof value === \"object\" &&\n value !== null &&\n \"ok\" in value &&\n typeof (value as { ok: unknown }).ok === \"boolean\"\n ) {\n return value as Result<StoryReport>;\n }\n return ok(value as StoryReport);\n}\n","import { useMemo, type ReactNode } from \"react\";\nimport type { StoryReport } from \"executable-stories-core\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\nimport { ReportContext, type ReportContextValue } from \"./ReportContext\";\nimport { narrativeBlockRenderers } from \"../components/doc/NarrativeBlocks\";\n\nexport interface ReportRootProps {\n report: StoryReport;\n customRenderers?: CustomRenderers;\n renderers?: BuiltinRenderers;\n children: ReactNode;\n}\n\nconst EMPTY_RENDERERS: BuiltinRenderers = {};\n\nexport function ReportRoot({\n report,\n customRenderers,\n renderers,\n children,\n}: ReportRootProps) {\n const value = useMemo<ReportContextValue>(\n () => ({\n report,\n // Narrative blocks render everywhere the report does (static SSR, the\n // island, Astro) without every host wiring them up. A host renderer for\n // the same type still wins.\n customRenderers: { ...narrativeBlockRenderers, ...customRenderers },\n renderers: renderers ?? EMPTY_RENDERERS,\n }),\n [report, customRenderers, renderers],\n );\n return <ReportContext.Provider value={value}>{children}</ReportContext.Provider>;\n}\n","import { createContext } from \"react\";\nimport type { StoryReport } from \"executable-stories-core\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\n\nexport interface ReportContextValue {\n report: StoryReport;\n customRenderers: CustomRenderers;\n renderers: BuiltinRenderers;\n}\n\nexport const ReportContext = createContext<ReportContextValue | null>(null);\n","import * as React from \"react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport { useRender } from \"@base-ui/react/use-render\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary:\n \"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90\",\n outline:\n \"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n ghost: \"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground\",\n link: \"text-primary underline-offset-4 [a&]:hover:underline\",\n // Pass/skip/pending are the quiet states: outline + coloured text, no\n // fill, so a green report reads calm. Only `failed` keeps a tinted\n // fill, making it the single loud badge on the page, so red pops the\n // instant something breaks. Colour-as-accent, matching the KPI cards.\n passed: \"border-pass-border text-pass font-mono uppercase\",\n failed: \"border-fail-border bg-fail-bg text-fail font-mono uppercase\",\n skipped: \"border-skip-border text-skip font-mono uppercase\",\n pending: \"border-pend-border text-pend font-mono uppercase\",\n tag: \"border-border text-muted-foreground font-mono font-medium [a&]:hover:bg-muted\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction Badge({\n className,\n variant = \"default\",\n render,\n ...props\n}: React.ComponentProps<\"span\"> &\n VariantProps<typeof badgeVariants> & {\n // Base UI composition: pass `render={<a … />}` to swap the underlying tag —\n // replaces Radix's `asChild`. See rules/base-vs-radix.md.\n render?: useRender.RenderProp\n }) {\n return useRender({\n defaultTagName: \"span\",\n render,\n props: {\n \"data-slot\": \"badge\",\n \"data-variant\": variant,\n className: cn(badgeVariants({ variant }), className),\n ...props,\n },\n })\n}\n\nexport { Badge, badgeVariants }\n","import { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\n/** Merge class names with Tailwind-aware conflict resolution (shadcn `cn`). */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * Renderers for the two narrative block types an agent reaches for when it\n * explains a change: a file map and a data shape.\n *\n * They ride on `story.custom({ type, data })`, so every adapter can already\n * emit them with no API change; only the renderer is new. Register them with\n * `customRenderers` (the standalone report island does this by default).\n *\n * These blocks describe, they do not prove. Nothing here executed, so a block\n * whose `data.authored` says an agent wrote it renders a visible marker. A\n * picture that looks as trustworthy as a passing test, without being one, is\n * the failure mode this whole report exists to avoid.\n */\n\nimport type { ReportDocCustom } from \"executable-stories-core\";\nimport { Badge } from \"../ui/badge\";\nimport { cn } from \"../../lib/utils\";\n\nexport const FILE_TREE_TYPE = \"file-tree\";\nexport const DATA_MODEL_TYPE = \"data-model\";\n\n/** Change annotation shared by both blocks. */\ntype ChangeKind = \"added\" | \"modified\" | \"removed\" | \"renamed\";\n\nfunction isChangeKind(value: unknown): value is ChangeKind {\n return value === \"added\" || value === \"modified\" || value === \"removed\" || value === \"renamed\";\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === \"string\" && value !== \"\" ? value : undefined;\n}\n\n/**\n * \"Written by an agent, not verified by a run.\" Only rendered when the author\n * says so; there is no way to detect it after the fact, which is exactly why\n * the authoring skills are told to set it.\n */\nfunction AuthoredMarker({ authored }: { authored?: string }) {\n if (authored !== \"agent\") return null;\n return (\n <Badge variant=\"outline\" className=\"border-border text-[10px] text-muted-foreground\">\n AI-authored, not verified by a run\n </Badge>\n );\n}\n\nfunction BlockFrame({\n title,\n authored,\n children,\n}: {\n title?: string;\n authored?: string;\n children: React.ReactNode;\n}) {\n return (\n <figure className=\"my-3\">\n {title || authored === \"agent\" ? (\n <figcaption className=\"mb-1.5 flex flex-wrap items-center gap-2\">\n {title ? <span className=\"text-xs font-medium text-muted-foreground\">{title}</span> : null}\n <AuthoredMarker authored={authored} />\n </figcaption>\n ) : null}\n {children}\n </figure>\n );\n}\n\n/**\n * Deliberately uncoloured. In this report colour carries test status, so a\n * green \"added\" badge beside a failing scenario would read as a pass. The word\n * does the work.\n */\nfunction ChangeBadge({ change }: { change: ChangeKind }) {\n return (\n <Badge variant=\"tag\" className=\"text-[10px]\">\n {change}\n </Badge>\n );\n}\n\n// ---------------------------------------------------------------------------\n// file-tree\n// ---------------------------------------------------------------------------\n\ninterface FileEntry {\n path: string;\n change?: ChangeKind;\n note?: string;\n}\n\nexport interface FileTreeData {\n title?: string;\n authored?: string;\n files: FileEntry[];\n}\n\nexport function parseFileTree(data: unknown): FileTreeData | undefined {\n if (!isRecord(data) || !Array.isArray(data.files)) return undefined;\n const files: FileEntry[] = [];\n for (const raw of data.files) {\n // A bare string is a path; anything without one is not a file.\n if (typeof raw === \"string\") {\n if (raw) files.push({ path: raw });\n continue;\n }\n if (!isRecord(raw)) continue;\n const path = str(raw.path);\n if (!path) continue;\n files.push({\n path,\n change: isChangeKind(raw.change) ? raw.change : undefined,\n note: str(raw.note),\n });\n }\n if (files.length === 0) return undefined;\n return { title: str(data.title), authored: str(data.authored), files };\n}\n\ninterface TreeNode {\n name: string;\n children: Map<string, TreeNode>;\n file?: FileEntry;\n}\n\n/** Flat paths in, nested directories out. Sorting puts folders before files. */\nfunction buildTree(files: FileEntry[]): TreeNode {\n const root: TreeNode = { name: \"\", children: new Map() };\n for (const file of files) {\n const segments = file.path.split(\"/\").filter(Boolean);\n let node = root;\n segments.forEach((segment, index) => {\n let child = node.children.get(segment);\n if (!child) {\n child = { name: segment, children: new Map() };\n node.children.set(segment, child);\n }\n if (index === segments.length - 1) child.file = file;\n node = child;\n });\n }\n return root;\n}\n\nfunction sortedChildren(node: TreeNode): TreeNode[] {\n return [...node.children.values()].sort((a, b) => {\n const aDir = a.children.size > 0;\n const bDir = b.children.size > 0;\n if (aDir !== bDir) return aDir ? -1 : 1;\n return a.name.localeCompare(b.name);\n });\n}\n\nfunction TreeBranch({ node, depth }: { node: TreeNode; depth: number }) {\n const children = sortedChildren(node);\n return (\n <ul className={cn(\"space-y-0.5\", depth > 0 && \"ml-3 border-l border-border/60 pl-3\")}>\n {children.map((child) => {\n const isDir = child.children.size > 0;\n return (\n <li key={child.name}>\n <div className=\"flex flex-wrap items-baseline gap-2\">\n <span\n className={cn(\n \"font-mono text-xs\",\n isDir ? \"text-muted-foreground\" : \"text-foreground\",\n )}\n >\n {isDir ? `${child.name}/` : child.name}\n </span>\n {child.file?.change ? <ChangeBadge change={child.file.change} /> : null}\n {child.file?.note ? (\n <span className=\"text-xs text-muted-foreground\">{child.file.note}</span>\n ) : null}\n </div>\n {isDir ? <TreeBranch node={child} depth={depth + 1} /> : null}\n </li>\n );\n })}\n </ul>\n );\n}\n\nexport function FileTreeBlock({ entry }: { entry: ReportDocCustom }) {\n const data = parseFileTree(entry.data);\n if (!data) return <UnreadableBlock entry={entry} />;\n return (\n <BlockFrame title={data.title ?? \"Files changed\"} authored={data.authored}>\n <div tabIndex={0} className=\"overflow-x-auto rounded-md border border-border bg-card p-3\">\n <TreeBranch node={buildTree(data.files)} depth={0} />\n </div>\n </BlockFrame>\n );\n}\n\n// ---------------------------------------------------------------------------\n// data-model\n// ---------------------------------------------------------------------------\n\ninterface ModelField {\n name: string;\n type?: string;\n note?: string;\n change?: ChangeKind;\n}\n\nexport interface DataModelData {\n title?: string;\n authored?: string;\n name?: string;\n fields: ModelField[];\n}\n\nexport function parseDataModel(data: unknown): DataModelData | undefined {\n if (!isRecord(data) || !Array.isArray(data.fields)) return undefined;\n const fields: ModelField[] = [];\n for (const raw of data.fields) {\n if (!isRecord(raw)) continue;\n const name = str(raw.name);\n if (!name) continue;\n fields.push({\n name,\n type: str(raw.type),\n note: str(raw.note),\n change: isChangeKind(raw.change) ? raw.change : undefined,\n });\n }\n if (fields.length === 0) return undefined;\n return {\n title: str(data.title),\n authored: str(data.authored),\n name: str(data.name),\n fields,\n };\n}\n\nexport function DataModelBlock({ entry }: { entry: ReportDocCustom }) {\n const data = parseDataModel(entry.data);\n if (!data) return <UnreadableBlock entry={entry} />;\n const hasNotes = data.fields.some((f) => f.note);\n return (\n <BlockFrame title={data.title ?? data.name ?? \"Data model\"} authored={data.authored}>\n <div tabIndex={0} className=\"overflow-x-auto rounded-md border border-border\">\n <table className=\"w-full border-collapse text-sm\">\n <thead>\n <tr className=\"bg-muted/50\">\n <th scope=\"col\" className=\"border-b border-border px-3 py-2 text-left font-semibold\">\n Field\n </th>\n <th scope=\"col\" className=\"border-b border-border px-3 py-2 text-left font-semibold\">\n Type\n </th>\n {hasNotes ? (\n <th scope=\"col\" className=\"border-b border-border px-3 py-2 text-left font-semibold\">\n Note\n </th>\n ) : null}\n </tr>\n </thead>\n <tbody>\n {data.fields.map((field) => (\n <tr key={field.name}>\n <td className=\"border-b border-border px-3 py-2\">\n <span className=\"flex flex-wrap items-center gap-2\">\n <span className=\"font-mono text-xs text-foreground\">{field.name}</span>\n {field.change ? <ChangeBadge change={field.change} /> : null}\n </span>\n </td>\n <td className=\"border-b border-border px-3 py-2 font-mono text-xs text-muted-foreground\">\n {field.type ?? \"\"}\n </td>\n {hasNotes ? (\n <td className=\"border-b border-border px-3 py-2 text-foreground\">\n {field.note ?? \"\"}\n </td>\n ) : null}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </BlockFrame>\n );\n}\n\n// ---------------------------------------------------------------------------\n\n/**\n * Shape we could not read. Show the raw data rather than nothing: a malformed\n * block is a bug in whatever wrote it, and hiding it hides the bug.\n */\nfunction UnreadableBlock({ entry }: { entry: ReportDocCustom }) {\n return (\n <div className=\"my-2\" data-type={entry.type}>\n <p className=\"mb-1 text-xs font-medium text-muted-foreground\">\n {entry.type} (unrecognised shape)\n </p>\n <pre\n tabIndex={0}\n className=\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\"\n >\n {safeStringify(entry.data)}\n </pre>\n </div>\n );\n}\n\nfunction safeStringify(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n\n/**\n * The narrative block renderers, ready to spread into `customRenderers`.\n * Consumer-supplied renderers for the same type win, so a project can swap\n * either one out.\n */\nexport const narrativeBlockRenderers = {\n [FILE_TREE_TYPE]: (entry: ReportDocCustom) => <FileTreeBlock entry={entry} />,\n [DATA_MODEL_TYPE]: (entry: ReportDocCustom) => <DataModelBlock entry={entry} />,\n};\n","import { useContext } from \"react\";\nimport { ReportContext } from \"../context/ReportContext\";\n\nexport function useReport() {\n const ctx = useContext(ReportContext);\n if (!ctx) {\n throw new Error(\n \"useReport must be used inside <ReportRoot> or <Report>. Wrap your tree with one of those.\",\n );\n }\n return ctx.report;\n}\n","import type { ReportScenario as ReportScenarioT } from \"executable-stories-core\";\nimport { formatDuration } from \"executable-stories-core/utils/duration\";\nimport { ReportSteps } from \"./ReportSteps\";\nimport { ReportStoryboard } from \"./ReportStoryboard\";\nimport { ReportDocEntries } from \"./ReportDocEntries\";\nimport { ReportAttachments } from \"./ReportAttachments\";\nimport { ReportTrace } from \"./ReportTrace\";\nimport { ScenarioRunHistory } from \"./ScenarioRunHistory\";\nimport { ScenarioStaleness } from \"./ScenarioStaleness\";\nimport { useCollapse } from \"../interactive/collapse-context\";\nimport { useScenarioActions } from \"../interactive/scenario-actions\";\nimport { Card, CardContent, CardHeader } from \"@/components/ui/card\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { LinkIcon, FileTextIcon, SparklesIcon, MoreHorizontalIcon } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReportScenarioProps {\n scenario: ReportScenarioT;\n /**\n * Omit the card's own title row (status badge + tags still render). Use when\n * the surrounding page already shows the scenario title as its heading — e.g.\n * the Astro detail page, where Starlight renders the title as the page `h1`.\n */\n hideTitle?: boolean;\n}\n\ntype Status = ReportScenarioT[\"status\"];\n\ninterface StatusMeta {\n label: string;\n glyph: string;\n glyphColor: string;\n badgeVariant: \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n /**\n * Whether to render the status as a visible pill. Passing scenarios drop it:\n * the green ✓ glyph + title already carry the status, so the pill would be\n * pure redundancy on every (usually passing) row, and dropping it keeps a\n * green run calm while the failure pill stays the one loud badge. A\n * non-showPill status still exposes an sr-only label for screen readers.\n */\n showPill: boolean;\n}\n\nconst STATUS_META: Record<Status, StatusMeta> = {\n passed: { label: \"Passed\", glyph: \"✓\", glyphColor: \"text-pass\", badgeVariant: \"passed\", showPill: false },\n failed: { label: \"Failed\", glyph: \"✗\", glyphColor: \"text-fail\", badgeVariant: \"failed\", showPill: true },\n skipped: { label: \"Skipped\", glyph: \"○\", glyphColor: \"text-skip\", badgeVariant: \"skipped\", showPill: true },\n pending: { label: \"Pending\", glyph: \"○\", glyphColor: \"text-pend\", badgeVariant: \"pending\", showPill: true },\n};\n\nexport function ReportScenario({ scenario, hideTitle = false }: ReportScenarioProps) {\n const titleId = `${scenario.id}-title`;\n const bodyId = `${scenario.id}-body`;\n const meta = STATUS_META[scenario.status];\n // A planned scenario (it.todo) is canonically \"pending\", but the reader\n // should see intent, not limbo.\n const label = scenario.planned ? \"Planned\" : meta.label;\n const collapse = useCollapse();\n const collapsible = collapse !== null && !hideTitle;\n const collapsed = collapsible ? collapse!.isCollapsed(scenario.id) : false;\n const actions = useScenarioActions();\n return (\n <Card\n id={scenario.id}\n data-status={scenario.status}\n {...(hideTitle\n ? { \"aria-label\": `${scenario.title}, ${label}` }\n : { \"aria-labelledby\": titleId })}\n className=\"gap-0 py-0\"\n >\n <CardHeader className=\"px-4 py-3\">\n <div\n className={cn(\n // Wraps rather than squeezing: on a phone the status/duration group\n // is ~160px, which leaves a title column a few characters wide.\n \"flex flex-wrap items-start gap-x-4 gap-y-1\",\n hideTitle ? \"justify-end\" : \"justify-between\",\n )}\n >\n {hideTitle ? null : (\n <h3 id={titleId} className=\"flex min-w-0 flex-1 basis-48 items-center gap-2 text-sm font-medium text-foreground\">\n {collapsible ? (\n <button\n type=\"button\"\n onClick={() => collapse!.toggle(scenario.id)}\n aria-expanded={!collapsed}\n aria-controls={bodyId}\n aria-label={`Toggle ${scenario.title}`}\n className=\"shrink-0 cursor-pointer text-muted-foreground hover:text-foreground\"\n >\n <span aria-hidden className={cn(\"inline-block text-xs transition-transform\", !collapsed && \"rotate-90\")}>▸</span>\n </button>\n ) : null}\n <span aria-hidden className={cn(\"text-sm leading-none\", meta.glyphColor)}>\n {meta.glyph}\n </span>\n <span>{scenario.title}</span>\n </h3>\n )}\n <div className=\"flex shrink-0 items-center gap-2\">\n <ScenarioRunHistory scenarioId={scenario.id} />\n <ScenarioStaleness scenario={scenario} />\n {scenario.durationMs > 0 ? (\n <span className=\"whitespace-nowrap font-mono text-[0.6875rem] text-muted-foreground\">\n {formatDuration(scenario.durationMs)}\n </span>\n ) : null}\n {meta.showPill ? (\n <Badge variant={meta.badgeVariant} aria-label={`Status: ${label}`}>\n {label}\n </Badge>\n ) : (\n <span className=\"sr-only\">{`Status: ${label}`}</span>\n )}\n {actions ? (\n <DropdownMenu>\n <DropdownMenuTrigger\n aria-label={`Actions for ${scenario.title}`}\n className=\"cursor-pointer rounded p-1 text-muted-foreground hover:bg-muted hover:text-foreground [&_svg]:size-4\"\n >\n <MoreHorizontalIcon aria-hidden />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\">\n <DropdownMenuItem onClick={() => actions.copyLink(scenario)}>\n <LinkIcon /> Copy link\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => actions.copyMarkdown(scenario)}>\n <FileTextIcon /> Copy as Markdown\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => actions.copyPrompt(scenario)}>\n <SparklesIcon /> Explain with AI\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </div>\n </div>\n {scenario.tags.length > 0 || (scenario.tickets?.length ?? 0) > 0 ? (\n <ul aria-label=\"Tags and tickets\" className=\"flex flex-wrap gap-1.5\">\n {scenario.tags.map((t) => (\n <li key={`tag-${t}`}>\n <Badge variant=\"tag\">{t}</Badge>\n </li>\n ))}\n {(scenario.tickets ?? []).map((ticket) => (\n <li key={`ticket-${ticket.id}`}>\n {ticket.url ? (\n <a href={ticket.url} target=\"_blank\" rel=\"noreferrer noopener\" className=\"inline-flex min-h-6 items-center\">\n <Badge variant=\"outline\">{ticket.id}</Badge>\n </a>\n ) : (\n <Badge variant=\"outline\">{ticket.id}</Badge>\n )}\n </li>\n ))}\n </ul>\n ) : null}\n </CardHeader>\n <CardContent id={bodyId} hidden={collapsed} className=\"px-4 pt-0 pb-4\">\n {scenario.errorMessage ? (\n <pre\n role=\"alert\"\n className=\"mb-1 overflow-x-auto rounded-md border border-fail-border bg-fail-bg px-4 py-3.5 font-mono text-xs leading-relaxed whitespace-pre-wrap text-fail\"\n >\n {scenario.errorMessage}\n </pre>\n ) : null}\n <ReportStoryboard scenario={scenario} />\n <ReportSteps scenario={scenario} />\n {scenario.docEntries.length > 0 ? (\n <div data-es-docs className=\"mt-3\">\n <ReportDocEntries entries={scenario.docEntries} />\n </div>\n ) : null}\n <ReportAttachments attachments={scenario.attachments} />\n <ReportTrace spans={scenario.otelSpans} />\n </CardContent>\n </Card>\n );\n}\n","import type { ReactNode } from \"react\";\n\n/**\n * Highlight step parameters (double-quoted strings, standalone numbers) in step\n * text — the React equivalent of the report's highlightStepParams. Returns a\n * node array so the matched params can be wrapped in a styled <span> without\n * dangerouslySetInnerHTML.\n *\n * Regex mirrors the string renderer exactly:\n * - `\"[^\"]*\"` double-quoted strings (numbers inside quotes stay part of the string)\n * - `(?<![\\w.-])\\d+(?:\\.\\d+)?(?![\\w.-])` standalone numbers, dot/word-boundary aware\n */\nconst STEP_PARAM_PATTERN = /\"[^\"]*\"|(?<![\\w.-])\\d+(?:\\.\\d+)?(?![\\w.-])/g;\n\nexport function highlightStepParams(text: string): ReactNode {\n const matches = Array.from(text.matchAll(STEP_PARAM_PATTERN));\n if (matches.length === 0) return text;\n\n const nodes: ReactNode[] = [];\n let lastIndex = 0;\n matches.forEach((match, i) => {\n const start = match.index;\n const end = start + match[0].length;\n if (start > lastIndex) nodes.push(text.slice(lastIndex, start));\n nodes.push(\n <span key={i} className=\"font-medium text-step-param italic\">\n {match[0]}\n </span>,\n );\n lastIndex = end;\n });\n if (lastIndex < text.length) nodes.push(text.slice(lastIndex));\n return nodes;\n}\n","import { highlightStepParams } from '@/lib/step-params';\nimport { cn } from '@/lib/utils';\nimport type { ReportScenario, ReportStep } from 'executable-stories-core';\nimport {\n assertionState,\n assertiveSteps,\n} from 'executable-stories-core/utils/assertive-steps';\nimport { formatDuration } from 'executable-stories-core/utils/duration';\nimport { ReportDocEntries } from './ReportDocEntries';\n\nexport interface ReportStepsProps {\n scenario: ReportScenario;\n}\n\nconst STEP_GLYPH: Record<string, string> = {\n passed: '✓',\n failed: '✗',\n skipped: '○',\n pending: '○',\n};\n\nconst STEP_GLYPH_COLOR: Record<string, string> = {\n passed: 'text-pass',\n failed: 'text-fail',\n skipped: 'text-skip',\n pending: 'text-pend',\n};\n\nexport function ReportSteps({ scenario }: ReportStepsProps) {\n if (scenario.steps.length === 0) return null;\n const unasserted = new Set(\n assertionState(scenario.steps) === 'unasserted'\n ? assertiveSteps(scenario.steps).map((step) => step.id)\n : [],\n );\n return (\n <ol data-slot=\"steps\" className=\"flex flex-col\">\n {scenario.steps.map((step) => (\n <ReportStepItem\n key={step.id}\n step={step}\n unasserted={unasserted.has(step.id)}\n />\n ))}\n </ol>\n );\n}\n\nexport function ReportStepItem({\n step,\n unasserted = false,\n}: {\n step: ReportStep;\n unasserted?: boolean;\n}) {\n // And/But (incl. auto-And repeats) read as continuations of the prior step —\n // indented with a muted keyword, matching the report's `.step.continuation`.\n const kw = step.keyword.toLowerCase();\n const continuation = kw === 'and' || kw === 'but';\n return (\n <li\n id={step.id}\n data-status={step.status}\n className={cn(\n 'py-1.5 text-[0.8125rem] leading-normal',\n continuation && 'pl-5',\n )}\n >\n <div className=\"flex items-baseline gap-2\">\n <span\n aria-hidden\n className={cn(\n 'w-4 shrink-0 text-center text-xs',\n STEP_GLYPH_COLOR[step.status],\n )}\n >\n {STEP_GLYPH[step.status] ?? '○'}\n </span>\n <span\n className={cn(\n 'min-w-[52px] shrink-0 font-mono text-xs font-semibold capitalize',\n continuation ? 'font-medium text-muted-foreground' : 'text-keyword',\n )}\n >\n {step.keyword}\n </span>\n <span className=\"flex-1 text-foreground\">\n {highlightStepParams(step.text)}\n </span>\n {unasserted ? (\n <span className=\"shrink-0 rounded-full border border-pend-border bg-pend-bg px-2 py-0.5 text-[0.6875rem] font-medium text-pend\">\n No assertion\n </span>\n ) : null}\n {step.durationMs > 0 ? (\n <span className=\"shrink-0 whitespace-nowrap font-mono text-[0.6875rem] text-muted-foreground\">\n {formatDuration(step.durationMs)}\n </span>\n ) : null}\n </div>\n {step.errorMessage ? (\n <pre\n role=\"alert\"\n className=\"mt-2.5 ml-6 overflow-x-auto rounded-md border border-fail-border bg-fail-bg px-4 py-3.5 font-mono text-xs leading-relaxed whitespace-pre-wrap text-fail\"\n >\n {step.errorMessage}\n </pre>\n ) : null}\n {step.docEntries.length > 0 ? (\n <div data-es-docs className=\"mt-2 ml-6\">\n <ReportDocEntries entries={step.docEntries} />\n </div>\n ) : null}\n </li>\n );\n}\n","import type { ReportDocNote } from \"executable-stories-core\";\n\nexport function DocNote({ entry }: { entry: ReportDocNote }) {\n return <p className=\"my-2 text-sm text-muted-foreground\">{entry.text}</p>;\n}\n","import type { ReportDocTag } from \"executable-stories-core\";\nimport { Badge } from \"@/components/ui/badge\";\n\nexport function DocTag({ entry }: { entry: ReportDocTag }) {\n return (\n <ul className=\"my-2 flex flex-wrap gap-1.5\" aria-label=\"Tags\">\n {entry.names.map((n) => (\n <li key={n}>\n <Badge variant=\"tag\">{n}</Badge>\n </li>\n ))}\n </ul>\n );\n}\n","import type { ReportDocKv } from \"executable-stories-core\";\n\nfunction formatValue(value: unknown): string {\n if (value === null) return \"null\";\n if (typeof value === \"string\") return value;\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n try {\n return JSON.stringify(value);\n } catch {\n return String(value);\n }\n}\n\nexport function DocKv({ entry }: { entry: ReportDocKv }) {\n return (\n <dl className=\"my-2 flex flex-wrap items-baseline gap-x-2 text-sm\">\n <dt className=\"font-semibold text-muted-foreground\">{entry.label}</dt>\n <dd className=\"min-w-0 break-words font-mono text-foreground\">{formatValue(entry.value)}</dd>\n </dl>\n );\n}\n","import { useContext } from \"react\";\nimport { ReportContext } from \"../context/ReportContext\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\n\nconst EMPTY_CUSTOM: CustomRenderers = {};\nconst EMPTY_RENDERERS: BuiltinRenderers = {};\n\nexport function useCustomRenderers(): CustomRenderers {\n const ctx = useContext(ReportContext);\n return ctx?.customRenderers ?? EMPTY_CUSTOM;\n}\n\nexport function useBuiltinRenderers(): BuiltinRenderers {\n const ctx = useContext(ReportContext);\n return ctx?.renderers ?? EMPTY_RENDERERS;\n}\n","import type { ReactNode } from \"react\";\nimport type { ReportDocCode } from \"executable-stories-core\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * Shared shell for code blocks: optional label + the scrollable `<pre>`. Both\n * the static `DocCode` and the island's CDN-highlighted variant render their\n * `<code>` into this so the two can never drift in spacing or chrome.\n */\nexport function CodeFigure({ label, children }: { label?: string; children: ReactNode }) {\n return (\n <figure className=\"my-3\">\n {label ? (\n <figcaption className=\"mb-1.5 text-xs font-medium text-muted-foreground\">{label}</figcaption>\n ) : null}\n <pre tabIndex={0} className=\"overflow-x-auto rounded-md bg-muted p-3\">\n {children}\n </pre>\n </figure>\n );\n}\n\nexport function DocCode({ entry }: { entry: ReportDocCode }) {\n const renderers = useBuiltinRenderers();\n if (renderers.code) {\n return <>{renderers.code(entry)}</>;\n }\n return (\n <CodeFigure label={entry.label}>\n <code className={cn(\"font-mono text-xs\", entry.lang && `language-${entry.lang}`)}>\n {entry.content}\n </code>\n </CodeFigure>\n );\n}\n","import type { ReportDocTable } from \"executable-stories-core\";\n\nexport function DocTable({ entry }: { entry: ReportDocTable }) {\n return (\n <figure className=\"my-3\">\n {entry.label ? (\n <figcaption className=\"mb-1.5 text-xs font-medium text-muted-foreground\">\n {entry.label}\n </figcaption>\n ) : null}\n <div tabIndex={0} className=\"overflow-x-auto rounded-md border border-border\">\n <table className=\"w-full border-collapse text-sm\">\n <thead>\n <tr className=\"bg-muted/50\">\n {entry.columns.map((c) => (\n <th key={c} scope=\"col\" className=\"border-b border-border px-3 py-2 text-left font-semibold\">\n {c}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {entry.rows.map((row, i) => (\n <tr key={i}>\n {row.map((cell, j) => (\n <td key={j} className=\"border-b border-border px-3 py-2 text-foreground\">\n {cell}\n </td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </figure>\n );\n}\n","import type { ReportDocLink } from \"executable-stories-core\";\n\nexport function DocLink({ entry }: { entry: ReportDocLink }) {\n return (\n <a\n className=\"text-sm font-medium text-primary underline underline-offset-2 hover:no-underline\"\n href={entry.url}\n rel=\"noreferrer noopener\"\n target=\"_blank\"\n >\n {entry.label}\n </a>\n );\n}\n","import { marked } from \"marked\";\nimport { safeUrl } from \"./url\";\n\n/**\n * Best-effort sanitizer for marked-generated HTML. The markdown we render is\n * authored in test source (developer-trusted), so this is defense-in-depth,\n * not a hard boundary against hostile input. It:\n * - drops <script>/<style> and other active elements (iframe/object/embed/form)\n * - strips on* event-handler attributes\n * - neutralizes any non-http(s) scheme on href/src via the shared `safeUrl`\n * allow-list (covers javascript:/data:/vbscript:/file:, not just javascript:)\n *\n * It is NOT a substitute for a full HTML sanitizer (it won't catch entity-\n * obfuscated schemes). For untrusted markdown, supply your own renderer.\n */\nexport function safeMarkdownHtml(markdown: string): string {\n const raw = marked.parse(markdown, { async: false }) as string;\n return raw\n .replace(/<script\\b[^>]*>[\\s\\S]*?<\\/script>/gi, \"\")\n .replace(/<style\\b[^>]*>[\\s\\S]*?<\\/style>/gi, \"\")\n .replace(/<\\/?(?:iframe|object|embed|form|base)\\b[^>]*>/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*\"[^\"]*\"/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*'[^']*'/gi, \"\")\n .replace(/\\son[a-z]+\\s*=\\s*[^\\s>]+/gi, \"\")\n .replace(/(href|src)\\s*=\\s*\"([^\"]*)\"/gi, (_m, attr, val) => `${attr}=\"${neutralizeUrl(val)}\"`)\n .replace(/(href|src)\\s*=\\s*'([^']*)'/gi, (_m, attr, val) => `${attr}='${neutralizeUrl(val)}'`);\n}\n\n/**\n * Strip the leading indentation a template literal picks up from its source.\n *\n * Narratives are written inline in test files, so they arrive indented to match\n * the surrounding code. Left alone, four spaces make Markdown render the whole\n * paragraph as a code block.\n */\nexport function dedent(text: string): string {\n const lines = text.replace(/\\t/g, \" \").split(\"\\n\");\n const indents = lines\n .filter((line) => line.trim().length > 0)\n .map((line) => line.length - line.trimStart().length);\n const shortest = indents.length > 0 ? Math.min(...indents) : 0;\n return lines\n .map((line) => line.slice(shortest))\n .join(\"\\n\")\n .trim();\n}\n\nfunction neutralizeUrl(value: string): string {\n return safeUrl(value) ?? \"#\";\n}\n","/**\n * URL trust boundary for report-sourced strings reaching the DOM. The\n * implementation lives in executable-stories-core/utils/url (shared with the\n * Astro state-catalog thumbnails); this module stays as the package-local\n * import point. Subpath import: the core package root pulls in Node-only\n * converters, which breaks browser bundles.\n */\nexport { safeUrl, safeImageUrl, isLocalFsPath } from \"executable-stories-core/utils/url\";\n","import type { ReportDocSection } from \"executable-stories-core\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\nimport { safeMarkdownHtml } from \"../../lib/markdown\";\n\nexport function DocSection({ entry }: { entry: ReportDocSection }) {\n const renderers = useBuiltinRenderers();\n if (renderers.section) {\n return <>{renderers.section(entry)}</>;\n }\n const html = safeMarkdownHtml(entry.markdown);\n return (\n <section className=\"my-3 text-sm\" aria-label={entry.title}>\n {entry.title ? <h4 className=\"mb-1 font-semibold text-foreground\">{entry.title}</h4> : null}\n <div\n className=\"es-doc-prose prose prose-sm max-w-none\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n </section>\n );\n}\n","import type { Ref } from \"react\";\nimport type { ReportDocMermaid } from \"executable-stories-core\";\nimport { useBuiltinRenderers } from \"../../hooks/useRenderers\";\n\n/**\n * The raw mermaid source as a semantic `<pre data-mermaid>`. This is the\n * default render and the universal fallback: AI agents, screen readers, and\n * no-JS views all get the readable source. `<MermaidDiagram>` upgrades this to\n * a drawn diagram on the client.\n */\nexport function MermaidSource({ entry, ref }: { entry: ReportDocMermaid; ref?: Ref<HTMLElement> }) {\n return (\n <figure ref={ref} className=\"my-3\" aria-label={entry.title ?? \"Diagram\"}>\n {entry.title ? (\n <figcaption className=\"mb-1.5 text-xs font-medium text-muted-foreground\">{entry.title}</figcaption>\n ) : null}\n <pre\n data-mermaid\n tabIndex={0}\n className=\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\"\n >\n {entry.code}\n </pre>\n </figure>\n );\n}\n\n/**\n * Renders mermaid source as a semantic `<pre data-mermaid>` by default.\n *\n * To draw the diagram, supply a `renderers.mermaid` prop — e.g. the shipped\n * `MermaidDiagram` (`renderers={{ mermaid: (e) => <MermaidDiagram entry={e} /> }}`).\n */\nexport function DocMermaid({ entry }: { entry: ReportDocMermaid }) {\n const renderers = useBuiltinRenderers();\n if (renderers.mermaid) {\n return <>{renderers.mermaid(entry)}</>;\n }\n return <MermaidSource entry={entry} />;\n}\n","import type { ReportDocScreenshot } from \"executable-stories-core\";\nimport { isLocalFsPath, safeImageUrl } from \"../../lib/url\";\n\n/**\n * A screenshot that's still an absolute local filesystem path by the time it\n * reaches this component means the report's asset bundler couldn't find the\n * file to inline/copy it (deleted, moved, or never captured — see\n * inlineScreenshotIfPossible in executable-stories-playwright). `<img src>`\n * would 404 against a path from the machine that generated the report, so\n * show a placeholder instead of a broken image.\n */\nexport function DocScreenshot({ entry }: { entry: ReportDocScreenshot }) {\n const src = isLocalFsPath(entry.path) ? undefined : safeImageUrl(entry.path);\n\n if (!src) {\n return (\n <figure className=\"my-3 rounded-md border border-dashed border-border p-3 text-sm text-muted-foreground\">\n <div className=\"font-medium\">Screenshot unavailable</div>\n <div className=\"mt-1 break-all font-mono text-xs\">{entry.path}</div>\n {entry.alt ? <figcaption className=\"mt-1.5 text-xs\">{entry.alt}</figcaption> : null}\n </figure>\n );\n }\n\n return (\n <figure className=\"my-3\">\n <img\n src={src}\n alt={entry.alt ?? \"\"}\n loading=\"lazy\"\n className=\"max-w-full rounded-md border border-border\"\n />\n {entry.alt ? <figcaption className=\"mt-1.5 text-xs text-muted-foreground\">{entry.alt}</figcaption> : null}\n </figure>\n );\n}\n","import type { ReportDocVideo } from \"executable-stories-core\";\nimport { isLocalFsPath, safeUrl } from \"../../lib/url\";\n\n/**\n * Renders a video doc entry. Video bytes are large and never inlined; `path` is\n * a URL or a path that resolves alongside the report. Both `path` and `poster`\n * are adapter-supplied, so they go through the same scheme allow-list as the\n * DocHtml iframe src (no `javascript:`/`data:` URLs reach the DOM).\n *\n * An absolute local filesystem path means the report's asset bundler\n * couldn't find/copy the file — a `<video src>` pointed at a runner-local\n * path would just fail to load, so show a placeholder instead.\n */\nexport function DocVideo({ entry }: { entry: ReportDocVideo }) {\n if (isLocalFsPath(entry.path)) {\n return (\n <figure className=\"my-3 rounded-md border border-dashed border-border p-3 text-sm text-muted-foreground\">\n <div className=\"font-medium\">Video unavailable</div>\n <div className=\"mt-1 break-all font-mono text-xs\">{entry.path}</div>\n {entry.caption ? <figcaption className=\"mt-1.5 text-xs\">{entry.caption}</figcaption> : null}\n </figure>\n );\n }\n\n const src = safeUrl(entry.path);\n const poster = safeUrl(entry.poster);\n return (\n <figure className=\"my-3\">\n <video\n controls\n preload=\"metadata\"\n {...(src ? { src } : {})}\n {...(poster ? { poster } : {})}\n className=\"max-w-full rounded-md border border-border\"\n />\n {entry.caption ? (\n <figcaption className=\"mt-1 text-xs text-muted-foreground\">{entry.caption}</figcaption>\n ) : null}\n </figure>\n );\n}\n","import { useEffect, useRef, useState } from \"react\";\nimport type { ReportDocHtml } from \"executable-stories-core\";\nimport { safeUrl } from \"../../lib/url\";\n\n/**\n * Measures the framed page and posts its height out.\n *\n * The frame is `sandbox=\"allow-scripts\"` with no `allow-same-origin`, so it is\n * an opaque origin and the report cannot read into it. Measurement has to run\n * inside the frame and come back by postMessage, which is only possible for\n * HTML the report owns — inline `content`. A remote `url`/`path` page can only\n * do this if its own author opts in, so those keep their declared height.\n *\n * Inlined rather than fetched: the HTML report is a single self-contained file\n * with no CDN and no external requests.\n *\n * The closing tag is written plainly. This module is bundled into the report\n * island, which is inlined into a `<script>` in the report HTML, where a raw\n * `</script>` inside a string would close that tag early. esbuild escapes it on\n * the way out, so hand-escaping here only trips the linter. Checked against the\n * generated bundle rather than assumed.\n */\nconst MEASURE_SCRIPT =\n \"<script>(function(){\" +\n \"if(parent===window)return;\" +\n \"var last=0,queued=false;\" +\n // Measure the bottom edge of body's children, never the document's own\n // scrollHeight. A standalone artifact routinely sets `html,body{height:100%}`,\n // which makes scrollHeight equal to the frame, so measuring it is a ratchet:\n // the frame grows and can never shrink, because the thing measured is the\n // frame.\n //\n // Zero means there was nothing to measure that way: `content` is any string,\n // so it can be bare text with no element children, or text beside only\n // non-rendered ones (a <style> block, a <script>). Body's own box is what\n // gives that text a box to be measured in. It is the fallback and not the\n // primary because a stretched body is exactly the ratchet above.\n \"var measure=function(){\" +\n \"var kids=document.body.children,h=0;\" +\n \"for(var i=0;i<kids.length;i++)h=Math.max(h,kids[i].getBoundingClientRect().bottom);\" +\n \"return Math.ceil(h||document.body.getBoundingClientRect().bottom)};\" +\n // Unchanged height posts nothing. That both spares the report a re-render per\n // frame and breaks the feedback loop: resizing the frame resizes a stretched\n // body, which fires the observer again.\n \"var post=function(){queued=false;var h=measure();if(h===last)return;last=h;\" +\n \"parent.postMessage({__esHtmlHeight:h},'*')};\" +\n // One measurement per frame: mutations arrive in bursts and each measure\n // forces a layout.\n \"var schedule=function(){if(queued)return;queued=true;requestAnimationFrame(post)};\" +\n \"var start=function(){\" +\n // ResizeObserver catches reflow (images, fonts, viewport). MutationObserver\n // catches DOM and style changes, which the observer never sees when body is\n // stretched to the frame and so never changes size itself.\n \"new ResizeObserver(schedule).observe(document.body);\" +\n \"new MutationObserver(schedule).observe(document.body,\" +\n \"{subtree:true,childList:true,attributes:true,characterData:true});\" +\n \"addEventListener('load',schedule);post()};\" +\n \"if(document.body)start();else addEventListener('DOMContentLoaded',start)\" +\n \"})();</script>\";\n\n/**\n * The tallest frame the report will grow to. The embedded page is untrusted by\n * construction, so a height it reports is input at a trust boundary: a broken\n * or hostile document claiming 10 million pixels would otherwise take the page\n * with it. Past this the frame scrolls.\n */\nconst MAX_MEASURED_HEIGHT = 5000;\n\n/**\n * Renders an embedded-HTML doc entry inside a SANDBOXED iframe. All embedded\n * HTML is untrusted, so the frame is `sandbox=\"allow-scripts\"` only (no\n * allow-same-origin) — embedded scripts run (charts work) but can't touch the\n * report DOM, cookies, or storage. Inline `content` → srcdoc (keeps the report\n * self-contained); `url`/`path` → src (scheme-validated).\n */\nexport function DocHtml({ entry }: { entry: ReportDocHtml }) {\n const declaredHeight =\n typeof entry.height === \"number\" ? `${entry.height}px` : (entry.height ?? \"400px\");\n const title = entry.title ?? \"Embedded HTML\";\n const safeHref = safeUrl(entry.url ?? entry.path);\n\n const frameRef = useRef<HTMLIFrameElement>(null);\n const [measuredHeight, setMeasuredHeight] = useState<number>();\n\n // Runs only on the client, so the server and the first client render agree on\n // the declared height and hydration is stable.\n useEffect(() => {\n if (entry.content === undefined) return;\n\n const onMessage = (event: MessageEvent) => {\n // The frame has an opaque origin (sandboxed without allow-same-origin),\n // so `event.origin` is \"null\" and proves nothing. Identity comes from the\n // source window instead: this is the only check separating our own frame\n // from every other script on the page posting at us.\n if (event.source !== frameRef.current?.contentWindow) return;\n\n const reported = (event.data as { __esHtmlHeight?: unknown } | null)?.__esHtmlHeight;\n if (typeof reported !== \"number\" || !Number.isFinite(reported) || reported <= 0) return;\n setMeasuredHeight(Math.min(reported, MAX_MEASURED_HEIGHT));\n };\n\n window.addEventListener(\"message\", onMessage);\n return () => window.removeEventListener(\"message\", onMessage);\n }, [entry.content]);\n\n const height = measuredHeight === undefined ? declaredHeight : `${measuredHeight}px`;\n\n // Exactly one of content / url / path is set. A url/path with an unsafe\n // scheme yields no src (the figure still renders, just empty).\n const frameProps =\n entry.content !== undefined\n ? { srcDoc: entry.content + MEASURE_SCRIPT }\n : { src: safeHref ?? \"\" };\n\n return (\n <figure className=\"my-3 overflow-hidden rounded-md border border-border\">\n <figcaption className=\"flex items-center justify-between border-b border-border bg-muted/40 px-3 py-1.5 text-xs font-medium text-muted-foreground\">\n <span>{entry.title ?? \"HTML\"}</span>\n {safeHref ? (\n <a\n href={safeHref}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n aria-label=\"Open in new tab\"\n title=\"Open in new tab\"\n className=\"text-primary\"\n >\n ↗\n </a>\n ) : null}\n </figcaption>\n <iframe\n ref={frameRef}\n {...frameProps}\n sandbox=\"allow-scripts\"\n loading=\"lazy\"\n title={title}\n className=\"block w-full border-0\"\n // Embedded HTML is authored standalone, so it assumes a light page. An\n // iframe with no background inherits the host's dark canvas (via the\n // report's `color-scheme`), leaving that authored dark text unreadable.\n style={{ height, colorScheme: \"light\", background: \"#fff\" }}\n />\n </figure>\n );\n}\n","import type { ReportDocState } from \"executable-stories-core\";\nimport { CodeFigure } from \"./DocCode\";\n\n/**\n * A `story.state()` snapshot in the step detail: label + pretty JSON, same\n * chrome as `code(json)`. Frame-to-frame diffs are the storyboard's job —\n * here the entry just shows what was captured at this step.\n */\nexport function DocState({ entry }: { entry: ReportDocState }) {\n let json: string;\n try {\n json = JSON.stringify(entry.value, null, 2) ?? String(entry.value);\n } catch {\n json = String(entry.value);\n }\n return (\n <CodeFigure label={entry.label ?? \"State\"}>\n <code className=\"font-mono text-xs language-json\">{json}</code>\n </CodeFigure>\n );\n}\n","import type { ReportDocCustom } from \"executable-stories-core\";\nimport { useCustomRenderers } from \"../../hooks/useRenderers\";\n\nexport function DocCustom({ entry }: { entry: ReportDocCustom }) {\n const renderers = useCustomRenderers();\n const renderer = renderers[entry.type];\n if (renderer) {\n return <>{renderer(entry)}</>;\n }\n return (\n <div className=\"my-2\" data-type={entry.type}>\n <p className=\"mb-1 text-xs font-medium text-muted-foreground\">{entry.type}</p>\n <pre tabIndex={0} className=\"overflow-x-auto rounded-md bg-muted p-3 font-mono text-xs text-foreground\">\n {safeStringify(entry.data)}\n </pre>\n </div>\n );\n}\n\nfunction safeStringify(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2);\n } catch {\n return String(value);\n }\n}\n","import type { ReportDocEntry } from \"executable-stories-core\";\nimport { DocNote } from \"./DocNote\";\nimport { DocTag } from \"./DocTag\";\nimport { DocKv } from \"./DocKv\";\nimport { DocCode } from \"./DocCode\";\nimport { DocTable } from \"./DocTable\";\nimport { DocLink } from \"./DocLink\";\nimport { DocSection } from \"./DocSection\";\nimport { DocMermaid } from \"./DocMermaid\";\nimport { DocScreenshot } from \"./DocScreenshot\";\nimport { DocVideo } from \"./DocVideo\";\nimport { DocHtml } from \"./DocHtml\";\nimport { DocState } from \"./DocState\";\nimport { DocCustom } from \"./DocCustom\";\n\nexport function DocEntry({ entry }: { entry: ReportDocEntry }) {\n switch (entry.kind) {\n case \"note\":\n return <DocNote entry={entry} />;\n case \"tag\":\n return <DocTag entry={entry} />;\n case \"kv\":\n return <DocKv entry={entry} />;\n case \"code\":\n return <DocCode entry={entry} />;\n case \"table\":\n return <DocTable entry={entry} />;\n case \"link\":\n return <DocLink entry={entry} />;\n case \"section\":\n return <DocSection entry={entry} />;\n case \"mermaid\":\n return <DocMermaid entry={entry} />;\n case \"screenshot\":\n return <DocScreenshot entry={entry} />;\n case \"video\":\n return <DocVideo entry={entry} />;\n case \"html\":\n return <DocHtml entry={entry} />;\n case \"state\":\n return <DocState entry={entry} />;\n case \"custom\":\n return <DocCustom entry={entry} />;\n }\n}\n","import type { ReportDocEntry } from \"executable-stories-core\";\nimport { DocEntry } from \"./doc/DocEntry\";\n\nexport interface ReportDocEntriesProps {\n entries: readonly ReportDocEntry[];\n}\n\nexport function ReportDocEntries({ entries }: ReportDocEntriesProps) {\n if (entries.length === 0) return null;\n return (\n <>\n {entries.map((entry, i) => (\n <DocEntry key={i} entry={entry} />\n ))}\n </>\n );\n}\n","import type { ReportScenario } from \"executable-stories-core\";\n// Subpath import: the core package root pulls in Node-only converters\n// (node:crypto), which breaks browser bundles — see formatDuration's import.\nimport { extractStoryboardFrames } from \"executable-stories-core/storyboard\";\nimport type { StoryboardFrame, StoryboardStateCard } from \"executable-stories-core/storyboard\";\nimport { summarizeStateChanges } from \"executable-stories-core/state-diff\";\nimport type { StateChangeKind } from \"executable-stories-core/state-diff\";\nimport { isLocalFsPath, safeImageUrl } from \"executable-stories-core/utils/url\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReportStoryboardProps {\n scenario: ReportScenario;\n}\n\nconst FRAME_GLYPH: Record<string, string> = {\n passed: \"✓\",\n failed: \"✗\",\n skipped: \"○\",\n pending: \"○\",\n};\n\nconst FRAME_GLYPH_COLOR: Record<string, string> = {\n passed: \"text-pass\",\n failed: \"text-fail\",\n skipped: \"text-skip\",\n pending: \"text-pend\",\n};\n\n/**\n * Storyboard — a horizontal filmstrip of the scenario's step evidence\n * (Given → When → Then), derived from the same step docs the vertical step\n * list renders. A frame is a container: the step's screenshot (when present)\n * plus its `story.state()` snapshot cards, so data-only scenarios get\n * filmstrips too. Each frame links to its step's anchor.\n *\n * Renders nothing below 2 frames: a single capture is evidence, not a\n * walkthrough, and it already shows under its step.\n *\n * Must stay hydration-free: the Astro story pages render this inside a static\n * (no client JS) island, so navigation is plain anchors and snapshot expansion\n * is a native <details> — no lightbox or toggle state.\n */\nexport function ReportStoryboard({ scenario }: ReportStoryboardProps) {\n const frames = extractStoryboardFrames(scenario);\n if (frames.length < 2) return null;\n return (\n <section data-slot=\"storyboard\" aria-label=\"Storyboard\" className=\"mb-3\">\n <h4 className=\"mb-1.5 text-xs font-semibold tracking-wide text-muted-foreground uppercase\">\n Storyboard\n </h4>\n <ol className=\"flex items-start gap-3 overflow-x-auto pb-2\">\n {frames.map((frame) => (\n <StoryboardFrameItem key={frame.stepId} frame={frame} />\n ))}\n </ol>\n </section>\n );\n}\n\nfunction StoryboardFrameItem({ frame }: { frame: StoryboardFrame }) {\n const label = `${frame.keyword} ${frame.text}`;\n const hasStates = frame.states.length > 0;\n const caption = (\n <p className=\"mt-1 flex items-baseline gap-1.5 text-[0.6875rem] leading-snug\">\n <span aria-hidden className={cn(\"shrink-0\", FRAME_GLYPH_COLOR[frame.status])}>\n {FRAME_GLYPH[frame.status] ?? \"○\"}\n </span>\n <span className=\"min-w-0\">\n <span className=\"font-mono font-semibold text-keyword\">{frame.keyword}</span>{\" \"}\n <span className=\"text-muted-foreground\">{frame.screenshot?.alt ?? frame.text}</span>\n </span>\n </p>\n );\n return (\n // State cards need room for diff rows; screenshot-only frames keep the\n // original narrow film-cell width (and DOM) unchanged.\n <li className={cn(\"shrink-0\", hasStates ? \"w-64\" : \"w-40\")}>\n {frame.screenshot ? (\n <FrameScreenshot frame={frame} label={label} />\n ) : null}\n {hasStates ? (\n <div className={cn(\"flex flex-col gap-1.5\", frame.screenshot && \"mt-1.5\")}>\n {frame.states.map((card, i) => (\n <StateCardView key={card.label ?? i} card={card} />\n ))}\n </div>\n ) : null}\n {frame.screenshot ? (\n caption\n ) : (\n // No screenshot means no image anchor, so the caption carries the\n // jump-to-step link instead.\n <a href={`#${frame.stepId}`} aria-label={`Jump to step: ${label}`} className=\"block hover:underline\">\n {caption}\n </a>\n )}\n </li>\n );\n}\n\nfunction FrameScreenshot({ frame, label }: { frame: StoryboardFrame; label: string }) {\n const path = frame.screenshot?.path ?? \"\";\n const src = isLocalFsPath(path) ? undefined : safeImageUrl(path);\n return (\n <a\n href={`#${frame.stepId}`}\n aria-label={`Jump to step: ${label}`}\n className=\"block overflow-hidden rounded-md border border-border transition-colors hover:border-ring\"\n >\n {src ? (\n <img\n src={src}\n alt={frame.screenshot?.alt ?? label}\n loading=\"lazy\"\n className=\"h-24 w-full bg-muted object-cover object-top\"\n />\n ) : (\n <span className=\"flex h-24 w-full items-center justify-center border-b border-dashed border-border bg-muted px-2 text-center text-[0.6875rem] text-muted-foreground\">\n Screenshot unavailable\n </span>\n )}\n </a>\n );\n}\n\n// Same accent scheme as the status badges/KPI cards: green = new, red = gone,\n// amber (skip tokens) = changed. Text + bg pairs are the AA-audited --es-*\n// combinations from tailwind.css.\nconst CHANGE_TONE: Record<StateChangeKind, string> = {\n added: \"bg-pass-bg text-pass\",\n removed: \"bg-fail-bg text-fail\",\n changed: \"bg-skip-bg text-skip\",\n};\n\nfunction prettyJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2) ?? String(value);\n } catch {\n return String(value);\n }\n}\n\n/**\n * One `story.state()` snapshot card: label chip, then what changed since the\n * previous frame's snapshot of the same label (changed fields first, full\n * snapshot behind a disclosure). First appearance shows the snapshot itself\n * with a \"first capture\" hint — there is nothing to diff against yet.\n */\nfunction StateCardView({ card }: { card: StoryboardStateCard }) {\n const json = prettyJson(card.value);\n const firstCapture = card.changes === undefined;\n return (\n <div data-slot=\"state-card\" className=\"rounded-md border border-border bg-card p-2\">\n <p className=\"flex flex-wrap items-baseline gap-1.5\">\n <span className=\"inline-flex rounded-full border border-border px-1.5 font-mono text-[0.625rem] font-medium text-muted-foreground\">\n {card.label ?? \"State\"}\n </span>\n {firstCapture ? (\n <span className=\"text-[0.625rem] text-muted-foreground italic\">first capture</span>\n ) : null}\n </p>\n {!firstCapture &&\n (card.changes && card.changes.length > 0 ? (\n <ul className=\"mt-1.5 flex flex-col gap-0.5\">\n {card.changes.map((change, i) => (\n <li\n key={i}\n className={cn(\n \"rounded-sm px-1.5 py-0.5 font-mono text-[0.625rem] leading-snug break-all\",\n CHANGE_TONE[change.kind]\n )}\n >\n {summarizeStateChanges([change])[0]}\n </li>\n ))}\n </ul>\n ) : (\n <p className=\"mt-1.5 text-[0.625rem] text-muted-foreground\">No changes</p>\n ))}\n <details\n // First capture opens short snapshots by default: it IS the card's\n // content. Diff cards keep the snapshot collapsed — the rows above\n // already tell the story.\n open={firstCapture && json.length <= 240}\n className={cn(firstCapture ? \"mt-1.5\" : \"mt-1\")}\n >\n <summary className=\"cursor-pointer text-[0.625rem] text-muted-foreground hover:text-foreground\">\n Snapshot\n </summary>\n <pre tabIndex={0} className=\"mt-1 max-h-48 overflow-auto rounded-sm bg-muted p-1.5 font-mono text-[0.625rem] leading-snug\">\n {json}\n </pre>\n </details>\n </div>\n );\n}\n","import type { ReportAttachment } from \"executable-stories-core\";\n\n/**\n * Renders scenario attachments. Base64 images embed inline; everything else\n * becomes a labelled data-URI download link. Mirrors the report's attachments\n * block (which also inlines images and links other media).\n */\nexport function ReportAttachments({ attachments }: { attachments: ReportAttachment[] }) {\n if (attachments.length === 0) return null;\n return (\n // role=\"group\" (not a labelled <section>) so multiple scenarios' attachment\n // blocks don't create duplicate \"Attachments\" region landmarks.\n <div role=\"group\" aria-label=\"Attachments\" className=\"mt-3 flex flex-col gap-2\">\n {attachments.map((att, i) => {\n const dataUri =\n att.contentEncoding === \"BASE64\"\n ? `data:${att.mediaType};base64,${att.body}`\n : `data:${att.mediaType},${encodeURIComponent(att.body)}`;\n const isImage = att.mediaType.startsWith(\"image/\");\n return (\n <figure key={`${att.name}-${i}`} className=\"m-0\">\n {isImage ? (\n <>\n <img\n src={dataUri}\n alt={att.name}\n loading=\"lazy\"\n className=\"max-w-full rounded-md border border-border\"\n />\n <figcaption className=\"mt-1 text-xs text-muted-foreground\">{att.name}</figcaption>\n </>\n ) : (\n <a\n href={dataUri}\n download={att.name}\n className=\"text-xs text-link underline underline-offset-2\"\n >\n {att.name} <span className=\"text-muted-foreground\">({att.mediaType})</span>\n </a>\n )}\n </figure>\n );\n })}\n </div>\n );\n}\n","import type { OtelSpan } from \"executable-stories-core/types/otel\";\nimport { formatDuration } from \"executable-stories-core/utils/duration\";\nimport { toTraceRows, traceWindow } from \"@/lib/trace\";\nimport { cn } from \"@/lib/utils\";\n\nconst BAR_COLOR: Record<string, string> = {\n ok: \"bg-pass\",\n error: \"bg-fail\",\n unset: \"bg-skip\",\n};\n\n/**\n * OTel trace waterfall. Collapsed by default (native <details>, no JS) so it\n * renders in both the static and interactive reports. Each span is a row with a\n * depth-indented name and a bar positioned/sized by its time window.\n */\nexport function ReportTrace({ spans }: { spans: readonly OtelSpan[] | undefined }) {\n if (!spans || spans.length === 0) return null;\n const rows = toTraceRows(spans);\n if (rows.length === 0) return null;\n const { minStartMs, totalMs } = traceWindow(rows);\n\n return (\n <details className=\"mt-3 rounded-md border border-border bg-muted/30\">\n <summary className=\"cursor-pointer px-3 py-2 text-xs font-medium text-muted-foreground\">\n Trace ({rows.length} span{rows.length === 1 ? \"\" : \"s\"}, {formatDuration(totalMs)})\n </summary>\n <ul className=\"flex flex-col gap-0.5 px-3 pb-3 font-mono text-[0.6875rem]\">\n {rows.map((row, i) => {\n const leftPct = ((row.startTimeMs - minStartMs) / totalMs) * 100;\n const widthPct = Math.max((row.durationMs / totalMs) * 100, 0.5);\n return (\n <li key={`${row.spanId}-${i}`} className=\"flex items-center gap-2\">\n <span\n className=\"min-w-0 flex-1 truncate text-foreground\"\n style={{ paddingLeft: `${row.depth * 12}px` }}\n title={row.statusMessage ? `${row.name}: ${row.statusMessage}` : row.name}\n >\n {row.name}\n </span>\n <span className=\"relative h-3 w-1/2 shrink-0 overflow-hidden rounded-sm bg-border/40\">\n <span\n className={cn(\"absolute top-0 h-full rounded-sm\", BAR_COLOR[row.status])}\n style={{ left: `${leftPct}%`, width: `${widthPct}%` }}\n />\n </span>\n <span className=\"w-16 shrink-0 text-right text-muted-foreground\">\n {formatDuration(row.durationMs)}\n </span>\n </li>\n );\n })}\n </ul>\n </details>\n );\n}\n","/**\n * Pure span normalization + tree building for the OTel trace waterfall.\n * Ported from the formatters trace-view renderer so the React waterfall shows\n * the same structure. Side-effect-free for unit testing.\n */\n\nimport type { OtelSpan } from \"executable-stories-core/types/otel\";\n\nexport interface NormalizedSpan {\n spanId: string;\n parentSpanId?: string;\n name: string;\n startTimeMs: number;\n durationMs: number;\n status: \"ok\" | \"error\" | \"unset\";\n statusMessage?: string;\n}\n\nexport interface TraceRow extends NormalizedSpan {\n depth: number;\n}\n\nconst VALID = new Set([\"ok\", \"error\", \"unset\"]);\nconst safeStatus = (s: string): NormalizedSpan[\"status\"] => (VALID.has(s) ? (s as NormalizedSpan[\"status\"]) : \"unset\");\n\nexport function normalizeSpans(spans: readonly OtelSpan[]): NormalizedSpan[] {\n const out: NormalizedSpan[] = [];\n for (const span of spans) {\n if (!span || typeof span.spanId !== \"string\" || typeof span.name !== \"string\") continue;\n let startTimeMs: number;\n let durationMs: number;\n if (span.startTimeMs != null && span.durationMs != null) {\n startTimeMs = span.startTimeMs;\n durationMs = span.durationMs;\n } else if (span.startTimeUnixNano != null && span.endTimeUnixNano != null) {\n startTimeMs = span.startTimeUnixNano / 1e6;\n durationMs = (span.endTimeUnixNano - span.startTimeUnixNano) / 1e6;\n } else {\n continue;\n }\n durationMs = Math.max(0, durationMs);\n if (!isFinite(startTimeMs) || !isFinite(durationMs)) continue;\n out.push({\n spanId: span.spanId,\n parentSpanId: span.parentSpanId,\n name: span.name,\n startTimeMs,\n durationMs,\n status: safeStatus(span.status),\n statusMessage: span.statusMessage,\n });\n }\n return out;\n}\n\n/** Flatten spans into rows in tree order with a depth, parent before children. */\nexport function toTraceRows(spans: readonly OtelSpan[]): TraceRow[] {\n const normalized = normalizeSpans(spans);\n if (normalized.length === 0) return [];\n\n interface Node {\n span: NormalizedSpan;\n children: Node[];\n depth: number;\n }\n const byId = new Map<string, Node>();\n for (const span of normalized) {\n let key = span.spanId;\n let suffix = 2;\n while (byId.has(key)) key = `${span.spanId}__dup${suffix++}`;\n byId.set(key, { span: { ...span, spanId: key }, children: [], depth: 0 });\n }\n\n const roots: Node[] = [];\n for (const node of byId.values()) {\n const parent = node.span.parentSpanId ? byId.get(node.span.parentSpanId) : undefined;\n if (parent && parent !== node) parent.children.push(node);\n else roots.push(node);\n }\n for (const node of byId.values()) node.children.sort((a, b) => a.span.startTimeMs - b.span.startTimeMs);\n roots.sort((a, b) => a.span.startTimeMs - b.span.startTimeMs);\n\n const rows: TraceRow[] = [];\n const seen = new Set<string>();\n const walk = (node: Node, depth: number): void => {\n if (seen.has(node.span.spanId)) return;\n seen.add(node.span.spanId);\n rows.push({ ...node.span, depth });\n for (const child of node.children) walk(child, depth + 1);\n };\n for (const root of roots) walk(root, 0);\n // Orphans from cycles: promote to depth 0.\n for (const node of byId.values()) {\n if (!seen.has(node.span.spanId)) walk(node, 0);\n }\n return rows;\n}\n\nexport interface TraceWindow {\n minStartMs: number;\n totalMs: number;\n}\n\nexport function traceWindow(rows: readonly TraceRow[]): TraceWindow {\n let min = Infinity;\n let max = -Infinity;\n for (const r of rows) {\n min = Math.min(min, r.startTimeMs);\n max = Math.max(max, r.startTimeMs + r.durationMs);\n }\n const total = max - min;\n return { minStartMs: isFinite(min) ? min : 0, totalMs: total > 0 ? total : 1 };\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { ScenarioHistoryMap } from \"../lib/run-history\";\n\n/**\n * Provided only inside <ReportInteractive> when the CLI embedded a run\n * history (--history-file). When null (the static <Report/> render,\n * Storybook, Astro), scenario cards simply omit the history strip.\n */\nconst ScenarioHistoryContext = createContext<ScenarioHistoryMap | null>(null);\n\nexport const ScenarioHistoryProvider = ScenarioHistoryContext.Provider;\n\nexport function useScenarioHistory(): ScenarioHistoryMap | null {\n return useContext(ScenarioHistoryContext);\n}\n","export type ScenarioRunStatus = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\n/** One historical run of a scenario, oldest → newest in a history array. */\nexport interface ScenarioRunEvent {\n /** Epoch ms the run started. */\n timestamp: number;\n status: ScenarioRunStatus;\n runId?: string;\n durationMs?: number;\n commitSha?: string;\n branch?: string;\n}\n\n/** Recent run events keyed by ReportScenario.id. */\nexport type ScenarioHistoryMap = Record<string, ScenarioRunEvent[]>;\n\nexport interface RunStreak {\n status: ScenarioRunStatus;\n /** How many consecutive trailing runs share that status (≥1). */\n count: number;\n}\n\n/** The trailing same-status streak — \"passing for 5 runs\", \"failing for 2\". */\nexport function currentStreak(entries: readonly ScenarioRunEvent[]): RunStreak | undefined {\n const last = entries[entries.length - 1];\n if (!last) return undefined;\n let count = 0;\n for (let i = entries.length - 1; i >= 0 && entries[i]!.status === last.status; i--) count++;\n return { status: last.status, count };\n}\n\nconst STREAK_VERB: Record<ScenarioRunStatus, string> = {\n passed: \"Passing\",\n failed: \"Failing\",\n skipped: \"Skipped\",\n pending: \"Pending\",\n};\n\n/** Short human summary of a history window, used for the strip's tooltip. */\nexport function describeRunHistory(entries: readonly ScenarioRunEvent[]): string {\n const passed = entries.filter((e) => e.status === \"passed\").length;\n const base = `${passed}/${entries.length} runs passed`;\n const streak = currentStreak(entries);\n if (!streak || entries.length < 2) return base;\n return `${base} · ${STREAK_VERB[streak.status]} for the last ${streak.count === 1 ? \"run\" : `${streak.count} runs`}`;\n}\n\nexport type FlakinessLevel = \"stable\" | \"unstable\" | \"flaky\";\n\n/**\n * Below this many pass/fail samples a scenario is always \"stable\" — mirrors\n * MIN_FLAKINESS_SAMPLES in the formatters history module, which owns the\n * canonical thresholds. Keep the two in sync.\n */\nconst MIN_FLAKINESS_SAMPLES = 3;\n\n/**\n * Status-transition flakiness over a scenario's recent runs. Same\n * classification as the CLI history module (`calculateFlakiness`), ported so\n * the island stays self-sufficient on the embedded history JSON.\n */\nexport function flakinessOf(entries: readonly ScenarioRunEvent[]): FlakinessLevel {\n const countable = entries.filter((e) => e.status === \"passed\" || e.status === \"failed\");\n if (countable.length < MIN_FLAKINESS_SAMPLES) return \"stable\";\n\n let transitions = 0;\n for (let i = 1; i < countable.length; i++) {\n if (countable[i]!.status !== countable[i - 1]!.status) transitions++;\n }\n const transitionScore = transitions / (countable.length - 1);\n const failureRate = countable.filter((e) => e.status === \"failed\").length / countable.length;\n\n if (transitionScore > 0.5 || (transitionScore > 0.3 && failureRate > 0.2)) return \"flaky\";\n if (transitionScore > 0.2 || failureRate > 0.3) return \"unstable\";\n return \"stable\";\n}\n\nexport interface ScenarioRef {\n id: string;\n title: string;\n}\n\nexport interface LastRunDelta {\n /** Failed in this run, not failed in the previous one. */\n newlyFailing: ScenarioRef[];\n /** Passed in this run, failed in the previous one. */\n newlyPassing: ScenarioRef[];\n /** First appearance in the history window — no previous run to compare. */\n added: ScenarioRef[];\n}\n\n/**\n * What changed between the previous run and this one, for the report-header\n * strip. The history store appends the current run before the report is\n * generated, so each scenario's last entry IS this run and the entry before\n * it is the previous run. Returns undefined when no scenario has a previous\n * run to compare against (first run with history enabled).\n */\nexport function diffSinceLastRun(\n history: ScenarioHistoryMap,\n scenarios: readonly ScenarioRef[],\n): LastRunDelta | undefined {\n let hasPreviousRun = false;\n const delta: LastRunDelta = { newlyFailing: [], newlyPassing: [], added: [] };\n\n for (const scenario of scenarios) {\n const entries = history[scenario.id];\n if (!entries || entries.length === 0) continue;\n const last = entries[entries.length - 1]!;\n const prev = entries[entries.length - 2];\n if (!prev) {\n delta.added.push(scenario);\n continue;\n }\n hasPreviousRun = true;\n if (last.status === \"failed\" && prev.status !== \"failed\") delta.newlyFailing.push(scenario);\n else if (last.status === \"passed\" && prev.status === \"failed\") delta.newlyPassing.push(scenario);\n }\n\n return hasPreviousRun ? delta : undefined;\n}\n","import { useScenarioHistory } from \"../interactive/scenario-history-context\";\nimport { describeRunHistory, flakinessOf, type ScenarioRunEvent, type ScenarioRunStatus } from \"../lib/run-history\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/lib/utils\";\n\n/** How many trailing runs the strip shows; older entries stay in the tooltip count. */\nconst MAX_DOTS = 10;\n\nconst DOT_COLOR: Record<ScenarioRunStatus, string> = {\n passed: \"bg-pass\",\n failed: \"bg-fail\",\n skipped: \"bg-skip\",\n pending: \"bg-pend\",\n};\n\nfunction dotTitle(e: ScenarioRunEvent): string {\n const parts = [new Date(e.timestamp).toLocaleString(), e.status];\n if (e.commitSha) parts.push(e.commitSha.slice(0, 8));\n return parts.join(\" · \");\n}\n\n/**\n * Compact run-over-run timeline for one scenario: a dot per recent run,\n * oldest → newest. Renders nothing outside <ReportInteractive> or when the\n * report was generated without --history-file — history is presentation-layer\n * data and never part of the StoryReport contract.\n */\nexport function ScenarioRunHistory({ scenarioId }: { scenarioId: string }) {\n const history = useScenarioHistory();\n const entries = history?.[scenarioId];\n if (!entries || entries.length < 2) return null; // one run = no timeline yet\n\n const recent = entries.slice(-MAX_DOTS);\n // Judge flakiness on the same window the dots show, so the badge never\n // contradicts the strip next to it.\n const flaky = flakinessOf(recent) === \"flaky\";\n const summary = flaky ? `${describeRunHistory(recent)} · Flaky` : describeRunHistory(recent);\n\n return (\n <>\n {flaky ? (\n <Badge variant=\"pending\" aria-label=\"Flaky: status flips between recent runs\" title={summary}>\n Flaky\n </Badge>\n ) : null}\n <span\n role=\"img\"\n aria-label={`Run history: ${summary}`}\n title={summary}\n className=\"flex shrink-0 items-center gap-[3px]\"\n >\n {recent.map((e, i) => (\n <span\n key={`${e.timestamp}-${i}`}\n aria-hidden\n title={dotTitle(e)}\n className={cn(\n \"inline-block size-1.5 rounded-full\",\n DOT_COLOR[e.status],\n // The newest run (rightmost dot) is the one the card's status\n // badge already describes; ring it so the timeline reads as\n // \"…leading up to now\".\n i === recent.length - 1 && \"ring-1 ring-border ring-offset-1 ring-offset-card\",\n )}\n />\n ))}\n </span>\n </>\n );\n}\n","\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { formatRelativeAge, isReportStale } from \"../lib/provenance\";\nimport { useScenarioFreshness } from \"../interactive/scenario-freshness-context\";\nimport { Badge } from \"@/components/ui/badge\";\n\n/**\n * Per-scenario age signal.\n *\n * A report assembled from accumulated runs can be freshly rendered while some\n * of its scenarios last ran weeks ago. The report-level banner speaks for the\n * run, not for those scenarios, so without this the carried-over ones borrow a\n * freshness they have not earned.\n *\n * Only scenarios that are actually old say anything: a scenario that ran in\n * this run is the normal case and adds no badge. Age is computed on mount for\n * the same reason the report banner does it — static HTML is generated once and\n * read later, so an age baked in at build time would lie.\n */\nexport function ScenarioStaleness({ scenario }: { scenario: { lastRunAtMs?: number } }) {\n const freshness = useScenarioFreshness();\n const fixedNow = freshness?.nowMs;\n const [now, setNow] = useState<number | undefined>(fixedNow);\n\n useEffect(() => {\n if (fixedNow === undefined) setNow(Date.now());\n }, [fixedNow]);\n\n if (!freshness || now === undefined) return null;\n\n // No stamp means the report predates stamping, or came straight from one run.\n // Either way the report-level signal already speaks for it.\n const lastRunAtMs = scenario.lastRunAtMs;\n if (!lastRunAtMs || lastRunAtMs <= 0) return null;\n if (!isReportStale(lastRunAtMs, freshness.staleAfterDays, now)) return null;\n\n return (\n <Badge variant=\"outline\" aria-label=\"Scenario freshness\">\n Last ran {formatRelativeAge(lastRunAtMs, now)}\n </Badge>\n );\n}\n","import type { StoryReport } from \"executable-stories-core\";\n\ntype ReportCI = NonNullable<StoryReport[\"ci\"]>;\n\n/**\n * Epoch ms of the run the report documents — the staleness reference.\n * Prefers finishedAtMs; falls back to startedAtMs for reports from adapters\n * that only stamp a start time.\n */\nexport function reportLastRunMs(\n report: Pick<StoryReport, \"startedAtMs\" | \"finishedAtMs\">,\n): number | undefined {\n if (report.finishedAtMs && report.finishedAtMs > 0) return report.finishedAtMs;\n if (report.startedAtMs && report.startedAtMs > 0) return report.startedAtMs;\n return undefined;\n}\n\n/**\n * Epoch ms of the run that produced one scenario.\n *\n * A report assembled from accumulated runs holds scenarios that last ran at\n * different times, so the run-level timestamp overstates how fresh most of them\n * are. Falls back to the report for scenarios recorded before stamping, and for\n * reports rendered straight from a single run.\n */\nexport function scenarioLastRunMs(\n scenario: { lastRunAtMs?: number },\n report: Pick<StoryReport, \"startedAtMs\" | \"finishedAtMs\">,\n): number | undefined {\n if (scenario.lastRunAtMs && scenario.lastRunAtMs > 0) return scenario.lastRunAtMs;\n return reportLastRunMs(report);\n}\n\n/**\n * Human-readable age like \"just now\", \"5 minutes ago\", \"3 hours ago\",\n * \"12 days ago\". Clock skew (thenMs in the future) reads as \"just now\".\n */\nexport function formatRelativeAge(thenMs: number, nowMs: number): string {\n const deltaMs = Math.max(0, nowMs - thenMs);\n const minutes = Math.floor(deltaMs / 60_000);\n if (minutes < 1) return \"just now\";\n if (minutes < 60) return `${minutes} minute${minutes === 1 ? \"\" : \"s\"} ago`;\n const hours = Math.floor(minutes / 60);\n if (hours < 24) return `${hours} hour${hours === 1 ? \"\" : \"s\"} ago`;\n const days = Math.floor(hours / 24);\n return `${days} day${days === 1 ? \"\" : \"s\"} ago`;\n}\n\n/**\n * A report is stale once its run is `staleAfterDays` or more days old.\n * A threshold of 0 (or negative) disables staleness entirely.\n */\nexport function isReportStale(\n lastRunMs: number | undefined,\n staleAfterDays: number,\n nowMs: number,\n): boolean {\n if (lastRunMs === undefined || staleAfterDays <= 0) return false;\n return nowMs - lastRunMs >= staleAfterDays * 86_400_000;\n}\n\n/**\n * StoryReport.ci.name carries the raw transport name — lowercase provider\n * keys (\"github\") from env detection, or a free-form string from older\n * adapters (\"GitHub Actions\"). Map the known keys to display names and pass\n * everything else through.\n */\nconst CI_DISPLAY_NAMES: Record<string, string> = {\n github: \"GitHub Actions\",\n gitlab: \"GitLab CI\",\n circleci: \"CircleCI\",\n jenkins: \"Jenkins\",\n azure: \"Azure DevOps\",\n buildkite: \"Buildkite\",\n travis: \"Travis CI\",\n ci: \"CI\",\n};\n\nexport function ciDisplayName(name: string): string {\n return CI_DISPLAY_NAMES[name] ?? name;\n}\n\n/**\n * Derive a browsable commit URL from the CI run URL, for the providers whose\n * URL structure makes that safe:\n * GitHub Actions …/owner/repo/actions/runs/123 -> …/owner/repo/commit/<sha>\n * GitLab CI …/group/project/-/pipelines/123 -> …/group/project/-/commit/<sha>\n * Other providers return undefined (a wrong link is worse than none).\n */\nexport function commitUrl(ci: ReportCI | undefined, sha: string | undefined): string | undefined {\n const commitSha = ci?.commitSha ?? sha;\n if (!ci?.url || !commitSha) return undefined;\n\n const github = ci.url.match(/^(https?:\\/\\/[^/]+\\/[^/]+\\/[^/]+)\\/actions\\/runs\\//);\n if (github) return `${github[1]}/commit/${commitSha}`;\n\n const gitlab = ci.url.match(/^(https?:\\/\\/.+)\\/-\\/pipelines\\//);\n if (gitlab) return `${gitlab[1]}/-/commit/${commitSha}`;\n\n return undefined;\n}\n\n/**\n * Derive a pull-request URL for GitHub-shaped CI run URLs. GitLab and the\n * rest return undefined for the same wrong-link-is-worse-than-none reason.\n */\nexport function prUrl(ci: ReportCI | undefined): string | undefined {\n if (!ci?.url || !ci.prNumber) return undefined;\n const github = ci.url.match(/^(https?:\\/\\/[^/]+\\/[^/]+\\/[^/]+)\\/actions\\/runs\\//);\n if (github) return `${github[1]}/pull/${ci.prNumber}`;\n return undefined;\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { StoryReport } from \"executable-stories-core\";\n\nexport interface ScenarioFreshness {\n /** Days before a scenario counts as stale; 0 disables the signal. */\n staleAfterDays: number;\n /** The run being rendered, used for scenarios carrying no stamp of their own. */\n report: Pick<StoryReport, \"startedAtMs\" | \"finishedAtMs\">;\n /** Test seam: fixed \"now\". Left undefined, the badge reads the clock on mount. */\n nowMs?: number;\n}\n\n/**\n * Provided only where a report knows its staleness threshold. When null (a bare\n * <Report/> render, Storybook), scenario cards simply omit the age signal —\n * same shape as the run-history context.\n */\nconst ScenarioFreshnessContext = createContext<ScenarioFreshness | null>(null);\n\nexport const ScenarioFreshnessProvider = ScenarioFreshnessContext.Provider;\n\nexport function useScenarioFreshness(): ScenarioFreshness | null {\n return useContext(ScenarioFreshnessContext);\n}\n","\"use client\";\n\nimport { createContext, useCallback, useContext, useState } from \"react\";\n\nexport interface CollapseApi {\n isCollapsed: (id: string) => boolean;\n toggle: (id: string) => void;\n}\n\n/**\n * Provided only inside <ReportInteractive>. When null (the static <Report/>\n * render, Storybook, Astro), components render fully expanded with no toggle\n * affordance — so the static path and component-tier tests are unaffected.\n */\nconst CollapseContext = createContext<CollapseApi | null>(null);\n\nexport const CollapseProvider = CollapseContext.Provider;\n\nexport function useCollapse(): CollapseApi | null {\n return useContext(CollapseContext);\n}\n\nconst STORAGE_KEY = \"es-collapsed-ids\";\n\n/** Returns the persisted collapsed set, or null when the user has never set one\n * (so the caller can fall back to a data-driven default like failures-first). */\nfunction readPersisted(): Set<string> | null {\n if (typeof localStorage === \"undefined\") return null;\n try {\n const raw = localStorage.getItem(STORAGE_KEY);\n return raw ? new Set(JSON.parse(raw) as string[]) : null;\n } catch {\n return null;\n }\n}\n\nfunction persist(ids: Set<string>): void {\n if (typeof localStorage === \"undefined\") return;\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify([...ids]));\n } catch {\n /* quota / disabled — collapse still works for the session */\n }\n}\n\n/**\n * Collapse state for the interactive report: a persisted set of collapsed\n * feature/scenario ids, plus expand-all / collapse-all. `computeDefault` seeds\n * the initial set the FIRST time (nothing persisted yet) — the report uses it\n * to open failures and collapse the rest, so a broken run reveals what failed\n * without a click. Once the user toggles anything, their choice persists and\n * wins over the default.\n */\nexport function useCollapseState(computeDefault?: () => Set<string>) {\n const [collapsed, setCollapsed] = useState<Set<string>>(\n () => readPersisted() ?? computeDefault?.() ?? new Set<string>(),\n );\n\n const isCollapsed = useCallback((id: string) => collapsed.has(id), [collapsed]);\n\n const toggle = useCallback((id: string) => {\n setCollapsed((prev) => {\n const next = new Set(prev);\n if (next.has(id)) next.delete(id);\n else next.add(id);\n persist(next);\n return next;\n });\n }, []);\n\n const collapseAll = useCallback((ids: string[]) => {\n setCollapsed(() => {\n const next = new Set(ids);\n persist(next);\n return next;\n });\n }, []);\n\n const expandAll = useCallback(() => {\n setCollapsed(() => {\n const next = new Set<string>();\n persist(next);\n return next;\n });\n }, []);\n\n return { api: { isCollapsed, toggle } as CollapseApi, collapseAll, expandAll };\n}\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\nimport type { ReportScenario } from \"executable-stories-core\";\n// Deep import, NOT the package barrel: core's index pulls in Node-only modules\n// (attachment resolution reads the filesystem), which a browser bundler cannot\n// resolve. Types erase at compile time, so the type-only import above is safe;\n// this one is a value and must stay on the fs-free subpath.\nimport { scenarioToMarkdown as coreScenarioToMarkdown } from \"executable-stories-core/utils/scenario-markdown\";\n\nexport interface ScenarioActions {\n copyLink: (scenario: ReportScenario) => void;\n copyMarkdown: (scenario: ReportScenario) => void;\n copyPrompt: (scenario: ReportScenario) => void;\n}\n\n/**\n * Provided only inside <ReportInteractive>. When null (static render), scenarios\n * show no per-scenario action buttons.\n */\nconst ScenarioActionsContext = createContext<ScenarioActions | null>(null);\nexport const ScenarioActionsProvider = ScenarioActionsContext.Provider;\nexport function useScenarioActions(): ScenarioActions | null {\n return useContext(ScenarioActionsContext);\n}\n\n/**\n * A scenario rendered as Markdown — for pasting into PRs / issues / docs.\n *\n * Delegates to the shared serializer in core (`variant: \"compact\"`), the same\n * one behind the Astro site's `<slug>.md` twin endpoints, so what you copy here\n * and what an agent fetches there can never drift.\n */\nexport function scenarioToMarkdown(scenario: ReportScenario): string {\n return coreScenarioToMarkdown(scenario, { variant: \"compact\" });\n}\n\n/**\n * A failed scenario rendered as an investigation prompt for an AI agent — the\n * \"cheap to verify\" loop: hand the agent the failing behaviour + error verbatim.\n */\nexport function scenarioToPrompt(scenario: ReportScenario): string {\n const lines: string[] = [\n `A test scenario is ${scenario.status}. Investigate the likely cause and propose a fix.`,\n \"\",\n `Scenario: ${scenario.title}`,\n \"Steps:\",\n ];\n for (const step of scenario.steps) {\n const mark = step.status === \"failed\" ? \" ⟵ failed here\" : \"\";\n lines.push(` ${step.keyword} ${step.text}${mark}`);\n }\n if (scenario.errorMessage) {\n lines.push(\"\", \"Error:\", scenario.errorMessage.trim());\n }\n if (scenario.errorStack) {\n lines.push(\"\", \"Stack:\", scenario.errorStack.trim());\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * Every failure in the run as ONE prompt. A red run is rarely one broken thing,\n * and copying scenarios one at a time loses the shape of the breakage — the\n * agent that sees all three at once can spot the shared cause.\n */\nexport function failuresToPrompt(scenarios: readonly ReportScenario[]): string {\n if (scenarios.length === 0) return \"\";\n const noun = scenarios.length === 1 ? \"test scenario is\" : \"test scenarios are\";\n const lines: string[] = [\n `${scenarios.length} ${noun} failing. Investigate the likely cause (they may share one) and propose a fix.`,\n ];\n scenarios.forEach((scenario, i) => {\n lines.push(\"\", `${i + 1}. ${scenario.title}`, \"Steps:\");\n for (const step of scenario.steps) {\n const mark = step.status === \"failed\" ? \" ⟵ failed here\" : \"\";\n lines.push(` ${step.keyword} ${step.text}${mark}`);\n }\n if (scenario.errorMessage) {\n lines.push(\"Error:\", scenario.errorMessage.trim());\n }\n });\n return lines.join(\"\\n\");\n}\n\n/** Absolute permalink to a scenario in the current document. */\nexport function scenarioPermalink(scenario: ReportScenario): string {\n if (typeof location === \"undefined\") return `#${scenario.id}`;\n return `${location.href.split(\"#\")[0]}#${scenario.id}`;\n}\n","import * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n \"flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn(\"leading-none font-semibold\", className)}\n {...props}\n />\n )\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\n \"col-start-2 row-span-2 row-start-1 self-start justify-self-end\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn(\"px-6\", className)}\n {...props}\n />\n )\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn(\"flex items-center px-6 [.border-t]:pt-6\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardAction,\n CardDescription,\n CardContent,\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Menu as MenuPrimitive } from \"@base-ui/react/menu\"\nimport { CheckIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst itemClasses =\n \"relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground\"\n\nfunction DropdownMenu(props: React.ComponentProps<typeof MenuPrimitive.Root>) {\n return <MenuPrimitive.Root data-slot=\"dropdown-menu\" {...props} />\n}\n\nfunction DropdownMenuTrigger(\n props: React.ComponentProps<typeof MenuPrimitive.Trigger>,\n) {\n return <MenuPrimitive.Trigger data-slot=\"dropdown-menu-trigger\" {...props} />\n}\n\nfunction DropdownMenuContent({\n className,\n align = \"end\",\n sideOffset = 4,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.Popup> & {\n align?: MenuPrimitive.Positioner.Props[\"align\"]\n sideOffset?: MenuPrimitive.Positioner.Props[\"sideOffset\"]\n}) {\n return (\n <MenuPrimitive.Portal>\n <MenuPrimitive.Positioner\n data-slot=\"dropdown-menu-positioner\"\n className=\"z-50\"\n align={align}\n sideOffset={sideOffset}\n >\n <MenuPrimitive.Popup\n data-slot=\"dropdown-menu-content\"\n className={cn(\n \"z-50 min-w-[11rem] origin-[var(--transform-origin)] overflow-hidden rounded-md border border-border bg-popover p-1 font-sans text-sm text-popover-foreground shadow-md transition-[opacity,transform] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n className,\n )}\n {...props}\n />\n </MenuPrimitive.Positioner>\n </MenuPrimitive.Portal>\n )\n}\n\nfunction DropdownMenuItem({\n className,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.Item>) {\n return (\n <MenuPrimitive.Item\n data-slot=\"dropdown-menu-item\"\n className={cn(itemClasses, className)}\n {...props}\n />\n )\n}\n\nfunction DropdownMenuLabel({\n className,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.GroupLabel>) {\n return (\n <MenuPrimitive.GroupLabel\n data-slot=\"dropdown-menu-label\"\n className={cn(\"px-2 py-1.5 text-xs font-medium text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\n// Base UI's Menu has no Separator part; a plain divider row is equivalent.\nfunction DropdownMenuSeparator({ className }: { className?: string }) {\n return <div role=\"separator\" className={cn(\"-mx-1 my-1 h-px bg-border\", className)} />\n}\n\nfunction DropdownMenuRadioGroup(\n props: React.ComponentProps<typeof MenuPrimitive.RadioGroup>,\n) {\n return <MenuPrimitive.RadioGroup data-slot=\"dropdown-menu-radio-group\" {...props} />\n}\n\nfunction DropdownMenuRadioItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.RadioItem>) {\n return (\n <MenuPrimitive.RadioItem\n data-slot=\"dropdown-menu-radio-item\"\n className={cn(itemClasses, \"pl-8\", className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <MenuPrimitive.RadioItemIndicator>\n <CheckIcon className=\"size-4 text-foreground\" />\n </MenuPrimitive.RadioItemIndicator>\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n )\n}\n\nfunction DropdownMenuCheckboxItem({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof MenuPrimitive.CheckboxItem>) {\n return (\n <MenuPrimitive.CheckboxItem\n data-slot=\"dropdown-menu-checkbox-item\"\n className={cn(itemClasses, \"pl-8\", className)}\n {...props}\n >\n <span className=\"absolute left-2 flex size-3.5 items-center justify-center\">\n <MenuPrimitive.CheckboxItemIndicator>\n <CheckIcon className=\"size-4\" />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n )\n}\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuCheckboxItem,\n}\n","import type { ReportFeature } from \"executable-stories-core\";\nimport { ReportScenario } from \"./ReportScenario\";\n\nexport interface ReportScenarioListProps {\n feature: ReportFeature;\n}\n\nexport function ReportScenarioList({ feature }: ReportScenarioListProps) {\n return (\n <>\n {feature.scenarios.map((scenario) => (\n <ReportScenario key={scenario.id} scenario={scenario} />\n ))}\n </>\n );\n}\n","import type { ReportFeature } from \"executable-stories-core\";\nimport { dedent, safeMarkdownHtml } from \"../lib/markdown\";\n\nexport interface ReportFeatureIntroProps {\n feature: ReportFeature;\n}\n\n/**\n * What the feature is for, ahead of the scenarios that prove it.\n *\n * Scenarios answer \"what does it do\". A reader arriving cold needs \"why does\n * this exist and who is it for\" first, which is what `story.feature(...)`\n * records. Renders nothing when a file never declared one, so existing reports\n * look exactly as they did.\n */\nexport function ReportFeatureIntro({ feature }: ReportFeatureIntroProps) {\n const hasNarrative = Boolean(feature.narrative?.trim());\n const hasGlossary = Boolean(feature.glossary?.length);\n if (!hasNarrative && !hasGlossary) return null;\n\n return (\n <div className=\"flex flex-col gap-3 border-l-2 border-border pl-4 text-sm\">\n {hasNarrative ? (\n <div\n className=\"es-doc-prose prose prose-sm max-w-none text-muted-foreground\"\n dangerouslySetInnerHTML={{ __html: safeMarkdownHtml(dedent(feature.narrative!)) }}\n />\n ) : null}\n\n {hasGlossary ? (\n <dl className=\"grid gap-1.5\" aria-label=\"Glossary\">\n {feature.glossary!.map((entry) => (\n <div key={entry.term} className=\"flex flex-wrap gap-x-2 text-xs\">\n <dt className=\"font-medium text-foreground\">{entry.term}</dt>\n <dd className=\"flex-1 text-muted-foreground\">{entry.definition}</dd>\n </div>\n ))}\n </dl>\n ) : null}\n </div>\n );\n}\n\n/**\n * Label the feature the way it was declared.\n *\n * An ability reads as something a person can now do; a business need covers the\n * cross-cutting concerns nobody asks for by name, like security or performance.\n * Naming the kind keeps that distinction visible to a reader who never sees the\n * test code. A derived title gets no badge, since nobody claimed anything.\n */\nexport function featureKindLabel(kind: ReportFeature[\"kind\"]): string | null {\n if (kind === \"ability\") return \"Ability\";\n if (kind === \"business-need\") return \"Business need\";\n if (kind === \"feature\") return \"Feature\";\n return null;\n}\n","import type { ReportFeature as ReportFeatureT } from \"executable-stories-core\";\nimport { ReportScenarioList } from \"./ReportScenarioList\";\nimport { ReportFeatureIntro, featureKindLabel } from \"./ReportFeatureIntro\";\nimport { useCollapse } from \"../interactive/collapse-context\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReportFeatureProps {\n feature: ReportFeatureT;\n}\n\n/**\n * Feature group — the report's `.feature` card: a header bar with the feature\n * title + mono source path and ✓/✗/○ status counts on the right, over a stack\n * of scenario cards. Kept a semantic <section> (a region), not a shadcn Card\n * div, so it stays a landmark and doesn't collide with the scenario cards'\n * `[data-slot=\"card\"]`.\n */\nexport function ReportFeature({ feature }: ReportFeatureProps) {\n const titleId = `${feature.id}-title`;\n const bodyId = `${feature.id}-body`;\n const s = feature.summary;\n const skipped = s.skipped + s.pending;\n const collapse = useCollapse();\n const collapsed = collapse?.isCollapsed(feature.id) ?? false;\n const kindLabel = featureKindLabel(feature.kind);\n return (\n // Suite = a section heading + a divider, NOT another bordered card. Drops a\n // layer of nesting so the scenario cards below read as the primary unit.\n <section\n id={feature.id}\n data-slot=\"feature\"\n aria-labelledby={titleId}\n className=\"flex flex-col gap-3\"\n >\n <div className=\"flex items-end justify-between gap-4 border-b border-border pb-2\">\n <div className=\"min-w-0\">\n {/* The heading itself is the toggle — a wide, obvious hit area rather\n than a lone caret. Kept inside <h2> so it stays a landmark. */}\n <h2 id={titleId} className=\"text-base font-semibold tracking-tight text-foreground\">\n {collapse ? (\n <button\n type=\"button\"\n onClick={() => collapse.toggle(feature.id)}\n aria-expanded={!collapsed}\n aria-controls={bodyId}\n className=\"flex w-full cursor-pointer items-center gap-2 text-left hover:text-foreground/80\"\n >\n <span aria-hidden className={cn(\"shrink-0 text-xs text-muted-foreground transition-transform\", !collapsed && \"rotate-90\")}>▸</span>\n <span className=\"truncate\">{feature.title}</span>\n </button>\n ) : (\n feature.title\n )}\n </h2>\n <p className={cn(\"mt-0.5 flex items-center gap-2 text-xs text-muted-foreground\", collapse && \"pl-5\")}>\n {kindLabel ? (\n <span className=\"shrink-0 rounded-sm bg-muted px-1.5 py-0.5 font-medium text-foreground\">\n {kindLabel}\n </span>\n ) : null}\n <span className=\"truncate font-mono\">{feature.sourceFile}</span>\n </p>\n </div>\n {/* Readable, failure-weighted counts — only the failure count carries\n colour, so a broken suite reads at a glance without a colour salad. */}\n <p\n className=\"flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground\"\n aria-label={`${s.passed} passed, ${s.failed} failed, ${skipped} skipped`}\n >\n <span>{s.passed} passed</span>\n <span aria-hidden>·</span>\n <span className={cn(s.failed > 0 && \"font-medium text-fail\")}>{s.failed} failed</span>\n {skipped > 0 ? (\n <>\n <span aria-hidden>·</span>\n <span>{skipped} skipped</span>\n </>\n ) : null}\n </p>\n </div>\n <div id={bodyId} hidden={collapsed} className=\"flex flex-col gap-3\">\n <ReportFeatureIntro feature={feature} />\n <ReportScenarioList feature={feature} />\n </div>\n </section>\n );\n}\n","import { useReport } from \"../hooks/useReport\";\nimport { ReportFeature } from \"./ReportFeature\";\n\nexport function ReportFeatureList() {\n const report = useReport();\n // Roomy gap between features — they're now divider-led sections rather than\n // self-contained cards, so they need clear air to read as separate suites.\n return (\n <div className=\"flex flex-col gap-8\">\n {report.features.map((feature) => (\n <ReportFeature key={feature.id} feature={feature} />\n ))}\n </div>\n );\n}\n","import { cva, type VariantProps } from \"class-variance-authority\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Empty({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty\"\n className={cn(\n \"flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction EmptyHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-header\"\n className={cn(\n \"flex max-w-sm flex-col items-center gap-2 text-center\",\n className\n )}\n {...props}\n />\n )\n}\n\nconst emptyMediaVariants = cva(\n \"mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default: \"bg-transparent\",\n icon: \"flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n }\n)\n\nfunction EmptyMedia({\n className,\n variant = \"default\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof emptyMediaVariants>) {\n return (\n <div\n data-slot=\"empty-icon\"\n data-variant={variant}\n className={cn(emptyMediaVariants({ variant, className }))}\n {...props}\n />\n )\n}\n\nfunction EmptyTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-title\"\n className={cn(\"text-lg font-medium tracking-tight\", className)}\n {...props}\n />\n )\n}\n\nfunction EmptyDescription({ className, ...props }: React.ComponentProps<\"p\">) {\n return (\n <div\n data-slot=\"empty-description\"\n className={cn(\n \"text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction EmptyContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"empty-content\"\n className={cn(\n \"flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Empty,\n EmptyHeader,\n EmptyTitle,\n EmptyDescription,\n EmptyContent,\n EmptyMedia,\n}\n","import { Empty, EmptyHeader, EmptyTitle } from \"@/components/ui/empty\";\n\nexport interface ReportEmptyProps {\n message?: string;\n}\n\nexport function ReportEmpty({ message }: ReportEmptyProps) {\n return (\n <Empty aria-live=\"polite\" className=\"border\">\n <EmptyHeader>\n <EmptyTitle>{message ?? \"No scenarios in this report.\"}</EmptyTitle>\n </EmptyHeader>\n </Empty>\n );\n}\n","import type { ReportSummary as ReportSummaryT } from \"executable-stories-core\";\nimport { useReport } from \"../hooks/useReport\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ReportSummaryProps {\n className?: string;\n}\n\nexport function ReportSummary({ className }: ReportSummaryProps) {\n const report = useReport();\n return (\n <ReportSummaryView\n summary={report.summary}\n {...(className !== undefined && { className })}\n ariaLabel=\"Run summary\"\n />\n );\n}\n\nexport interface ReportSummaryViewProps {\n summary: ReportSummaryT;\n className?: string;\n ariaLabel?: string;\n}\n\n/**\n * A single stat card. All cards share the neutral card surface; the status\n * *number* carries the colour (`--es-pass/fail/skip/pend`, mapped to Tailwind\n * in tailwind.css) and a matching leading dot. This drops the earlier pastel\n * fills for the flatter, dashboard-style KPI treatment — a mono micro-label\n * above an oversized tabular number.\n */\nconst TONE = {\n total: { num: \"text-foreground\", dot: \"bg-muted-foreground/50\" },\n passed: { num: \"text-pass\", dot: \"bg-pass\" },\n failed: { num: \"text-fail\", dot: \"bg-fail\" },\n skipped: { num: \"text-skip\", dot: \"bg-skip\" },\n pending: { num: \"text-pend\", dot: \"bg-pend\" },\n} as const;\n\nexport function ReportSummaryView({ summary, className, ariaLabel }: ReportSummaryViewProps) {\n const cards: Array<{ status: keyof typeof TONE; label: string; value: number }> = [\n { status: \"total\", label: \"Total\", value: summary.total },\n { status: \"passed\", label: \"Passed\", value: summary.passed },\n { status: \"failed\", label: \"Failed\", value: summary.failed },\n { status: \"skipped\", label: \"Skipped\", value: summary.skipped },\n ];\n if (summary.pending > 0) {\n cards.push({ status: \"pending\", label: \"Pending\", value: summary.pending });\n }\n return (\n <dl\n className={cn(\n \"grid grid-cols-2 gap-3\",\n // Columns follow the card count so the row is always full — 5 statuses\n // (pending present) never leave a lone orphan card below a row of four.\n cards.length === 5 ? \"sm:grid-cols-5\" : \"sm:grid-cols-4\",\n className,\n )}\n aria-label={ariaLabel}\n >\n {cards.map((c) => {\n const tone = TONE[c.status];\n return (\n <div\n key={c.status}\n data-status={c.status}\n className=\"rounded-lg border bg-card px-4 py-3\"\n >\n <dt className=\"flex items-center gap-1.5 font-mono text-[11px] font-medium uppercase tracking-wider text-muted-foreground\">\n <span className={cn(\"size-1.5 shrink-0 rounded-full\", tone.dot)} aria-hidden=\"true\" />\n {c.label}\n </dt>\n <dd className={cn(\"mt-2 text-3xl font-semibold leading-none tracking-tight tabular-nums\", tone.num)}>\n {c.value}\n </dd>\n </div>\n );\n })}\n </dl>\n );\n}\n","import { formatDuration } from \"executable-stories-core/utils/duration\";\nimport { slowestScenarios } from \"executable-stories-core/report-queries\";\nimport { useReport } from \"../hooks/useReport\";\nimport { ciDisplayName, commitUrl, prUrl } from \"../lib/provenance\";\n\n/**\n * Run metadata line (started, duration, version, branch, git SHA, CI, PR) —\n * the React equivalent of the report's `.meta-info` block. Reads the top-level\n * StoryReport fields from context. Commit and PR become links when the CI run\n * URL lets us derive them safely (GitHub/GitLab shapes only).\n */\nexport function ReportMeta() {\n const report = useReport();\n\n const items: Array<{ label: string; value: React.ReactNode }> = [];\n const linkClass = \"text-primary underline underline-offset-2\";\n\n if (report.startedAtMs) {\n items.push({ label: \"Started\", value: new Date(report.startedAtMs).toLocaleString() });\n }\n if (report.durationMs) {\n items.push({ label: \"Duration\", value: formatDuration(report.durationMs) });\n }\n if (report.packageVersion) {\n items.push({ label: \"Version\", value: report.packageVersion });\n }\n if (report.ci?.branch) {\n items.push({ label: \"Branch\", value: report.ci.branch });\n }\n const sha = report.ci?.commitSha ?? report.gitSha;\n if (sha) {\n const url = commitUrl(report.ci, report.gitSha);\n const short = sha.slice(0, 8);\n items.push({\n label: \"Commit\",\n value: url ? (\n <a href={url} target=\"_blank\" rel=\"noreferrer noopener\" className={linkClass}>\n {short}\n </a>\n ) : (\n short\n ),\n });\n }\n if (report.ci) {\n items.push({\n label: \"CI\",\n value: report.ci.url ? (\n <a href={report.ci.url} target=\"_blank\" rel=\"noreferrer noopener\" className={linkClass}>\n {ciDisplayName(report.ci.name)}\n {report.ci.buildNumber ? ` #${report.ci.buildNumber}` : \"\"}\n </a>\n ) : (\n `${ciDisplayName(report.ci.name)}${report.ci.buildNumber ? ` #${report.ci.buildNumber}` : \"\"}`\n ),\n });\n }\n if (report.ci?.prNumber) {\n const url = prUrl(report.ci);\n const label = `#${report.ci.prNumber}`;\n items.push({\n label: \"PR\",\n value: url ? (\n <a href={url} target=\"_blank\" rel=\"noreferrer noopener\" className={linkClass}>\n {label}\n </a>\n ) : (\n label\n ),\n });\n }\n\n // A \"slowest\" list needs a field to rank: below a handful of timed scenarios\n // it just repeats the run in a different order.\n const slowest = slowestScenarios(report, 5);\n const showSlowest = slowest.length >= 3;\n\n if (items.length === 0 && !showSlowest) return null;\n\n return (\n // Run metadata is useful but secondary to \"what failed\" — tuck it into a\n // collapsed disclosure so it doesn't push the result down. Native <details>\n // so it works with no JS (the SSR/no-hydration report still toggles).\n <details data-es-meta-card className=\"es-run-details group rounded-lg border border-border bg-card text-xs\">\n <summary className=\"flex cursor-pointer list-none select-none items-center gap-1.5 px-4 py-2 font-medium text-muted-foreground [&::-webkit-details-marker]:hidden\">\n <span aria-hidden className=\"text-xs transition-transform group-open:rotate-90\">▸</span>\n Run details\n </summary>\n <dl className=\"flex flex-wrap gap-x-5 gap-y-2 border-t border-border px-4 py-3 text-muted-foreground\" aria-label=\"Run metadata\">\n {items.map((item) => (\n <div key={item.label} className=\"flex items-baseline gap-1.5\">\n <dt className=\"font-medium\">{item.label}</dt>\n <dd className=\"font-mono text-foreground\">{item.value}</dd>\n </div>\n ))}\n </dl>\n {showSlowest ? (\n <div className=\"border-t border-border px-4 py-3\">\n <div className=\"mb-1.5 font-medium text-muted-foreground\">Slowest scenarios</div>\n <ol className=\"flex flex-col gap-1\" aria-label=\"Slowest scenarios\">\n {slowest.map((s) => (\n <li key={s.id} className=\"flex items-baseline justify-between gap-4\">\n <a href={`#${s.id}`} className=\"min-w-0 text-primary underline underline-offset-2\">\n {s.title}\n </a>\n <span className=\"shrink-0 font-mono tabular-nums text-muted-foreground\">\n {formatDuration(s.durationMs)}\n </span>\n </li>\n ))}\n </ol>\n </div>\n ) : null}\n </details>\n );\n}\n","import type { ReportParseError } from \"../result\";\n\nexport interface ReportSchemaErrorProps {\n error: ReportParseError;\n}\n\nexport function ReportSchemaError({ error }: ReportSchemaErrorProps) {\n return (\n <section className=\"es-schema-error\" role=\"alert\" aria-live=\"assertive\">\n <p>\n <strong>Report could not be displayed.</strong>\n </p>\n <p>{error.message}</p>\n {error.code === \"SCHEMA_VERSION_MISMATCH\" ? (\n <p>\n The report bundle is newer than this version of <code>executable-stories-react</code>.\n Upgrade the package, or regenerate the report with an older formatters CLI.\n </p>\n ) : null}\n {error.issues && error.issues.length > 0 ? (\n <details>\n <summary>{error.issues.length} validation issue{error.issues.length === 1 ? \"\" : \"s\"}</summary>\n <pre>\n {error.issues\n .slice(0, 20)\n .map((i) => `${i.path}: ${i.message}`)\n .join(\"\\n\")}\n </pre>\n </details>\n ) : null}\n </section>\n );\n}\n","import type { ReactNode } from \"react\";\nimport type { ReportParseError } from \"../result\";\nimport { cn } from \"../lib/utils\";\nimport { ReportSummary } from \"./ReportSummary\";\nimport { ReportMeta } from \"./ReportMeta\";\nimport { ReportSchemaError } from \"./ReportSchemaError\";\n\n/**\n * The report's title block — `<h1>` + summary + meta. Shared by the static\n * `Report` header and the interactive `ReportInteractive` header so the two\n * views can't drift on the no-JS fallback.\n */\nexport function ReportTitleBlock({ title }: { title?: string }) {\n return (\n <>\n <h1>{title ?? \"Story Report\"}</h1>\n <ReportSummary />\n <ReportMeta />\n </>\n );\n}\n\n/**\n * The `<main>` landmark shown when the report failed to parse. Both entrypoints\n * render the identical shell on a `Result` error, so it lives here once.\n */\nexport function ReportErrorShell({\n error,\n className,\n title,\n dataTheme,\n}: {\n error: ReportParseError;\n className?: string;\n title?: string;\n dataTheme?: \"light\" | \"dark\";\n}): ReactNode {\n return (\n <main className={cn(\"es-report\", className)} aria-label={title ?? \"Test report\"} data-theme={dataTheme}>\n <ReportSchemaError error={error} />\n </main>\n );\n}\n","// Subpath imports: the core package root pulls in Node-only converters\n// (node:crypto), which breaks browser bundles — same rule as ReportStoryboard.\nimport { deriveSpanGraph, spanGraphNodeMark, spanGraphToMermaid } from \"executable-stories-core/span-graph\";\nimport type { SpanGraphKind, SpanGraphNode } from \"executable-stories-core/span-graph\";\nimport { useMemo } from \"react\";\nimport { useReport } from \"../hooks/useReport\";\nimport { DocMermaid } from \"./doc/DocMermaid\";\nimport { cn } from \"../lib/utils\";\n\nconst LANE_LABEL: Record<SpanGraphKind, string> = {\n edge: \"Edge\",\n service: \"Service\",\n queue: \"Queue\",\n datastore: \"Data\",\n};\n\nconst MARK_LABEL = {\n failing: \"Failing\",\n added: \"New\",\n changed: \"Changed\",\n} as const;\n\nconst MARK_CLASS = {\n failing: \"text-fail\",\n added: \"text-pass\",\n changed: \"text-pend\",\n} as const;\n\nfunction MarkBadge({ node }: { node: SpanGraphNode }) {\n const mark = spanGraphNodeMark(node);\n if (!mark) return null;\n return (\n <span className={cn(\"ml-2 text-xs font-medium\", MARK_CLASS[mark])}>{MARK_LABEL[mark]}</span>\n );\n}\n\n/**\n * The architecture the run exercised, drawn from its OTel spans.\n *\n * Every other picture of a system's shape is inferred — from the folder tree,\n * the import graph, or a model reading a diff — and so has to be labelled as\n * unverified when it sits beside a scenario that executed. This one is not: a\n * component is here because a span named it during a run, and the scenarios\n * that put it there are listed beside it and link to their own cards.\n *\n * Renders nothing when the run carries no spans, which is most runs. A section\n * saying \"no diagram\" in every report of every uninstrumented suite is worse\n * than no section.\n *\n * Hydration-free: the derivation is pure and the links are plain anchors, so\n * this renders identically in the static report, the interactive island, and\n * the Astro story pages.\n */\nexport function ReportSpanGraph() {\n const report = useReport();\n // Memoised on the report, not recomputed per render: the interactive island\n // re-renders on every keystroke in the search box, and this walks every span\n // of every scenario. The report object is stable for the life of the view, so\n // the graph is derived once.\n const { code, graph, titleById } = useMemo(() => {\n const scenarios = report.features.flatMap((feature) => feature.scenarios);\n const derived = deriveSpanGraph(scenarios);\n return {\n graph: derived,\n code: spanGraphToMermaid(derived),\n titleById: new Map(scenarios.map((scenario) => [scenario.id, scenario.title])),\n };\n }, [report]);\n\n if (code === \"\") return null;\n\n return (\n <section className=\"es-span-graph mt-6\" aria-labelledby=\"es-span-graph-heading\">\n <h2 id=\"es-span-graph-heading\" className=\"text-base font-semibold text-foreground\">\n Architecture, as it ran\n </h2>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n Derived from this run&rsquo;s traces. Every component was named by a span while a\n scenario ran, so nothing here is inferred from the code. Instrumented, exercised\n paths only: a component no scenario reaches does not appear.\n </p>\n\n <DocMermaid entry={{ kind: \"mermaid\", phase: \"static\", code }} />\n\n <table className=\"mt-2 w-full text-left text-sm\">\n <caption className=\"sr-only\">\n Each component and the scenarios that exercised it\n </caption>\n <thead>\n <tr className=\"text-xs text-muted-foreground\">\n <th scope=\"col\" className=\"py-1 pr-4 font-medium\">\n Component\n </th>\n <th scope=\"col\" className=\"py-1 pr-4 font-medium\">\n Lane\n </th>\n <th scope=\"col\" className=\"py-1 font-medium\">\n Covered by\n </th>\n </tr>\n </thead>\n <tbody>\n {graph.nodes.map((node) => (\n <tr key={node.id} className=\"border-t border-border align-top\">\n <th scope=\"row\" className=\"py-1.5 pr-4 font-mono text-xs font-normal\">\n {node.id}\n <MarkBadge node={node} />\n </th>\n <td className=\"py-1.5 pr-4 text-xs text-muted-foreground\">\n {LANE_LABEL[node.kind]}\n </td>\n <td className=\"py-1.5\">\n <ul className=\"flex flex-col gap-0.5\">\n {node.scenarioIds.map((id) => (\n <li key={id}>\n {/* The card sets id={scenario.id}, so this jumps to it. */}\n <a href={`#${id}`} className=\"text-xs underline underline-offset-2\">\n {titleById.get(id) ?? id}\n </a>\n </li>\n ))}\n </ul>\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </section>\n );\n}\n","import type { StoryReport } from \"executable-stories-core\";\nimport type { Result } from \"../result\";\nimport { unwrapReport } from \"../result\";\nimport type { BuiltinRenderers, CustomRenderers } from \"../renderers\";\nimport { ReportRoot } from \"../context/ReportRoot\";\nimport { ReportFeatureList } from \"./ReportFeatureList\";\nimport { ReportEmpty } from \"./ReportEmpty\";\nimport { ReportTitleBlock, ReportErrorShell } from \"./ReportShell\";\nimport { ReportSpanGraph } from \"./ReportSpanGraph\";\nimport { cn } from \"../lib/utils\";\n\nexport interface ReportProps {\n /** A StoryReport, or a Result-wrapped one (e.g., from parseStoryReport). */\n report: StoryReport | Result<StoryReport>;\n /** Renderers keyed by `story.custom({ type })` strings. */\n customRenderers?: CustomRenderers;\n /** Optional overrides for the heavy built-ins (mermaid, code, section). */\n renderers?: BuiltinRenderers;\n /** Optional class on the <main> landmark for layout positioning. */\n className?: string;\n /** Optional override title. */\n title?: string;\n /** Optional theme attribute scope. Use to force \"light\" or \"dark\". */\n dataTheme?: \"light\" | \"dark\";\n}\n\nexport function Report(props: ReportProps) {\n const { report, customRenderers, renderers, className, title, dataTheme } = props;\n const result = unwrapReport(report);\n if (!result.ok) {\n return <ReportErrorShell error={result.error} className={className} title={title} dataTheme={dataTheme} />;\n }\n const data = result.data;\n const hasContent = data.features.length > 0;\n return (\n <ReportRoot report={data} customRenderers={customRenderers} renderers={renderers}>\n <main className={cn(\"es-report\", className)} aria-label={title ?? \"Test report\"} data-theme={dataTheme}>\n <header className=\"es-report-header\">\n <ReportTitleBlock title={title} />\n </header>\n {/* Run-level, so it sits above the features rather than inside one.\n Renders nothing unless the run carried spans. Mirrored in\n ReportInteractive — the two headers are composed separately, and\n Report.stories/ReportInteractive.stories both assert it. */}\n <ReportSpanGraph />\n {hasContent ? <ReportFeatureList /> : <ReportEmpty />}\n </main>\n </ReportRoot>\n );\n}\n","\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport type { ReportDocMermaid } from \"executable-stories-core\";\nimport { MermaidSource } from \"./DocMermaid\";\n\nexport type MermaidApi = typeof import(\"mermaid\").default;\nexport type MermaidLoader = () => Promise<MermaidApi>;\n\nfunction prefersDark(el: HTMLElement | null): boolean {\n const themed = el?.closest<HTMLElement>(\"[data-theme]\");\n if (themed?.dataset.theme === \"dark\") return true;\n if (themed?.dataset.theme === \"light\") return false;\n return typeof window !== \"undefined\" && !!window.matchMedia?.(\"(prefers-color-scheme: dark)\").matches;\n}\n\n/**\n * Presentational mermaid renderer with the loader INJECTED — it contains no\n * literal `import(\"mermaid\")`, so a bundler following this module never pulls\n * mermaid in. `MermaidDiagram` wraps this with the installed-package loader;\n * the standalone report island wraps it with a CDN loader so the heavy library\n * never bloats the inlined island bundle.\n *\n * Draws the diagram to inline SVG (React-owned via state, so an island\n * re-render can't clobber it), redraws when the report's `data-theme` flips,\n * and falls back to `<MermaidSource>` (the readable, agent-friendly code) on\n * the server, before load, and on any error.\n */\nexport function MermaidView({ entry, load }: { entry: ReportDocMermaid; load: MermaidLoader }) {\n const ref = useRef<HTMLElement>(null);\n const [svg, setSvg] = useState<string | null>(null);\n const [error, setError] = useState<string | null>(null);\n\n useEffect(() => {\n let cancelled = false;\n const draw = async () => {\n let mermaid: MermaidApi;\n try {\n mermaid = await load();\n } catch {\n // No library (offline, blocked CDN). Not the diagram's fault, so keep\n // the quiet source fallback rather than accusing the author.\n if (!cancelled) {\n setSvg(null);\n setError(null);\n }\n return;\n }\n try {\n mermaid.initialize({\n startOnLoad: false,\n securityLevel: \"strict\",\n theme: prefersDark(ref.current) ? \"dark\" : \"default\",\n });\n // mermaid.parse is the library's own syntax check. Running it first\n // turns a broken diagram into a message naming the problem, and keeps\n // mermaid from injecting its own error graphic into the document.\n await mermaid.parse(entry.code);\n const id = `es-mermaid-${Math.random().toString(36).slice(2)}`;\n const { svg: rendered } = await mermaid.render(id, entry.code);\n if (!cancelled) {\n setSvg(rendered);\n setError(null);\n }\n } catch (err) {\n if (!cancelled) {\n setSvg(null);\n setError(err instanceof Error ? err.message : String(err));\n }\n }\n };\n void draw();\n\n // Redraw when the report toggles theme on an ancestor.\n const themed = ref.current?.closest<HTMLElement>(\"[data-theme]\");\n const observer = themed ? new MutationObserver(() => void draw()) : undefined;\n observer?.observe(themed!, { attributes: true, attributeFilter: [\"data-theme\"] });\n\n return () => {\n cancelled = true;\n observer?.disconnect();\n };\n }, [entry.code, load]);\n\n if (svg) {\n return (\n <figure ref={ref} className=\"my-3\">\n {entry.title ? (\n <figcaption className=\"mb-1.5 text-xs font-medium text-muted-foreground\">{entry.title}</figcaption>\n ) : null}\n {/* role=\"img\" presents the diagram as a single labelled graphic. */}\n <div\n role=\"img\"\n aria-label={entry.title ?? \"Mermaid diagram\"}\n className=\"overflow-x-auto rounded-md border border-border bg-card p-3 [&_svg]:mx-auto [&_svg]:h-auto [&_svg]:max-w-full\"\n dangerouslySetInnerHTML={{ __html: svg }}\n />\n </figure>\n );\n }\n\n // Pre-render / fallback: the readable source. The ref lets the effect locate\n // the themed ancestor from the same DOM position before the SVG swaps in.\n // A syntax error shows above it, because a diagram that silently degrades to\n // a code block is a diagram nobody ever fixes.\n return (\n <>\n {error ? (\n <p\n role=\"alert\"\n data-es-mermaid-error\n className=\"mt-3 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs text-destructive\"\n >\n Diagram failed to render: {error}\n </p>\n ) : null}\n <MermaidSource entry={entry} ref={ref} />\n </>\n );\n}\n","\"use client\";\n\nimport type { ReportDocMermaid } from \"executable-stories-core\";\nimport { MermaidView, type MermaidApi, type MermaidLoader } from \"./MermaidView\";\n\nexport type { MermaidApi, MermaidLoader };\n\n// Mermaid is heavy, so it's loaded only when a diagram actually renders (an\n// optional peer dependency, dynamically imported) and cached for the page.\nlet mermaidLoader: Promise<MermaidApi> | undefined;\nfunction loadMermaid(): Promise<MermaidApi> {\n // Intentional dynamic import: mermaid is an optional peer dep loaded on demand\n // so it never lands in the base bundle (see tsup external + peerDeps). This\n // literal lives ONLY here, not in MermaidView, so the standalone island —\n // which imports MermaidView with a CDN loader — never bundles mermaid.\n // eslint-disable-next-line no-restricted-syntax\n mermaidLoader ??= import(\"mermaid\").then((m) => m.default);\n return mermaidLoader;\n}\n\n/**\n * Client renderer for `story.mermaid(...)` entries. Dynamically imports the\n * installed `mermaid` package and draws the diagram to inline SVG, falling back\n * to the readable source on the server / before load / on error.\n *\n * Opt in via `<Report renderers={{ mermaid: (e) => <MermaidDiagram entry={e} /> }} />`.\n * Requires `mermaid` to be installed (an optional peer dependency). Pass `load`\n * to override how mermaid is obtained (the standalone report island injects a\n * CDN loader via `MermaidView` directly).\n */\nexport function MermaidDiagram({ entry, load = loadMermaid }: { entry: ReportDocMermaid; load?: MermaidLoader }) {\n return <MermaidView entry={entry} load={load} />;\n}\n","import { useState } from \"react\";\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/components/ui/command\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ExplorerStatus = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\nexport interface ExplorerScenario {\n id: string;\n title: string;\n status: ExplorerStatus;\n tags: string[];\n /** Source file / feature label shown on the right. */\n feature: string;\n /** Resolved href to the scenario detail page. */\n href: string;\n}\n\nexport interface ScenarioExplorerProps {\n scenarios: ExplorerScenario[];\n summary?: { total: number; passed: number; failed: number };\n}\n\nconst STATUS_FILTERS: Array<{ value: \"all\" | ExplorerStatus; label: string }> = [\n { value: \"all\", label: \"All\" },\n { value: \"passed\", label: \"Passed\" },\n { value: \"failed\", label: \"Failed\" },\n { value: \"skipped\", label: \"Skipped\" },\n { value: \"pending\", label: \"Pending\" },\n];\n\n/**\n * Scenario Explorer surface — a shadcn `Command` palette rendered inline. cmdk\n * filters by the item value (title + feature + tags) as you type; the status\n * pills pre-filter the list. Each row is a real `<a>` to the detail page.\n */\nexport function ScenarioExplorer({ scenarios, summary }: ScenarioExplorerProps) {\n const [status, setStatus] = useState<\"all\" | ExplorerStatus>(\"all\");\n const visible = status === \"all\" ? scenarios : scenarios.filter((s) => s.status === status);\n\n return (\n <div className=\"font-sans text-foreground\">\n {summary ? (\n <p className=\"mb-3 text-sm text-muted-foreground\">\n {summary.total} scenarios · <span className=\"text-pass\">{summary.passed} passed</span> ·{\" \"}\n <span className=\"text-fail\">{summary.failed} failed</span>\n </p>\n ) : null}\n\n <div className=\"mb-2 flex flex-wrap gap-1.5\" role=\"group\" aria-label=\"Filter by status\">\n {STATUS_FILTERS.map((f) => (\n <button\n key={f.value}\n type=\"button\"\n aria-pressed={status === f.value}\n onClick={() => setStatus(f.value)}\n className={cn(\n \"rounded-full border px-2.5 py-1 text-xs font-medium transition-colors\",\n \"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2\",\n status === f.value\n ? \"border-primary bg-primary text-primary-foreground\"\n : \"border-border bg-card text-muted-foreground hover:bg-accent hover:text-accent-foreground\",\n )}\n >\n {f.label}\n </button>\n ))}\n </div>\n\n <Command\n className=\"rounded-lg border border-border bg-card\"\n filter={(value, search) => (value.toLowerCase().includes(search.toLowerCase()) ? 1 : 0)}\n >\n <CommandInput placeholder=\"Search scenarios…\" />\n <CommandList className=\"max-h-none\">\n <CommandEmpty>No scenarios match your filters.</CommandEmpty>\n <CommandGroup>\n {visible.map((s) => (\n <CommandItem\n key={s.id}\n value={`${s.title} ${s.feature} ${s.tags.join(\" \")}`}\n asChild\n className=\"cursor-pointer\"\n >\n <a href={s.href} className=\"flex items-center gap-3\">\n <Badge variant={s.status}>{s.status}</Badge>\n <span className=\"min-w-0 flex-1 truncate font-medium\">{s.title}</span>\n {s.tags.slice(0, 3).map((t) => (\n <Badge key={t} variant=\"tag\" className=\"hidden sm:inline-flex\">\n {t}\n </Badge>\n ))}\n <code className=\"hidden font-mono text-xs text-muted-foreground md:inline\">{s.feature}</code>\n </a>\n </CommandItem>\n ))}\n </CommandGroup>\n </CommandList>\n </Command>\n </div>\n );\n}\n","\"use client\"\n\nimport * as React from \"react\"\nimport { Command as CommandPrimitive } from \"cmdk\"\nimport { SearchIcon } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogHeader,\n DialogTitle,\n} from \"@/components/ui/dialog\"\n\nfunction Command({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n return (\n <CommandPrimitive\n data-slot=\"command\"\n className={cn(\n \"flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandDialog({\n title = \"Command Palette\",\n description = \"Search for a command to run...\",\n children,\n className,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof Dialog> & {\n title?: string\n description?: string\n className?: string\n showCloseButton?: boolean\n // Base UI's Dialog.Root permits function-as-children; cmdk's Command wants a\n // plain node, so narrow it back here.\n children?: React.ReactNode\n}) {\n return (\n <Dialog {...props}>\n <DialogHeader className=\"sr-only\">\n <DialogTitle>{title}</DialogTitle>\n <DialogDescription>{description}</DialogDescription>\n </DialogHeader>\n <DialogContent\n className={cn(\"overflow-hidden p-0\", className)}\n showCloseButton={showCloseButton}\n >\n <Command className=\"**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5\">\n {children}\n </Command>\n </DialogContent>\n </Dialog>\n )\n}\n\nfunction CommandInput({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n return (\n <div\n data-slot=\"command-input-wrapper\"\n className=\"flex h-9 items-center gap-2 border-b px-3\"\n >\n <SearchIcon className=\"size-4 shrink-0 opacity-50\" />\n <CommandPrimitive.Input\n data-slot=\"command-input\"\n className={cn(\n \"flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50\",\n className\n )}\n {...props}\n />\n </div>\n )\n}\n\nfunction CommandList({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n return (\n <CommandPrimitive.List\n data-slot=\"command-list\"\n className={cn(\n \"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandEmpty({\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n return (\n <CommandPrimitive.Empty\n data-slot=\"command-empty\"\n className=\"py-6 text-center text-sm\"\n {...props}\n />\n )\n}\n\nfunction CommandGroup({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n return (\n <CommandPrimitive.Group\n data-slot=\"command-group\"\n className={cn(\n \"overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandSeparator({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n return (\n <CommandPrimitive.Separator\n data-slot=\"command-separator\"\n className={cn(\"-mx-1 h-px bg-border\", className)}\n {...props}\n />\n )\n}\n\nfunction CommandItem({\n className,\n ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n return (\n <CommandPrimitive.Item\n data-slot=\"command-item\"\n className={cn(\n \"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CommandShortcut({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"command-shortcut\"\n className={cn(\n \"ml-auto text-xs tracking-widest text-muted-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n}\n","/**\n * StoryReport runtime Zod schema, derived from the canonical JSON Schema\n * at executable-stories-core/schemas/story-report-v1.json.\n *\n * Uses z.fromJSONSchema (experimental in Zod 4.x). If the API changes upstream,\n * only this file needs updating — the rest of the package consumes\n * `storyReportSchema` and `StoryReportSchemaShape` via parse.ts.\n *\n * The JSON Schema is bundled at build time by tsup (resolveJsonModule).\n */\n\nimport { z } from \"zod\";\nimport schemaJson from \"executable-stories-core/schemas/story-report-v1.json\" with { type: \"json\" };\n\nexport { STORY_REPORT_SCHEMA_MAJOR } from \"./version\";\n\n// z.fromJSONSchema (experimental in Zod 4.x) can't translate DocHtml's nested\n// `oneOf` (the exactly-one-of path/url/content constraint) and rejects every\n// html doc entry. The on-disk schema keeps that constraint for Ajv + the\n// machine contract; here we drop it from the in-memory copy the runtime\n// validator is built from. The React DocHtml component already resolves\n// precedence (content → url → path), so the looser runtime check is safe.\nconst schemaForZod = structuredClone(schemaJson) as {\n $defs?: { DocHtml?: { oneOf?: unknown } };\n};\nif (schemaForZod.$defs?.DocHtml) {\n delete schemaForZod.$defs.DocHtml.oneOf;\n}\n\nconst compiled = z.fromJSONSchema(schemaForZod as Parameters<typeof z.fromJSONSchema>[0]);\n\nexport const storyReportSchema = compiled;\nexport type StoryReportSchemaShape = z.infer<typeof compiled>;\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"https://executable-stories.dev/schemas/story-report-v1.schema.json\",\n \"title\": \"StoryReport\",\n \"description\": \"Pre-grouped, denormalized report shape consumed by UI renderers (React, Svelte, Vue, etc.). Stable public contract \\u2014 additive-only within a major. Distinct from internal TestRunResult.\",\n \"type\": \"object\",\n \"$ref\": \"#/$defs/StoryReport\",\n \"$defs\": {\n \"StoryReport\": {\n \"type\": \"object\",\n \"description\": \"Top-level report containing all features, runtime metadata, and a pre-computed summary.\",\n \"properties\": {\n \"schemaVersion\": {\n \"type\": \"string\",\n \"pattern\": \"^1\\\\.[0-9]+$\",\n \"description\": \"Schema version as 'major.minor'. Major bumps are breaking; minors are additive-only. UI packages must accept any 1.x.\"\n },\n \"runId\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Unique deterministic identifier for this run.\"\n },\n \"startedAtMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Run start time as Unix epoch milliseconds.\"\n },\n \"finishedAtMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Run finish time as Unix epoch milliseconds.\"\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"description\": \"Total run duration in milliseconds.\"\n },\n \"projectRoot\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Absolute path to the project root (for context only; relative paths in features.sourceFile are preferred).\"\n },\n \"packageVersion\": {\n \"type\": \"string\",\n \"description\": \"Version of the package under test, if known.\"\n },\n \"gitSha\": {\n \"type\": \"string\",\n \"description\": \"Git commit SHA at the time of the run.\"\n },\n \"ci\": {\n \"$ref\": \"#/$defs/CIInfo\"\n },\n \"coverage\": {\n \"$ref\": \"#/$defs/CoverageSummary\"\n },\n \"summary\": {\n \"$ref\": \"#/$defs/Summary\",\n \"description\": \"Pre-computed counts across all features and scenarios.\"\n },\n \"features\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Feature\"\n },\n \"description\": \"Features grouped by sourceFile, sorted by title.\"\n }\n },\n \"required\": [\n \"schemaVersion\",\n \"runId\",\n \"startedAtMs\",\n \"finishedAtMs\",\n \"durationMs\",\n \"projectRoot\",\n \"summary\",\n \"features\"\n ],\n \"additionalProperties\": false\n },\n \"Summary\": {\n \"type\": \"object\",\n \"description\": \"Counts by status. Sums equal 'total'.\",\n \"properties\": {\n \"total\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"passed\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"failed\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"skipped\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"pending\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0\n }\n },\n \"required\": [\n \"total\",\n \"passed\",\n \"failed\",\n \"skipped\",\n \"pending\",\n \"durationMs\"\n ],\n \"additionalProperties\": false\n },\n \"Feature\": {\n \"type\": \"object\",\n \"description\": \"A group of scenarios from the same source file.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Stable slug derived from the relative source path. Suitable for use as a deep-link anchor.\"\n },\n \"title\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Display title. Comes from story.feature(...) when declared, otherwise the describe block or file basename.\"\n },\n \"sourceFile\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Source path, relative to projectRoot when possible.\"\n },\n \"summary\": {\n \"$ref\": \"#/$defs/Summary\"\n },\n \"scenarios\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Scenario\"\n },\n \"description\": \"Scenarios in this feature, in declaration order.\"\n },\n \"kind\": {\n \"type\": \"string\",\n \"enum\": [\"feature\", \"ability\", \"business-need\"],\n \"description\": \"How the feature was declared. Absent when the title was derived rather than declared.\"\n },\n \"narrative\": {\n \"type\": \"string\",\n \"description\": \"Markdown explaining why the feature exists and who it serves.\"\n },\n \"glossary\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/GlossaryTerm\"\n },\n \"description\": \"Terms this feature defines, linked wherever they appear in scenario text.\"\n }\n },\n \"required\": [\"id\", \"title\", \"sourceFile\", \"summary\", \"scenarios\"],\n \"additionalProperties\": false\n },\n \"Scenario\": {\n \"type\": \"object\",\n \"description\": \"A single scenario with its steps, story-level doc entries, and attachments.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1,\n \"description\": \"Stable identifier: '<feature.id>--<slug-of-title>'. Suitable for use as a deep-link anchor.\"\n },\n \"title\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"status\": {\n \"$ref\": \"#/$defs/TestStatus\"\n },\n \"planned\": {\n \"type\": \"boolean\",\n \"description\": \"True for scenarios authored with the framework's todo modifier (e.g. it.todo): specified behavior with no implementation yet. Canonical status stays 'pending'; this flags why.\"\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"tags\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Normalized tags, deduplicated, lowercased.\"\n },\n \"tickets\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Ticket\"\n }\n },\n \"covers\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n },\n \"description\": \"Product-code paths/globs this scenario exercises.\"\n },\n \"sourceLine\": {\n \"type\": \"integer\",\n \"minimum\": 1\n },\n \"errorMessage\": {\n \"type\": \"string\"\n },\n \"errorStack\": {\n \"type\": \"string\"\n },\n \"retry\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"retries\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"docEntries\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n },\n \"description\": \"Story-level doc entries (rendered before steps).\"\n },\n \"steps\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Step\"\n }\n },\n \"attachments\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/Attachment\"\n }\n },\n \"otelSpans\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/OtelSpan\"\n }\n }\n },\n \"required\": [\n \"id\",\n \"title\",\n \"status\",\n \"durationMs\",\n \"tags\",\n \"retry\",\n \"retries\",\n \"docEntries\",\n \"steps\",\n \"attachments\"\n ],\n \"additionalProperties\": false\n },\n \"Step\": {\n \"type\": \"object\",\n \"description\": \"A single BDD step.\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"index\": {\n \"type\": \"integer\",\n \"minimum\": 0\n },\n \"keyword\": {\n \"$ref\": \"#/$defs/StepKeyword\"\n },\n \"text\": {\n \"type\": \"string\"\n },\n \"status\": {\n \"$ref\": \"#/$defs/TestStatus\"\n },\n \"durationMs\": {\n \"type\": \"number\",\n \"minimum\": 0\n },\n \"assertions\": {\n \"type\": \"integer\",\n \"minimum\": 0,\n \"description\": \"Assertions observed or declared for this step. Omit when the adapter cannot observe assertions; zero means observed none.\"\n },\n \"errorMessage\": {\n \"type\": \"string\"\n },\n \"mode\": {\n \"$ref\": \"#/$defs/StepMode\"\n },\n \"docEntries\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n },\n \"description\": \"Doc entries attached to this step.\"\n }\n },\n \"required\": [\n \"id\",\n \"index\",\n \"keyword\",\n \"text\",\n \"status\",\n \"durationMs\",\n \"docEntries\"\n ],\n \"additionalProperties\": false\n },\n \"StepKeyword\": {\n \"type\": \"string\",\n \"enum\": [\"Given\", \"When\", \"Then\", \"And\", \"But\"]\n },\n \"StepMode\": {\n \"type\": \"string\",\n \"enum\": [\"normal\", \"skip\", \"only\", \"todo\", \"fails\", \"concurrent\"]\n },\n \"TestStatus\": {\n \"type\": \"string\",\n \"enum\": [\"passed\", \"failed\", \"skipped\", \"pending\"]\n },\n \"Ticket\": {\n \"type\": \"object\",\n \"properties\": {\n \"id\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"url\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"id\"],\n \"additionalProperties\": false\n },\n \"Attachment\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"mediaType\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"body\": {\n \"type\": \"string\"\n },\n \"contentEncoding\": {\n \"type\": \"string\",\n \"enum\": [\"BASE64\", \"IDENTITY\"]\n }\n },\n \"required\": [\"name\", \"mediaType\", \"body\", \"contentEncoding\"],\n \"additionalProperties\": false\n },\n \"CIInfo\": {\n \"type\": \"object\",\n \"properties\": {\n \"name\": {\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n },\n \"buildNumber\": {\n \"type\": \"string\"\n },\n \"branch\": {\n \"type\": \"string\"\n },\n \"commitSha\": {\n \"type\": \"string\"\n },\n \"prNumber\": {\n \"type\": \"string\"\n }\n },\n \"required\": [\"name\"],\n \"additionalProperties\": false\n },\n \"CoverageSummary\": {\n \"type\": \"object\",\n \"properties\": {\n \"linesPct\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100\n },\n \"branchesPct\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100\n },\n \"functionsPct\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100\n },\n \"statementsPct\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 100\n }\n },\n \"additionalProperties\": false\n },\n \"DocPhase\": {\n \"type\": \"string\",\n \"enum\": [\"static\", \"runtime\"]\n },\n \"DocEntry\": {\n \"oneOf\": [\n {\n \"$ref\": \"#/$defs/DocNote\"\n },\n {\n \"$ref\": \"#/$defs/DocTag\"\n },\n {\n \"$ref\": \"#/$defs/DocKv\"\n },\n {\n \"$ref\": \"#/$defs/DocCode\"\n },\n {\n \"$ref\": \"#/$defs/DocTable\"\n },\n {\n \"$ref\": \"#/$defs/DocLink\"\n },\n {\n \"$ref\": \"#/$defs/DocSection\"\n },\n {\n \"$ref\": \"#/$defs/DocMermaid\"\n },\n {\n \"$ref\": \"#/$defs/DocScreenshot\"\n },\n {\n \"$ref\": \"#/$defs/DocVideo\"\n },\n {\n \"$ref\": \"#/$defs/DocHtml\"\n },\n {\n \"$ref\": \"#/$defs/DocState\"\n },\n {\n \"$ref\": \"#/$defs/DocCustom\"\n }\n ]\n },\n \"DocNote\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"note\"\n },\n \"text\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"text\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocTag\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"tag\"\n },\n \"names\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"names\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocKv\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"kv\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"value\": {},\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"label\", \"value\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocCode\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"code\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\"\n },\n \"lang\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"label\", \"content\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocTable\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"table\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"columns\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n },\n \"rows\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"array\",\n \"items\": {\n \"type\": \"string\"\n }\n }\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"label\", \"columns\", \"rows\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocLink\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"link\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"label\", \"url\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocSection\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"section\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"markdown\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"title\", \"markdown\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocMermaid\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"mermaid\"\n },\n \"code\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"code\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocScreenshot\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"screenshot\"\n },\n \"path\": {\n \"type\": \"string\"\n },\n \"alt\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"path\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocVideo\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"video\"\n },\n \"path\": {\n \"type\": \"string\"\n },\n \"caption\": {\n \"type\": \"string\"\n },\n \"poster\": {\n \"type\": \"string\"\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"path\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocHtml\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"html\"\n },\n \"path\": {\n \"type\": \"string\"\n },\n \"url\": {\n \"type\": \"string\"\n },\n \"content\": {\n \"type\": \"string\"\n },\n \"title\": {\n \"type\": \"string\"\n },\n \"height\": {\n \"oneOf\": [\n {\n \"type\": \"number\"\n },\n {\n \"type\": \"string\"\n }\n ]\n },\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"phase\"],\n \"additionalProperties\": false,\n \"oneOf\": [\n {\n \"required\": [\"path\"]\n },\n {\n \"required\": [\"url\"]\n },\n {\n \"required\": [\"content\"]\n }\n ]\n },\n \"DocState\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"state\"\n },\n \"label\": {\n \"type\": \"string\"\n },\n \"value\": {},\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"value\", \"phase\"],\n \"additionalProperties\": false\n },\n \"DocCustom\": {\n \"type\": \"object\",\n \"properties\": {\n \"kind\": {\n \"const\": \"custom\"\n },\n \"type\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"data\": {},\n \"phase\": {\n \"$ref\": \"#/$defs/DocPhase\"\n },\n \"children\": {\n \"type\": \"array\",\n \"items\": {\n \"$ref\": \"#/$defs/DocEntry\"\n }\n }\n },\n \"required\": [\"kind\", \"type\", \"data\", \"phase\"],\n \"additionalProperties\": false\n },\n \"OtelSpan\": {\n \"type\": \"object\",\n \"required\": [\"spanId\", \"name\", \"status\"],\n \"properties\": {\n \"spanId\": {\n \"type\": \"string\"\n },\n \"parentSpanId\": {\n \"type\": \"string\"\n },\n \"name\": {\n \"type\": \"string\"\n },\n \"startTimeMs\": {\n \"type\": \"number\"\n },\n \"durationMs\": {\n \"type\": \"number\"\n },\n \"startTimeUnixNano\": {\n \"type\": \"number\"\n },\n \"endTimeUnixNano\": {\n \"type\": \"number\"\n },\n \"status\": {\n \"enum\": [\"ok\", \"error\", \"unset\"]\n },\n \"statusMessage\": {\n \"type\": \"string\"\n },\n \"attributes\": {\n \"type\": \"object\"\n }\n },\n \"additionalProperties\": false\n },\n \"GlossaryTerm\": {\n \"type\": \"object\",\n \"description\": \"One glossary entry: a term the scenarios use and what it means.\",\n \"properties\": {\n \"term\": {\n \"type\": \"string\",\n \"minLength\": 1\n },\n \"definition\": {\n \"type\": \"string\",\n \"minLength\": 1\n }\n },\n \"required\": [\"term\", \"definition\"],\n \"additionalProperties\": false\n }\n }\n}\n","/**\n * The supported StoryReport schema major version, factored out of\n * story-report.schema.ts so the client island can do a cheap version check\n * WITHOUT importing the Zod schema module (which evaluates z.fromJSONSchema at\n * module load and pulls ~315kb of zod + locales into the bundle).\n */\nexport const STORY_REPORT_SCHEMA_MAJOR = 1 as const;\n","/**\n * parseStoryReport — boundary validator. Accepts unknown input (file contents,\n * fetch body, prop) and returns a Result-typed StoryReport.\n */\n\nimport type { StoryReport } from \"executable-stories-core\";\nimport type { Result } from \"../result\";\nimport { ok, err } from \"../result\";\nimport { storyReportSchema, STORY_REPORT_SCHEMA_MAJOR } from \"./story-report.schema\";\n\nexport function parseStoryReport(input: unknown): Result<StoryReport> {\n if (input === null || typeof input !== \"object\") {\n return err({\n message: \"Expected a StoryReport object.\",\n code: \"INVALID_INPUT\",\n });\n }\n\n const versionRaw = (input as { schemaVersion?: unknown }).schemaVersion;\n if (typeof versionRaw === \"string\") {\n const major = versionRaw.split(\".\")[0];\n if (major !== String(STORY_REPORT_SCHEMA_MAJOR)) {\n return err({\n message: `Schema major ${major} is not supported by this version of executable-stories-react (expected ${STORY_REPORT_SCHEMA_MAJOR}.x). Upgrade the package.`,\n code: \"SCHEMA_VERSION_MISMATCH\",\n });\n }\n }\n\n const parsed = storyReportSchema.safeParse(input);\n if (parsed.success) {\n return ok(parsed.data as StoryReport);\n }\n\n const issues = parsed.error.issues.map((i) => ({\n path: i.path.join(\".\") || \"/\",\n message: i.message,\n }));\n\n return err({\n message: `StoryReport failed validation (${issues.length} issue${issues.length === 1 ? \"\" : \"s\"}).`,\n code: \"VALIDATION_FAILED\",\n issues,\n });\n}\n"],"mappings":";;;AAuBO,I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;AAAA,MACR,CAAC;AAAA,IACH;AAAA,EACF;AAEA,QAAM,SAAS,kBAAkB,UAAU,KAAK;AAChD,MAAI,OAAO,SAAS;AAClB,WAAO,GAAG,OAAO,IAAmB;AAAA,EACtC;AAEA,QAAM,SAAS,OAAO,MAAM,OAAO,IAAI,CAAC,OAAO;AAAA,IAC7C,MAAM,EAAE,KAAK,KAAK,GAAG,KAAK;AAAA,IAC1B,SAAS,EAAE;AAAA,EACb,EAAE;AAEF,SAAO,IAAI;AAAA,IACT,SAAS,kCAAkC,OAAO,MAAM,SAAS,OAAO,WAAW,IAAI,KAAK,GAAG;AAAA,IAC/F,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AACH;","names":["jsx","formatDuration","jsx","jsx","jsx","jsx","jsxs","useContext","EMPTY_RENDERERS","useContext","jsx","jsxs","jsx","jsxs","jsx","Fragment","jsx","jsxs","Fragment","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","jsxs","jsx","Fragment","jsx","jsxs","safeStringify","jsx","Fragment","jsx","jsx","jsxs","isLocalFsPath","safeImageUrl","jsx","jsxs","isLocalFsPath","safeImageUrl","Fragment","jsx","jsxs","formatDuration","jsx","jsxs","formatDuration","createContext","useContext","Fragment","jsx","jsxs","useEffect","useState","createContext","useContext","jsxs","useState","useEffect","createContext","useContext","useState","createContext","useContext","jsx","jsx","jsx","jsxs","jsx","jsxs","formatDuration","Fragment","jsx","jsx","jsxs","Fragment","jsx","jsxs","jsx","cva","jsx","cva","jsx","jsx","jsx","jsxs","formatDuration","jsx","jsxs","formatDuration","jsx","jsxs","Fragment","jsx","jsxs","useMemo","jsx","jsxs","useMemo","jsx","jsxs","useEffect","useRef","useState","Fragment","jsx","jsxs","useRef","useState","useEffect","err","jsx","useState","jsx","jsxs","jsxs","jsx","jsx","jsx","jsxs","useState"]}