pagegraph 0.13.0 → 0.14.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.
Files changed (80) hide show
  1. package/README.md +48 -41
  2. package/dist/anthropic-messages-TqKpKmfW.js +1067 -0
  3. package/dist/anthropic-messages-TqKpKmfW.js.map +1 -0
  4. package/dist/audit.d.ts +2 -0
  5. package/dist/audit.js +1 -1
  6. package/dist/audit.js.map +1 -1
  7. package/dist/azure-openai-responses-DJjBLwoI.js +231 -0
  8. package/dist/azure-openai-responses-DJjBLwoI.js.map +1 -0
  9. package/dist/cli.js +10487 -38044
  10. package/dist/cli.js.map +1 -1
  11. package/dist/cloudflare-workers-ai-system-one-f3ZrvNYZ.js +41 -0
  12. package/dist/cloudflare-workers-ai-system-one-f3ZrvNYZ.js.map +1 -0
  13. package/dist/config.d.ts +6 -6
  14. package/dist/config.js.map +1 -1
  15. package/dist/diagnostics-Wt5faNDM.js +108 -0
  16. package/dist/diagnostics-Wt5faNDM.js.map +1 -0
  17. package/dist/dist-B6zg_Z3Z.js +4794 -0
  18. package/dist/dist-B6zg_Z3Z.js.map +1 -0
  19. package/dist/env-api-keys-C-OA0yM-.js +124 -0
  20. package/dist/env-api-keys-C-OA0yM-.js.map +1 -0
  21. package/dist/error-body-CyiejW4b.js +103 -0
  22. package/dist/error-body-CyiejW4b.js.map +1 -0
  23. package/dist/github-copilot-headers-CEpMOpQF.js +24 -0
  24. package/dist/github-copilot-headers-CEpMOpQF.js.map +1 -0
  25. package/dist/google-generative-ai-BxABKIKO.js +330 -0
  26. package/dist/google-generative-ai-BxABKIKO.js.map +1 -0
  27. package/dist/google-shared-0gpM2jFi.js +19471 -0
  28. package/dist/google-shared-0gpM2jFi.js.map +1 -0
  29. package/dist/google-vertex-D8Eb5cbu.js +376 -0
  30. package/dist/google-vertex-D8Eb5cbu.js.map +1 -0
  31. package/dist/hash-Dp7EzZUo.js +18 -0
  32. package/dist/hash-Dp7EzZUo.js.map +1 -0
  33. package/dist/headers-BRNMVpzu.js +19 -0
  34. package/dist/headers-BRNMVpzu.js.map +1 -0
  35. package/dist/json-parse-C10znB7l.js +383 -0
  36. package/dist/json-parse-C10znB7l.js.map +1 -0
  37. package/dist/mistral-conversations-CvaqBWjR.js +690 -0
  38. package/dist/mistral-conversations-CvaqBWjR.js.map +1 -0
  39. package/dist/models-DcT5qOEL.js +1203 -0
  40. package/dist/models-DcT5qOEL.js.map +1 -0
  41. package/dist/node-Ccvru9GE.js +26 -0
  42. package/dist/node-Ccvru9GE.js.map +1 -0
  43. package/dist/node-MEosBOF2.js +2403 -0
  44. package/dist/node-MEosBOF2.js.map +1 -0
  45. package/dist/openai-BCBEd2eO.js +17350 -0
  46. package/dist/openai-BCBEd2eO.js.map +1 -0
  47. package/dist/openai-codex-responses-vJqxeeRC.js +1268 -0
  48. package/dist/openai-codex-responses-vJqxeeRC.js.map +1 -0
  49. package/dist/openai-completions-Cb_fRAbI.js +989 -0
  50. package/dist/openai-completions-Cb_fRAbI.js.map +1 -0
  51. package/dist/openai-prompt-cache-Bc6qNWt0.js +10 -0
  52. package/dist/openai-prompt-cache-Bc6qNWt0.js.map +1 -0
  53. package/dist/openai-responses-sDuh82G5.js +268 -0
  54. package/dist/openai-responses-sDuh82G5.js.map +1 -0
  55. package/dist/openai-responses-shared-mhuo1Jov.js +599 -0
  56. package/dist/openai-responses-shared-mhuo1Jov.js.map +1 -0
  57. package/dist/openrouter-images-CRmBkzpX.js +127 -0
  58. package/dist/openrouter-images-CRmBkzpX.js.map +1 -0
  59. package/dist/pi-Bvw6J0gh.js +56795 -0
  60. package/dist/pi-Bvw6J0gh.js.map +1 -0
  61. package/dist/pi-messages-CejiVYvO.js +308 -0
  62. package/dist/pi-messages-CejiVYvO.js.map +1 -0
  63. package/dist/provider-env-t38GK5FF.js +39 -0
  64. package/dist/provider-env-t38GK5FF.js.map +1 -0
  65. package/dist/provider-retry-DzKoh1X7.js +80 -0
  66. package/dist/provider-retry-DzKoh1X7.js.map +1 -0
  67. package/dist/rolldown-runtime-B-lAHAz2.js +37 -0
  68. package/dist/sanitize-unicode-Ds14l9Om.js +28 -0
  69. package/dist/sanitize-unicode-Ds14l9Om.js.map +1 -0
  70. package/dist/sdk-C9_wiO6w.js +12503 -0
  71. package/dist/sdk-C9_wiO6w.js.map +1 -0
  72. package/dist/state-BuJP_3Lr.js +28102 -0
  73. package/dist/state-BuJP_3Lr.js.map +1 -0
  74. package/dist/system-one-shared-Dl10ZF7Z.js +167 -0
  75. package/dist/system-one-shared-Dl10ZF7Z.js.map +1 -0
  76. package/dist/transform-messages-BLJ8EfK6.js +468 -0
  77. package/dist/transform-messages-BLJ8EfK6.js.map +1 -0
  78. package/dist/typesafe-system-one-CwEWMV8P.js +25 -0
  79. package/dist/typesafe-system-one-CwEWMV8P.js.map +1 -0
  80. package/package.json +4 -8
@@ -0,0 +1,41 @@
1
+ import { n as isRecord, t as classifySystemOne } from "./system-one-shared-Dl10ZF7Z.js";
2
+ //#region node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js
3
+ const LABEL = "Cloudflare Workers AI";
4
+ function cloudflareErrorMessage(errors) {
5
+ if (Array.isArray(errors)) {
6
+ const messages = errors.map((error) => isRecord(error) && typeof error.message === "string" ? error.message : void 0).filter((message) => message !== void 0);
7
+ if (messages.length > 0) return `${LABEL} error: ${messages.join("; ")}`;
8
+ }
9
+ return `${LABEL} request failed`;
10
+ }
11
+ /**
12
+ * System One models on the Workers AI REST endpoint:
13
+ * `POST /accounts/{account}/ai/run` with `{ model, input }`. The REST API
14
+ * wraps the model output in Cloudflare's API envelope and a run record:
15
+ * `{ success, result: { state: "Completed", result: { answers, usage } } }`.
16
+ * https://developers.cloudflare.com/ai/models/typesafe/jev/
17
+ */
18
+ const transport = {
19
+ api: "cloudflare-workers-ai-system-one",
20
+ label: LABEL,
21
+ url: (model) => new URL("run", `${model.baseUrl.replace(/\/+$/u, "")}/`),
22
+ payload: (model, request) => ({
23
+ model: model.id,
24
+ input: request
25
+ }),
26
+ output: (body) => {
27
+ if (!isRecord(body)) throw new Error(`${LABEL} returned an unexpected response`);
28
+ if (body.success === false) throw new Error(cloudflareErrorMessage(body.errors));
29
+ const run = body.result;
30
+ if (!isRecord(run)) throw new Error(`${LABEL} returned an unexpected response`);
31
+ if (run.state !== "Completed") throw new Error(`${LABEL} run did not complete (state: ${String(run.state)})`);
32
+ if (!isRecord(run.result)) throw new Error(`${LABEL} returned an unexpected response`);
33
+ return run.result;
34
+ }
35
+ };
36
+ /** Cloudflare Workers AI System One classification with public `bool` values mapped to wire-level `noul`. */
37
+ const classify = (model, context, options) => classifySystemOne(transport, model, context, options);
38
+ //#endregion
39
+ export { classify };
40
+
41
+ //# sourceMappingURL=cloudflare-workers-ai-system-one-f3ZrvNYZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloudflare-workers-ai-system-one-f3ZrvNYZ.js","names":[],"sources":["../node_modules/@earendil-works/pi-ai/dist/api/cloudflare-workers-ai-system-one.js"],"sourcesContent":["import { classifySystemOne, isRecord } from \"./system-one-shared.js\";\nconst LABEL = \"Cloudflare Workers AI\";\nfunction cloudflareErrorMessage(errors) {\n if (Array.isArray(errors)) {\n const messages = errors\n .map((error) => (isRecord(error) && typeof error.message === \"string\" ? error.message : undefined))\n .filter((message) => message !== undefined);\n if (messages.length > 0)\n return `${LABEL} error: ${messages.join(\"; \")}`;\n }\n return `${LABEL} request failed`;\n}\n/**\n * System One models on the Workers AI REST endpoint:\n * `POST /accounts/{account}/ai/run` with `{ model, input }`. The REST API\n * wraps the model output in Cloudflare's API envelope and a run record:\n * `{ success, result: { state: \"Completed\", result: { answers, usage } } }`.\n * https://developers.cloudflare.com/ai/models/typesafe/jev/\n */\nconst transport = {\n api: \"cloudflare-workers-ai-system-one\",\n label: LABEL,\n url: (model) => new URL(\"run\", `${model.baseUrl.replace(/\\/+$/u, \"\")}/`),\n payload: (model, request) => ({ model: model.id, input: request }),\n output: (body) => {\n if (!isRecord(body))\n throw new Error(`${LABEL} returned an unexpected response`);\n if (body.success === false)\n throw new Error(cloudflareErrorMessage(body.errors));\n const run = body.result;\n if (!isRecord(run))\n throw new Error(`${LABEL} returned an unexpected response`);\n if (run.state !== \"Completed\") {\n throw new Error(`${LABEL} run did not complete (state: ${String(run.state)})`);\n }\n if (!isRecord(run.result))\n throw new Error(`${LABEL} returned an unexpected response`);\n return run.result;\n },\n};\n/** Cloudflare Workers AI System One classification with public `bool` values mapped to wire-level `noul`. */\nexport const classify = (model, context, options) => classifySystemOne(transport, model, context, options);\n//# sourceMappingURL=cloudflare-workers-ai-system-one.js.map"],"x_google_ignoreList":[0],"mappings":";;AACA,MAAM,QAAQ;AACd,SAAS,uBAAuB,QAAQ;CACpC,IAAI,MAAM,QAAQ,MAAM,GAAG;EACvB,MAAM,WAAW,OACZ,KAAK,UAAW,SAAS,KAAK,KAAK,OAAO,MAAM,YAAY,WAAW,MAAM,UAAU,KAAA,CAAU,CAAC,CAClG,QAAQ,YAAY,YAAY,KAAA,CAAS;EAC9C,IAAI,SAAS,SAAS,GAClB,OAAO,GAAG,MAAM,UAAU,SAAS,KAAK,IAAI;CACpD;CACA,OAAO,GAAG,MAAM;AACpB;;;;;;;;AAQA,MAAM,YAAY;CACd,KAAK;CACL,OAAO;CACP,MAAM,UAAU,IAAI,IAAI,OAAO,GAAG,MAAM,QAAQ,QAAQ,SAAS,EAAE,EAAE,EAAE;CACvE,UAAU,OAAO,aAAa;EAAE,OAAO,MAAM;EAAI,OAAO;CAAQ;CAChE,SAAS,SAAS;EACd,IAAI,CAAC,SAAS,IAAI,GACd,MAAM,IAAI,MAAM,GAAG,MAAM,iCAAiC;EAC9D,IAAI,KAAK,YAAY,OACjB,MAAM,IAAI,MAAM,uBAAuB,KAAK,MAAM,CAAC;EACvD,MAAM,MAAM,KAAK;EACjB,IAAI,CAAC,SAAS,GAAG,GACb,MAAM,IAAI,MAAM,GAAG,MAAM,iCAAiC;EAC9D,IAAI,IAAI,UAAU,aACd,MAAM,IAAI,MAAM,GAAG,MAAM,gCAAgC,OAAO,IAAI,KAAK,EAAE,EAAE;EAEjF,IAAI,CAAC,SAAS,IAAI,MAAM,GACpB,MAAM,IAAI,MAAM,GAAG,MAAM,iCAAiC;EAC9D,OAAO,IAAI;CACf;AACJ;;AAEA,MAAa,YAAY,OAAO,SAAS,YAAY,kBAAkB,WAAW,OAAO,SAAS,OAAO"}
package/dist/config.d.ts CHANGED
@@ -6,14 +6,14 @@ import { a as SiteRuntime, i as SeoGraphLoader, n as GraphLoaderInput, o as Vite
6
6
  declare function loadPageHeads(loader: SeoGraphLoader, options?: PageHeadsOptions): Promise<Array<PageHead>>;
7
7
  //#endregion
8
8
  //#region src/config/index.d.ts
9
- interface SeoWorkflowOpenCodeConfig {
10
- /** Project-owned OpenCode configuration directory, relative to the project root. */
11
- readonly configDirectory: string;
9
+ interface SeoWorkflowAgentConfig {
10
+ /** Project-owned agent preset directory, relative to the project root. */
11
+ readonly presetDirectory: string;
12
12
  /** Default `provider/model` used by agentic workflows. */
13
13
  readonly defaultModel: string;
14
14
  /** Per-workflow `provider/model` overrides. */
15
15
  readonly models?: Readonly<Record<string, string>> | undefined;
16
- /** Per-completion deadline in milliseconds, including JSON repair; defaults to 180000. */
16
+ /** Per-run deadline in milliseconds; defaults to 180000. */
17
17
  readonly timeoutMs?: number | undefined;
18
18
  }
19
19
  interface SeoWorkflowContextConfig {
@@ -23,7 +23,7 @@ interface SeoWorkflowContextConfig {
23
23
  readonly byWorkflow?: Readonly<Record<string, ReadonlyArray<string>>> | undefined;
24
24
  }
25
25
  interface SeoWorkflowConfig {
26
- readonly opencode: SeoWorkflowOpenCodeConfig;
26
+ readonly agent: SeoWorkflowAgentConfig;
27
27
  readonly context?: SeoWorkflowContextConfig | undefined;
28
28
  /** Ignored run-artifact directory, relative to the project root. */
29
29
  readonly runsDirectory?: string | undefined;
@@ -61,5 +61,5 @@ interface SeoCliConfig {
61
61
  /** Identity — it exists for the type inference and the editor completions. */
62
62
  declare const defineSeoConfig: (config: SeoCliConfig) => SeoCliConfig;
63
63
  //#endregion
64
- export { type GraphLoaderEnvironment, type GraphLoaderInput, type LoadedSeoGraph, SeoCliConfig, type SeoGraphLoader, SeoWorkflowConfig, SeoWorkflowContextConfig, SeoWorkflowOpenCodeConfig, type SiteRuntime, type ViteGraphLoaderOptions, defineSeoConfig, loadPageHeads, viteGraphLoader };
64
+ export { type GraphLoaderEnvironment, type GraphLoaderInput, type LoadedSeoGraph, SeoCliConfig, type SeoGraphLoader, SeoWorkflowAgentConfig, SeoWorkflowConfig, SeoWorkflowContextConfig, type SiteRuntime, type ViteGraphLoaderOptions, defineSeoConfig, loadPageHeads, viteGraphLoader };
65
65
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":[],"sources":["../src/config/page-heads.ts","../src/config/index.ts"],"sourcesContent":["import { pageHeads, type PageHead, type PageHeadsOptions } from \"../core/page-heads\";\nimport type { SeoGraphLoader } from \"./vite-graph-loader\";\n\n/** Acquire, extract and release a graph on both success and metadata failure. Bind loader input in a closure. */\nexport async function loadPageHeads(loader: SeoGraphLoader, options: PageHeadsOptions = {}): Promise<Array<PageHead>> {\n const loaded = await loader();\n try {\n return pageHeads(loaded.graph, options);\n } finally {\n await loaded.dispose();\n }\n}\n","/**\n * `pagegraph/config` — the `pagegraph` CLI's configuration surface.\n *\n * The CLI is a set of pure views over one graph, but *acquiring* that graph is\n * host knowledge: only the app knows where its graph module lives and what its\n * module needs to evaluate. So the app declares it once in a `pagegraph.config.ts` at\n * its root, which the CLI discovers from the working directory:\n *\n * ```ts\n * // pagegraph.config.ts\n * import { defineSeoConfig, viteGraphLoader } from \"pagegraph/config\";\n * import { routeConfig } from \"./lib/route-config\";\n *\n * export default defineSeoConfig({\n * loadGraph: viteGraphLoader({\n * root: import.meta.dirname,\n * entry: \"/lib/seo/graph.ts\",\n * site: { origin: \"https://example.com\", indexable: true, robots: { disallow: routeConfig.robotsExclusions } },\n * }),\n * });\n * ```\n *\n * Nothing here imports Effect. The CLI needs it (an optional peer dependency),\n * but a config file must not: it is the app's file, and the app may not be an\n * Effect app.\n */\n\nexport type { GraphLoaderEnvironment, GraphLoaderInput, LoadedSeoGraph, SeoGraphLoader, SiteRuntime, ViteGraphLoaderOptions } from \"./vite-graph-loader\";\nexport { viteGraphLoader } from \"./vite-graph-loader\";\n\nexport { loadPageHeads } from \"./page-heads\";\n\nimport type { CoverageRule } from \"../core/checks\";\nimport type { ContentPolicy } from \"../core/content\";\nimport type { FreshnessPolicy } from \"../core/freshness\";\nimport type { SeoGraphLoader } from \"./vite-graph-loader\";\n\nexport interface SeoWorkflowOpenCodeConfig {\n /** Project-owned OpenCode configuration directory, relative to the project root. */\n readonly configDirectory: string;\n /** Default `provider/model` used by agentic workflows. */\n readonly defaultModel: string;\n /** Per-workflow `provider/model` overrides. */\n readonly models?: Readonly<Record<string, string>> | undefined;\n /** Per-completion deadline in milliseconds, including JSON repair; defaults to 180000. */\n readonly timeoutMs?: number | undefined;\n}\n\nexport interface SeoWorkflowContextConfig {\n /** Durable project context included in every workflow prompt. */\n readonly files?: ReadonlyArray<string> | undefined;\n /** Additional context files keyed by workflow id. */\n readonly byWorkflow?: Readonly<Record<string, ReadonlyArray<string>>> | undefined;\n}\n\nexport interface SeoWorkflowConfig {\n readonly opencode: SeoWorkflowOpenCodeConfig;\n readonly context?: SeoWorkflowContextConfig | undefined;\n /** Ignored run-artifact directory, relative to the project root. */\n readonly runsDirectory?: string | undefined;\n}\n\nexport interface SeoCliConfig {\n /**\n * Last-mile robots.txt override, forwarded to `renderRobots` as `transform`.\n * Runs for indexable and preview hosts.\n */\n readonly transform?: ((robots: string) => string) | undefined;\n /**\n * Contextual-link coverage policy for `pagegraph check`: every sitemap-eligible\n * page matching a rule's `path` glob needs at least `minInbound` incoming\n * `related` edges. A `--require-inbound` flag overrides this per invocation.\n */\n readonly coverage?: ReadonlyArray<CoverageRule> | undefined;\n /**\n * Rendered content policy for `pagegraph check --site`: word-count floors per\n * path glob. The heading, structured-data, robots, and canonical rules need no\n * configuration.\n */\n readonly content?: ContentPolicy | undefined;\n /**\n * Freshness policy: sitemap-eligible pages whose declared `modifiedAt` (or an\n * instance's `publishedAt`) is older than `maxAgeDays` are editorial\n * `stale-page` findings in `pagegraph check` and the refresh queue in\n * `pagegraph stale`.\n */\n readonly freshness?: FreshnessPolicy | undefined;\n /** Agentic workflow host, context, and artifact settings. */\n readonly workflows?: SeoWorkflowConfig | undefined;\n /** How the CLI gets the graph. {@link viteGraphLoader} covers the Vite-app case. */\n readonly loadGraph: SeoGraphLoader;\n}\n\n/** Identity — it exists for the type inference and the editor completions. */\nexport const defineSeoConfig = (config: SeoCliConfig): SeoCliConfig => config;\n"],"mappings":";;;;AAIA,eAAsB,cAAc,QAAwB,UAA4B,CAAC,GAA6B;CACpH,MAAM,SAAS,MAAM,OAAO;CAC5B,IAAI;EACF,OAAO,UAAU,OAAO,OAAO,OAAO;CACxC,UAAU;EACR,MAAM,OAAO,QAAQ;CACvB;AACF;;;;ACmFA,MAAa,mBAAmB,WAAuC"}
1
+ {"version":3,"file":"config.js","names":[],"sources":["../src/config/page-heads.ts","../src/config/index.ts"],"sourcesContent":["import { pageHeads, type PageHead, type PageHeadsOptions } from \"../core/page-heads\";\nimport type { SeoGraphLoader } from \"./vite-graph-loader\";\n\n/** Acquire, extract and release a graph on both success and metadata failure. Bind loader input in a closure. */\nexport async function loadPageHeads(loader: SeoGraphLoader, options: PageHeadsOptions = {}): Promise<Array<PageHead>> {\n const loaded = await loader();\n try {\n return pageHeads(loaded.graph, options);\n } finally {\n await loaded.dispose();\n }\n}\n","/**\n * `pagegraph/config` — the `pagegraph` CLI's configuration surface.\n *\n * The CLI is a set of pure views over one graph, but *acquiring* that graph is\n * host knowledge: only the app knows where its graph module lives and what its\n * module needs to evaluate. So the app declares it once in a `pagegraph.config.ts` at\n * its root, which the CLI discovers from the working directory:\n *\n * ```ts\n * // pagegraph.config.ts\n * import { defineSeoConfig, viteGraphLoader } from \"pagegraph/config\";\n * import { routeConfig } from \"./lib/route-config\";\n *\n * export default defineSeoConfig({\n * loadGraph: viteGraphLoader({\n * root: import.meta.dirname,\n * entry: \"/lib/seo/graph.ts\",\n * site: { origin: \"https://example.com\", indexable: true, robots: { disallow: routeConfig.robotsExclusions } },\n * }),\n * });\n * ```\n *\n * Nothing here imports Effect. The CLI needs it (an optional peer dependency),\n * but a config file must not: it is the app's file, and the app may not be an\n * Effect app.\n */\n\nexport type { GraphLoaderEnvironment, GraphLoaderInput, LoadedSeoGraph, SeoGraphLoader, SiteRuntime, ViteGraphLoaderOptions } from \"./vite-graph-loader\";\nexport { viteGraphLoader } from \"./vite-graph-loader\";\n\nexport { loadPageHeads } from \"./page-heads\";\n\nimport type { CoverageRule } from \"../core/checks\";\nimport type { ContentPolicy } from \"../core/content\";\nimport type { FreshnessPolicy } from \"../core/freshness\";\nimport type { SeoGraphLoader } from \"./vite-graph-loader\";\n\nexport interface SeoWorkflowAgentConfig {\n /** Project-owned agent preset directory, relative to the project root. */\n readonly presetDirectory: string;\n /** Default `provider/model` used by agentic workflows. */\n readonly defaultModel: string;\n /** Per-workflow `provider/model` overrides. */\n readonly models?: Readonly<Record<string, string>> | undefined;\n /** Per-run deadline in milliseconds; defaults to 180000. */\n readonly timeoutMs?: number | undefined;\n}\n\nexport interface SeoWorkflowContextConfig {\n /** Durable project context included in every workflow prompt. */\n readonly files?: ReadonlyArray<string> | undefined;\n /** Additional context files keyed by workflow id. */\n readonly byWorkflow?: Readonly<Record<string, ReadonlyArray<string>>> | undefined;\n}\n\nexport interface SeoWorkflowConfig {\n readonly agent: SeoWorkflowAgentConfig;\n readonly context?: SeoWorkflowContextConfig | undefined;\n /** Ignored run-artifact directory, relative to the project root. */\n readonly runsDirectory?: string | undefined;\n}\n\nexport interface SeoCliConfig {\n /**\n * Last-mile robots.txt override, forwarded to `renderRobots` as `transform`.\n * Runs for indexable and preview hosts.\n */\n readonly transform?: ((robots: string) => string) | undefined;\n /**\n * Contextual-link coverage policy for `pagegraph check`: every sitemap-eligible\n * page matching a rule's `path` glob needs at least `minInbound` incoming\n * `related` edges. A `--require-inbound` flag overrides this per invocation.\n */\n readonly coverage?: ReadonlyArray<CoverageRule> | undefined;\n /**\n * Rendered content policy for `pagegraph check --site`: word-count floors per\n * path glob. The heading, structured-data, robots, and canonical rules need no\n * configuration.\n */\n readonly content?: ContentPolicy | undefined;\n /**\n * Freshness policy: sitemap-eligible pages whose declared `modifiedAt` (or an\n * instance's `publishedAt`) is older than `maxAgeDays` are editorial\n * `stale-page` findings in `pagegraph check` and the refresh queue in\n * `pagegraph stale`.\n */\n readonly freshness?: FreshnessPolicy | undefined;\n /** Agentic workflow host, context, and artifact settings. */\n readonly workflows?: SeoWorkflowConfig | undefined;\n /** How the CLI gets the graph. {@link viteGraphLoader} covers the Vite-app case. */\n readonly loadGraph: SeoGraphLoader;\n}\n\n/** Identity — it exists for the type inference and the editor completions. */\nexport const defineSeoConfig = (config: SeoCliConfig): SeoCliConfig => config;\n"],"mappings":";;;;AAIA,eAAsB,cAAc,QAAwB,UAA4B,CAAC,GAA6B;CACpH,MAAM,SAAS,MAAM,OAAO;CAC5B,IAAI;EACF,OAAO,UAAU,OAAO,OAAO,OAAO;CACxC,UAAU;EACR,MAAM,OAAO,QAAQ;CACvB;AACF;;;;ACmFA,MAAa,mBAAmB,WAAuC"}
@@ -0,0 +1,108 @@
1
+ //#region node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js
2
+ var FifoQueue = class {
3
+ incoming = [];
4
+ outgoing = [];
5
+ get length() {
6
+ return this.incoming.length + this.outgoing.length;
7
+ }
8
+ enqueue(value) {
9
+ this.incoming.push(value);
10
+ }
11
+ dequeue() {
12
+ if (this.outgoing.length === 0) while (this.incoming.length > 0) this.outgoing.push(this.incoming.pop());
13
+ return this.outgoing.pop();
14
+ }
15
+ };
16
+ var EventStream = class {
17
+ queue = new FifoQueue();
18
+ waiting = new FifoQueue();
19
+ done = false;
20
+ finalResultPromise;
21
+ resolveFinalResult;
22
+ isComplete;
23
+ extractResult;
24
+ constructor(isComplete, extractResult) {
25
+ this.isComplete = isComplete;
26
+ this.extractResult = extractResult;
27
+ this.finalResultPromise = new Promise((resolve) => {
28
+ this.resolveFinalResult = resolve;
29
+ });
30
+ }
31
+ push(event) {
32
+ if (this.done) return;
33
+ if (this.isComplete(event)) {
34
+ this.done = true;
35
+ this.resolveFinalResult(this.extractResult(event));
36
+ }
37
+ const waiter = this.waiting.dequeue();
38
+ if (waiter) waiter({
39
+ value: event,
40
+ done: false
41
+ });
42
+ else this.queue.enqueue(event);
43
+ }
44
+ end(result) {
45
+ this.done = true;
46
+ if (result !== void 0) this.resolveFinalResult(result);
47
+ while (this.waiting.length > 0) this.waiting.dequeue()({
48
+ value: void 0,
49
+ done: true
50
+ });
51
+ }
52
+ async *[Symbol.asyncIterator]() {
53
+ while (true) if (this.queue.length > 0) yield this.queue.dequeue();
54
+ else if (this.done) return;
55
+ else {
56
+ const result = await new Promise((resolve) => this.waiting.enqueue(resolve));
57
+ if (result.done) return;
58
+ yield result.value;
59
+ }
60
+ }
61
+ result() {
62
+ return this.finalResultPromise;
63
+ }
64
+ };
65
+ var AssistantMessageEventStream = class extends EventStream {
66
+ constructor() {
67
+ super((event) => event.type === "done" || event.type === "error", (event) => {
68
+ if (event.type === "done") return event.message;
69
+ else if (event.type === "error") return event.error;
70
+ throw new Error("Unexpected event type for final result");
71
+ });
72
+ }
73
+ };
74
+ //#endregion
75
+ //#region node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js
76
+ function formatThrownValue(value) {
77
+ if (value instanceof Error) return value.message || value.name;
78
+ if (typeof value === "string") return value;
79
+ return String(value);
80
+ }
81
+ function extractDiagnosticError(error) {
82
+ if (!(error instanceof Error)) return {
83
+ name: "ThrownValue",
84
+ message: formatThrownValue(error)
85
+ };
86
+ const code = error.code;
87
+ return {
88
+ name: error.name || void 0,
89
+ message: error.message || error.name,
90
+ stack: error.stack,
91
+ code: typeof code === "string" || typeof code === "number" ? code : void 0
92
+ };
93
+ }
94
+ function createAssistantMessageDiagnostic(type, error, details) {
95
+ return {
96
+ type,
97
+ timestamp: Date.now(),
98
+ error: extractDiagnosticError(error),
99
+ details
100
+ };
101
+ }
102
+ function appendAssistantMessageDiagnostic(message, diagnostic) {
103
+ message.diagnostics = [...message.diagnostics ?? [], diagnostic];
104
+ }
105
+ //#endregion
106
+ export { AssistantMessageEventStream as a, formatThrownValue as i, createAssistantMessageDiagnostic as n, EventStream as o, extractDiagnosticError as r, appendAssistantMessageDiagnostic as t };
107
+
108
+ //# sourceMappingURL=diagnostics-Wt5faNDM.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics-Wt5faNDM.js","names":[],"sources":["../node_modules/@earendil-works/pi-ai/dist/utils/event-stream.js","../node_modules/@earendil-works/pi-ai/dist/utils/diagnostics.js"],"sourcesContent":["class FifoQueue {\n incoming = [];\n outgoing = [];\n get length() {\n return this.incoming.length + this.outgoing.length;\n }\n enqueue(value) {\n this.incoming.push(value);\n }\n dequeue() {\n if (this.outgoing.length === 0) {\n while (this.incoming.length > 0) {\n this.outgoing.push(this.incoming.pop());\n }\n }\n return this.outgoing.pop();\n }\n}\n// Generic event stream class for async iteration\nexport class EventStream {\n queue = new FifoQueue();\n waiting = new FifoQueue();\n done = false;\n finalResultPromise;\n resolveFinalResult;\n isComplete;\n extractResult;\n constructor(isComplete, extractResult) {\n this.isComplete = isComplete;\n this.extractResult = extractResult;\n this.finalResultPromise = new Promise((resolve) => {\n this.resolveFinalResult = resolve;\n });\n }\n push(event) {\n if (this.done)\n return;\n if (this.isComplete(event)) {\n this.done = true;\n this.resolveFinalResult(this.extractResult(event));\n }\n // Deliver to waiting consumer or queue it\n const waiter = this.waiting.dequeue();\n if (waiter) {\n waiter({ value: event, done: false });\n }\n else {\n this.queue.enqueue(event);\n }\n }\n end(result) {\n this.done = true;\n if (result !== undefined) {\n this.resolveFinalResult(result);\n }\n // Notify all waiting consumers that we're done\n while (this.waiting.length > 0) {\n const waiter = this.waiting.dequeue();\n waiter({ value: undefined, done: true });\n }\n }\n async *[Symbol.asyncIterator]() {\n while (true) {\n if (this.queue.length > 0) {\n yield this.queue.dequeue();\n }\n else if (this.done) {\n return;\n }\n else {\n const result = await new Promise((resolve) => this.waiting.enqueue(resolve));\n if (result.done)\n return;\n yield result.value;\n }\n }\n }\n result() {\n return this.finalResultPromise;\n }\n}\nexport class AssistantMessageEventStream extends EventStream {\n constructor() {\n super((event) => event.type === \"done\" || event.type === \"error\", (event) => {\n if (event.type === \"done\") {\n return event.message;\n }\n else if (event.type === \"error\") {\n return event.error;\n }\n throw new Error(\"Unexpected event type for final result\");\n });\n }\n}\n/** Factory function for AssistantMessageEventStream (for use in extensions) */\nexport function createAssistantMessageEventStream() {\n return new AssistantMessageEventStream();\n}\n//# sourceMappingURL=event-stream.js.map","export function formatThrownValue(value) {\n if (value instanceof Error)\n return value.message || value.name;\n if (typeof value === \"string\")\n return value;\n return String(value);\n}\nexport function extractDiagnosticError(error) {\n if (!(error instanceof Error))\n return { name: \"ThrownValue\", message: formatThrownValue(error) };\n const code = error.code;\n return {\n name: error.name || undefined,\n message: error.message || error.name,\n stack: error.stack,\n code: typeof code === \"string\" || typeof code === \"number\" ? code : undefined,\n };\n}\nexport function createAssistantMessageDiagnostic(type, error, details) {\n return { type, timestamp: Date.now(), error: extractDiagnosticError(error), details };\n}\nexport function appendAssistantMessageDiagnostic(message, diagnostic) {\n message.diagnostics = [...(message.diagnostics ?? []), diagnostic];\n}\n//# sourceMappingURL=diagnostics.js.map"],"x_google_ignoreList":[0,1],"mappings":";AAAA,IAAM,YAAN,MAAgB;CACZ,WAAW,CAAC;CACZ,WAAW,CAAC;CACZ,IAAI,SAAS;EACT,OAAO,KAAK,SAAS,SAAS,KAAK,SAAS;CAChD;CACA,QAAQ,OAAO;EACX,KAAK,SAAS,KAAK,KAAK;CAC5B;CACA,UAAU;E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