@wildo-ai/saas-technical-doc 1.1.3 → 1.1.5

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 (85) hide show
  1. package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts +37 -0
  2. package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map +1 -1
  3. package/dist/esm/companion/application-documentation/application-connection-documentation.js +46 -5
  4. package/dist/esm/companion/application-documentation/application-connection-documentation.js.map +1 -1
  5. package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts +101 -0
  6. package/dist/esm/companion/application-documentation/application-documentation-chapters.d.ts.map +1 -0
  7. package/dist/esm/companion/application-documentation/application-documentation-chapters.js +205 -0
  8. package/dist/esm/companion/application-documentation/application-documentation-chapters.js.map +1 -0
  9. package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js +3 -0
  10. package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js.map +1 -1
  11. package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts +34 -0
  12. package/dist/esm/companion/application-documentation/docs-api-origin-substitution.d.ts.map +1 -0
  13. package/dist/esm/companion/application-documentation/docs-api-origin-substitution.js +45 -0
  14. package/dist/esm/companion/application-documentation/docs-api-origin-substitution.js.map +1 -0
  15. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts +24 -10
  16. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
  17. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js +25 -15
  18. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -1
  19. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts +11 -3
  20. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
  21. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js +9 -2
  22. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -1
  23. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -1
  24. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js +10 -4
  25. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js.map +1 -1
  26. package/dist/esm/companion/index.d.ts +2 -0
  27. package/dist/esm/companion/index.d.ts.map +1 -1
  28. package/dist/esm/companion/index.js +2 -0
  29. package/dist/esm/companion/index.js.map +1 -1
  30. package/dist/esm/companion/openapi-generator.d.ts +8 -4
  31. package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
  32. package/dist/esm/companion/openapi-generator.js +43 -17
  33. package/dist/esm/companion/openapi-generator.js.map +1 -1
  34. package/dist/esm/companion/operation-projection.schemas.d.ts +21 -1
  35. package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
  36. package/dist/esm/companion/operation-projection.schemas.js +11 -0
  37. package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
  38. package/dist/esm/companion/publish-result.types.d.ts +37 -4
  39. package/dist/esm/companion/publish-result.types.d.ts.map +1 -1
  40. package/dist/esm/companion/publish-result.types.js.map +1 -1
  41. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
  42. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js +8 -0
  43. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -1
  44. package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
  45. package/dist/esm/companion/rendering/technical-documentation-render-model.js +26 -10
  46. package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -1
  47. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +18 -15
  48. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
  49. package/dist/esm/content/application-consumer-documentation-content.techdoc.js +169 -61
  50. package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
  51. package/dist/esm/runtime/DocsAuthContext.d.ts +2 -2
  52. package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -1
  53. package/dist/esm/runtime/DocsAuthContext.js +8 -4
  54. package/dist/esm/runtime/DocsAuthContext.js.map +1 -1
  55. package/dist/esm/runtime/DocsFrontendProviders.d.ts +16 -0
  56. package/dist/esm/runtime/DocsFrontendProviders.d.ts.map +1 -0
  57. package/dist/esm/runtime/DocsFrontendProviders.js +26 -0
  58. package/dist/esm/runtime/DocsFrontendProviders.js.map +1 -0
  59. package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts +1 -2
  60. package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -1
  61. package/dist/esm/runtime/frontend-provider-registry.techdoc.js.map +1 -1
  62. package/dist/esm/runtime/index.d.ts +2 -0
  63. package/dist/esm/runtime/index.d.ts.map +1 -1
  64. package/dist/esm/runtime/index.js +2 -0
  65. package/dist/esm/runtime/index.js.map +1 -1
  66. package/dist/esm/runtime/openapi-reference-model.d.ts +5 -0
  67. package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -1
  68. package/dist/esm/runtime/openapi-reference-model.js +5 -0
  69. package/dist/esm/runtime/openapi-reference-model.js.map +1 -1
  70. package/dist/esm/runtime/openapi-reference-view.js +1 -1
  71. package/dist/esm/runtime/openapi-reference-view.js.map +1 -1
  72. package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts +1 -0
  73. package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -1
  74. package/dist/esm/runtime/use-docs-frontend-provider-registry.js +10 -2
  75. package/dist/esm/runtime/use-docs-frontend-provider-registry.js.map +1 -1
  76. package/dist/esm/runtime/use-docs-provider-scripts.d.ts +30 -0
  77. package/dist/esm/runtime/use-docs-provider-scripts.d.ts.map +1 -0
  78. package/dist/esm/runtime/use-docs-provider-scripts.js +40 -0
  79. package/dist/esm/runtime/use-docs-provider-scripts.js.map +1 -0
  80. package/dist/tsconfig.build.tsbuildinfo +1 -1
  81. package/package.json +8 -24
  82. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts +0 -0
  83. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts.map +0 -0
  84. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js +0 -0
  85. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js.map +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-docusaurus-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-docusaurus-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,GAInC,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC5G,OAAO,EACL,mCAAmC,GACpC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,6CAA6C,EAG7C,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,yBAAyB,GAA6D,IAAI,GAAG,CAAC;IAClG,2CAA2C,CAAC,WAAW;IACvD,2CAA2C,CAAC,QAAQ;CACrD,CAAC,CAAC;AAEH,MAAM,uBAAuB,GAAG,6CAA6C,CAAC;AAE9E;;;;;;;;;;GAUG;AACH,MAAM,sCAAsC,GAAqC;IAC/E,qBAAqB,EAAE,qBAAqB;IAC5C;;;;;;;;;;OAUG;IACH,+BAA+B,EAAE,+BAA+B;IAChE,YAAY,EAAE,cAAc;IAC5B,oBAAoB,EAAE,oBAAoB;IAC1C,qBAAqB,EAAE,qBAAqB;CAC7C,CAAC;AAgBF;;;;;;;;;GASG;AACH,MAAM,wCAAwC,GAA+D;IAC3G,oBAAoB,EAAE;QACpB,4FAA4F;QAC5F,4EAA4E;QAC5E,iDAAiD;QACjD,sCAAsC;QACtC,0CAA0C;QAC1C,yCAAyC;QACzC;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AAC,CAAC;QAC3I,OAAO,CAAC;gBACN,SAAS,EAAE,wCAAwC,mCAAmC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;gBACxG,WAAW,EAAE,uBAAuB;gBACpC,UAAU,EAAE,gCAAgC,CAAC,KAAK;gBAClD,cAAc;gBACd,sBAAsB,EAAE,qBAAqB,IAAI,EAAE;gBACnD,SAAS,EAAE,KAAK,CAAC,SAAS;gBAC1B,KAAK;aACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO;QACL,SAAS,EAAE,6CAA6C,CAAC;YACvD,YAAY,EAAE,kCAAkC,CAAC,UAAU;YAC3D,WAAW,EAAE,uBAAuB;YACpC,eAAe,EAAE,CAAC;YAClB,gBAAgB,EAAE,8DAA8D;SACjF,CAAC;QACF,KAAK,EAAE;YACL,GAAG,SAAS;YACZ,GAAG,UAAU;YACb;gBACE,SAAS,EAAE,oDAAoD;gBAC/D,WAAW,EAAE,uBAAuB;gBACpC,UAAU,EAAE,gCAAgC,CAAC,gBAAgB;gBAC7D,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC7D,sBAAsB,EAAE,0BAA0B;gBAClD,SAAS,EAAE,kBAAkB;gBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;aAClE;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationLinkKind,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationApiReferenceTargetV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport { escapeMarkdownForMdx } from './technical-documentation-mdx-escaping';\nimport { isImplicitLeadSection, pruneUnpublishedSiteLinks } from './technical-documentation-markdown-links';\nimport {\n technicalDocumentationAssetFileStem,\n} from '../technical-documentation-asset-path';\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRenderModel,\n type TechnicalDocumentationRendererResult,\n ENGINE_UNIT_ROUTES,\n} from './technical-documentation-render-model';\n\n/**\n * Statuses whose asset carries real bytes at a real path, and therefore renders.\n *\n * `PLACEHOLDER` belongs here with `RESOLVED`: the framework materializes a stand-in image,\n * so the page shows a picture rather than a hole. That is the whole distinction from\n * `MISSING` — both mean \"the real capture has not run\", but only one of them SHIPS\n * something. Rendering is a question about bytes; whether provisional imagery may be\n * published at all is an environment policy decided at publication, not here.\n */\nconst RENDERABLE_ASSET_STATUSES: ReadonlySet<TechnicalDocumentationAssetResolutionStatus> = new Set([\n TechnicalDocumentationAssetResolutionStatus.PLACEHOLDER,\n TechnicalDocumentationAssetResolutionStatus.RESOLVED,\n]);\n\nconst DOCUSAURUS_RENDERER_REF = 'technical-documentation:renderer/docusaurus';\n\n/**\n * Reader-facing names for the product responsibilities in the portal.\n *\n * Folder names are stable routing mechanics, not customer copy: exposing\n * `user-administration` in the sidebar leaks a URL convention. A category\n * with a landing document links to that document and excludes it from the\n * dropdown, so readers select the category for orientation and expand it for\n * focused tasks. A landing may use the category's canonical root path or the\n * conventional nested `overview` path; the former keeps a public entry route\n * concise without introducing a redirect or duplicate document.\n */\nconst DOCUSAURUS_CATEGORY_LABEL_BY_DIRECTORY: Readonly<Record<string, string>> = {\n 'access-and-identity': 'Access and identity',\n /*\n * The per-resource pages nest under the page that lists them, which makes this a category the\n * moment an application publishes a resource of its own. It has a LANDING document at the\n * category's canonical root path — the overview — so a reader selects it for orientation and\n * expands it for one resource.\n *\n * The label is generic where the pages beneath it are not, and deliberately: an application's\n * own name for this part of its product is a fact only the application has, and it already\n * states it inside the page. Putting a projected value here would make the sidebar the one\n * surface whose words come from somewhere the renderer cannot see.\n */\n 'what-this-application-manages': 'What this application manages',\n integrations: 'Integrations',\n 'security-and-audit': 'Security and audit',\n 'user-administration': 'User administration',\n};\n\ntype DocusaurusJourneyItem = string | {\n readonly landingPath: string;\n readonly childPaths: readonly string[];\n};\n\ntype DocusaurusSidebarItem = string | {\n readonly type: 'category';\n readonly label: string;\n readonly collapsible: true;\n readonly collapsed: true;\n readonly link?: { readonly type: 'doc'; readonly id: string };\n readonly items: readonly DocusaurusSidebarItem[];\n};\n\n/**\n * A category is a reader journey, not an alphabetized file listing. Most\n * categories need no override; user administration does, because readers first\n * choose how accounts are managed and then follow the relevant task sequence.\n *\n * A journey landing is rendered as a clickable second-level category. It is\n * deliberately absent from that category's children: selecting the label opens\n * the explanation, while expanding it reveals the concrete tasks. Plain paths\n * remain direct children for work that spans several journeys.\n */\nconst DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY: Readonly<Record<string, readonly DocusaurusJourneyItem[]>> = {\n 'security-and-audit': [\n // First in the section on purpose: somebody reaching this during an incident has no time to\n // browse, and every other page here is a capability rather than a response.\n 'security-and-audit/respond-to-leaked-credential',\n 'security-and-audit/investigate-event',\n 'security-and-audit/review-access-changes',\n 'security-and-audit/export-audit-records',\n {\n landingPath: 'security-and-audit/configure-siem',\n childPaths: [\n 'security-and-audit/siem-splunk',\n 'security-and-audit/siem-microsoft-sentinel',\n 'security-and-audit/siem-elastic',\n 'security-and-audit/operate-siem',\n ],\n },\n 'security-and-audit/protect-evidence',\n ],\n 'access-and-identity': [\n {\n landingPath: 'access-and-identity/sign-in-and-mfa',\n childPaths: [\n 'access-and-identity/complete-sign-in',\n 'access-and-identity/mfa-enrollment-and-recovery',\n 'access-and-identity/sign-in-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/single-sign-on',\n childPaths: [\n 'access-and-identity/sso-configure',\n 'access-and-identity/sso-rollout-and-recovery',\n 'access-and-identity/sso-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/api-keys',\n childPaths: [\n 'access-and-identity/api-keys-create-and-store',\n 'access-and-identity/api-keys-lifecycle',\n 'access-and-identity/api-keys-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/oauth-provider',\n childPaths: [\n 'access-and-identity/oauth-register-client',\n 'access-and-identity/oauth-authorize-delegated-access',\n 'access-and-identity/oauth-operate-and-revoke',\n ],\n },\n ],\n 'user-administration': [\n {\n landingPath: 'user-administration/manage-users-manually',\n childPaths: [\n 'user-administration/invite-and-onboard-user',\n 'user-administration/roles-and-permissions',\n 'user-administration/change-user-access',\n 'user-administration/suspend-or-remove-user',\n ],\n },\n {\n landingPath: 'user-administration/manage-organization-units',\n childPaths: [\n 'user-administration/design-organization-unit-hierarchy',\n 'user-administration/assign-organization-unit-access',\n 'user-administration/operate-organization-units',\n ],\n },\n 'user-administration/review-users-and-access',\n 'user-administration/troubleshoot-user-access',\n {\n landingPath: 'user-administration/scim-provisioning',\n childPaths: [\n 'user-administration/scim-protocol-and-payloads',\n 'user-administration/scim-configure',\n 'user-administration/scim-microsoft-entra',\n 'user-administration/scim-okta',\n 'user-administration/scim-ldap-and-active-directory',\n 'user-administration/scim-map-profile-and-units',\n 'user-administration/scim-validate-and-roll-out',\n 'user-administration/scim-operate-and-troubleshoot',\n ],\n },\n ],\n integrations: [\n {\n landingPath: 'integrations/automation-platforms',\n childPaths: [\n 'integrations/automation/n8n',\n 'integrations/automation/zapier',\n 'integrations/automation/make',\n ],\n },\n {\n landingPath: 'integrations/ai-coding-tools',\n childPaths: [\n 'integrations/ai-tools/cursor',\n 'integrations/ai-tools/codex',\n 'integrations/ai-tools/claude-code',\n ],\n },\n {\n landingPath: 'integrations/rest-api',\n childPaths: [\n 'integrations/rest/conventions',\n 'integrations/rest/send-request',\n 'integrations/rest/read-collections',\n 'integrations/rest/write-and-reconcile',\n 'integrations/rest/troubleshoot',\n ],\n },\n {\n landingPath: 'integrations/webhooks',\n childPaths: [\n 'integrations/webhooks/configure-and-test',\n 'integrations/webhooks/verify-delivery',\n 'integrations/webhooks/operate-deliveries',\n 'integrations/webhooks/troubleshoot',\n ],\n },\n {\n landingPath: 'integrations/agents',\n childPaths: [\n 'integrations/mcp',\n 'integrations/a2a',\n ],\n },\n 'integrations/create-your-own-integration',\n ],\n};\n\nfunction renderDocusaurusCategoryItems(input: {\n readonly directory: string;\n readonly itemPaths: readonly string[];\n readonly unitTitleByPath: ReadonlyMap<string, string>;\n}): DocusaurusSidebarItem[] {\n const availablePaths = new Set(input.itemPaths);\n const claimedPaths = new Set<string>();\n const journey = DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY[input.directory] ?? [];\n const renderedJourney = journey.flatMap((item): DocusaurusSidebarItem[] => {\n if (typeof item === 'string') {\n if (!availablePaths.has(item)) return [];\n claimedPaths.add(item);\n return [item];\n }\n\n const availableChildPaths = item.childPaths.filter((path) => availablePaths.has(path));\n for (const path of availableChildPaths) claimedPaths.add(path);\n if (!availablePaths.has(item.landingPath)) {\n // Applicability may omit a landing while retaining an independently\n // useful task. Never hide those tasks merely because their group cannot\n // be rendered as a linked category in this publication.\n return availableChildPaths;\n }\n\n const label = input.unitTitleByPath.get(item.landingPath);\n if (label === undefined) throw new Error(`technical-documentation Docusaurus journey landing is missing a reader title: ${item.landingPath}`);\n claimedPaths.add(item.landingPath);\n // A landing without applicable child tasks is a document, not an empty\n // disclosure control. This preserves the same no-duplicate/no-empty-arrow\n // rule used for top-level single-page responsibilities.\n if (availableChildPaths.length === 0) return [item.landingPath];\n return [{\n type: 'category',\n label,\n collapsible: true,\n collapsed: true,\n link: { type: 'doc', id: item.landingPath },\n items: availableChildPaths,\n }];\n });\n\n return [\n ...renderedJourney,\n ...input.itemPaths.filter((path) => !claimedPaths.has(path)).sort((left, right) => left.localeCompare(right)),\n ];\n}\n\n/**\n * Authors use tilde fences because this content module itself is a TypeScript\n * template literal. CommonMark accepts them, but the installed Docusaurus\n * Mermaid integration recognizes backtick fences only. Normalize just a\n * well-formed Mermaid pair at this renderer boundary: prose authors stay\n * renderer-neutral, while the renderer emits the fence syntax its MDX plugin\n * actually executes. Other fenced examples retain their authored delimiter.\n */\nfunction normalizeMermaidFencesForDocusaurus(markdown: string): string {\n let insideTildeMermaidFence = false;\n return markdown.split('\\n').map((line) => {\n if (/^\\s{0,3}~~~mermaid\\s*$/.test(line)) {\n insideTildeMermaidFence = true;\n return line.replace('~~~mermaid', '```mermaid');\n }\n if (insideTildeMermaidFence && /^\\s{0,3}~~~\\s*$/.test(line)) {\n insideTildeMermaidFence = false;\n return line.replace('~~~', '```');\n }\n return line;\n }).join('\\n');\n}\n\nfunction renderUnit(unit: TechnicalDocumentationUnitV1, model: TechnicalDocumentationRenderModel, assetPathByRef: ReadonlyMap<string, string>, resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null): string {\n const path = model.unitPathByRef.get(unit.unitRef) as string;\n // Every field below carries authored or derived PROSE into an `.mdx` file, so each one is a\n // site where a route template like `/organizations/{organizationId}/todos` would compile fine\n // and then crash the page in the reader's browser. Escaping is applied per field rather than\n // once over the assembled document on purpose: the assembly also emits `---` frontmatter and\n // Markdown punctuation this must not touch, and `title` is JSON-encoded rather than Markdown.\n const publishedPaths = new Set(model.unitPathByRef.values());\n const sections = unit.sections\n .map((section, index) => {\n const body = escapeMarkdownForMdx(pruneUnpublishedSiteLinks(normalizeMermaidFencesForDocusaurus(section.bodyMarkdown), publishedPaths, ENGINE_UNIT_ROUTES));\n // The lead section is what the author wrote between the title and the first `##`. It is\n // the page's opening, not a section called \"Overview\", so it renders without a heading.\n return isImplicitLeadSection(section, index) ? body : `## ${escapeMarkdownForMdx(section.heading)}\\n\\n${body}`;\n })\n .join('\\n\\n');\n const figures = unit.assetRequests.flatMap((request) => {\n const assetPath = assetPathByRef.get(request.assetRef);\n return assetPath === undefined ? [] : [`![${escapeMarkdownForMdx(request.altText)}](/${assetPath})`];\n });\n const links = unit.links.flatMap((link) => {\n const label = escapeMarkdownForMdx(link.label);\n if (link.kind === TechnicalDocumentationLinkKind.UNIT) {\n const target = model.unitPathByRef.get(link.targetUnitRef as string);\n if (target === undefined) throw new Error(`technical-documentation Docusaurus link target is absent: ${link.targetUnitRef}`);\n return [`- [${label}](/${target})`];\n }\n if (link.kind === TechnicalDocumentationLinkKind.EXTERNAL) return [`- [${label}](${link.externalUrl})`];\n if (link.kind === TechnicalDocumentationLinkKind.API_REFERENCE) {\n if (resolveApiReferenceTarget === undefined) throw new Error(`technical-documentation API-reference link was not resolved before Docusaurus rendering: ${link.linkRef}`);\n /*\n * A `null` resolution means the target is not published by THIS application — a guide links to\n * a resource the application has feature-gated off. It degrades to plain text; the rest of the\n * portal publishes (#472, decided 2026-09-08).\n *\n * This used to throw, from inside `renderUnit`, which runs BEFORE the generated tree is\n * synchronized — so one missing target wrote NOTHING AT ALL. Not a broken link: no portal.\n * With 43 hardcoded engine `apiReferenceTargets` naming resources an application may switch\n * off, any application not enabling all 43 could not publish documentation.\n *\n * The `undefined` guard above is a DIFFERENT failure and still throws: it means the caller\n * wired no resolver, so nothing was even asked. Degrading there would hide a wiring mistake.\n *\n * Reporting the degradation is the CALLER's job — see the resolver the companion supplies. A\n * portal that quietly drops links would be worse than one that failed loudly, which is why\n * this half is not the whole fix.\n */\n const href = resolveApiReferenceTarget(link.apiReferenceTarget as TechnicalDocumentationApiReferenceTargetV1);\n return href === null ? [`- ${label}`] : [`- [${label}](${href})`];\n }\n return [];\n });\n const assetSection = figures.length === 0 ? '' : `\\n\\n## Product view\\n\\n${figures.join('\\n\\n')}`;\n const relatedSection = links.length === 0 ? '' : `\\n\\n## Related\\n\\n${links.join('\\n')}`;\n const summary = escapeMarkdownForMdx(unit.summary);\n return `---\\nid: ${path.split('/').at(-1)}\\ntitle: ${JSON.stringify(unit.title)}\\nsidebar_label: ${JSON.stringify(unit.title)}\\n---\\n\\n${summary}\\n\\n${sections}${assetSection}${relatedSection}\\n`;\n}\n\nfunction renderDocusaurusSidebars(model: TechnicalDocumentationRenderModel): string {\n const rootDocumentPaths: string[] = [];\n const rootDocumentPathSet = new Set<string>();\n const categoryItems: DocusaurusSidebarItem[] = [];\n const claimedRootLandingPaths = new Set<string>();\n const pathsByDirectory = new Map<string, string[]>();\n const unitTitleByPath = new Map<string, string>();\n for (const unit of model.units) {\n const path = model.unitPathByRef.get(unit.unitRef) as string;\n unitTitleByPath.set(path, unit.title);\n const [directory] = path.split('/');\n if (directory === undefined || !path.includes('/')) {\n rootDocumentPaths.push(path);\n rootDocumentPathSet.add(path);\n continue;\n }\n const paths = pathsByDirectory.get(directory) ?? [];\n paths.push(path);\n pathsByDirectory.set(directory, paths);\n }\n\n for (const [directory, paths] of [...pathsByDirectory.entries()].sort(([left], [right]) => left.localeCompare(right))) {\n const label = DOCUSAURUS_CATEGORY_LABEL_BY_DIRECTORY[directory];\n if (label === undefined) throw new Error(`technical-documentation Docusaurus category is missing a reader label: ${directory}`);\n const overviewPath = `${directory}/overview`;\n // A root document and a child directory may deliberately share one route\n // identity (`user-administration` + `user-administration/*`). That exact\n // path relation—not mutable display copy—makes the root document the\n // category landing. Labels remain free to evolve without breaking IA.\n const rootLandingPath = rootDocumentPathSet.has(directory) ? directory : undefined;\n const landingPath = paths.includes(overviewPath) ? overviewPath : rootLandingPath;\n if (rootLandingPath !== undefined && landingPath === rootLandingPath) claimedRootLandingPaths.add(rootLandingPath);\n const itemPaths = paths.filter((path) => path !== overviewPath);\n const [onlyItemPath] = itemPaths;\n\n // A category with one identically named document is not a journey: rendering\n // both creates two adjacent controls with the same reader meaning. Flatten\n // only that exact shape. A differently named single document remains under\n // its responsibility label because the category still adds useful context.\n if (landingPath === undefined && itemPaths.length === 1 && onlyItemPath !== undefined && unitTitleByPath.get(onlyItemPath) === label) {\n categoryItems.push(onlyItemPath);\n continue;\n }\n\n const orderedItems = renderDocusaurusCategoryItems({ directory, itemPaths, unitTitleByPath });\n categoryItems.push({\n type: 'category',\n label,\n collapsible: true,\n // Docusaurus expands the category containing the active document. Keeping\n // other journeys collapsed makes the sidebar scale with the catalogue.\n collapsed: true,\n ...(landingPath === undefined ? {} : { link: { type: 'doc', id: landingPath } }),\n items: orderedItems,\n });\n }\n\n const rootItems = [\n ...rootDocumentPaths.filter((path) => !claimedRootLandingPaths.has(path)),\n ...categoryItems,\n ];\n return `${JSON.stringify({ docs: rootItems }, null, 2)}\\n`;\n}\n\nexport function renderTechnicalDocumentationDocusaurus(input: {\n readonly model: TechnicalDocumentationRenderModel;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly assetBytesByPath: ReadonlyMap<string, Uint8Array>;\n /**\n * Resolves a guide's API-reference target to a public href, or returns `null` when this\n * application does not publish it — a link to a feature-gated resource. `null` degrades the link\n * to plain text rather than failing the render (#472). Reporting the degradation belongs to\n * whoever supplies this function; the renderer only renders.\n */\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null;\n}): TechnicalDocumentationRendererResult {\n const assetPathByRef = new Map(input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) =>\n RENDERABLE_ASSET_STATUSES.has(asset.status) ? [[asset.assetRef, asset.normalizedRelativePath as string]] : []));\n const sourceUnitRefsByAssetRef = new Map<string, string[]>();\n for (const unit of input.model.units) {\n for (const request of unit.assetRequests) {\n const owners = sourceUnitRefsByAssetRef.get(request.assetRef) ?? [];\n owners.push(unit.unitRef);\n sourceUnitRefsByAssetRef.set(request.assetRef, owners);\n }\n }\n const pageFiles = input.model.units.map((unit) => {\n const path = input.model.unitPathByRef.get(unit.unitRef) as string;\n return {\n // The full route identity is part of the output identity. Two valid pages\n // may share their final slug (`integrations/todos` and\n // `user-administration/users`) without sharing a file or a manifest row.\n outputRef: `technical-documentation:output/docusaurus/${path.split('/').join(':')}`,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT,\n sourceUnitRefs: [unit.unitRef],\n normalizedRelativePath: `docusaurus/docs/${path}.mdx`,\n mediaType: 'text/mdx',\n bytes: Buffer.from(renderUnit(unit, input.model, assetPathByRef, input.resolveApiReferenceTarget), 'utf8'),\n } as const;\n });\n const assetFiles = input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) => {\n if (!RENDERABLE_ASSET_STATUSES.has(asset.status)) return [];\n const path = asset.normalizedRelativePath as string;\n const bytes = input.assetBytesByPath.get(path);\n if (bytes === undefined) throw new Error(`technical-documentation Docusaurus asset bytes are absent: ${path}`);\n const sourceUnitRefs = [...(sourceUnitRefsByAssetRef.get(asset.assetRef) ?? [])].sort();\n if (sourceUnitRefs.length === 0) throw new Error(`technical-documentation resolved asset has no authorized unit owner: ${asset.assetRef}`);\n return [{\n outputRef: `technical-documentation:output/asset/${technicalDocumentationAssetFileStem(asset.assetRef)}`,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.ASSET,\n sourceUnitRefs,\n normalizedRelativePath: `docusaurus/static/${path}`,\n mediaType: asset.mediaType,\n bytes,\n }];\n });\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.DOCUSAURUS,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/docusaurus-v1',\n }),\n files: [\n ...pageFiles,\n ...assetFiles,\n {\n outputRef: 'technical-documentation:output/docusaurus-sidebars',\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,\n sourceUnitRefs: input.model.units.map((unit) => unit.unitRef),\n normalizedRelativePath: 'docusaurus/sidebars.json',\n mediaType: 'application/json',\n bytes: Buffer.from(renderDocusaurusSidebars(input.model), 'utf8'),\n },\n ],\n };\n}\n"]}
1
+ {"version":3,"file":"technical-documentation-docusaurus-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-docusaurus-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,8BAA8B,E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,CAAC,SAAS;gBAC1B,KAAK;aACN,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO;QACL,SAAS,EAAE,6CAA6C,CAAC;YACvD,YAAY,EAAE,kCAAkC,CAAC,UAAU;YAC3D,WAAW,EAAE,uBAAuB;YACpC,eAAe,EAAE,CAAC;YAClB,gBAAgB,EAAE,8DAA8D;SACjF,CAAC;QACF,KAAK,EAAE;YACL,GAAG,SAAS;YACZ,GAAG,UAAU;YACb;gBACE,SAAS,EAAE,oDAAoD;gBAC/D,WAAW,EAAE,uBAAuB;gBACpC,UAAU,EAAE,gCAAgC,CAAC,gBAAgB;gBAC7D,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC7D,sBAAsB,EAAE,0BAA0B;gBAClD,SAAS,EAAE,kBAAkB;gBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;aAClE;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import {\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationLinkKind,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationApiReferenceTargetV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport { APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY } from '../application-documentation/application-documentation-chapters';\nimport { escapeMarkdownForMdx } from './technical-documentation-mdx-escaping';\nimport { isImplicitLeadSection, pruneUnpublishedSiteLinks } from './technical-documentation-markdown-links';\nimport {\n technicalDocumentationAssetFileStem,\n} from '../technical-documentation-asset-path';\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRenderModel,\n type TechnicalDocumentationRendererResult,\n ENGINE_UNIT_ROUTES,\n} from './technical-documentation-render-model';\n\n/**\n * Statuses whose asset carries real bytes at a real path, and therefore renders.\n *\n * `PLACEHOLDER` belongs here with `RESOLVED`: the framework materializes a stand-in image,\n * so the page shows a picture rather than a hole. That is the whole distinction from\n * `MISSING` — both mean \"the real capture has not run\", but only one of them SHIPS\n * something. Rendering is a question about bytes; whether provisional imagery may be\n * published at all is an environment policy decided at publication, not here.\n */\nconst RENDERABLE_ASSET_STATUSES: ReadonlySet<TechnicalDocumentationAssetResolutionStatus> = new Set([\n TechnicalDocumentationAssetResolutionStatus.PLACEHOLDER,\n TechnicalDocumentationAssetResolutionStatus.RESOLVED,\n]);\n\nconst DOCUSAURUS_RENDERER_REF = 'technical-documentation:renderer/docusaurus';\n\n/**\n * Reader-facing names for the product responsibilities in the portal.\n *\n * Folder names are stable routing mechanics, not customer copy: exposing\n * `user-administration` in the sidebar leaks a URL convention. A category\n * with a landing document links to that document and excludes it from the\n * dropdown, so readers select the category for orientation and expand it for\n * focused tasks. A landing may use the category's canonical root path or the\n * conventional nested `overview` path; the former keeps a public entry route\n * concise without introducing a redirect or duplicate document.\n */\nconst DOCUSAURUS_CATEGORY_LABEL_BY_DIRECTORY: Readonly<Record<string, string>> = {\n 'access-and-identity': 'Access and identity',\n /*\n * The per-resource pages nest under the page that lists them, which makes this a category the\n * moment an application publishes a resource of its own. It has a LANDING document at the\n * category's canonical root path — the overview — so a reader selects it for orientation and\n * expands it for one resource.\n *\n * The label is generic where the pages beneath it are not, and deliberately: an application's\n * own name for this part of its product is a fact only the application has, and it already\n * states it inside the page. Putting a projected value here would make the sidebar the one\n * surface whose words come from somewhere the renderer cannot see.\n */\n 'what-this-application-manages': 'What this application manages',\n /*\n * The chapters the APPLICATION authored (#874): its business journeys, administrator tasks and\n * troubleshooting, written against its own resources. Generic for the reason the label above is —\n * each page carries its own title, and a sidebar word projected from the application would be the\n * one surface whose words come from somewhere this renderer cannot see.\n */\n [APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY]: 'Guides',\n integrations: 'Integrations',\n 'security-and-audit': 'Security and audit',\n 'user-administration': 'User administration',\n};\n\ntype DocusaurusJourneyItem = string | {\n readonly landingPath: string;\n readonly childPaths: readonly string[];\n};\n\ntype DocusaurusSidebarItem = string | {\n readonly type: 'category';\n readonly label: string;\n readonly collapsible: true;\n readonly collapsed: true;\n readonly link?: { readonly type: 'doc'; readonly id: string };\n readonly items: readonly DocusaurusSidebarItem[];\n};\n\n/**\n * A category is a reader journey, not an alphabetized file listing. Most\n * categories need no override; user administration does, because readers first\n * choose how accounts are managed and then follow the relevant task sequence.\n *\n * A journey landing is rendered as a clickable second-level category. It is\n * deliberately absent from that category's children: selecting the label opens\n * the explanation, while expanding it reveals the concrete tasks. Plain paths\n * remain direct children for work that spans several journeys.\n */\nconst DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY: Readonly<Record<string, readonly DocusaurusJourneyItem[]>> = {\n 'security-and-audit': [\n // First in the section on purpose: somebody reaching this during an incident has no time to\n // browse, and every other page here is a capability rather than a response.\n 'security-and-audit/respond-to-leaked-credential',\n 'security-and-audit/investigate-event',\n 'security-and-audit/review-access-changes',\n 'security-and-audit/export-audit-records',\n {\n landingPath: 'security-and-audit/configure-siem',\n childPaths: [\n 'security-and-audit/siem-splunk',\n 'security-and-audit/siem-microsoft-sentinel',\n 'security-and-audit/siem-elastic',\n 'security-and-audit/operate-siem',\n ],\n },\n 'security-and-audit/protect-evidence',\n ],\n 'access-and-identity': [\n {\n landingPath: 'access-and-identity/sign-in-and-mfa',\n childPaths: [\n 'access-and-identity/complete-sign-in',\n 'access-and-identity/mfa-enrollment-and-recovery',\n 'access-and-identity/sign-in-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/single-sign-on',\n childPaths: [\n 'access-and-identity/sso-configure',\n 'access-and-identity/sso-rollout-and-recovery',\n 'access-and-identity/sso-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/api-keys',\n childPaths: [\n 'access-and-identity/api-keys-create-and-store',\n 'access-and-identity/api-keys-lifecycle',\n 'access-and-identity/api-keys-troubleshoot',\n ],\n },\n {\n landingPath: 'access-and-identity/oauth-provider',\n childPaths: [\n 'access-and-identity/oauth-register-client',\n 'access-and-identity/oauth-authorize-delegated-access',\n 'access-and-identity/oauth-operate-and-revoke',\n ],\n },\n ],\n 'user-administration': [\n {\n landingPath: 'user-administration/manage-users-manually',\n childPaths: [\n 'user-administration/invite-and-onboard-user',\n 'user-administration/roles-and-permissions',\n 'user-administration/change-user-access',\n 'user-administration/suspend-or-remove-user',\n ],\n },\n {\n landingPath: 'user-administration/manage-organization-units',\n childPaths: [\n 'user-administration/design-organization-unit-hierarchy',\n 'user-administration/assign-organization-unit-access',\n 'user-administration/operate-organization-units',\n ],\n },\n 'user-administration/review-users-and-access',\n 'user-administration/troubleshoot-user-access',\n {\n landingPath: 'user-administration/scim-provisioning',\n childPaths: [\n 'user-administration/scim-protocol-and-payloads',\n 'user-administration/scim-configure',\n 'user-administration/scim-microsoft-entra',\n 'user-administration/scim-okta',\n 'user-administration/scim-ldap-and-active-directory',\n 'user-administration/scim-map-profile-and-units',\n 'user-administration/scim-validate-and-roll-out',\n 'user-administration/scim-operate-and-troubleshoot',\n ],\n },\n ],\n integrations: [\n {\n landingPath: 'integrations/automation-platforms',\n childPaths: [\n 'integrations/automation/n8n',\n 'integrations/automation/zapier',\n 'integrations/automation/make',\n ],\n },\n {\n landingPath: 'integrations/ai-coding-tools',\n childPaths: [\n 'integrations/ai-tools/cursor',\n 'integrations/ai-tools/codex',\n 'integrations/ai-tools/claude-code',\n ],\n },\n {\n landingPath: 'integrations/rest-api',\n childPaths: [\n 'integrations/rest/conventions',\n 'integrations/rest/send-request',\n 'integrations/rest/read-collections',\n 'integrations/rest/write-and-reconcile',\n 'integrations/rest/troubleshoot',\n ],\n },\n {\n landingPath: 'integrations/webhooks',\n childPaths: [\n 'integrations/webhooks/configure-and-test',\n 'integrations/webhooks/verify-delivery',\n 'integrations/webhooks/operate-deliveries',\n 'integrations/webhooks/troubleshoot',\n ],\n },\n {\n landingPath: 'integrations/agents',\n childPaths: [\n 'integrations/mcp',\n 'integrations/a2a',\n ],\n },\n 'integrations/create-your-own-integration',\n ],\n};\n\nfunction renderDocusaurusCategoryItems(input: {\n readonly directory: string;\n readonly itemPaths: readonly string[];\n readonly unitTitleByPath: ReadonlyMap<string, string>;\n}): DocusaurusSidebarItem[] {\n const availablePaths = new Set(input.itemPaths);\n const claimedPaths = new Set<string>();\n const journey = DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY[input.directory] ?? [];\n const renderedJourney = journey.flatMap((item): DocusaurusSidebarItem[] => {\n if (typeof item === 'string') {\n if (!availablePaths.has(item)) return [];\n claimedPaths.add(item);\n return [item];\n }\n\n const availableChildPaths = item.childPaths.filter((path) => availablePaths.has(path));\n for (const path of availableChildPaths) claimedPaths.add(path);\n if (!availablePaths.has(item.landingPath)) {\n // Applicability may omit a landing while retaining an independently\n // useful task. Never hide those tasks merely because their group cannot\n // be rendered as a linked category in this publication.\n return availableChildPaths;\n }\n\n const label = input.unitTitleByPath.get(item.landingPath);\n if (label === undefined) throw new Error(`technical-documentation Docusaurus journey landing is missing a reader title: ${item.landingPath}`);\n claimedPaths.add(item.landingPath);\n // A landing without applicable child tasks is a document, not an empty\n // disclosure control. This preserves the same no-duplicate/no-empty-arrow\n // rule used for top-level single-page responsibilities.\n if (availableChildPaths.length === 0) return [item.landingPath];\n return [{\n type: 'category',\n label,\n collapsible: true,\n collapsed: true,\n link: { type: 'doc', id: item.landingPath },\n items: availableChildPaths,\n }];\n });\n\n return [\n ...renderedJourney,\n ...input.itemPaths.filter((path) => !claimedPaths.has(path)).sort((left, right) => left.localeCompare(right)),\n ];\n}\n\n/**\n * Authors use tilde fences because this content module itself is a TypeScript\n * template literal. CommonMark accepts them, but the installed Docusaurus\n * Mermaid integration recognizes backtick fences only. Normalize just a\n * well-formed Mermaid pair at this renderer boundary: prose authors stay\n * renderer-neutral, while the renderer emits the fence syntax its MDX plugin\n * actually executes. Other fenced examples retain their authored delimiter.\n */\nfunction normalizeMermaidFencesForDocusaurus(markdown: string): string {\n let insideTildeMermaidFence = false;\n return markdown.split('\\n').map((line) => {\n if (/^\\s{0,3}~~~mermaid\\s*$/.test(line)) {\n insideTildeMermaidFence = true;\n return line.replace('~~~mermaid', '```mermaid');\n }\n if (insideTildeMermaidFence && /^\\s{0,3}~~~\\s*$/.test(line)) {\n insideTildeMermaidFence = false;\n return line.replace('~~~', '```');\n }\n return line;\n }).join('\\n');\n}\n\nfunction renderUnit(unit: TechnicalDocumentationUnitV1, model: TechnicalDocumentationRenderModel, assetPathByRef: ReadonlyMap<string, string>, resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null): string {\n const path = model.unitPathByRef.get(unit.unitRef) as string;\n // Every field below carries authored or derived PROSE into an `.mdx` file, so each one is a\n // site where a route template like `/organizations/{organizationId}/todos` would compile fine\n // and then crash the page in the reader's browser. Escaping is applied per field rather than\n // once over the assembled document on purpose: the assembly also emits `---` frontmatter and\n // Markdown punctuation this must not touch, and `title` is JSON-encoded rather than Markdown.\n const publishedPaths = new Set(model.unitPathByRef.values());\n const sections = unit.sections\n .map((section, index) => {\n const body = escapeMarkdownForMdx(pruneUnpublishedSiteLinks(normalizeMermaidFencesForDocusaurus(section.bodyMarkdown), publishedPaths, ENGINE_UNIT_ROUTES));\n // The lead section is what the author wrote between the title and the first `##`. It is\n // the page's opening, not a section called \"Overview\", so it renders without a heading.\n return isImplicitLeadSection(section, index) ? body : `## ${escapeMarkdownForMdx(section.heading)}\\n\\n${body}`;\n })\n .join('\\n\\n');\n const figures = unit.assetRequests.flatMap((request) => {\n const assetPath = assetPathByRef.get(request.assetRef);\n return assetPath === undefined ? [] : [`![${escapeMarkdownForMdx(request.altText)}](/${assetPath})`];\n });\n const links = unit.links.flatMap((link) => {\n const label = escapeMarkdownForMdx(link.label);\n if (link.kind === TechnicalDocumentationLinkKind.UNIT) {\n const target = model.unitPathByRef.get(link.targetUnitRef as string);\n if (target === undefined) throw new Error(`technical-documentation Docusaurus link target is absent: ${link.targetUnitRef}`);\n return [`- [${label}](/${target})`];\n }\n if (link.kind === TechnicalDocumentationLinkKind.EXTERNAL) return [`- [${label}](${link.externalUrl})`];\n if (link.kind === TechnicalDocumentationLinkKind.API_REFERENCE) {\n if (resolveApiReferenceTarget === undefined) throw new Error(`technical-documentation API-reference link was not resolved before Docusaurus rendering: ${link.linkRef}`);\n /*\n * A `null` resolution means the target is not published by THIS application — a guide links to\n * a resource the application has feature-gated off. It degrades to plain text; the rest of the\n * portal publishes (#472, decided 2026-09-08).\n *\n * This used to throw, from inside `renderUnit`, which runs BEFORE the generated tree is\n * synchronized — so one missing target wrote NOTHING AT ALL. Not a broken link: no portal.\n * With 43 hardcoded engine `apiReferenceTargets` naming resources an application may switch\n * off, any application not enabling all 43 could not publish documentation.\n *\n * The `undefined` guard above is a DIFFERENT failure and still throws: it means the caller\n * wired no resolver, so nothing was even asked. Degrading there would hide a wiring mistake.\n *\n * Reporting the degradation is the CALLER's job — see the resolver the companion supplies. A\n * portal that quietly drops links would be worse than one that failed loudly, which is why\n * this half is not the whole fix.\n */\n const href = resolveApiReferenceTarget(link.apiReferenceTarget as TechnicalDocumentationApiReferenceTargetV1);\n return href === null ? [`- ${label}`] : [`- [${label}](${href})`];\n }\n return [];\n });\n const assetSection = figures.length === 0 ? '' : `\\n\\n## Product view\\n\\n${figures.join('\\n\\n')}`;\n const relatedSection = links.length === 0 ? '' : `\\n\\n## Related\\n\\n${links.join('\\n')}`;\n const summary = escapeMarkdownForMdx(unit.summary);\n return `---\\nid: ${path.split('/').at(-1)}\\ntitle: ${JSON.stringify(unit.title)}\\nsidebar_label: ${JSON.stringify(unit.title)}\\n---\\n\\n${summary}\\n\\n${sections}${assetSection}${relatedSection}\\n`;\n}\n\nfunction renderDocusaurusSidebars(model: TechnicalDocumentationRenderModel): string {\n const rootDocumentPaths: string[] = [];\n const rootDocumentPathSet = new Set<string>();\n const categoryItems: DocusaurusSidebarItem[] = [];\n const claimedRootLandingPaths = new Set<string>();\n const pathsByDirectory = new Map<string, string[]>();\n const unitTitleByPath = new Map<string, string>();\n for (const unit of model.units) {\n const path = model.unitPathByRef.get(unit.unitRef) as string;\n unitTitleByPath.set(path, unit.title);\n const [directory] = path.split('/');\n if (directory === undefined || !path.includes('/')) {\n rootDocumentPaths.push(path);\n rootDocumentPathSet.add(path);\n continue;\n }\n const paths = pathsByDirectory.get(directory) ?? [];\n paths.push(path);\n pathsByDirectory.set(directory, paths);\n }\n\n for (const [directory, paths] of [...pathsByDirectory.entries()].sort(([left], [right]) => left.localeCompare(right))) {\n const label = DOCUSAURUS_CATEGORY_LABEL_BY_DIRECTORY[directory];\n if (label === undefined) throw new Error(`technical-documentation Docusaurus category is missing a reader label: ${directory}`);\n const overviewPath = `${directory}/overview`;\n // A root document and a child directory may deliberately share one route\n // identity (`user-administration` + `user-administration/*`). That exact\n // path relation—not mutable display copy—makes the root document the\n // category landing. Labels remain free to evolve without breaking IA.\n const rootLandingPath = rootDocumentPathSet.has(directory) ? directory : undefined;\n const landingPath = paths.includes(overviewPath) ? overviewPath : rootLandingPath;\n if (rootLandingPath !== undefined && landingPath === rootLandingPath) claimedRootLandingPaths.add(rootLandingPath);\n const itemPaths = paths.filter((path) => path !== overviewPath);\n const [onlyItemPath] = itemPaths;\n\n // A category with one identically named document is not a journey: rendering\n // both creates two adjacent controls with the same reader meaning. Flatten\n // only that exact shape. A differently named single document remains under\n // its responsibility label because the category still adds useful context.\n if (landingPath === undefined && itemPaths.length === 1 && onlyItemPath !== undefined && unitTitleByPath.get(onlyItemPath) === label) {\n categoryItems.push(onlyItemPath);\n continue;\n }\n\n const orderedItems = renderDocusaurusCategoryItems({ directory, itemPaths, unitTitleByPath });\n categoryItems.push({\n type: 'category',\n label,\n collapsible: true,\n // Docusaurus expands the category containing the active document. Keeping\n // other journeys collapsed makes the sidebar scale with the catalogue.\n collapsed: true,\n ...(landingPath === undefined ? {} : { link: { type: 'doc', id: landingPath } }),\n items: orderedItems,\n });\n }\n\n const rootItems = [\n ...rootDocumentPaths.filter((path) => !claimedRootLandingPaths.has(path)),\n ...categoryItems,\n ];\n return `${JSON.stringify({ docs: rootItems }, null, 2)}\\n`;\n}\n\nexport function renderTechnicalDocumentationDocusaurus(input: {\n readonly model: TechnicalDocumentationRenderModel;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly assetBytesByPath: ReadonlyMap<string, Uint8Array>;\n /**\n * Resolves a guide's API-reference target to a public href, or returns `null` when this\n * application does not publish it — a link to a feature-gated resource. `null` degrades the link\n * to plain text rather than failing the render (#472). Reporting the degradation belongs to\n * whoever supplies this function; the renderer only renders.\n */\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null;\n}): TechnicalDocumentationRendererResult {\n const assetPathByRef = new Map(input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) =>\n RENDERABLE_ASSET_STATUSES.has(asset.status) ? [[asset.assetRef, asset.normalizedRelativePath as string]] : []));\n const sourceUnitRefsByAssetRef = new Map<string, string[]>();\n for (const unit of input.model.units) {\n for (const request of unit.assetRequests) {\n const owners = sourceUnitRefsByAssetRef.get(request.assetRef) ?? [];\n owners.push(unit.unitRef);\n sourceUnitRefsByAssetRef.set(request.assetRef, owners);\n }\n }\n const pageFiles = input.model.units.map((unit) => {\n const path = input.model.unitPathByRef.get(unit.unitRef) as string;\n return {\n // The full route identity is part of the output identity. Two valid pages\n // may share their final slug (`integrations/todos` and\n // `user-administration/users`) without sharing a file or a manifest row.\n outputRef: `technical-documentation:output/docusaurus/${path.split('/').join(':')}`,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT,\n sourceUnitRefs: [unit.unitRef],\n normalizedRelativePath: `docusaurus/docs/${path}.mdx`,\n mediaType: 'text/mdx',\n bytes: Buffer.from(renderUnit(unit, input.model, assetPathByRef, input.resolveApiReferenceTarget), 'utf8'),\n } as const;\n });\n const assetFiles = input.resolvedAssetBundle.resolvedAssetSet.assets.flatMap((asset) => {\n if (!RENDERABLE_ASSET_STATUSES.has(asset.status)) return [];\n const path = asset.normalizedRelativePath as string;\n const bytes = input.assetBytesByPath.get(path);\n if (bytes === undefined) throw new Error(`technical-documentation Docusaurus asset bytes are absent: ${path}`);\n const sourceUnitRefs = [...(sourceUnitRefsByAssetRef.get(asset.assetRef) ?? [])].sort();\n if (sourceUnitRefs.length === 0) throw new Error(`technical-documentation resolved asset has no authorized unit owner: ${asset.assetRef}`);\n return [{\n outputRef: `technical-documentation:output/asset/${technicalDocumentationAssetFileStem(asset.assetRef)}`,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.ASSET,\n sourceUnitRefs,\n normalizedRelativePath: `docusaurus/static/${path}`,\n mediaType: asset.mediaType,\n bytes,\n }];\n });\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.DOCUSAURUS,\n rendererRef: DOCUSAURUS_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/docusaurus-v1',\n }),\n files: [\n ...pageFiles,\n ...assetFiles,\n {\n outputRef: 'technical-documentation:output/docusaurus-sidebars',\n rendererRef: DOCUSAURUS_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,\n sourceUnitRefs: input.model.units.map((unit) => unit.unitRef),\n normalizedRelativePath: 'docusaurus/sidebars.json',\n mediaType: 'application/json',\n bytes: Buffer.from(renderDocusaurusSidebars(input.model), 'utf8'),\n },\n ],\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-render-model.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-render-model.ts"],"names":[],"mappings":"AAIA,OAAO,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IACjC,kGAAkG;IAClG,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC,GAAG,yCAAyC,CAa5C;AA4FD,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAoD,CAAC;AA+CxG,wBAAgB,uCAAuC,CACrD,gBAAgB,EAAE,gDAAgD,GACjE,iCAAiC,CAenC;AAED,wBAAgB,mDAAmD,CAAC,KAAK,EAAE;IACzE,QAAQ,CAAC,gBAAgB,EAAE,gDAAgD,CAAC;IAC5E,QAAQ,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;IAClF,QAAQ,CAAC,mBAAmB,EAAE,yCAAyC,CAAC;IACxE,QAAQ,CAAC,eAAe,EAAE,SAAS,oCAAoC,EAAE,CAAC;IAC1E,kFAAkF;IAClF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,GAAG,4CAA4C,CAsB/C"}
1
+ {"version":3,"file":"technical-documentation-render-model.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-render-model.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,gCAAgC,EAEhC,kCAAkC,EAClC,KAAK,gDAAgD,EACrD,KAAK,4CAA4C,EACjD,KAAK,yCAAyC,EAC9C,KAAK,yCAAyC,EAC9C,KAAK,mDAAmD,EACxD,KAAK,yCAAyC,EAC9C,KAAK,4BAA4B,EAClC,MAAM,uDAAuD,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE3E;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,wBAAwB,EAAE,yCAAyC,CAAC;IAC7E,QAAQ,CAAC,OAAO,EAAE,gDAAgD,CAAC,SAAS,CAAC,CAAC;IAC9E,QAAQ,CAAC,KAAK,EAAE,SAAS,4BAA4B,EAAE,CAAC;IACxD,QAAQ,CAAC,aAAa,EAAE,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E,MAAM,CAAC;IAC3B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC,GAAG,4CAA4C,CAsB/C"}
@@ -1,5 +1,6 @@
1
1
  import { createHash } from 'node:crypto';
2
2
  import { APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX } from '../application-documentation/technical-documentation-engine-content-bundle.js';
3
+ import { APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY, APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX, } from '../application-documentation/application-documentation-chapters.js';
3
4
  import { createTechnicalDocumentationRenderOutputManifestV1, TechnicalDocumentationNormalizedRelativePathSchema, } from '@wildo-ai/saas-specifications/technical-documentation';
4
5
  /**
5
6
  * Names opaque emitted bytes, and detects their corruption when a reader compares this against the
@@ -124,25 +125,28 @@ export const ENGINE_UNIT_ROUTES = new Set(Object.values(ENGINE_UNIT_PATH_BY_SLUG
124
125
  * it—so readers can find access, organization, security and integration
125
126
  * material without learning Wildo vocabulary.
126
127
  *
127
- * One namespace is DERIVED rather than listed — `unit/manages/<resource>`, the page per
128
- * application resource — because those units cannot be enumerated when this file is written. An
129
- * application-OWNED unit still fails closed instead of acquiring an implicit route; that refusal
130
- * is what this table is for, and it is untouched.
128
+ * Two namespaces are DERIVED rather than listed, because their units cannot be enumerated when this
129
+ * file is written: `unit/manages/<resource>`, the page per application resource, and
130
+ * `unit/guides/<slug>`, the chapters an application authors (#874). Both are RESERVED engine
131
+ * namespaces the projectors emit; the application supplies a subject or a slug and never a URL
132
+ * scheme. Any other unit — including one whose ref an application chose freely — still fails closed
133
+ * instead of acquiring an implicit route; that refusal is what this table is for.
131
134
  */
132
135
  function pathForUnit(unit) {
133
136
  const slug = slugForUnit(unit);
134
137
  /*
135
- * ONE derived branch, and it is deliberately narrow.
138
+ * The first of TWO derived branches, both deliberately narrow.
136
139
  *
137
140
  * Every other route in this table is a constant, because a renderer owns audience-facing URLs
138
141
  * and an authored page's URL is a decision somebody made. A page per application resource cannot
139
142
  * work that way — the resources are not known when this file is written — so its route is
140
- * DERIVED from the reserved `unit/manages/` namespace the projector emits.
143
+ * DERIVED from the reserved `unit/manages/` namespace the projector emits. The second branch,
144
+ * below, does the same for the reserved `unit/guides/` namespace of authored chapters (#874).
141
145
  *
142
- * What has NOT changed is the refusal below. A unit an application named still fails closed; the
143
- * generated pages are engine units carrying an application subject, which is why they can be
144
- * routed at all. Anything outside both the fixed table and this one namespace is still a
145
- * missing decision rather than an implicit URL.
146
+ * What has NOT changed is the refusal at the end. A unit whose ref an application chose freely
147
+ * still fails closed; both derived namespaces are reserved by an engine projector, which is why
148
+ * their units can be routed at all. Anything outside the fixed table and these two namespaces is
149
+ * still a missing decision rather than an implicit URL.
146
150
  */
147
151
  if (unit.unitRef.startsWith(APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX)) {
148
152
  const resourceIdentifier = unit.unitRef.slice(APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX.length);
@@ -151,6 +155,18 @@ function pathForUnit(unit) {
151
155
  }
152
156
  return `${ENGINE_UNIT_PATH_BY_SLUG['what-this-application-manages']}/${resourceIdentifier}`;
153
157
  }
158
+ /*
159
+ * The second derived branch, for authored chapters (#874). Checked BEFORE the fixed table on
160
+ * purpose: a chapter slug may coincide with an engine slug (`webhooks`), and the reserved prefix —
161
+ * not the slug — is what says whose page this is.
162
+ */
163
+ if (unit.unitRef.startsWith(APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX)) {
164
+ const chapterSlug = unit.unitRef.slice(APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX.length);
165
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(chapterSlug)) {
166
+ throw new Error(`technical-documentation chapter unit ${unit.unitRef} has no single-segment kebab-case slug`);
167
+ }
168
+ return `${APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY}/${chapterSlug}`;
169
+ }
154
170
  if (unit.unitRef.startsWith('technical-documentation:unit/')) {
155
171
  const path = ENGINE_UNIT_PATH_BY_SLUG[slug];
156
172
  if (path !== undefined)
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-render-model.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-render-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,gDAAgD,EAAE,MAAM,4EAA4E,CAAC;AAE9I,OAAO,EACL,kDAAkD,EAGlD,kDAAkD,GASnD,MAAM,uDAAuD,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAAC,KAAiB;IACjE,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACtE,CAAC;AAwBD,MAAM,UAAU,6CAA6C,CAAC,KAM7D;IACC;;;;;OAKG;IACH,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;KACzC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,IAAkC;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC;IAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACpF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,OAAO,+BAA+B,CAAC,CAAC;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AAE,CAAC;QAChB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,wBAAwB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,aAAa,EAAE;QAClH,2BAA2B,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,kBAAkB,EAAE;QACrI,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;QAC9C,kBAAkB;QAClB,OAAO;KACR,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { createHash } from 'node:crypto';\n\nimport { APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX } from '../application-documentation/technical-documentation-engine-content-bundle';\n\nimport {\n createTechnicalDocumentationRenderOutputManifestV1,\n canonicalizeTechnicalDocumentationJson,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationNormalizedRelativePathSchema,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationRenderOutputManifestV1,\n type TechnicalDocumentationRendererExecutionV1,\n type TechnicalDocumentationVersionedIdentityV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationSupportedApiVersion,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\n/**\n * Names opaque emitted bytes, and detects their corruption when a reader compares this against the\n * bytes it actually loaded. That two-sided check is why it survived the 2026-08-27 digest\n * demolition; its string-hashing sibling did not, because every caller of that one was recording\n * agreement between two parts of the repository rather than naming content.\n */\nexport function technicalDocumentationSha256Bytes(bytes: Uint8Array): string {\n return `sha256:${createHash('sha256').update(bytes).digest('hex')}`;\n}\n\nexport interface TechnicalDocumentationRenderModel {\n readonly authorizedBundleIdentity: TechnicalDocumentationVersionedIdentityV1;\n readonly channel: TechnicalDocumentationAuthorizedBundleManifestV1['channel'];\n readonly units: readonly TechnicalDocumentationUnitV1[];\n readonly unitPathByRef: ReadonlyMap<string, string>;\n}\n\nexport interface TechnicalDocumentationRenderedFile {\n readonly outputRef: string;\n readonly rendererRef: string;\n readonly outputKind: TechnicalDocumentationOutputKind;\n readonly sourceUnitRefs: readonly string[];\n readonly normalizedRelativePath: string;\n readonly mediaType: string;\n readonly bytes: Uint8Array;\n}\n\nexport interface TechnicalDocumentationRendererResult {\n readonly execution: TechnicalDocumentationRendererExecutionV1;\n readonly files: readonly TechnicalDocumentationRenderedFile[];\n}\n\nexport function createTechnicalDocumentationRendererExecution(input: {\n readonly rendererKind: TechnicalDocumentationRendererKind;\n readonly rendererRef: string;\n readonly rendererVersion: number;\n /** Names the renderer's configuration. `rendererRef@rendererVersion` names the implementation. */\n readonly configurationRef: string;\n}): TechnicalDocumentationRendererExecutionV1 {\n /*\n * This built two sha256 fields until 2026-08-27: one over the renderer's own function bodies\n * (`Function.prototype.toString()`), one over its configuration object. Neither was ever compared\n * to anything — they rode into the manifest beside the `rendererRef` and `rendererVersion` that\n * already say which renderer ran, in a form a reader can act on.\n */\n return {\n rendererKind: input.rendererKind,\n rendererRef: input.rendererRef,\n rendererVersion: input.rendererVersion,\n configurationRef: input.configurationRef,\n };\n}\n\nfunction slugForUnit(unit: TechnicalDocumentationUnitV1): string {\n const source = unit.unitRef.split('/').at(-1) ?? unit.unitRef;\n const slug = source.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');\n if (slug.length === 0) throw new Error(`technical-documentation unit ${unit.unitRef} cannot produce a stable path`);\n return slug;\n}\n\n/**\n * Every route the engine content module owns, keyed by unit slug. Exported as a SET so the\n * renderers can tell a gated page this application does not publish (flatten the link) from a\n * misspelled route (leave it for the managed-tree validator).\n */\nconst ENGINE_UNIT_PATH_BY_SLUG: Readonly<Record<string, string>> = {\n 'application-orientation': 'get-started',\n 'what-this-application-manages': 'what-this-application-manages',\n authentication: 'access-and-identity/overview',\n 'sign-in-and-mfa': 'access-and-identity/sign-in-and-mfa',\n 'complete-sign-in': 'access-and-identity/complete-sign-in',\n 'mfa-enrollment-and-recovery': 'access-and-identity/mfa-enrollment-and-recovery',\n 'sign-in-troubleshoot': 'access-and-identity/sign-in-troubleshoot',\n 'single-sign-on': 'access-and-identity/single-sign-on',\n 'sso-configure': 'access-and-identity/sso-configure',\n 'sso-rollout-and-recovery': 'access-and-identity/sso-rollout-and-recovery',\n 'sso-troubleshoot': 'access-and-identity/sso-troubleshoot',\n 'api-keys': 'access-and-identity/api-keys',\n 'api-keys-create-and-store': 'access-and-identity/api-keys-create-and-store',\n 'api-keys-lifecycle': 'access-and-identity/api-keys-lifecycle',\n 'api-keys-troubleshoot': 'access-and-identity/api-keys-troubleshoot',\n 'oauth-provider': 'access-and-identity/oauth-provider',\n 'oauth-register-client': 'access-and-identity/oauth-register-client',\n 'oauth-authorize-delegated-access': 'access-and-identity/oauth-authorize-delegated-access',\n 'oauth-operate-and-revoke': 'access-and-identity/oauth-operate-and-revoke',\n 'user-administration': 'user-administration',\n 'manage-users-manually': 'user-administration/manage-users-manually',\n 'invite-and-onboard-user': 'user-administration/invite-and-onboard-user',\n 'organization-roles': 'user-administration/roles-and-permissions',\n 'change-user-access': 'user-administration/change-user-access',\n 'manage-organization-units': 'user-administration/manage-organization-units',\n 'design-organization-unit-hierarchy': 'user-administration/design-organization-unit-hierarchy',\n 'assign-organization-unit-access': 'user-administration/assign-organization-unit-access',\n 'operate-organization-units': 'user-administration/operate-organization-units',\n 'suspend-or-remove-user': 'user-administration/suspend-or-remove-user',\n 'review-users-and-access': 'user-administration/review-users-and-access',\n 'troubleshoot-user-access': 'user-administration/troubleshoot-user-access',\n scim: 'user-administration/scim-provisioning',\n 'scim-protocol-and-payloads': 'user-administration/scim-protocol-and-payloads',\n 'scim-configure': 'user-administration/scim-configure',\n 'scim-microsoft-entra': 'user-administration/scim-microsoft-entra',\n 'scim-okta': 'user-administration/scim-okta',\n 'scim-ldap-and-active-directory': 'user-administration/scim-ldap-and-active-directory',\n 'scim-map-profile-and-units': 'user-administration/scim-map-profile-and-units',\n 'scim-validate-and-roll-out': 'user-administration/scim-validate-and-roll-out',\n 'scim-operate-and-troubleshoot': 'user-administration/scim-operate-and-troubleshoot',\n 'audit-and-siem': 'security-and-audit',\n 'investigate-audit-event': 'security-and-audit/investigate-event',\n 'review-privileged-and-access-changes': 'security-and-audit/review-access-changes',\n 'export-audit-records': 'security-and-audit/export-audit-records',\n 'configure-siem-export': 'security-and-audit/configure-siem',\n 'siem-splunk': 'security-and-audit/siem-splunk',\n 'siem-microsoft-sentinel': 'security-and-audit/siem-microsoft-sentinel',\n 'siem-elastic': 'security-and-audit/siem-elastic',\n 'operate-and-troubleshoot-siem-delivery': 'security-and-audit/operate-siem',\n 'respond-to-leaked-credential': 'security-and-audit/respond-to-leaked-credential',\n 'protect-and-retain-audit-evidence': 'security-and-audit/protect-evidence',\n integrations: 'integrations',\n 'automation-platforms': 'integrations/automation-platforms',\n 'connect-n8n': 'integrations/automation/n8n',\n 'connect-zapier': 'integrations/automation/zapier',\n 'connect-make': 'integrations/automation/make',\n 'ai-coding-tools': 'integrations/ai-coding-tools',\n 'connect-cursor': 'integrations/ai-tools/cursor',\n 'connect-codex': 'integrations/ai-tools/codex',\n 'connect-claude-code': 'integrations/ai-tools/claude-code',\n 'agent-interoperability': 'integrations/agents',\n 'mcp-integrations': 'integrations/mcp',\n 'a2a-integrations': 'integrations/a2a',\n 'first-request': 'integrations/create-your-own-integration',\n 'common-rest-api': 'integrations/rest-api',\n 'rest-api-conventions': 'integrations/rest/conventions',\n 'send-api-request': 'integrations/rest/send-request',\n 'work-with-api-collections': 'integrations/rest/read-collections',\n 'write-and-reconcile-api-changes': 'integrations/rest/write-and-reconcile',\n 'troubleshoot-api-request': 'integrations/rest/troubleshoot',\n webhooks: 'integrations/webhooks',\n 'configure-and-test-webhook-endpoint': 'integrations/webhooks/configure-and-test',\n 'verify-webhook-delivery': 'integrations/webhooks/verify-delivery',\n 'operate-webhook-deliveries': 'integrations/webhooks/operate-deliveries',\n 'troubleshoot-webhook-deliveries': 'integrations/webhooks/troubleshoot',\n};\n\nexport const ENGINE_UNIT_ROUTES: ReadonlySet<string> = new Set(Object.values(ENGINE_UNIT_PATH_BY_SLUG));\n\n/**\n * Maps a published semantic unit to its consumer navigation home.\n *\n * This is deliberately renderer-owned rather than inferred from Markdown file\n * names: the semantic unit is the stable composition input, while a renderer\n * owns audience-facing URLs. The route table is deliberately organized by a\n * customer's product responsibility—not the internal framework that implements\n * it—so readers can find access, organization, security and integration\n * material without learning Wildo vocabulary.\n *\n * One namespace is DERIVED rather than listed — `unit/manages/<resource>`, the page per\n * application resource — because those units cannot be enumerated when this file is written. An\n * application-OWNED unit still fails closed instead of acquiring an implicit route; that refusal\n * is what this table is for, and it is untouched.\n */\nfunction pathForUnit(unit: TechnicalDocumentationUnitV1): string {\n const slug = slugForUnit(unit);\n /*\n * ONE derived branch, and it is deliberately narrow.\n *\n * Every other route in this table is a constant, because a renderer owns audience-facing URLs\n * and an authored page's URL is a decision somebody made. A page per application resource cannot\n * work that way — the resources are not known when this file is written — so its route is\n * DERIVED from the reserved `unit/manages/` namespace the projector emits.\n *\n * What has NOT changed is the refusal below. A unit an application named still fails closed; the\n * generated pages are engine units carrying an application subject, which is why they can be\n * routed at all. Anything outside both the fixed table and this one namespace is still a\n * missing decision rather than an implicit URL.\n */\n if (unit.unitRef.startsWith(APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX)) {\n const resourceIdentifier = unit.unitRef.slice(APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX.length);\n if (resourceIdentifier.length === 0 || resourceIdentifier.includes('/')) {\n throw new Error(`technical-documentation generated resource unit ${unit.unitRef} has no single-segment resource identifier`);\n }\n return `${ENGINE_UNIT_PATH_BY_SLUG['what-this-application-manages']}/${resourceIdentifier}`;\n }\n if (unit.unitRef.startsWith('technical-documentation:unit/')) {\n const path = ENGINE_UNIT_PATH_BY_SLUG[slug];\n if (path !== undefined) return path;\n throw new Error(`technical-documentation framework unit ${unit.unitRef} has no consumer navigation path`);\n }\n throw new Error(`technical-documentation unit ${unit.unitRef} has no consumer navigation category`);\n}\n\nexport function createTechnicalDocumentationRenderModel(\n authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1,\n): TechnicalDocumentationRenderModel {\n const unitPathByRef = new Map<string, string>();\n const occupiedPaths = new Set<string>();\n for (const unit of authorizedBundle.units) {\n const path = pathForUnit(unit);\n if (occupiedPaths.has(path)) throw new Error(`technical-documentation units collide on renderer path ${path}`);\n occupiedPaths.add(path);\n unitPathByRef.set(unit.unitRef, path);\n }\n return Object.freeze({\n authorizedBundleIdentity: Object.freeze({ ref: authorizedBundle.bundleRef, version: authorizedBundle.bundleVersion }),\n channel: authorizedBundle.channel,\n units: Object.freeze([...authorizedBundle.units]),\n unitPathByRef,\n });\n}\n\nexport function createTechnicalDocumentationAggregateRenderManifest(input: {\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly rendererResults: readonly TechnicalDocumentationRendererResult[];\n /** This render's own identity; the publication pointer selects a render by it. */\n readonly renderRef: string;\n readonly renderVersion: number;\n}): TechnicalDocumentationRenderOutputManifestV1 {\n const rendererExecutions = input.rendererResults.map((result) => result.execution);\n const outputs = input.rendererResults.flatMap((result) => result.files.map((file) => ({\n outputRef: file.outputRef,\n rendererRef: file.rendererRef,\n outputKind: file.outputKind,\n sourceUnitRefs: [...file.sourceUnitRefs],\n normalizedRelativePath: TechnicalDocumentationNormalizedRelativePathSchema.parse(file.normalizedRelativePath),\n mediaType: file.mediaType,\n byteLength: file.bytes.byteLength,\n byteDigest: technicalDocumentationSha256Bytes(file.bytes),\n })));\n return createTechnicalDocumentationRenderOutputManifestV1({\n schemaVersion: 1,\n renderRef: input.renderRef,\n renderVersion: input.renderVersion,\n authorizedBundleIdentity: { ref: input.authorizedBundle.bundleRef, version: input.authorizedBundle.bundleVersion },\n resolvedAssetBundleIdentity: { ref: input.resolvedAssetBundle.assetBundleRef, version: input.resolvedAssetBundle.assetBundleVersion },\n supportedApiVersion: input.supportedApiVersion,\n rendererExecutions,\n outputs,\n });\n}\n"]}
1
+ {"version":3,"file":"technical-documentation-render-model.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-render-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,gDAAgD,EAAE,MAAM,4EAA4E,CAAC;AAC9I,OAAO,EACL,iDAAiD,EACjD,iDAAiD,GAClD,MAAM,iEAAiE,CAAC;AAEzE,OAAO,EACL,kDAAkD,EAGlD,kDAAkD,GASnD,MAAM,uDAAuD,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAAC,KAAiB;IACjE,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACtE,CAAC;AAwBD,MAAM,UAAU,6CAA6C,CAAC,KAM7D;IACC;;;;;OAKG;IACH,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;KACzC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,IAAkC;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC;IAC9D,MAAM,IAAI,GAAG,MAA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,CAAC,SAAS,CAAC,CAAC;IACnF,MAAM,OAAO,GAAG,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACpF,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,cAAc,EAAE,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;QACxC,sBAAsB,EAAE,kDAAkD,CAAC,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC;QAC7G,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU;QACjC,UAAU,EAAE,iCAAiC,CAAC,IAAI,CAAC,KAAK,CAAC;KAC1D,CAAC,CAAC,CAAC,CAAC;IACL,OAAO,kDAAkD,CAAC;QACxD,aAAa,EAAE,CAAC;QAChB,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,wBAAwB,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,gBAAgB,CAAC,aAAa,EAAE;QAClH,2BAA2B,EAAE,EAAE,GAAG,EAAE,KAAK,CAAC,mBAAmB,CAAC,cAAc,EAAE,OAAO,EAAE,KAAK,CAAC,mBAAmB,CAAC,kBAAkB,EAAE;QACrI,mBAAmB,EAAE,KAAK,CAAC,mBAAmB;QAC9C,kBAAkB;QAClB,OAAO;KACR,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { createHash } from 'node:crypto';\n\nimport { APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX } from '../application-documentation/technical-documentation-engine-content-bundle';\nimport {\n APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY,\n APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX,\n} from '../application-documentation/application-documentation-chapters';\n\nimport {\n createTechnicalDocumentationRenderOutputManifestV1,\n canonicalizeTechnicalDocumentationJson,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationNormalizedRelativePathSchema,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationRenderOutputManifestV1,\n type TechnicalDocumentationRendererExecutionV1,\n type TechnicalDocumentationVersionedIdentityV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationSupportedApiVersion,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\n/**\n * Names opaque emitted bytes, and detects their corruption when a reader compares this against the\n * bytes it actually loaded. That two-sided check is why it survived the 2026-08-27 digest\n * demolition; its string-hashing sibling did not, because every caller of that one was recording\n * agreement between two parts of the repository rather than naming content.\n */\nexport function technicalDocumentationSha256Bytes(bytes: Uint8Array): string {\n return `sha256:${createHash('sha256').update(bytes).digest('hex')}`;\n}\n\nexport interface TechnicalDocumentationRenderModel {\n readonly authorizedBundleIdentity: TechnicalDocumentationVersionedIdentityV1;\n readonly channel: TechnicalDocumentationAuthorizedBundleManifestV1['channel'];\n readonly units: readonly TechnicalDocumentationUnitV1[];\n readonly unitPathByRef: ReadonlyMap<string, string>;\n}\n\nexport interface TechnicalDocumentationRenderedFile {\n readonly outputRef: string;\n readonly rendererRef: string;\n readonly outputKind: TechnicalDocumentationOutputKind;\n readonly sourceUnitRefs: readonly string[];\n readonly normalizedRelativePath: string;\n readonly mediaType: string;\n readonly bytes: Uint8Array;\n}\n\nexport interface TechnicalDocumentationRendererResult {\n readonly execution: TechnicalDocumentationRendererExecutionV1;\n readonly files: readonly TechnicalDocumentationRenderedFile[];\n}\n\nexport function createTechnicalDocumentationRendererExecution(input: {\n readonly rendererKind: TechnicalDocumentationRendererKind;\n readonly rendererRef: string;\n readonly rendererVersion: number;\n /** Names the renderer's configuration. `rendererRef@rendererVersion` names the implementation. */\n readonly configurationRef: string;\n}): TechnicalDocumentationRendererExecutionV1 {\n /*\n * This built two sha256 fields until 2026-08-27: one over the renderer's own function bodies\n * (`Function.prototype.toString()`), one over its configuration object. Neither was ever compared\n * to anything — they rode into the manifest beside the `rendererRef` and `rendererVersion` that\n * already say which renderer ran, in a form a reader can act on.\n */\n return {\n rendererKind: input.rendererKind,\n rendererRef: input.rendererRef,\n rendererVersion: input.rendererVersion,\n configurationRef: input.configurationRef,\n };\n}\n\nfunction slugForUnit(unit: TechnicalDocumentationUnitV1): string {\n const source = unit.unitRef.split('/').at(-1) ?? unit.unitRef;\n const slug = source.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');\n if (slug.length === 0) throw new Error(`technical-documentation unit ${unit.unitRef} cannot produce a stable path`);\n return slug;\n}\n\n/**\n * Every route the engine content module owns, keyed by unit slug. Exported as a SET so the\n * renderers can tell a gated page this application does not publish (flatten the link) from a\n * misspelled route (leave it for the managed-tree validator).\n */\nconst ENGINE_UNIT_PATH_BY_SLUG: Readonly<Record<string, string>> = {\n 'application-orientation': 'get-started',\n 'what-this-application-manages': 'what-this-application-manages',\n authentication: 'access-and-identity/overview',\n 'sign-in-and-mfa': 'access-and-identity/sign-in-and-mfa',\n 'complete-sign-in': 'access-and-identity/complete-sign-in',\n 'mfa-enrollment-and-recovery': 'access-and-identity/mfa-enrollment-and-recovery',\n 'sign-in-troubleshoot': 'access-and-identity/sign-in-troubleshoot',\n 'single-sign-on': 'access-and-identity/single-sign-on',\n 'sso-configure': 'access-and-identity/sso-configure',\n 'sso-rollout-and-recovery': 'access-and-identity/sso-rollout-and-recovery',\n 'sso-troubleshoot': 'access-and-identity/sso-troubleshoot',\n 'api-keys': 'access-and-identity/api-keys',\n 'api-keys-create-and-store': 'access-and-identity/api-keys-create-and-store',\n 'api-keys-lifecycle': 'access-and-identity/api-keys-lifecycle',\n 'api-keys-troubleshoot': 'access-and-identity/api-keys-troubleshoot',\n 'oauth-provider': 'access-and-identity/oauth-provider',\n 'oauth-register-client': 'access-and-identity/oauth-register-client',\n 'oauth-authorize-delegated-access': 'access-and-identity/oauth-authorize-delegated-access',\n 'oauth-operate-and-revoke': 'access-and-identity/oauth-operate-and-revoke',\n 'user-administration': 'user-administration',\n 'manage-users-manually': 'user-administration/manage-users-manually',\n 'invite-and-onboard-user': 'user-administration/invite-and-onboard-user',\n 'organization-roles': 'user-administration/roles-and-permissions',\n 'change-user-access': 'user-administration/change-user-access',\n 'manage-organization-units': 'user-administration/manage-organization-units',\n 'design-organization-unit-hierarchy': 'user-administration/design-organization-unit-hierarchy',\n 'assign-organization-unit-access': 'user-administration/assign-organization-unit-access',\n 'operate-organization-units': 'user-administration/operate-organization-units',\n 'suspend-or-remove-user': 'user-administration/suspend-or-remove-user',\n 'review-users-and-access': 'user-administration/review-users-and-access',\n 'troubleshoot-user-access': 'user-administration/troubleshoot-user-access',\n scim: 'user-administration/scim-provisioning',\n 'scim-protocol-and-payloads': 'user-administration/scim-protocol-and-payloads',\n 'scim-configure': 'user-administration/scim-configure',\n 'scim-microsoft-entra': 'user-administration/scim-microsoft-entra',\n 'scim-okta': 'user-administration/scim-okta',\n 'scim-ldap-and-active-directory': 'user-administration/scim-ldap-and-active-directory',\n 'scim-map-profile-and-units': 'user-administration/scim-map-profile-and-units',\n 'scim-validate-and-roll-out': 'user-administration/scim-validate-and-roll-out',\n 'scim-operate-and-troubleshoot': 'user-administration/scim-operate-and-troubleshoot',\n 'audit-and-siem': 'security-and-audit',\n 'investigate-audit-event': 'security-and-audit/investigate-event',\n 'review-privileged-and-access-changes': 'security-and-audit/review-access-changes',\n 'export-audit-records': 'security-and-audit/export-audit-records',\n 'configure-siem-export': 'security-and-audit/configure-siem',\n 'siem-splunk': 'security-and-audit/siem-splunk',\n 'siem-microsoft-sentinel': 'security-and-audit/siem-microsoft-sentinel',\n 'siem-elastic': 'security-and-audit/siem-elastic',\n 'operate-and-troubleshoot-siem-delivery': 'security-and-audit/operate-siem',\n 'respond-to-leaked-credential': 'security-and-audit/respond-to-leaked-credential',\n 'protect-and-retain-audit-evidence': 'security-and-audit/protect-evidence',\n integrations: 'integrations',\n 'automation-platforms': 'integrations/automation-platforms',\n 'connect-n8n': 'integrations/automation/n8n',\n 'connect-zapier': 'integrations/automation/zapier',\n 'connect-make': 'integrations/automation/make',\n 'ai-coding-tools': 'integrations/ai-coding-tools',\n 'connect-cursor': 'integrations/ai-tools/cursor',\n 'connect-codex': 'integrations/ai-tools/codex',\n 'connect-claude-code': 'integrations/ai-tools/claude-code',\n 'agent-interoperability': 'integrations/agents',\n 'mcp-integrations': 'integrations/mcp',\n 'a2a-integrations': 'integrations/a2a',\n 'first-request': 'integrations/create-your-own-integration',\n 'common-rest-api': 'integrations/rest-api',\n 'rest-api-conventions': 'integrations/rest/conventions',\n 'send-api-request': 'integrations/rest/send-request',\n 'work-with-api-collections': 'integrations/rest/read-collections',\n 'write-and-reconcile-api-changes': 'integrations/rest/write-and-reconcile',\n 'troubleshoot-api-request': 'integrations/rest/troubleshoot',\n webhooks: 'integrations/webhooks',\n 'configure-and-test-webhook-endpoint': 'integrations/webhooks/configure-and-test',\n 'verify-webhook-delivery': 'integrations/webhooks/verify-delivery',\n 'operate-webhook-deliveries': 'integrations/webhooks/operate-deliveries',\n 'troubleshoot-webhook-deliveries': 'integrations/webhooks/troubleshoot',\n};\n\nexport const ENGINE_UNIT_ROUTES: ReadonlySet<string> = new Set(Object.values(ENGINE_UNIT_PATH_BY_SLUG));\n\n/**\n * Maps a published semantic unit to its consumer navigation home.\n *\n * This is deliberately renderer-owned rather than inferred from Markdown file\n * names: the semantic unit is the stable composition input, while a renderer\n * owns audience-facing URLs. The route table is deliberately organized by a\n * customer's product responsibility—not the internal framework that implements\n * it—so readers can find access, organization, security and integration\n * material without learning Wildo vocabulary.\n *\n * Two namespaces are DERIVED rather than listed, because their units cannot be enumerated when this\n * file is written: `unit/manages/<resource>`, the page per application resource, and\n * `unit/guides/<slug>`, the chapters an application authors (#874). Both are RESERVED engine\n * namespaces the projectors emit; the application supplies a subject or a slug and never a URL\n * scheme. Any other unit — including one whose ref an application chose freely — still fails closed\n * instead of acquiring an implicit route; that refusal is what this table is for.\n */\nfunction pathForUnit(unit: TechnicalDocumentationUnitV1): string {\n const slug = slugForUnit(unit);\n /*\n * The first of TWO derived branches, both deliberately narrow.\n *\n * Every other route in this table is a constant, because a renderer owns audience-facing URLs\n * and an authored page's URL is a decision somebody made. A page per application resource cannot\n * work that way — the resources are not known when this file is written — so its route is\n * DERIVED from the reserved `unit/manages/` namespace the projector emits. The second branch,\n * below, does the same for the reserved `unit/guides/` namespace of authored chapters (#874).\n *\n * What has NOT changed is the refusal at the end. A unit whose ref an application chose freely\n * still fails closed; both derived namespaces are reserved by an engine projector, which is why\n * their units can be routed at all. Anything outside the fixed table and these two namespaces is\n * still a missing decision rather than an implicit URL.\n */\n if (unit.unitRef.startsWith(APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX)) {\n const resourceIdentifier = unit.unitRef.slice(APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX.length);\n if (resourceIdentifier.length === 0 || resourceIdentifier.includes('/')) {\n throw new Error(`technical-documentation generated resource unit ${unit.unitRef} has no single-segment resource identifier`);\n }\n return `${ENGINE_UNIT_PATH_BY_SLUG['what-this-application-manages']}/${resourceIdentifier}`;\n }\n /*\n * The second derived branch, for authored chapters (#874). Checked BEFORE the fixed table on\n * purpose: a chapter slug may coincide with an engine slug (`webhooks`), and the reserved prefix —\n * not the slug — is what says whose page this is.\n */\n if (unit.unitRef.startsWith(APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX)) {\n const chapterSlug = unit.unitRef.slice(APPLICATION_DOCUMENTATION_CHAPTER_UNIT_REF_PREFIX.length);\n if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(chapterSlug)) {\n throw new Error(`technical-documentation chapter unit ${unit.unitRef} has no single-segment kebab-case slug`);\n }\n return `${APPLICATION_DOCUMENTATION_CHAPTER_ROUTE_DIRECTORY}/${chapterSlug}`;\n }\n if (unit.unitRef.startsWith('technical-documentation:unit/')) {\n const path = ENGINE_UNIT_PATH_BY_SLUG[slug];\n if (path !== undefined) return path;\n throw new Error(`technical-documentation framework unit ${unit.unitRef} has no consumer navigation path`);\n }\n throw new Error(`technical-documentation unit ${unit.unitRef} has no consumer navigation category`);\n}\n\nexport function createTechnicalDocumentationRenderModel(\n authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1,\n): TechnicalDocumentationRenderModel {\n const unitPathByRef = new Map<string, string>();\n const occupiedPaths = new Set<string>();\n for (const unit of authorizedBundle.units) {\n const path = pathForUnit(unit);\n if (occupiedPaths.has(path)) throw new Error(`technical-documentation units collide on renderer path ${path}`);\n occupiedPaths.add(path);\n unitPathByRef.set(unit.unitRef, path);\n }\n return Object.freeze({\n authorizedBundleIdentity: Object.freeze({ ref: authorizedBundle.bundleRef, version: authorizedBundle.bundleVersion }),\n channel: authorizedBundle.channel,\n units: Object.freeze([...authorizedBundle.units]),\n unitPathByRef,\n });\n}\n\nexport function createTechnicalDocumentationAggregateRenderManifest(input: {\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly rendererResults: readonly TechnicalDocumentationRendererResult[];\n /** This render's own identity; the publication pointer selects a render by it. */\n readonly renderRef: string;\n readonly renderVersion: number;\n}): TechnicalDocumentationRenderOutputManifestV1 {\n const rendererExecutions = input.rendererResults.map((result) => result.execution);\n const outputs = input.rendererResults.flatMap((result) => result.files.map((file) => ({\n outputRef: file.outputRef,\n rendererRef: file.rendererRef,\n outputKind: file.outputKind,\n sourceUnitRefs: [...file.sourceUnitRefs],\n normalizedRelativePath: TechnicalDocumentationNormalizedRelativePathSchema.parse(file.normalizedRelativePath),\n mediaType: file.mediaType,\n byteLength: file.bytes.byteLength,\n byteDigest: technicalDocumentationSha256Bytes(file.bytes),\n })));\n return createTechnicalDocumentationRenderOutputManifestV1({\n schemaVersion: 1,\n renderRef: input.renderRef,\n renderVersion: input.renderVersion,\n authorizedBundleIdentity: { ref: input.authorizedBundle.bundleRef, version: input.authorizedBundle.bundleVersion },\n resolvedAssetBundleIdentity: { ref: input.resolvedAssetBundle.assetBundleRef, version: input.resolvedAssetBundle.assetBundleVersion },\n supportedApiVersion: input.supportedApiVersion,\n rendererExecutions,\n outputs,\n });\n}\n"]}