@wildo-ai/saas-technical-doc 1.1.1 → 1.1.2

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 (64) hide show
  1. package/dist/esm/companion/application-documentation/application-administration-documentation.d.ts +52 -0
  2. package/dist/esm/companion/application-documentation/application-administration-documentation.d.ts.map +1 -0
  3. package/dist/esm/companion/application-documentation/application-administration-documentation.js +58 -0
  4. package/dist/esm/companion/application-documentation/application-administration-documentation.js.map +1 -0
  5. package/dist/esm/companion/application-documentation/application-authentication-documentation.d.ts +76 -0
  6. package/dist/esm/companion/application-documentation/application-authentication-documentation.d.ts.map +1 -0
  7. package/dist/esm/companion/application-documentation/application-authentication-documentation.js +116 -0
  8. package/dist/esm/companion/application-documentation/application-authentication-documentation.js.map +1 -0
  9. package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts +87 -0
  10. package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts.map +1 -0
  11. package/dist/esm/companion/application-documentation/application-connection-documentation.js +138 -0
  12. package/dist/esm/companion/application-documentation/application-connection-documentation.js.map +1 -0
  13. package/dist/esm/companion/application-documentation/application-integration-documentation.d.ts +48 -0
  14. package/dist/esm/companion/application-documentation/application-integration-documentation.d.ts.map +1 -0
  15. package/dist/esm/companion/application-documentation/application-integration-documentation.js +63 -0
  16. package/dist/esm/companion/application-documentation/application-integration-documentation.js.map +1 -0
  17. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts +21 -3
  18. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
  19. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js +166 -10
  20. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -1
  21. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts +8 -0
  22. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
  23. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js +8 -1
  24. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -1
  25. package/dist/esm/companion/index.d.ts +4 -0
  26. package/dist/esm/companion/index.d.ts.map +1 -1
  27. package/dist/esm/companion/index.js +4 -0
  28. package/dist/esm/companion/index.js.map +1 -1
  29. package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
  30. package/dist/esm/companion/openapi-generator.js +9 -7
  31. package/dist/esm/companion/openapi-generator.js.map +1 -1
  32. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
  33. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js +10 -2
  34. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -1
  35. package/dist/esm/companion/rendering/technical-documentation-markdown-links.d.ts +28 -0
  36. package/dist/esm/companion/rendering/technical-documentation-markdown-links.d.ts.map +1 -0
  37. package/dist/esm/companion/rendering/technical-documentation-markdown-links.js +52 -0
  38. package/dist/esm/companion/rendering/technical-documentation-markdown-links.js.map +1 -0
  39. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts.map +1 -1
  40. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js +7 -2
  41. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js.map +1 -1
  42. package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts +1 -0
  43. package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
  44. package/dist/esm/companion/rendering/technical-documentation-render-model.js +91 -84
  45. package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -1
  46. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +74 -69
  47. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
  48. package/dist/esm/content/application-consumer-documentation-content.techdoc.js +654 -1120
  49. package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
  50. package/dist/esm/runtime/decode-jwt-claims.d.ts +7 -4
  51. package/dist/esm/runtime/decode-jwt-claims.d.ts.map +1 -1
  52. package/dist/esm/runtime/decode-jwt-claims.js +7 -4
  53. package/dist/esm/runtime/decode-jwt-claims.js.map +1 -1
  54. package/dist/esm/runtime/docs-auth-session.schemas.d.ts +16 -5
  55. package/dist/esm/runtime/docs-auth-session.schemas.d.ts.map +1 -1
  56. package/dist/esm/runtime/docs-auth-session.schemas.js +16 -5
  57. package/dist/esm/runtime/docs-auth-session.schemas.js.map +1 -1
  58. package/dist/esm/runtime/use-docs-auth-session.d.ts +9 -7
  59. package/dist/esm/runtime/use-docs-auth-session.d.ts.map +1 -1
  60. package/dist/esm/runtime/use-docs-auth-session.js +9 -7
  61. package/dist/esm/runtime/use-docs-auth-session.js.map +1 -1
  62. package/dist/tsconfig.build.tsbuildinfo +1 -1
  63. package/package.json +5 -5
  64. package/dist/esm/.builder.pid +0 -9
@@ -1,7 +1,8 @@
1
1
  import { TechnicalDocumentationAssetResolutionStatus, TechnicalDocumentationLinkKind, TechnicalDocumentationOutputKind, TechnicalDocumentationRendererKind, } from '@wildo-ai/saas-specifications/technical-documentation';
2
2
  import { escapeMarkdownForMdx } from './technical-documentation-mdx-escaping.js';
3
+ import { isImplicitLeadSection, pruneUnpublishedSiteLinks } from './technical-documentation-markdown-links.js';
3
4
  import { technicalDocumentationAssetFileStem, } from '../technical-documentation-asset-path.js';
4
- import { createTechnicalDocumentationRendererExecution, } from './technical-documentation-render-model.js';
5
+ import { createTechnicalDocumentationRendererExecution, ENGINE_UNIT_ROUTES, } from './technical-documentation-render-model.js';
5
6
  /**
6
7
  * Statuses whose asset carries real bytes at a real path, and therefore renders.
7
8
  *
@@ -164,6 +165,7 @@ const DOCUSAURUS_CATEGORY_JOURNEY_BY_DIRECTORY = {
164
165
  {
165
166
  landingPath: 'integrations/rest-api',
166
167
  childPaths: [
168
+ 'integrations/rest/conventions',
167
169
  'integrations/rest/send-request',
168
170
  'integrations/rest/read-collections',
169
171
  'integrations/rest/write-and-reconcile',
@@ -261,8 +263,14 @@ function renderUnit(unit, model, assetPathByRef, resolveApiReferenceTarget) {
261
263
  // and then crash the page in the reader's browser. Escaping is applied per field rather than
262
264
  // once over the assembled document on purpose: the assembly also emits `---` frontmatter and
263
265
  // Markdown punctuation this must not touch, and `title` is JSON-encoded rather than Markdown.
266
+ const publishedPaths = new Set(model.unitPathByRef.values());
264
267
  const sections = unit.sections
265
- .map((section) => `## ${escapeMarkdownForMdx(section.heading)}\n\n${escapeMarkdownForMdx(normalizeMermaidFencesForDocusaurus(section.bodyMarkdown))}`)
268
+ .map((section, index) => {
269
+ const body = escapeMarkdownForMdx(pruneUnpublishedSiteLinks(normalizeMermaidFencesForDocusaurus(section.bodyMarkdown), publishedPaths, ENGINE_UNIT_ROUTES));
270
+ // The lead section is what the author wrote between the title and the first `##`. It is
271
+ // the page's opening, not a section called "Overview", so it renders without a heading.
272
+ return isImplicitLeadSection(section, index) ? body : `## ${escapeMarkdownForMdx(section.heading)}\n\n${body}`;
273
+ })
266
274
  .join('\n\n');
267
275
  const figures = unit.assetRequests.flatMap((request) => {
268
276
  const assetPath = assetPathByRef.get(request.assetRef);
@@ -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,EACL,mCAAmC,GACpC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,6CAA6C,GAG9C,MAAM,wCAAwC,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,yBAAyB,GAA6D,IAAI,GAAG,CAAC;IAClG,2CAA2C,CAAC,WAAW;IACvD,2CAA2C,CAAC,QAAQ;CACrD,CAAC,CAAC;AAEH,MA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AC;QACxF,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wEAAwE,KAAK,CAAC,QAAQ,EAAE,CAAC,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 {\n technicalDocumentationAssetFileStem,\n} from '../technical-documentation-asset-path';\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRenderModel,\n type TechnicalDocumentationRendererResult,\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 'billing-and-subscriptions': 'Billing and subscriptions',\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 'billing-and-subscriptions': [\n {\n landingPath: 'billing-and-subscriptions/plans-and-access',\n childPaths: ['billing-and-subscriptions/start-subscription'],\n },\n 'billing-and-subscriptions/change-or-end-subscription',\n {\n landingPath: 'billing-and-subscriptions/billing-records',\n childPaths: [\n 'billing-and-subscriptions/invoices-and-payments',\n 'billing-and-subscriptions/metered-usage',\n ],\n },\n 'billing-and-subscriptions/reconcile-access',\n 'billing-and-subscriptions/troubleshoot',\n ],\n 'security-and-audit': [\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/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): 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 sections = unit.sections\n .map((section) => `## ${escapeMarkdownForMdx(section.heading)}\\n\\n${escapeMarkdownForMdx(normalizeMermaidFencesForDocusaurus(section.bodyMarkdown))}`)\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 return [`- [${label}](${resolveApiReferenceTarget(link.apiReferenceTarget as TechnicalDocumentationApiReferenceTargetV1)})`];\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 readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string;\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,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,2BAA2B,EAAE,2BAA2B;IACxD,YAAY,EAAE,cAAc;IAC5B,oBAAoB,EAAE,oBAAoB;IAC1C,qBAAqB,EAAE,qBAAqB;CAC7C,CAAC;AAgBF;;;;;;;;;GASG;AACH,MAAM,wCAAwC,GAA+D;IAC3G,2BAA2B,EAAE;QAC3B;YACE,WAAW,EAAE,4CAA4C;YACzD,UAAU,EAAE,CAAC,8CAA8C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,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wEAAwE,KAAK,CAAC,QAAQ,EAAE,CAAC,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 'billing-and-subscriptions': 'Billing and subscriptions',\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 'billing-and-subscriptions': [\n {\n landingPath: 'billing-and-subscriptions/plans-and-access',\n childPaths: ['billing-and-subscriptions/start-subscription'],\n },\n 'billing-and-subscriptions/change-or-end-subscription',\n {\n landingPath: 'billing-and-subscriptions/billing-records',\n childPaths: [\n 'billing-and-subscriptions/invoices-and-payments',\n 'billing-and-subscriptions/metered-usage',\n ],\n },\n 'billing-and-subscriptions/reconcile-access',\n 'billing-and-subscriptions/troubleshoot',\n ],\n 'security-and-audit': [\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): 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 return [`- [${label}](${resolveApiReferenceTarget(link.apiReferenceTarget as TechnicalDocumentationApiReferenceTargetV1)})`];\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 readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string;\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"]}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The heading the Markdown parser gives the text an author wrote between a page's title and its
3
+ * first `##`. Authors do not write it; it exists so the parser can carry that opening text as a
4
+ * section. Renderers therefore emit the lead section's body without a heading.
5
+ */
6
+ export declare const IMPLICIT_LEAD_SECTION_HEADING: "Overview";
7
+ export declare function isImplicitLeadSection(section: {
8
+ readonly heading: string;
9
+ }, index: number): boolean;
10
+ /**
11
+ * Rewrites a site-absolute link whose target page is not part of this publication into plain
12
+ * text, keeping the label.
13
+ *
14
+ * Feature-gated pages (billing, webhooks, MCP, A2A, SIEM export) are suppressed per application by
15
+ * the publication policy. Declared related links are pruned with them; an INLINE link an author
16
+ * wrote in prose is not, and the managed-tree validator then refuses the whole publication for a
17
+ * dangling target. Before this helper, authors had to write "look for Billing in the navigation"
18
+ * instead of a link, which every application paid for in prose quality. Now prose may link freely:
19
+ * a target that exists renders as a link, a target this application does not publish renders as
20
+ * its label, and the validator still catches a genuinely misspelled route because a route that is
21
+ * neither published nor an API-reference route is left untouched for it to report.
22
+ *
23
+ * Trade-off, stated: the pruner cannot tell WHY an engine route is absent from this publication.
24
+ * A page suppressed by a publication defect is flattened exactly like one suppressed by a feature
25
+ * gate. The publication policy's `decisions[]` ledger is where that difference is visible.
26
+ */
27
+ export declare function pruneUnpublishedSiteLinks(markdown: string, publishedUnitPaths: ReadonlySet<string>, knownUnitPaths: ReadonlySet<string>): string;
28
+ //# sourceMappingURL=technical-documentation-markdown-links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"technical-documentation-markdown-links.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-markdown-links.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,EAAG,UAAmB,CAAC;AAEjE,wBAAgB,qBAAqB,CAAC,OAAO,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAEnG;AAUD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,EAAE,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,MAAM,CAahJ"}
@@ -0,0 +1,52 @@
1
+ import { ApplicationConsumerDocumentationRoute, applicationConsumerDocumentationRoutePath } from '../../openapi/api-reference-targets.js';
2
+ /**
3
+ * The heading the Markdown parser gives the text an author wrote between a page's title and its
4
+ * first `##`. Authors do not write it; it exists so the parser can carry that opening text as a
5
+ * section. Renderers therefore emit the lead section's body without a heading.
6
+ */
7
+ export const IMPLICIT_LEAD_SECTION_HEADING = 'Overview';
8
+ export function isImplicitLeadSection(section, index) {
9
+ return index === 0 && section.heading === IMPLICIT_LEAD_SECTION_HEADING;
10
+ }
11
+ /** Same shape the managed-tree validator uses to enumerate links; kept identical on purpose. */
12
+ const SITE_LINK_PATTERN = /(!?)\[([^\]]*)\]\(([^)\s]+)(?:\s+["'][^)]*)?\)/g;
13
+ const API_REFERENCE_ROUTES = new Set([
14
+ applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.API_REFERENCE),
15
+ applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE),
16
+ ]);
17
+ /**
18
+ * Rewrites a site-absolute link whose target page is not part of this publication into plain
19
+ * text, keeping the label.
20
+ *
21
+ * Feature-gated pages (billing, webhooks, MCP, A2A, SIEM export) are suppressed per application by
22
+ * the publication policy. Declared related links are pruned with them; an INLINE link an author
23
+ * wrote in prose is not, and the managed-tree validator then refuses the whole publication for a
24
+ * dangling target. Before this helper, authors had to write "look for Billing in the navigation"
25
+ * instead of a link, which every application paid for in prose quality. Now prose may link freely:
26
+ * a target that exists renders as a link, a target this application does not publish renders as
27
+ * its label, and the validator still catches a genuinely misspelled route because a route that is
28
+ * neither published nor an API-reference route is left untouched for it to report.
29
+ *
30
+ * Trade-off, stated: the pruner cannot tell WHY an engine route is absent from this publication.
31
+ * A page suppressed by a publication defect is flattened exactly like one suppressed by a feature
32
+ * gate. The publication policy's `decisions[]` ledger is where that difference is visible.
33
+ */
34
+ export function pruneUnpublishedSiteLinks(markdown, publishedUnitPaths, knownUnitPaths) {
35
+ const publishedRoutes = new Set([...publishedUnitPaths].map((unitPath) => `/${unitPath}`));
36
+ const knownRoutes = new Set([...knownUnitPaths].map((unitPath) => `/${unitPath}`));
37
+ return markdown.replace(SITE_LINK_PATTERN, (whole, image, label, destination) => {
38
+ if (image === '!')
39
+ return whole;
40
+ if (!destination.startsWith('/'))
41
+ return whole;
42
+ const pathOnly = destination.split(/[?#]/, 1)[0] ?? destination;
43
+ if (publishedRoutes.has(pathOnly))
44
+ return whole;
45
+ if (API_REFERENCE_ROUTES.has(pathOnly) || [...API_REFERENCE_ROUTES].some((route) => pathOnly.startsWith(`${route}/`)))
46
+ return whole;
47
+ // Only a route that SOME engine page owns is a gated target. Anything else is unknown and stays
48
+ // for the validator, so a typo is still refused rather than silently flattened.
49
+ return knownRoutes.has(pathOnly) ? label : whole;
50
+ });
51
+ }
52
+ //# sourceMappingURL=technical-documentation-markdown-links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"technical-documentation-markdown-links.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-markdown-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qCAAqC,EAAE,yCAAyC,EAAE,MAAM,qCAAqC,CAAC;AAEvI;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,UAAmB,CAAC;AAEjE,MAAM,UAAU,qBAAqB,CAAC,OAAqC,EAAE,KAAa;IACxF,OAAO,KAAK,KAAK,CAAC,IAAI,OAAO,CAAC,OAAO,KAAK,6BAA6B,CAAC;AAC1E,CAAC;AAED,gGAAgG;AAChG,MAAM,iBAAiB,GAAG,iDAAiD,CAAC;AAE5E,MAAM,oBAAoB,GAAwB,IAAI,GAAG,CAAC;IACxD,yCAAyC,CAAC,qCAAqC,CAAC,aAAa,CAAC;IAC9F,yCAAyC,CAAC,qCAAqC,CAAC,wCAAwC,CAAC;CAC1H,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,yBAAyB,CAAC,QAAgB,EAAE,kBAAuC,EAAE,cAAmC;IACtI,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,kBAAkB,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC;IAC3F,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC;IACnF,OAAO,QAAQ,CAAC,OAAO,CAAC,iBAAiB,EAAE,CAAC,KAAK,EAAE,KAAa,EAAE,KAAa,EAAE,WAAmB,EAAE,EAAE;QACtG,IAAI,KAAK,KAAK,GAAG;YAAE,OAAO,KAAK,CAAC;QAChC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC;QAChE,IAAI,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC;YAAE,OAAO,KAAK,CAAC;QAChD,IAAI,oBAAoB,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QACpI,gGAAgG;QAChG,gFAAgF;QAChF,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { ApplicationConsumerDocumentationRoute, applicationConsumerDocumentationRoutePath } from '../../openapi/api-reference-targets';\n\n/**\n * The heading the Markdown parser gives the text an author wrote between a page's title and its\n * first `##`. Authors do not write it; it exists so the parser can carry that opening text as a\n * section. Renderers therefore emit the lead section's body without a heading.\n */\nexport const IMPLICIT_LEAD_SECTION_HEADING = 'Overview' as const;\n\nexport function isImplicitLeadSection(section: { readonly heading: string }, index: number): boolean {\n return index === 0 && section.heading === IMPLICIT_LEAD_SECTION_HEADING;\n}\n\n/** Same shape the managed-tree validator uses to enumerate links; kept identical on purpose. */\nconst SITE_LINK_PATTERN = /(!?)\\[([^\\]]*)\\]\\(([^)\\s]+)(?:\\s+[\"'][^)]*)?\\)/g;\n\nconst API_REFERENCE_ROUTES: ReadonlySet<string> = new Set([\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.API_REFERENCE),\n applicationConsumerDocumentationRoutePath(ApplicationConsumerDocumentationRoute.APPLICATION_ADMINISTRATION_API_REFERENCE),\n]);\n\n/**\n * Rewrites a site-absolute link whose target page is not part of this publication into plain\n * text, keeping the label.\n *\n * Feature-gated pages (billing, webhooks, MCP, A2A, SIEM export) are suppressed per application by\n * the publication policy. Declared related links are pruned with them; an INLINE link an author\n * wrote in prose is not, and the managed-tree validator then refuses the whole publication for a\n * dangling target. Before this helper, authors had to write \"look for Billing in the navigation\"\n * instead of a link, which every application paid for in prose quality. Now prose may link freely:\n * a target that exists renders as a link, a target this application does not publish renders as\n * its label, and the validator still catches a genuinely misspelled route because a route that is\n * neither published nor an API-reference route is left untouched for it to report.\n *\n * Trade-off, stated: the pruner cannot tell WHY an engine route is absent from this publication.\n * A page suppressed by a publication defect is flattened exactly like one suppressed by a feature\n * gate. The publication policy's `decisions[]` ledger is where that difference is visible.\n */\nexport function pruneUnpublishedSiteLinks(markdown: string, publishedUnitPaths: ReadonlySet<string>, knownUnitPaths: ReadonlySet<string>): string {\n const publishedRoutes = new Set([...publishedUnitPaths].map((unitPath) => `/${unitPath}`));\n const knownRoutes = new Set([...knownUnitPaths].map((unitPath) => `/${unitPath}`));\n return markdown.replace(SITE_LINK_PATTERN, (whole, image: string, label: string, destination: string) => {\n if (image === '!') return whole;\n if (!destination.startsWith('/')) return whole;\n const pathOnly = destination.split(/[?#]/, 1)[0] ?? destination;\n if (publishedRoutes.has(pathOnly)) return whole;\n if (API_REFERENCE_ROUTES.has(pathOnly) || [...API_REFERENCE_ROUTES].some((route) => pathOnly.startsWith(`${route}/`))) return whole;\n // Only a route that SOME engine page owns is a gated target. Anything else is unknown and stays\n // for the validator, so a typo is still refused rather than silently flattened.\n return knownRoutes.has(pathOnly) ? label : whole;\n });\n}\n\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-markdown-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-markdown-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,0CAA0C,EAC/C,KAAK,mDAAmD,EAEzD,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EAC1C,MAAM,wCAAwC,CAAC;AA2DhD,wBAAgB,oCAAoC,CAAC,KAAK,EAAE;IAC1D,QAAQ,CAAC,KAAK,EAAE,iCAAiC,CAAC;IAClD,QAAQ,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;IAClF,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3D,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,0CAA0C,KAAK,MAAM,CAAC;CACrG,GAAG,oCAAoC,CAkDvC"}
1
+ {"version":3,"file":"technical-documentation-markdown-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-markdown-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,0CAA0C,EAC/C,KAAK,mDAAmD,EAEzD,MAAM,uDAAuD,CAAC;AAG/D,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EAE1C,MAAM,wCAAwC,CAAC;AA+DhD,wBAAgB,oCAAoC,CAAC,KAAK,EAAE;IAC1D,QAAQ,CAAC,KAAK,EAAE,iCAAiC,CAAC;IAClD,QAAQ,CAAC,mBAAmB,EAAE,mDAAmD,CAAC;IAClF,QAAQ,CAAC,gBAAgB,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3D,QAAQ,CAAC,yBAAyB,CAAC,EAAE,CAAC,MAAM,EAAE,0CAA0C,KAAK,MAAM,CAAC;CACrG,GAAG,oCAAoC,CAkDvC"}
@@ -1,5 +1,6 @@
1
1
  import { TechnicalDocumentationAssetResolutionStatus, TechnicalDocumentationLinkKind, TechnicalDocumentationOutputKind, TechnicalDocumentationRendererKind, } from '@wildo-ai/saas-specifications/technical-documentation';
2
- import { createTechnicalDocumentationRendererExecution, } from './technical-documentation-render-model.js';
2
+ import { isImplicitLeadSection, pruneUnpublishedSiteLinks } from './technical-documentation-markdown-links.js';
3
+ import { createTechnicalDocumentationRendererExecution, ENGINE_UNIT_ROUTES, } from './technical-documentation-render-model.js';
3
4
  import { technicalDocumentationAssetFileStem, } from '../technical-documentation-asset-path.js';
4
5
  /**
5
6
  * Statuses whose asset carries real bytes at a real path, and therefore renders.
@@ -40,7 +41,11 @@ function renderUnit(unit, model, assetPathByRef, resolveApiReferenceTarget) {
40
41
  if (unitPath === undefined)
41
42
  throw new Error(`technical-documentation render model has no path for ${unit.unitRef}`);
42
43
  const sourcePath = `markdown/${unitPath}.md`;
43
- const sections = unit.sections.map((section) => `## ${section.heading}\n\n${section.bodyMarkdown}`).join('\n\n');
44
+ const publishedPaths = new Set(model.unitPathByRef.values());
45
+ const sections = unit.sections.map((section, index) => {
46
+ const body = pruneUnpublishedSiteLinks(section.bodyMarkdown, publishedPaths, ENGINE_UNIT_ROUTES);
47
+ return isImplicitLeadSection(section, index) ? body : `## ${section.heading}\n\n${body}`;
48
+ }).join('\n\n');
44
49
  const links = unit.links.length === 0 ? '' : `\n\n## Related\n\n${unit.links.map((link) => renderLink(link, model, sourcePath, resolveApiReferenceTarget)).join('\n')}`;
45
50
  const figures = unit.assetRequests.flatMap((request) => {
46
51
  const assetPath = assetPathByRef.get(request.assetRef);
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-markdown-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-markdown-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,GAKnC,MAAM,uDAAuD,CAAC;AAE/D,OAAO,EACL,6CAA6C,GAG9C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,mCAAmC,GACpC,MAAM,uCAAuC,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,yBAAyB,GAA6D,IAAI,GAAG,CAAC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oBACL,kEAAkE;oBAClE,yEAAyE;oBACzE,SAAS,EAAE,2CAA2C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;oBACjF,WAAW,EAAE,qBAAqB;oBAClC,UAAU,EAAE,gCAAgC,CAAC,iBAAiB;oBAC9D,cAAc,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;oBAC9B,sBAAsB,EAAE,YAAY,IAAI,KAAK;oBAC7C,SAAS,EAAE,eAAe;oBAC1B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;iBAC3G,CAAC;YACJ,CAAC,CAAC,EAAE,GAAG,UAAU,CAAC;KACnB,CAAC;AACJ,CAAC;AACD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC","sourcesContent":["import {\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationLinkKind,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationLinkV1,\n type TechnicalDocumentationApiReferenceTargetV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRenderModel,\n type TechnicalDocumentationRendererResult,\n} from './technical-documentation-render-model';\nimport {\n technicalDocumentationAssetFileStem,\n} from '../technical-documentation-asset-path';\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 MARKDOWN_RENDERER_REF = 'technical-documentation:renderer/markdown';\n\nfunction relativeMarkdownPath(sourcePath: string, targetPath: string): string {\n const relativePath = path.relative(path.dirname(sourcePath), targetPath);\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;\n}\n\nfunction renderLink(link: TechnicalDocumentationLinkV1, model: TechnicalDocumentationRenderModel, sourcePath: string, resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string): string {\n if (link.kind === TechnicalDocumentationLinkKind.UNIT) {\n const targetPath = model.unitPathByRef.get(link.targetUnitRef as string);\n if (targetPath === undefined) throw new Error(`technical-documentation link target is not in the authorized render model: ${link.targetUnitRef}`);\n return `- [${link.label}](${relativeMarkdownPath(sourcePath, `markdown/${targetPath}.md`)})`;\n }\n if (link.kind === TechnicalDocumentationLinkKind.EXTERNAL) return `- [${link.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 Markdown rendering: ${link.linkRef}`);\n return `- [${link.label}](${resolveApiReferenceTarget(link.apiReferenceTarget as TechnicalDocumentationApiReferenceTargetV1)})`;\n }\n return `- ${link.label}`;\n}\n\nfunction renderUnit(\n unit: TechnicalDocumentationUnitV1,\n model: TechnicalDocumentationRenderModel,\n assetPathByRef: ReadonlyMap<string, string>,\n resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string,\n): string {\n const unitPath = model.unitPathByRef.get(unit.unitRef);\n if (unitPath === undefined) throw new Error(`technical-documentation render model has no path for ${unit.unitRef}`);\n const sourcePath = `markdown/${unitPath}.md`;\n const sections = unit.sections.map((section) => `## ${section.heading}\\n\\n${section.bodyMarkdown}`).join('\\n\\n');\n const links = unit.links.length === 0 ? '' : `\\n\\n## Related\\n\\n${unit.links.map((link) => renderLink(link, model, sourcePath, resolveApiReferenceTarget)).join('\\n')}`;\n const figures = unit.assetRequests.flatMap((request) => {\n const assetPath = assetPathByRef.get(request.assetRef);\n return assetPath === undefined ? [] : [`![${request.altText}](${relativeMarkdownPath(sourcePath, assetPath)})`];\n });\n const assetSection = figures.length === 0 ? '' : `\\n\\n## Product view\\n\\n${figures.join('\\n\\n')}`;\n return `# ${unit.title}\\n\\n${unit.summary}\\n\\n${sections}${assetSection}${links}\\n`;\n}\n\nexport function renderTechnicalDocumentationMarkdown(input: {\n readonly model: TechnicalDocumentationRenderModel;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly assetBytesByPath: ReadonlyMap<string, Uint8Array>;\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string;\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 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 Markdown 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/markdown-asset/${technicalDocumentationAssetFileStem(asset.assetRef)}`,\n rendererRef: MARKDOWN_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.ASSET,\n sourceUnitRefs,\n normalizedRelativePath: path,\n mediaType: asset.mediaType,\n bytes,\n }];\n });\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.MARKDOWN,\n rendererRef: MARKDOWN_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/markdown-v1',\n }),\n files: [...input.model.units.map((unit) => {\n const path = input.model.unitPathByRef.get(unit.unitRef) as string;\n return {\n // Keep the complete route identity: final path segments are not a\n // globally unique page identity once consumer documentation has domains.\n outputRef: `technical-documentation:output/markdown/${path.split('/').join(':')}`,\n rendererRef: MARKDOWN_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT,\n sourceUnitRefs: [unit.unitRef],\n normalizedRelativePath: `markdown/${path}.md`,\n mediaType: 'text/markdown',\n bytes: Buffer.from(renderUnit(unit, input.model, assetPathByRef, input.resolveApiReferenceTarget), 'utf8'),\n };\n }), ...assetFiles],\n };\n}\nimport { posix as path } from 'node:path';\n"]}
1
+ {"version":3,"file":"technical-documentation-markdown-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-markdown-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2CAA2C,EAC3C,8BAA8B,EAC9B,gCAAgC,EAChC,kCAAkC,GAKnC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAE5G,OAAO,EACL,6CAA6C,EAG7C,kBAAkB,GACnB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,mCAAmC,GACpC,MAAM,uCAAuC,CAAC;AAE/C;;;;;;;;GAQG;AACH,MAAM,yBAA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C,QAAQ;YACzD,WAAW,EAAE,qBAAqB;YAClC,eAAe,EAAE,CAAC;YAClB,gBAAgB,EAAE,4DAA4D;SAC/E,CAAC;QACF,KAAK,EAAE,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;gBACxC,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAW,CAAC;gBACnE,OAAO;oBACL,kEAAkE;oBAClE,yEAAyE;oBACzE,SAAS,EAAE,2CAA2C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;oBACjF,WAAW,EAAE,qBAAqB;oBAClC,UAAU,EAAE,gCAAgC,CAAC,iBAAiB;oBAC9D,cAAc,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;oBAC9B,sBAAsB,EAAE,YAAY,IAAI,KAAK;oBAC7C,SAAS,EAAE,eAAe;oBAC1B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;iBAC3G,CAAC;YACJ,CAAC,CAAC,EAAE,GAAG,UAAU,CAAC;KACnB,CAAC;AACJ,CAAC;AACD,OAAO,EAAE,KAAK,IAAI,IAAI,EAAE,MAAM,WAAW,CAAC","sourcesContent":["import {\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationLinkKind,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationLinkV1,\n type TechnicalDocumentationApiReferenceTargetV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\nimport { isImplicitLeadSection, pruneUnpublishedSiteLinks } from './technical-documentation-markdown-links';\n\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRenderModel,\n type TechnicalDocumentationRendererResult,\n ENGINE_UNIT_ROUTES,\n} from './technical-documentation-render-model';\nimport {\n technicalDocumentationAssetFileStem,\n} from '../technical-documentation-asset-path';\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 MARKDOWN_RENDERER_REF = 'technical-documentation:renderer/markdown';\n\nfunction relativeMarkdownPath(sourcePath: string, targetPath: string): string {\n const relativePath = path.relative(path.dirname(sourcePath), targetPath);\n return relativePath.startsWith('.') ? relativePath : `./${relativePath}`;\n}\n\nfunction renderLink(link: TechnicalDocumentationLinkV1, model: TechnicalDocumentationRenderModel, sourcePath: string, resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string): string {\n if (link.kind === TechnicalDocumentationLinkKind.UNIT) {\n const targetPath = model.unitPathByRef.get(link.targetUnitRef as string);\n if (targetPath === undefined) throw new Error(`technical-documentation link target is not in the authorized render model: ${link.targetUnitRef}`);\n return `- [${link.label}](${relativeMarkdownPath(sourcePath, `markdown/${targetPath}.md`)})`;\n }\n if (link.kind === TechnicalDocumentationLinkKind.EXTERNAL) return `- [${link.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 Markdown rendering: ${link.linkRef}`);\n return `- [${link.label}](${resolveApiReferenceTarget(link.apiReferenceTarget as TechnicalDocumentationApiReferenceTargetV1)})`;\n }\n return `- ${link.label}`;\n}\n\nfunction renderUnit(\n unit: TechnicalDocumentationUnitV1,\n model: TechnicalDocumentationRenderModel,\n assetPathByRef: ReadonlyMap<string, string>,\n resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string,\n): string {\n const unitPath = model.unitPathByRef.get(unit.unitRef);\n if (unitPath === undefined) throw new Error(`technical-documentation render model has no path for ${unit.unitRef}`);\n const sourcePath = `markdown/${unitPath}.md`;\n const publishedPaths = new Set(model.unitPathByRef.values());\n const sections = unit.sections.map((section, index) => {\n const body = pruneUnpublishedSiteLinks(section.bodyMarkdown, publishedPaths, ENGINE_UNIT_ROUTES);\n return isImplicitLeadSection(section, index) ? body : `## ${section.heading}\\n\\n${body}`;\n }).join('\\n\\n');\n const links = unit.links.length === 0 ? '' : `\\n\\n## Related\\n\\n${unit.links.map((link) => renderLink(link, model, sourcePath, resolveApiReferenceTarget)).join('\\n')}`;\n const figures = unit.assetRequests.flatMap((request) => {\n const assetPath = assetPathByRef.get(request.assetRef);\n return assetPath === undefined ? [] : [`![${request.altText}](${relativeMarkdownPath(sourcePath, assetPath)})`];\n });\n const assetSection = figures.length === 0 ? '' : `\\n\\n## Product view\\n\\n${figures.join('\\n\\n')}`;\n return `# ${unit.title}\\n\\n${unit.summary}\\n\\n${sections}${assetSection}${links}\\n`;\n}\n\nexport function renderTechnicalDocumentationMarkdown(input: {\n readonly model: TechnicalDocumentationRenderModel;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly assetBytesByPath: ReadonlyMap<string, Uint8Array>;\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string;\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 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 Markdown 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/markdown-asset/${technicalDocumentationAssetFileStem(asset.assetRef)}`,\n rendererRef: MARKDOWN_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.ASSET,\n sourceUnitRefs,\n normalizedRelativePath: path,\n mediaType: asset.mediaType,\n bytes,\n }];\n });\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.MARKDOWN,\n rendererRef: MARKDOWN_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/markdown-v1',\n }),\n files: [...input.model.units.map((unit) => {\n const path = input.model.unitPathByRef.get(unit.unitRef) as string;\n return {\n // Keep the complete route identity: final path segments are not a\n // globally unique page identity once consumer documentation has domains.\n outputRef: `technical-documentation:output/markdown/${path.split('/').join(':')}`,\n rendererRef: MARKDOWN_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.MARKDOWN_DOCUMENT,\n sourceUnitRefs: [unit.unitRef],\n normalizedRelativePath: `markdown/${path}.md`,\n mediaType: 'text/markdown',\n bytes: Buffer.from(renderUnit(unit, input.model, assetPathByRef, input.resolveApiReferenceTarget), 'utf8'),\n };\n }), ...assetFiles],\n };\n}\nimport { posix as path } from 'node:path';\n"]}
@@ -32,6 +32,7 @@ export declare function createTechnicalDocumentationRendererExecution(input: {
32
32
  /** Names the renderer's configuration. `rendererRef@rendererVersion` names the implementation. */
33
33
  readonly configurationRef: string;
34
34
  }): TechnicalDocumentationRendererExecutionV1;
35
+ export declare const ENGINE_UNIT_ROUTES: ReadonlySet<string>;
35
36
  export declare function createTechnicalDocumentationRenderModel(authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1): TechnicalDocumentationRenderModel;
36
37
  export declare function createTechnicalDocumentationAggregateRenderManifest(input: {
37
38
  readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-render-model.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-render-model.ts"],"names":[],"mappings":"AAEA,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,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,gCAAgC,CAAC;IACtD,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,sBAAsB,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;CAC5B;AAED,MAAM,WAAW,oCAAoC;IACnD,QAAQ,CAAC,SAAS,EAAE,yCAAyC,CAAC;IAC9D,QAAQ,CAAC,KAAK,EAAE,SAAS,kCAAkC,EAAE,CAAC;CAC/D;AAED,wBAAgB,6CAA6C,CAAC,KAAK,EAAE;IACnE,QAAQ,CAAC,YAAY,EAAE,kCAAkC,CAAC;IAC1D,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,kGAAkG;IAClG,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC,GAAG,yCAAyC,CAa5C;AAkHD,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":[],"m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