pagegraph 0.5.0 → 0.6.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/README.md +80 -4
- package/dist/audit.d.ts +8 -3
- package/dist/audit.js +1931 -1
- package/dist/audit.js.map +1 -0
- package/dist/{graph-BlLoEOw2.d.ts → checks-BfsQtKga.d.ts} +43 -2
- package/dist/cli.js +41973 -35
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +7 -1
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +131 -14
- package/dist/index.js +618 -2
- package/dist/index.js.map +1 -1
- package/dist/links-sGbLkl-7.js +184 -0
- package/dist/links-sGbLkl-7.js.map +1 -0
- package/package.json +13 -8
- package/dist/audit-B96V1x3q.js +0 -1929
- package/dist/audit-B96V1x3q.js.map +0 -1
- package/dist/inspect-html-CHuoiO2s.js +0 -452
- package/dist/inspect-html-CHuoiO2s.js.map +0 -1
- package/dist/main-GFEobQTH.js +0 -750
- package/dist/main-GFEobQTH.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"main-GFEobQTH.js","names":["Data","Effect","Effect","Effect","Effect","Effect","Effect","Effect","Effect","Effect","PackageJson.version"],"sources":["../package.json","../src/cli/output.ts","../src/cli/load-config.ts","../src/cli/render.ts","../src/cli/commands/check.ts","../src/cli/commands/audit.ts","../src/cli/commands/diff.ts","../src/cli/serialize.ts","../src/cli/commands/graph.ts","../src/cli/live-inspect.ts","../src/cli/commands/inspect.ts","../src/cli/commands/robots.ts","../src/cli/commands/sitemap.ts","../src/cli/cli.ts","../src/cli/main.ts"],"sourcesContent":["","/**\n * Shared surfaces for the `pagegraph` CLI. The three output planes:\n * - **data** → stdout via {@link printJson} / {@link printText}. Under `--json`\n * this is the *only* thing on stdout: no ANSI, no status, valid JSON.\n * - **status** → stderr via Effect leveled logging (`Effect.logInfo` /\n * `Effect.logDebug`), routed off stdout by `Logger.LogToStderr` in `main.ts`\n * and gated by the built-in `--log-level` flag.\n * - **diagnostics** → stderr; expected failures surface as {@link SeoCliError},\n * printed by the entrypoint with a non-zero exit.\n */\n\nimport * as Console from \"effect/Console\";\nimport * as Data from \"effect/Data\";\nimport * as Option from \"effect/Option\";\nimport * as Flag from \"effect/unstable/cli/Flag\";\n\n/** Expected, user-facing CLI failure — message to stderr, process exits non-zero. */\nexport class SeoCliError extends Data.TaggedError(\"SeoCliError\")<{\n readonly message: string;\n}> {}\n\n/** Machine-readable output. When set, stdout is exactly the JSON payload. */\nexport const jsonFlag = Flag.boolean(\"json\").pipe(\n Flag.withDescription(\"Emit the payload as JSON on stdout (no status, no color)\"),\n Flag.withDefault(false),\n);\n\n/**\n * Absolute origin the sitemap/robots projection is rendered under. It carries no\n * static default: the fallback is the host's own `origin` from `seo.config.ts`,\n * which is not known until the config is loaded. Resolve it with {@link originOf}.\n */\nexport const originFlag = Flag.string(\"origin\").pipe(\n Flag.withDescription(\"Absolute origin for URLs (default: `origin` from seo.config.ts)\"),\n Flag.optional,\n);\n\n/** The `--origin` flag when given, else the origin the config declares. */\nexport const originOf = (flag: Option.Option<string>, configured: string): string =>\n Option.getOrElse(flag, () => configured);\n\n/**\n * `--indexable` (default true) / `--no-indexable`. A non-indexable host yields a\n * disallow-all robots.txt with no Sitemap line — the preview posture.\n */\nexport const indexableFlag = Flag.boolean(\"indexable\").pipe(\n Flag.withDescription(\"Render as an indexable host; --no-indexable = disallow-all robots.txt\"),\n Flag.withDefault(true),\n);\n\n/** Data plane: pretty-printed JSON on stdout. */\nexport const printJson = (value: unknown) => Console.log(JSON.stringify(value, null, 2));\n\n/** Data plane: a block of already-formatted text on stdout. */\nexport const printText = (text: string) => Console.log(text);\n","/**\n * Config discovery and graph acquisition for the `pagegraph` CLI.\n *\n * The CLI knows how to *view* a graph; the host knows how to *produce* one. That\n * seam is a `seo.config.ts` at the app root, found by walking up from the working\n * directory — so `bun run pagegraph check` works from anywhere inside the app.\n *\n * The config is a TypeScript module the CLI imports directly, which is one of the\n * reasons the `bin` runs under Bun (the other being the synchronous fd-1 flush in\n * `main.ts`).\n */\n\nimport { existsSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\n\nimport * as Effect from \"effect/Effect\";\nimport * as Predicate from \"effect/Predicate\";\nimport type * as Scope from \"effect/Scope\";\n\nimport type { SeoCliConfig } from \"../config\";\nimport type { SeoGraph } from \"../core/graph\";\nimport { SeoCliError } from \"./output\";\n\nconst CONFIG_FILENAMES = [\"seo.config.ts\", \"seo.config.js\", \"seo.config.mjs\"] as const;\n\nconst messageOf = (cause: unknown): string =>\n cause instanceof Error ? cause.message : String(cause);\n\n/** First `seo.config.*` at or above `from`, or undefined at the filesystem root. */\nconst findConfigFile = (from: string): string | undefined => {\n let directory = resolve(from);\n for (;;) {\n for (const filename of CONFIG_FILENAMES) {\n const candidate = join(directory, filename);\n if (existsSync(candidate)) return candidate;\n }\n const parent = dirname(directory);\n if (parent === directory) return undefined;\n directory = parent;\n }\n};\n\nconst isStringArray = (value: unknown): value is ReadonlyArray<string> =>\n Array.isArray(value) && value.every(Predicate.isString);\n\n/**\n * `seo.config.ts` is the consumer's file and may be plain JS, so its types are\n * a suggestion, not a guarantee. Check every field the commands actually read —\n * an undefined `origin` would otherwise surface as \"undefined/pricing\" in a\n * rendered sitemap rather than as an error here.\n */\nconst isSeoCliConfig = (value: unknown): value is SeoCliConfig =>\n Predicate.isObject(value) &&\n Predicate.isFunction(value[\"loadGraph\"]) &&\n Predicate.isString(value[\"origin\"]) &&\n isStringArray(value[\"disallow\"]) &&\n (value[\"contentSignal\"] === undefined || Predicate.isString(value[\"contentSignal\"])) &&\n (value[\"directives\"] === undefined || isStringArray(value[\"directives\"])) &&\n (value[\"transform\"] === undefined || Predicate.isFunction(value[\"transform\"]));\n\n/**\n * Load the app's `seo.config.ts`. Cheap to run more than once per process: the\n * ESM cache evaluates the config module exactly once.\n */\nexport const loadSeoConfig: Effect.Effect<SeoCliConfig, SeoCliError> = Effect.gen(function* () {\n const cwd = process.cwd();\n const configPath = findConfigFile(cwd);\n if (configPath === undefined) {\n return yield* new SeoCliError({\n message: `No ${CONFIG_FILENAMES[0]} in ${cwd} or any parent directory. Create one that exports \\`defineSeoConfig({ origin, disallow, loadGraph })\\` from \"pagegraph/config\".`,\n });\n }\n\n yield* Effect.logDebug(`Loading SEO config from ${configPath}`);\n\n const module = yield* Effect.tryPromise({\n try: () => import(pathToFileURL(configPath).href) as Promise<{ default?: unknown }>,\n catch: (cause) =>\n new SeoCliError({ message: `Could not load ${configPath}: ${messageOf(cause)}` }),\n });\n\n if (!isSeoCliConfig(module.default)) {\n return yield* new SeoCliError({\n message: `${configPath} must default-export defineSeoConfig({ origin, disallow, loadGraph }).`,\n });\n }\n return module.default;\n});\n\n/**\n * The live SEO graph as a scoped resource: whatever the loader acquired (for\n * {@link viteGraphLoader}, an in-process Vite server) is released when the\n * surrounding `Effect.scoped` exits, on success or failure.\n */\nexport const acquireGraph = (\n config: SeoCliConfig,\n): Effect.Effect<SeoGraph, SeoCliError, Scope.Scope> =>\n Effect.gen(function* () {\n yield* Effect.logDebug(\"Loading the SEO graph…\");\n\n const loaded = yield* Effect.acquireRelease(\n Effect.tryPromise({\n try: () => config.loadGraph(),\n catch: (cause) => new SeoCliError({ message: messageOf(cause) }),\n }),\n // The graph is already in hand by release time, so a failed dispose must\n // not take the command down with it — a leaked Vite server in a\n // short-lived CLI process is worth a warning, not a crash.\n (acquired) =>\n Effect.promise(() => acquired.dispose()).pipe(\n Effect.catchDefect((defect) =>\n Effect.logWarning(`Could not dispose the SEO graph loader: ${messageOf(defect)}`),\n ),\n ),\n );\n\n yield* Effect.logDebug(\n `Loaded SEO graph: ${loaded.graph.nodes.size} nodes, ${loaded.graph.edges.length} edges.`,\n );\n return loaded.graph;\n });\n","/**\n * Human-plane formatters for the `pagegraph` CLI. Every function here is pure and\n * returns a plain string (no ANSI, no I/O) — commands print it to stdout via\n * `printText`, and the machine plane (`--json` / `--format json`) bypasses this\n * module entirely. Keeping it string-in/string-out makes the formatting unit-\n * testable and keeps color/TTY concerns out of the command handlers.\n */\n\nimport type { Violation } from \"../core/checks\";\nimport type { SeoGraph, SeoNode } from \"../core/graph\";\nimport type { LiveHeadReport } from \"../core/inspect-html\";\nimport type { NodeReport } from \"../core/projections\";\n\n/** Count of edges pointing *at* each node — 0 means nothing links to it. */\nconst incomingCounts = (graph: SeoGraph): Map<string, number> => {\n const counts = new Map<string, number>();\n for (const node of graph.nodes.keys()) counts.set(node, 0);\n for (const edge of graph.edges) counts.set(edge.to, (counts.get(edge.to) ?? 0) + 1);\n return counts;\n};\n\n/** Paths nothing links to (zero incoming edges) — the \"orphan\" set. */\nexport const orphanPaths = (graph: SeoGraph): Set<string> => {\n const incoming = incomingCounts(graph);\n return new Set([...graph.nodes.keys()].filter((path) => (incoming.get(path) ?? 0) === 0));\n};\n\nconst byPath = (a: SeoNode, b: SeoNode): number => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0);\n\n/** A compact one-line summary of a node's policy — kind and the flags that matter. */\nconst nodeMarkers = (node: SeoNode): string => {\n const markers: Array<string> = [node.kind];\n if (node.source !== \"route\") markers.push(node.source);\n const sitemap = node.policy.sitemap;\n if (sitemap) markers.push(`sitemap:${sitemap.priority.toFixed(1)}`);\n if (node.policy.robots?.includes(\"noindex\")) markers.push(\"noindex\");\n if (node.policy.redirectTo) markers.push(`→ ${node.policy.redirectTo}`);\n return markers.join(\" \");\n};\n\n/** Map each node to its parent = the longest strict path-prefix that is also a node. */\nconst parentOf = (path: string, nodePaths: Set<string>): string | undefined => {\n if (path === \"/\") return undefined;\n const segments = path.split(\"/\").filter(Boolean);\n for (let depth = segments.length - 1; depth >= 1; depth--) {\n const candidate = `/${segments.slice(0, depth).join(\"/\")}`;\n if (nodePaths.has(candidate)) return candidate;\n }\n return nodePaths.has(\"/\") ? \"/\" : undefined;\n};\n\n/** Render the graph as an indented path hierarchy with per-node markers. */\nexport const renderTree = (graph: SeoGraph): string => {\n const nodePaths = new Set(graph.nodes.keys());\n const children = new Map<string, Array<string>>();\n const roots: Array<string> = [];\n for (const path of [...nodePaths].sort()) {\n const parent = parentOf(path, nodePaths);\n if (parent === undefined) roots.push(path);\n else {\n const bucket = children.get(parent);\n if (bucket) bucket.push(path);\n else children.set(parent, [path]);\n }\n }\n\n const lines: Array<string> = [];\n const walk = (path: string, depth: number): void => {\n const node = graph.nodes.get(path)!;\n lines.push(`${\" \".repeat(depth)}${path} · ${nodeMarkers(node)}`);\n for (const child of children.get(path) ?? []) walk(child, depth + 1);\n };\n for (const root of roots) walk(root, 0);\n\n return `${lines.join(\"\\n\")}\\n\\n${renderSummary(graph)}`;\n};\n\n/** One-line-per-node list of nodes nothing links to (no incoming graph edges). */\nexport const renderOrphans = (graph: SeoGraph): string => {\n const orphans = orphanPaths(graph);\n const orphanNodes = [...graph.nodes.values()]\n .filter((node) => orphans.has(node.path))\n .sort(byPath);\n if (orphanNodes.length === 0) return \"No orphan nodes — every node has an incoming edge.\";\n const lines = orphanNodes.map((node) => `${node.path} · ${nodeMarkers(node)}`);\n return [\n `Orphans — ${orphanNodes.length} node(s) with no incoming edge (reachable only via nav/sitemap):`,\n \"\",\n ...lines,\n ].join(\"\\n\");\n};\n\nconst sanitizeId = (path: string): string => `n_${path.replace(/[^a-zA-Z0-9]/g, \"_\")}`;\n\n/** Render the graph (or just its orphans) as a Mermaid `graph LR` diagram. */\nexport const renderMermaid = (graph: SeoGraph, orphansOnly: boolean): string => {\n const orphans = orphanPaths(graph);\n const nodes = [...graph.nodes.values()]\n .filter((node) => !orphansOnly || orphans.has(node.path))\n .sort(byPath);\n const visible = new Set(nodes.map((node) => node.path));\n\n const lines: Array<string> = [\"graph LR\"];\n for (const node of nodes) {\n lines.push(` ${sanitizeId(node.path)}[\"${node.path}\"]`);\n }\n if (!orphansOnly) {\n for (const edge of graph.edges) {\n if (!visible.has(edge.from) || !visible.has(edge.to)) continue;\n lines.push(` ${sanitizeId(edge.from)} -->|${edge.type}| ${sanitizeId(edge.to)}`);\n }\n }\n return lines.join(\"\\n\");\n};\n\nconst renderSummary = (graph: SeoGraph): string => {\n const bySource = new Map<string, number>();\n for (const node of graph.nodes.values()) {\n bySource.set(node.source, (bySource.get(node.source) ?? 0) + 1);\n }\n const byEdge = new Map<string, number>();\n for (const edge of graph.edges) byEdge.set(edge.type, (byEdge.get(edge.type) ?? 0) + 1);\n const sources = [...bySource.entries()].map(([source, count]) => `${source} ${count}`).join(\", \");\n const edges = [...byEdge.entries()].map(([type, count]) => `${type} ${count}`).join(\", \");\n return `${graph.nodes.size} nodes (${sources}) · ${graph.edges.length} edges (${edges})`;\n};\n\n/** Static `inspect <path>` report: the node's declaration, sitemap status, edges. */\nexport const renderNodeReport = (report: NodeReport): string => {\n const { node } = report;\n const lines: Array<string> = [\n node.path,\n ` kind ${node.kind}`,\n ` source ${node.source}`,\n ` in sitemap ${report.inSitemap ? \"yes\" : \"no\"}`,\n ];\n if (node.policy.robots) lines.push(` robots ${node.policy.robots}`);\n if (node.policy.redirectTo) lines.push(` redirect → ${node.policy.redirectTo}`);\n if (node.policy.link) {\n lines.push(` link.title ${node.policy.link.title}`);\n lines.push(` link.desc ${node.policy.link.description}`);\n }\n if (node.instance) {\n lines.push(` title ${node.instance.title}`);\n if (node.instance.description) lines.push(` description ${node.instance.description}`);\n if (node.instance.publishedAt) lines.push(` published ${node.instance.publishedAt}`);\n if (node.instance.modifiedAt) lines.push(` modified ${node.instance.modifiedAt}`);\n }\n const edgeLine = (label: string, edges: NodeReport[\"outgoing\"]): void => {\n if (edges.length === 0) return;\n lines.push(` ${label}`);\n for (const edge of edges) {\n const other = label === \"outgoing\" ? edge.to : edge.from;\n lines.push(` ${edge.type.padEnd(13)} ${other}`);\n }\n };\n edgeLine(\"outgoing\", report.outgoing);\n edgeLine(\"incoming\", report.incoming);\n return lines.join(\"\\n\");\n};\n\n/** Live `inspect <url> --live` report: fetched head tags + JSON-LD validation. */\nexport const renderLiveReport = (report: LiveHeadReport): string => {\n const lines: Array<string> = [\n `${report.url} (HTTP ${report.status})`,\n ` title ${report.title ?? \"—\"}`,\n ` description ${report.description ?? \"—\"}`,\n ` canonical ${report.canonical ?? \"—\"}`,\n ` robots ${report.robots ?? \"—\"}`,\n ];\n const kv = (label: string, map: Record<string, string>): void => {\n const keys = Object.keys(map);\n if (keys.length === 0) return;\n lines.push(` ${label}`);\n for (const key of keys) lines.push(` ${key.padEnd(18)} ${map[key]}`);\n };\n kv(\"open graph\", report.og);\n kv(\"twitter\", report.twitter);\n if (report.jsonLd.length > 0) {\n lines.push(\" json-ld\");\n for (const block of report.jsonLd) {\n lines.push(` ${block.valid ? \"✓\" : \"✗\"} ${block.type}`);\n for (const error of block.errors) lines.push(` ${error}`);\n }\n }\n if (report.issues.length > 0) {\n lines.push(\"\", ` ${report.issues.length} issue(s):`);\n for (const issue of report.issues) lines.push(` ✗ ${issue}`);\n } else {\n lines.push(\"\", \" ✓ required tags present, JSON-LD valid\");\n }\n return lines.join(\"\\n\");\n};\n\n/** `pagegraph check` report: violations grouped by severity, with a headline count. */\nexport const renderViolations = (violations: ReadonlyArray<Violation>): string => {\n const structural = violations.filter((violation) => violation.severity === \"structural\");\n const editorial = violations.filter((violation) => violation.severity === \"editorial\");\n\n if (violations.length === 0) return \"✓ No violations. The SEO graph is clean.\";\n\n const block = (title: string, group: ReadonlyArray<Violation>): Array<string> => {\n if (group.length === 0) return [];\n const lines = [`${title} (${group.length}):`, \"\"];\n for (const violation of group) {\n const where = violation.path ? ` ${violation.path}` : \"\";\n lines.push(` ✗ [${violation.rule}]${where}`);\n lines.push(` ${violation.message}`);\n if (violation.fix) lines.push(` fix: ${violation.fix}`);\n }\n lines.push(\"\");\n return lines;\n };\n\n const parts: Array<string> = [\n ...block(\"Structural\", structural),\n ...block(\"Editorial\", editorial),\n structural.length > 0\n ? `${structural.length} structural, ${editorial.length} editorial — structural violations fail the check.`\n : `${editorial.length} editorial warning(s) — no structural violations.`,\n ];\n return parts.join(\"\\n\");\n};\n","import * as Effect from \"effect/Effect\";\nimport * as Command from \"effect/unstable/cli/Command\";\n\nimport { checkGraph, hasStructuralViolations } from \"../../core/checks\";\nimport { acquireGraph, loadSeoConfig } from \"../load-config\";\nimport { jsonFlag, printJson, printText, SeoCliError } from \"../output\";\nimport { renderViolations } from \"../render\";\n\nexport const checkCommand = Command.make(\"check\", { json: jsonFlag }).pipe(\n Command.withDescription(\"Check the SEO graph; exit 1 on any structural violation\"),\n Command.withExamples([\n { command: \"pagegraph check\", description: \"Run every rule and print the violations\" },\n { command: \"pagegraph check --json\", description: \"Violations as JSON (exit 1 iff structural)\" },\n ]),\n Command.withHandler(\n Effect.fnUntraced(function* ({ json }) {\n const config = yield* loadSeoConfig;\n const graph = yield* Effect.scoped(acquireGraph(config));\n const violations = checkGraph(graph);\n const structural = violations.filter((violation) => violation.severity === \"structural\");\n\n if (json) {\n yield* printJson({\n ok: structural.length === 0,\n structural: structural.length,\n editorial: violations.length - structural.length,\n violations,\n });\n } else {\n yield* printText(renderViolations(violations));\n }\n\n if (hasStructuralViolations(violations)) {\n return yield* new SeoCliError({\n message: `${structural.length} structural violation(s) — see the report above.`,\n });\n }\n }),\n ),\n);\n","import * as Argument from \"effect/unstable/cli/Argument\";\nimport * as Command from \"effect/unstable/cli/Command\";\nimport * as Effect from \"effect/Effect\";\nimport * as Flag from \"effect/unstable/cli/Flag\";\nimport * as Option from \"effect/Option\";\n\nimport { Audit, AuditLayer } from \"../../audit\";\nimport { makeHostedScanner } from \"../../audit/scanners/hosted\";\nimport { makeHttpScanner } from \"../../audit/scanners/http\";\nimport { makeLighthouseScanner } from \"../../audit/scanners/lighthouse\";\nimport { renderAuditMarkdown, writeAuditFiles } from \"../../audit/render\";\nimport { jsonFlag, printJson, printText, SeoCliError } from \"../output\";\n\nconst urls = Argument.string(\"url\").pipe(\n Argument.withDescription(\"One or more absolute http(s) URLs\"),\n Argument.variadic({ min: 1 }),\n);\nconst allowPrivate = Flag.boolean(\"allow-private\").pipe(\n Flag.withDescription(\n \"Allow localhost and private addresses (local development only)\",\n ),\n Flag.withDefault(false),\n);\nconst probeOnly = Flag.boolean(\"probe-only\").pipe(\n Flag.withDescription(\"Run HTTP probes without Lighthouse\"),\n Flag.withDefault(false),\n);\nconst hosted = Flag.boolean(\"hosted\").pipe(\n Flag.withDescription(\"Opt in to external agent-readiness scanners\"),\n Flag.withDefault(false),\n);\nconst formFactor = Flag.choice(\"form-factor\", [\n \"mobile\",\n \"desktop\",\n] as const).pipe(\n Flag.withDescription(\"Lighthouse form factor\"),\n Flag.withDefault(\"mobile\"),\n);\nconst runs = Flag.integer(\"runs\").pipe(\n Flag.withDescription(\"Lighthouse runs per target\"),\n Flag.withDefault(1),\n);\nconst concurrency = Flag.integer(\"concurrency\").pipe(\n Flag.withDescription(\"Maximum concurrent target/scanner pairs\"),\n Flag.withDefault(4),\n);\nconst requestTimeoutMs = Flag.integer(\"request-timeout-ms\").pipe(\n Flag.withDescription(\"HTTP request timeout in milliseconds\"),\n Flag.withDefault(15_000),\n);\nconst scannerTimeoutMs = Flag.integer(\"scanner-timeout-ms\").pipe(\n Flag.withDescription(\"Lighthouse and hosted scanner timeout in milliseconds\"),\n Flag.withDefault(180_000),\n);\nconst maxBodyBytes = Flag.integer(\"max-body-bytes\").pipe(\n Flag.withDescription(\"Maximum captured response bytes\"),\n Flag.withDefault(2_000_000),\n);\nconst outputDir = Flag.string(\"output-dir\").pipe(\n Flag.withDescription(\n \"Atomically write timestamped JSON and Markdown artifacts\",\n ),\n Flag.optional,\n);\n\nconst positive = (\n name: string,\n value: number,\n): Effect.Effect<number, SeoCliError> =>\n Number.isSafeInteger(value) && value > 0\n ? Effect.succeed(value)\n : Effect.fail(\n new SeoCliError({ message: `--${name} must be a positive integer` }),\n );\n\nexport const auditCommand = Command.make(\"audit\", {\n urls,\n json: jsonFlag,\n allowPrivate,\n probeOnly,\n hosted,\n formFactor,\n runs,\n concurrency,\n requestTimeoutMs,\n scannerTimeoutMs,\n maxBodyBytes,\n outputDir,\n}).pipe(\n Command.withDescription(\n \"Audit any website without a TanStack app or seo.config.ts\",\n ),\n Command.withExamples([\n {\n command: \"pagegraph audit https://example.com\",\n description: \"HTTP and Lighthouse audit\",\n },\n {\n command: \"pagegraph audit https://example.com --json\",\n description: \"One JSON report on stdout\",\n },\n {\n command: \"pagegraph audit http://localhost:3000 --allow-private --probe-only\",\n description: \"Audit a local app\",\n },\n ]),\n Command.withHandler(\n Effect.fn(\"SeoCli.audit\")(function* (options) {\n const checkedRuns = yield* positive(\"runs\", options.runs);\n const checkedConcurrency = yield* positive(\n \"concurrency\",\n options.concurrency,\n );\n const checkedRequestTimeout = yield* positive(\n \"request-timeout-ms\",\n options.requestTimeoutMs,\n );\n const checkedScannerTimeout = yield* positive(\n \"scanner-timeout-ms\",\n options.scannerTimeoutMs,\n );\n const checkedMaxBody = yield* positive(\n \"max-body-bytes\",\n options.maxBodyBytes,\n );\n\n const scanners = [\n makeHttpScanner({\n allowPrivate: options.allowPrivate,\n timeoutMs: checkedRequestTimeout,\n maxBodyBytes: checkedMaxBody,\n }),\n ...(!options.probeOnly\n ? [\n makeLighthouseScanner({\n allowPrivate: options.allowPrivate,\n timeoutMs: checkedScannerTimeout,\n }),\n ]\n : []),\n ...(options.hosted\n ? [\n makeHostedScanner({\n allowPrivate: options.allowPrivate,\n timeoutMs: checkedScannerTimeout,\n maxBodyBytes: checkedMaxBody,\n origins: {\n isitagentready: \"https://isitagentready.com\",\n isAgentic: \"https://is-agentic.com\",\n },\n }),\n ]\n : []),\n ];\n\n const report = yield* Effect.gen(function* () {\n const audit = yield* Audit.Service;\n return yield* audit.run({\n targets: [...new Set(options.urls)],\n options: {\n concurrency: checkedConcurrency,\n formFactors: [options.formFactor],\n runs: checkedRuns,\n allowPrivate: options.allowPrivate,\n requestTimeoutMs: checkedRequestTimeout,\n scannerTimeoutMs: checkedScannerTimeout,\n maxBodyBytes: checkedMaxBody,\n },\n });\n }).pipe(\n Effect.provide(AuditLayer(scanners)),\n Effect.mapError((error) => new SeoCliError({ message: error.message })),\n );\n\n if (options.json) yield* printJson(report);\n else yield* printText(renderAuditMarkdown(report));\n\n if (Option.isSome(options.outputDir)) {\n const directory = options.outputDir.value;\n const artifacts = yield* Effect.tryPromise({\n try: () => writeAuditFiles(report, directory),\n catch: (cause) =>\n new SeoCliError({\n message: `Could not write audit artifacts: ${cause instanceof Error ? cause.message : String(cause)}`,\n }),\n });\n yield* Effect.logInfo(\n `Wrote ${artifacts.json} and ${artifacts.markdown}`,\n );\n }\n\n const structural = report.findings.filter(\n (finding) => finding.severity === \"structural\",\n );\n const http = report.results.filter((result) => result.scanner === \"http\");\n if (\n structural.length > 0 ||\n http.every((result) => result.status === \"error\")\n ) {\n return yield* new SeoCliError({\n message: `${structural.length} structural finding(s); see the report above.`,\n });\n }\n }),\n ),\n);\n","import { Effect, FileSystem, Schema } from \"effect\";\nimport * as Argument from \"effect/unstable/cli/Argument\";\nimport * as Command from \"effect/unstable/cli/Command\";\n\nimport {\n AuditComparisonResult,\n compareAuditReports,\n} from \"../../audit/diff\";\nimport { AuditReport } from \"../../audit/model\";\nimport { renderAuditDiff } from \"../../audit/render\";\nimport { jsonFlag, printJson, printText, SeoCliError } from \"../output\";\n\nconst before = Argument.string(\"before.json\").pipe(\n Argument.withDescription(\"Earlier pagegraph audit JSON artifact\"),\n);\nconst after = Argument.string(\"after.json\").pipe(\n Argument.withDescription(\"Later pagegraph audit JSON artifact\"),\n);\n\nconst readAuditReport = Effect.fn(\"SeoCli.readAuditReport\")(function* (\n label: \"before\" | \"after\",\n path: string,\n) {\n const fileSystem = yield* FileSystem.FileSystem;\n const contents = yield* fileSystem.readFileString(path).pipe(\n Effect.mapError(\n (error) =>\n new SeoCliError({\n message: `Could not read ${label} report ${path}: ${error.message}`,\n }),\n ),\n );\n return yield* Schema.decodeUnknownEffect(\n Schema.fromJsonString(AuditReport),\n )(contents).pipe(\n Effect.mapError(\n (error) =>\n new SeoCliError({\n message: `Invalid ${label} report ${path}: ${error.message}`,\n }),\n ),\n );\n});\n\nexport const diffCommand = Command.make(\"diff\", {\n before,\n after,\n json: jsonFlag,\n}).pipe(\n Command.withDescription(\n \"Compare two versioned pagegraph audit JSON artifacts for semantic regressions\",\n ),\n Command.withExamples([\n {\n command: \"pagegraph diff before.json after.json\",\n description: \"Render a human-readable semantic comparison\",\n },\n {\n command: \"pagegraph diff before.json after.json --json\",\n description: \"Emit one versioned JSON diff on stdout\",\n },\n ]),\n Command.withHandler(\n Effect.fn(\"SeoCli.diff\")(function* (options) {\n const beforeReport = yield* readAuditReport(\"before\", options.before);\n const afterReport = yield* readAuditReport(\"after\", options.after);\n const comparison = compareAuditReports(beforeReport, afterReport);\n if (AuditComparisonResult.$is(\"InvalidReport\")(comparison)) {\n return yield* new SeoCliError({\n message: `Invalid audit report invariants:\\n${comparison.issues.map((issue) => `- ${issue}`).join(\"\\n\")}`,\n });\n }\n\n if (options.json) yield* printJson(comparison.diff);\n else yield* printText(renderAuditDiff(comparison.diff));\n\n if (comparison.diff.outcome === \"regressed\") {\n const summary = comparison.diff.summary;\n return yield* new SeoCliError({\n message: `${summary.structuralRegressions} structural, ${summary.scannerRegressions} scanner, and ${summary.coverageRegressions} coverage regression(s); see the diff above.`,\n });\n }\n }),\n ),\n);\n","/**\n * A stable, JSON-safe projection of the {@link SeoGraph} for the `--json` /\n * `--format json` data plane. The live graph keys nodes by a `Map` (not JSON) and\n * a route policy's `crumb` may be a function (also not JSON) — this flattens the\n * `Map` to a sorted array and renders a function crumb as the sentinel\n * `\"(dynamic)\"` so the payload is deterministic and diffable across runs.\n */\n\nimport type { RouteSeo } from \"../core/declare\";\nimport type { SeoGraph, SeoNode } from \"../core/graph\";\n\ninterface SerializedPolicy {\n kind: RouteSeo[\"kind\"];\n crumb?: string | undefined;\n sitemap?: RouteSeo[\"sitemap\"] | undefined;\n robots?: string | undefined;\n related?: ReadonlyArray<string> | undefined;\n link?: RouteSeo[\"link\"] | undefined;\n redirectTo?: string | undefined;\n}\n\nexport interface SerializedNode {\n path: string;\n kind: SeoNode[\"kind\"];\n source: SeoNode[\"source\"];\n policy: SerializedPolicy;\n instance?: SeoNode[\"instance\"] | undefined;\n}\n\nexport interface SerializedGraph {\n nodes: Array<SerializedNode>;\n edges: SeoGraph[\"edges\"];\n}\n\nconst serializeCrumb = (crumb: RouteSeo[\"crumb\"]): string | undefined => {\n if (crumb === undefined) return undefined;\n return typeof crumb === \"function\" ? \"(dynamic)\" : crumb;\n};\n\n/** JSON-safe projection of one node (route policy `crumb` functions → sentinel). */\nexport const serializeNode = (node: SeoNode): SerializedNode => ({\n path: node.path,\n kind: node.kind,\n source: node.source,\n policy: {\n kind: node.policy.kind,\n crumb: serializeCrumb(node.policy.crumb),\n sitemap: node.policy.sitemap,\n robots: node.policy.robots,\n related: node.policy.related,\n link: node.policy.link,\n redirectTo: node.policy.redirectTo,\n },\n instance: node.instance,\n});\n\n/** Flatten the graph to a sorted, JSON-safe shape. Nodes are ordered by path. */\nexport const serializeGraph = (graph: SeoGraph): SerializedGraph => ({\n nodes: [...graph.nodes.values()]\n .sort((a, b) => (a.path < b.path ? -1 : a.path > b.path ? 1 : 0))\n .map(serializeNode),\n edges: graph.edges,\n});\n","import * as Effect from \"effect/Effect\";\nimport * as Command from \"effect/unstable/cli/Command\";\nimport * as Flag from \"effect/unstable/cli/Flag\";\n\nimport { acquireGraph, loadSeoConfig } from \"../load-config\";\nimport { printJson, printText } from \"../output\";\nimport { orphanPaths, renderMermaid, renderOrphans, renderTree } from \"../render\";\nimport { serializeGraph } from \"../serialize\";\n\nconst formatFlag = Flag.choice(\"format\", [\"tree\", \"mermaid\", \"json\"]).pipe(\n Flag.withDescription(\"Output format: tree (default), mermaid diagram, or json\"),\n Flag.withDefault(\"tree\"),\n);\n\nconst orphansFlag = Flag.boolean(\"orphans\").pipe(\n Flag.withDescription(\"Show only orphan nodes (nothing links to them)\"),\n Flag.withDefault(false),\n);\n\nexport const graphCommand = Command.make(\"graph\", {\n format: formatFlag,\n orphans: orphansFlag,\n}).pipe(\n Command.withDescription(\"Render the SEO graph as a tree, a Mermaid diagram, or JSON\"),\n Command.withExamples([\n { command: \"pagegraph graph\", description: \"The graph as an indented path tree\" },\n { command: \"pagegraph graph --format mermaid\", description: \"A Mermaid diagram of nodes and edges\" },\n { command: \"pagegraph graph --orphans\", description: \"Only nodes with no incoming edge\" },\n { command: \"pagegraph graph --format json\", description: \"The serialized graph on stdout\" },\n ]),\n Command.withHandler(\n Effect.fnUntraced(function* ({ format, orphans }) {\n const config = yield* loadSeoConfig;\n const graph = yield* Effect.scoped(acquireGraph(config));\n\n if (format === \"json\") {\n const serialized = serializeGraph(graph);\n if (!orphans) return yield* printJson(serialized);\n const orphanSet = orphanPaths(graph);\n return yield* printJson({\n nodes: serialized.nodes.filter((node) => orphanSet.has(node.path)),\n edges: serialized.edges.filter(\n (edge) => orphanSet.has(edge.from) && orphanSet.has(edge.to),\n ),\n });\n }\n\n if (format === \"mermaid\") return yield* printText(renderMermaid(graph, orphans));\n return yield* printText(orphans ? renderOrphans(graph) : renderTree(graph));\n }),\n ),\n);\n","/**\n * `pagegraph inspect <url> --live`: fetch a URL and hand its body to the pure head\n * validator in `../inspect-html`. The fetch is all that lives here — the\n * validation is a library capability, not a CLI one, so it stays out of the\n * Effect-bearing half of the package.\n */\n\nimport * as Effect from \"effect/Effect\";\n\nimport { inspectHtml, type LiveHeadReport } from \"../core/inspect-html\";\nimport { SeoCliError } from \"./output\";\n\n/** Fetch a URL and inspect its `<head>`. Network failures surface as SeoCliError. */\nexport const fetchAndInspect = (url: string): Effect.Effect<LiveHeadReport, SeoCliError> =>\n Effect.tryPromise({\n try: async () => {\n const response = await fetch(url, { headers: { \"user-agent\": \"pagegraph-cli\" } });\n const html = await response.text();\n return inspectHtml(url, response.status, html);\n },\n catch: (cause) =>\n new SeoCliError({\n message: `Could not fetch ${url}: ${cause instanceof Error ? cause.message : String(cause)}`,\n }),\n });\n","import * as Effect from \"effect/Effect\";\nimport * as Argument from \"effect/unstable/cli/Argument\";\nimport * as Command from \"effect/unstable/cli/Command\";\nimport * as Flag from \"effect/unstable/cli/Flag\";\n\nimport { hasBlockingIssues } from \"../../core/inspect-html\";\nimport { inspectNode } from \"../../core/projections\";\nimport { fetchAndInspect } from \"../live-inspect\";\nimport { acquireGraph, loadSeoConfig } from \"../load-config\";\nimport { jsonFlag, printJson, printText, SeoCliError } from \"../output\";\nimport { renderLiveReport, renderNodeReport } from \"../render\";\nimport { serializeNode } from \"../serialize\";\n\nconst targetArg = Argument.string(\"target\").pipe(\n Argument.withDescription(\"A route path (e.g. /pricing), or a full URL with --live\"),\n);\n\nconst liveFlag = Flag.boolean(\"live\").pipe(\n Flag.withDescription(\"Fetch the URL and inspect its rendered <head> and JSON-LD\"),\n Flag.withDefault(false),\n);\n\nexport const inspectCommand = Command.make(\"inspect\", {\n target: targetArg,\n live: liveFlag,\n json: jsonFlag,\n}).pipe(\n Command.withDescription(\n \"Inspect one page: its graph declaration, or its live <head> with --live\",\n ),\n Command.withExamples([\n {\n command: \"pagegraph inspect /pricing\",\n description: \"The graph node, policy, and edges for a path\",\n },\n {\n command: \"pagegraph inspect https://example.com/pricing --live\",\n description: \"Fetch the page and validate its head tags + JSON-LD\",\n },\n { command: \"pagegraph inspect /blog/some-post --json\", description: \"The node report as JSON\" },\n ]),\n Command.withHandler(\n Effect.fnUntraced(function* ({ target, live, json }) {\n if (live) {\n const report = yield* fetchAndInspect(target);\n if (json) yield* printJson(report);\n else yield* printText(renderLiveReport(report));\n if (hasBlockingIssues(report)) {\n return yield* new SeoCliError({\n message: `${report.issues.length} issue(s) found at ${target}.`,\n });\n }\n return;\n }\n\n const config = yield* loadSeoConfig;\n const graph = yield* Effect.scoped(acquireGraph(config));\n const report = inspectNode(graph, target);\n if (report === undefined) {\n return yield* new SeoCliError({\n message: `No node at \"${target}\". Run \\`pagegraph graph\\` to list paths, or pass a URL with --live.`,\n });\n }\n if (json) {\n return yield* printJson({\n node: serializeNode(report.node),\n inSitemap: report.inSitemap,\n incoming: report.incoming,\n outgoing: report.outgoing,\n });\n }\n return yield* printText(renderNodeReport(report));\n }),\n ),\n);\n","import * as Effect from \"effect/Effect\";\nimport * as Command from \"effect/unstable/cli/Command\";\n\nimport { renderRobots } from \"../../core/projections\";\nimport { acquireGraph, loadSeoConfig } from \"../load-config\";\nimport { indexableFlag, originFlag, originOf, printText } from \"../output\";\n\nexport const robotsCommand = Command.make(\"robots\", {\n origin: originFlag,\n indexable: indexableFlag,\n}).pipe(\n Command.withDescription(\"Render robots.txt from the graph (the exact server-route output)\"),\n Command.withExamples([\n { command: \"pagegraph robots\", description: \"The robots.txt, under the origin from seo.config.ts\" },\n {\n command: \"pagegraph robots --origin https://preview.example.com --no-indexable\",\n description: \"Disallow-all with no Sitemap line — the preview posture\",\n },\n ]),\n Command.withHandler(\n Effect.fnUntraced(function* ({ origin, indexable }) {\n const config = yield* loadSeoConfig;\n const graph = yield* Effect.scoped(acquireGraph(config));\n yield* printText(\n renderRobots(graph, {\n origin: originOf(origin, config.origin),\n indexable,\n disallow: config.disallow,\n contentSignal: config.contentSignal,\n directives: config.directives,\n transform: config.transform,\n }),\n );\n }),\n ),\n);\n","import * as Effect from \"effect/Effect\";\nimport * as Command from \"effect/unstable/cli/Command\";\n\nimport { renderSitemap } from \"../../core/projections\";\nimport { acquireGraph, loadSeoConfig } from \"../load-config\";\nimport { indexableFlag, originFlag, originOf, printText } from \"../output\";\n\nexport const sitemapCommand = Command.make(\"sitemap\", {\n origin: originFlag,\n indexable: indexableFlag,\n}).pipe(\n Command.withDescription(\"Render sitemap.xml from the graph (the exact server-route output)\"),\n Command.withExamples([\n {\n command: \"pagegraph sitemap\",\n description: \"The sitemap XML, under the origin from seo.config.ts\",\n },\n {\n command: \"pagegraph sitemap --origin https://preview.example.com --no-indexable\",\n description: \"Sitemap body is host-independent; robots.txt is what gates crawling\",\n },\n ]),\n Command.withHandler(\n Effect.fnUntraced(function* ({ origin, indexable }) {\n const config = yield* loadSeoConfig;\n const graph = yield* Effect.scoped(acquireGraph(config));\n yield* printText(\n renderSitemap(graph, { origin: originOf(origin, config.origin), indexable }),\n );\n }),\n ),\n);\n","import * as Command from \"effect/unstable/cli/Command\";\n\nimport { checkCommand } from \"./commands/check\";\nimport { auditCommand } from \"./commands/audit\";\nimport { diffCommand } from \"./commands/diff\";\nimport { graphCommand } from \"./commands/graph\";\nimport { inspectCommand } from \"./commands/inspect\";\nimport { robotsCommand } from \"./commands/robots\";\nimport { sitemapCommand } from \"./commands/sitemap\";\n\n/**\n * Root `pagegraph` command. Every subcommand reads the same SEO graph that render\n * time, the sitemap/robots server routes, and the test suite read — the one the\n * app's `seo.config.ts` loader produces. Route declarations are the single\n * source of truth, and these are pure views over them.\n */\nexport const cli = Command.make(\"pagegraph\").pipe(\n Command.withDescription(\n \"Inspect and audit a TanStack Start SEO graph: sitemap, robots, cross-links, structured data, and link decisions.\",\n ),\n Command.withExamples([\n {\n command: \"pagegraph audit https://example.com\",\n description: \"Audit any deployed website\",\n },\n {\n command: \"pagegraph check\",\n description: \"Fail (exit 1) on any structural SEO violation\",\n },\n { command: \"pagegraph graph\", description: \"Print the SEO graph as a tree\" },\n { command: \"pagegraph sitemap\", description: \"Render sitemap.xml\" },\n ]),\n Command.withSubcommands([\n auditCommand,\n diffCommand,\n graphCommand,\n inspectCommand,\n checkCommand,\n sitemapCommand,\n robotsCommand,\n ]),\n);\n","/**\n * The `pagegraph` CLI program (Bun runtime), wiring the three output planes:\n * - **data** → stdout, via `Console.log` in the command handlers.\n * - **status** → stderr, via `Logger.LogToStderr(true)`: the built-in loggers\n * call `console.error`, so `Effect.log*` never touches stdout. The built-in\n * `--log-level` flag (from `Command.run`) gates them.\n * - **diagnostics** → stderr: an expected `SeoCliError` prints `✗ <message>`.\n *\n * This module is what `bin.ts` dynamic-imports, and it is the only place Effect\n * enters the package — which is what keeps Effect an *optional* peer dependency\n * that no consumer of `pagegraph` or `pagegraph/react` ever installs.\n *\n * Two Bun-specific wrinkles are handled here:\n * - `Command.run` writes its help to stdout, so a flag typo would dump the full\n * help there. Under Bun, `Console.log` bypasses `process.stdout.write` (it\n * calls `console.log` natively), so the buffer intercepts `console.log`.\n * - A graph loader may leave handles alive after the command finishes (the Vite\n * loader's worker threads do), and the default teardown only force-exits on a\n * non-zero code, so a custom teardown exits on success too.\n */\n\nimport * as fs from \"node:fs\";\n\nimport * as BunRuntime from \"@effect/platform-bun/BunRuntime\";\nimport * as BunServices from \"@effect/platform-bun/BunServices\";\nimport * as Console from \"effect/Console\";\nimport * as Effect from \"effect/Effect\";\nimport * as Logger from \"effect/Logger\";\nimport * as Runtime from \"effect/Runtime\";\nimport * as CliError from \"effect/unstable/cli/CliError\";\nimport * as Command from \"effect/unstable/cli/Command\";\n\nimport PackageJson from \"../../package.json\" with { type: \"json\" };\nimport { cli } from \"./cli\";\n\ntype StdoutState = {\n readonly originalLog: typeof console.log;\n readonly buffer: Array<ReadonlyArray<unknown>>;\n discard: boolean;\n};\n\n/**\n * Write one buffered line synchronously to fd 1, looping over partial writes and\n * retrying `EAGAIN`. The forced `process.exit` needed to escape the Vite loader's\n * lingering handles truncates async stdout to a slow pipe (`… | jq`) at the OS\n * pipe-buffer boundary; a synchronous write blocks until every byte lands, so\n * `process.exit` afterwards can't cut it off.\n */\nconst writeLineSync = (line: string): void => {\n const buffer = Buffer.from(`${line}\\n`, \"utf8\");\n let offset = 0;\n while (offset < buffer.length) {\n // NOTE: fs.writeSync throws EAGAIN; the write must stay raw-synchronous so process.exit can't truncate stdout\n try {\n offset += fs.writeSync(1, buffer, offset, buffer.length - offset);\n } catch (cause) {\n if ((cause as NodeJS.ErrnoException).code === \"EAGAIN\") continue;\n // NOTE: re-throw non-EAGAIN fs.writeSync errors out of the raw sync-flush boundary\n throw cause;\n }\n }\n};\n\nconst flushStdout = (state: StdoutState): void => {\n for (const args of state.buffer) {\n writeLineSync(args.map((arg) => (typeof arg === \"string\" ? arg : String(arg))).join(\" \"));\n }\n state.buffer.length = 0;\n};\n\n/**\n * `Command.run` already prints the error itself to stderr (showHelp → Console.error);\n * this adds only the \"Try …\" nudge, and `commandPath` already starts with \"seo\".\n */\nconst formatParseHint = (error: CliError.ShowHelp): string => {\n const helpTarget = error.commandPath.length > 0 ? error.commandPath.join(\" \") : \"seo\";\n return `Try: ${helpTarget} --help`;\n};\n\n/**\n * Buffer stdout (`console.log`) so a parse error can suppress the help dump and\n * print a one-line hint to stderr instead. Successful runs flush the buffer as\n * their final act. The Vite loader temporarily re-points `console.log` to stderr\n * while it runs (see `vite-graph-loader.ts`), nested inside this override, so its\n * noise never enters the buffer.\n */\nconst withStdoutBuffer = <E, R>(program: Effect.Effect<void, E, R>) =>\n Effect.acquireUseRelease(\n Effect.sync((): StdoutState => {\n const originalLog = console.log;\n const buffer: Array<ReadonlyArray<unknown>> = [];\n console.log = (...args: Array<unknown>) => buffer.push(args);\n return { originalLog, buffer, discard: false };\n }),\n (state) =>\n program.pipe(\n Effect.tap(() => Effect.sync(() => flushStdout(state))),\n Effect.tapError((error) => {\n if (CliError.isCliError(error) && error._tag === \"ShowHelp\" && error.errors.length > 0) {\n state.discard = true;\n return Console.error(formatParseHint(error));\n }\n return Effect.sync(() => flushStdout(state));\n }),\n ),\n (state) =>\n Effect.sync(() => {\n console.log = state.originalLog;\n if (!state.discard && state.buffer.length > 0) flushStdout(state);\n else state.buffer.length = 0;\n }),\n );\n\nconst program = withStdoutBuffer(\n Command.run(cli, { version: PackageJson.version }).pipe(\n Effect.provideService(Logger.LogToStderr, true),\n Effect.provide(BunServices.layer),\n Effect.tapErrorTag(\"SeoCliError\", (error) => Console.error(`✗ ${error.message}`)),\n ),\n);\n\n/**\n * Run the CLI. An explicit call from `bin.ts` rather than an import-time side\n * effect: the package declares `sideEffects: false`, so a body that only ran on\n * import would be tree-shaken out of the built chunk.\n *\n * Force exit to escape the Vite loader's lingering worker handles. `flushStdout`\n * already wrote the data plane synchronously, so exiting here can't truncate it.\n */\nexport const run = (): void => {\n BunRuntime.runMain(program, {\n disableErrorReporting: true,\n teardown: (exit, _onExit) => Runtime.defaultTeardown(exit, (code) => process.exit(code)),\n });\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACiBA,IAAa,cAAb,cAAiCA,OAAK,YAAY,aAAa,CAAC,CAE7D,CAAC;;AAGJ,MAAa,WAAW,KAAK,QAAQ,MAAM,CAAC,CAAC,KAC3C,KAAK,gBAAgB,0DAA0D,GAC/E,KAAK,YAAY,KAAK,CACxB;;;;;;AAOA,MAAa,aAAa,KAAK,OAAO,QAAQ,CAAC,CAAC,KAC9C,KAAK,gBAAgB,iEAAiE,GACtF,KAAK,QACP;;AAGA,MAAa,YAAY,MAA6B,eACpD,OAAO,UAAU,YAAY,UAAU;;;;;AAMzC,MAAa,gBAAgB,KAAK,QAAQ,WAAW,CAAC,CAAC,KACrD,KAAK,gBAAgB,uEAAuE,GAC5F,KAAK,YAAY,IAAI,CACvB;;AAGA,MAAa,aAAa,UAAmB,QAAQ,IAAI,KAAK,UAAU,OAAO,MAAM,CAAC,CAAC;;AAGvF,MAAa,aAAa,SAAiB,QAAQ,IAAI,IAAI;;;;;;;;;;;;;;AC9B3D,MAAM,mBAAmB;CAAC;CAAiB;CAAiB;AAAgB;AAE5E,MAAM,aAAa,UACjB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK;;AAGvD,MAAM,kBAAkB,SAAqC;CAC3D,IAAI,YAAY,QAAQ,IAAI;CAC5B,SAAS;EACP,KAAK,MAAM,YAAY,kBAAkB;GACvC,MAAM,YAAY,KAAK,WAAW,QAAQ;GAC1C,IAAI,WAAW,SAAS,GAAG,OAAO;EACpC;EACA,MAAM,SAAS,QAAQ,SAAS;EAChC,IAAI,WAAW,WAAW,OAAO,KAAA;EACjC,YAAY;CACd;AACF;AAEA,MAAM,iBAAiB,UACrB,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,UAAU,QAAQ;;;;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