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

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 (96) hide show
  1. package/dist/esm/companion/application-documentation/application-connection-documentation.d.ts +25 -1
  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 +28 -1
  4. package/dist/esm/companion/application-documentation/application-connection-documentation.js.map +1 -1
  5. package/dist/esm/companion/application-documentation/application-domain-documentation.d.ts +133 -0
  6. package/dist/esm/companion/application-documentation/application-domain-documentation.d.ts.map +1 -0
  7. package/dist/esm/companion/application-documentation/application-domain-documentation.js +243 -0
  8. package/dist/esm/companion/application-documentation/application-domain-documentation.js.map +1 -0
  9. package/dist/esm/companion/application-documentation/application-integration-documentation.d.ts.map +1 -1
  10. package/dist/esm/companion/application-documentation/application-integration-documentation.js +23 -0
  11. package/dist/esm/companion/application-documentation/application-integration-documentation.js.map +1 -1
  12. package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts +30 -0
  13. package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts.map +1 -1
  14. package/dist/esm/companion/application-documentation/application-organization-role-documentation.js +38 -0
  15. package/dist/esm/companion/application-documentation/application-organization-role-documentation.js.map +1 -1
  16. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts +61 -1
  17. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -1
  18. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js +255 -218
  19. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -1
  20. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts +2 -0
  21. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -1
  22. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js +1 -0
  23. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -1
  24. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js +1 -1
  25. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js.map +1 -1
  26. package/dist/esm/companion/index.d.ts +2 -1
  27. package/dist/esm/companion/index.d.ts.map +1 -1
  28. package/dist/esm/companion/index.js +2 -1
  29. package/dist/esm/companion/index.js.map +1 -1
  30. package/dist/esm/companion/manual-controller-route-projection.d.ts +112 -0
  31. package/dist/esm/companion/manual-controller-route-projection.d.ts.map +1 -0
  32. package/dist/esm/companion/manual-controller-route-projection.js +249 -0
  33. package/dist/esm/companion/manual-controller-route-projection.js.map +1 -0
  34. package/dist/esm/companion/openapi-generator.d.ts +16 -0
  35. package/dist/esm/companion/openapi-generator.d.ts.map +1 -1
  36. package/dist/esm/companion/openapi-generator.js +489 -26
  37. package/dist/esm/companion/openapi-generator.js.map +1 -1
  38. package/dist/esm/companion/operation-projection.schemas.d.ts +44 -0
  39. package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -1
  40. package/dist/esm/companion/operation-projection.schemas.js +37 -0
  41. package/dist/esm/companion/operation-projection.schemas.js.map +1 -1
  42. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts +7 -1
  43. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -1
  44. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js +34 -18
  45. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -1
  46. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -1
  47. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js +8 -1
  48. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -1
  49. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts +0 -9
  50. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts.map +0 -1
  51. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js +0 -111
  52. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js.map +0 -1
  53. package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -1
  54. package/dist/esm/companion/rendering/technical-documentation-render-model.js +30 -13
  55. package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -1
  56. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts +10 -0
  57. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts.map +1 -1
  58. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js +10 -15
  59. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js.map +1 -1
  60. package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts +27 -1
  61. package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts.map +1 -1
  62. package/dist/esm/companion/technical-documentation-capture-execution-port.js.map +1 -1
  63. package/dist/esm/companion/technical-documentation-diagram-definitions.d.ts +33 -0
  64. package/dist/esm/companion/technical-documentation-diagram-definitions.d.ts.map +1 -0
  65. package/dist/esm/companion/technical-documentation-diagram-definitions.js +54 -0
  66. package/dist/esm/companion/technical-documentation-diagram-definitions.js.map +1 -0
  67. package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts +10 -18
  68. package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts.map +1 -1
  69. package/dist/esm/companion/technical-documentation-diagram-materializer.js +9 -39
  70. package/dist/esm/companion/technical-documentation-diagram-materializer.js.map +1 -1
  71. package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts +8 -4
  72. package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts.map +1 -1
  73. package/dist/esm/config/wildo-tech-doc-config.schemas.js +8 -4
  74. package/dist/esm/config/wildo-tech-doc-config.schemas.js.map +1 -1
  75. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +42 -64
  76. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -1
  77. package/dist/esm/content/application-consumer-documentation-content.techdoc.js +164 -925
  78. package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -1
  79. package/dist/esm/runtime/DocsAuthContext.d.ts +16 -1
  80. package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -1
  81. package/dist/esm/runtime/DocsAuthContext.js +18 -2
  82. package/dist/esm/runtime/DocsAuthContext.js.map +1 -1
  83. package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts +35 -13
  84. package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -1
  85. package/dist/esm/runtime/frontend-provider-registry.techdoc.js +28 -19
  86. package/dist/esm/runtime/frontend-provider-registry.techdoc.js.map +1 -1
  87. package/dist/esm/runtime/index.d.ts +1 -0
  88. package/dist/esm/runtime/index.d.ts.map +1 -1
  89. package/dist/esm/runtime/index.js +1 -0
  90. package/dist/esm/runtime/index.js.map +1 -1
  91. package/dist/esm/runtime/use-docs-provider-sdks.d.ts +21 -0
  92. package/dist/esm/runtime/use-docs-provider-sdks.d.ts.map +1 -0
  93. package/dist/esm/runtime/use-docs-provider-sdks.js +49 -0
  94. package/dist/esm/runtime/use-docs-provider-sdks.js.map +1 -0
  95. package/dist/tsconfig.build.tsbuildinfo +1 -1
  96. package/package.json +6 -5
@@ -43,13 +43,36 @@ function webhookEventsMarkdown(source) {
43
43
  * application produce identical bytes.
44
44
  */
45
45
  export function projectApplicationIntegrationDocumentation(source) {
46
+ /*
47
+ * Both inventories are ADDRESSES: a tool name is what an agent types, and a (resource, operation,
48
+ * channel) triple is one fact about one delivery. Neither can legitimately appear twice, so a
49
+ * repeat is a producer walking something twice — which is exactly what the companion's collector
50
+ * did, visiting every selected core resource once from the prepared list and once from the core
51
+ * factory sweep. It survived because the collector used to answer a boolean, where duplicates are
52
+ * unobservable.
53
+ *
54
+ * The refusal lives HERE rather than only in that collector because this is the one place every
55
+ * producer passes through, and a duplicated row is worse than a loud failure: it reads as two
56
+ * separate things a reader must tell apart.
57
+ */
58
+ const seenToolNames = new Set();
46
59
  for (const tool of source.mcpTools) {
47
60
  if (tool.toolName.trim().length === 0)
48
61
  throw new Error('application integration projection received an MCP tool with no name');
62
+ if (seenToolNames.has(tool.toolName)) {
63
+ throw new Error(`application integration projection received the MCP tool '${tool.toolName}' twice — a tool name addresses one operation`);
64
+ }
65
+ seenToolNames.add(tool.toolName);
49
66
  }
67
+ const seenEvents = new Set();
50
68
  for (const event of source.webhookEvents) {
51
69
  if (event.channel.trim().length === 0)
52
70
  throw new Error('application integration projection received a webhook event with no channel');
71
+ const identity = `${event.resourceIdentifier}.${event.operationIdentifier}.${event.channel}`;
72
+ if (seenEvents.has(identity)) {
73
+ throw new Error(`application integration projection received the webhook event '${identity}' twice — one operation on one channel is one event`);
74
+ }
75
+ seenEvents.add(identity);
53
76
  }
54
77
  return {
55
78
  sourceRef: APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_REF,
@@ -1 +1 @@
1
- {"version":3,"file":"application-integration-documentation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-integration-documentation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gDAAgD,GAAG,qDAA8D,CAAC;AAC/H,MAAM,CAAC,MAAM,oDAAoD,GAAG,CAAC,CAAC;AAqBtE,4FAA4F;AAC5F,MAAM,CAAN,IAAY,kCAKX;AALD,WAAY,kCAAkC;IAC5C,4DAA4D;IAC5D,4DAAsB,CAAA;IACtB,2EAA2E;IAC3E,sEAAgC,CAAA;AAClC,CAAC,EALW,kCAAkC,KAAlC,kCAAkC,QAK7C;AAQD,SAAS,gBAAgB,CAAC,MAAiD;IACzE,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,8FAA8F,CAAC;IACxG,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ;SACzB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,CAAC,QAAQ,Q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qB,CAAC,MAAM,CAAC;SACnF,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The tools an MCP client will find, and the events a webhook receiver will be sent.\n *\n * Five webhook pages explained delivery, verification, retries and reconciliation without ever\n * naming an event, and the MCP page described a catalogue without naming a tool in it. Both\n * inventories were already being computed — as booleans, to decide whether those pages publish at\n * all — so the reader was one projection away from the list the whole time.\n *\n * Names are the application's own: a tool is `<resource>__<operation>` exactly as an agent must\n * type it, and an event names the resource and operation that produce it. Nothing here is\n * humanized, because every one of these strings is a value someone matches on in code.\n */\nexport const APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:application-integration' as const;\nexport const APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_VERSION = 1;\n\nexport interface ApplicationMcpToolSource {\n /** The exact name an agent calls, `<resource>__<operation>`. */\n readonly toolName: string;\n readonly resourceIdentifier: string;\n readonly operationIdentifier: string;\n}\n\nexport interface ApplicationWebhookEventSource {\n readonly resourceIdentifier: string;\n readonly operationIdentifier: string;\n /** The notification channel that carries it, which is also its delivery scope. */\n readonly channel: string;\n}\n\nexport interface ApplicationIntegrationDocumentationSource {\n readonly mcpTools: readonly ApplicationMcpToolSource[];\n readonly webhookEvents: readonly ApplicationWebhookEventSource[];\n}\n\n/** Named presentations a page may request with `{{APPLICATION_INTEGRATION:<selector>}}`. */\nexport enum ApplicationIntegrationPresentation {\n /** Every tool this application publishes to MCP clients. */\n MCP_TOOLS = 'mcpTools',\n /** Every resource operation that produces an outbound webhook delivery. */\n WEBHOOK_EVENTS = 'webhookEvents',\n}\n\nexport interface ApplicationIntegrationDocumentationFact {\n readonly sourceRef: string;\n readonly sourceVersion: number;\n readonly presentations: Readonly<Record<ApplicationIntegrationPresentation, string>>;\n}\n\nfunction mcpToolsMarkdown(source: ApplicationIntegrationDocumentationSource): string {\n if (source.mcpTools.length === 0) {\n return 'This application publishes no MCP tools, so a connected client will find an empty catalogue.';\n }\n const rows = source.mcpTools\n .map((tool) => `| \\`${tool.toolName}\\` | ${tool.resourceIdentifier} | ${tool.operationIdentifier} |`)\n .join('\\n');\n return `| Tool | Resource | Operation |\\n| --- | --- | --- |\\n${rows}\\n\\nThese are the tools the application publishes. What YOU see is the subset your credential is allowed to call, so a shorter catalogue is an authorization result and not a fault. The API reference carries each operation's exact arguments and response.`;\n}\n\nfunction webhookEventsMarkdown(source: ApplicationIntegrationDocumentationSource): string {\n if (source.webhookEvents.length === 0) {\n return 'This application declares no outbound webhook events, so an endpoint would receive nothing even when one is configured and enabled.';\n }\n const rows = source.webhookEvents\n .map((event) => `| ${event.resourceIdentifier} | ${event.operationIdentifier} | \\`${event.channel}\\` |`)\n .join('\\n');\n return `| Resource | Operation that fires it | Channel |\\n| --- | --- | --- |\\n${rows}\\n\\nEvery enabled endpoint on the matching channel receives every event on that channel: an endpoint is not subscribed to a subset. Route on the signed \\`resourceIdentifier\\` and \\`operationIdentifier\\` claims rather than on the destination URL, and ignore an event your receiver does not handle.`;\n}\n\n/**\n * Projects both integration inventories. A pure function of the source, so two runs over the same\n * application produce identical bytes.\n */\nexport function projectApplicationIntegrationDocumentation(\n source: ApplicationIntegrationDocumentationSource,\n): ApplicationIntegrationDocumentationFact {\n for (const tool of source.mcpTools) {\n if (tool.toolName.trim().length === 0) throw new Error('application integration projection received an MCP tool with no name');\n }\n for (const event of source.webhookEvents) {\n if (event.channel.trim().length === 0) throw new Error('application integration projection received a webhook event with no channel');\n }\n return {\n sourceRef: APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_REF,\n sourceVersion: APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_VERSION,\n presentations: Object.freeze({\n [ApplicationIntegrationPresentation.MCP_TOOLS]: mcpToolsMarkdown(source),\n [ApplicationIntegrationPresentation.WEBHOOK_EVENTS]: webhookEventsMarkdown(source),\n }),\n };\n}\n"]}
1
+ {"version":3,"file":"application-integration-documentation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-integration-documentation.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EAAE,qBAAqB,CAAC,MAAM,CAAC;SACnF,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["/**\n * The tools an MCP client will find, and the events a webhook receiver will be sent.\n *\n * Five webhook pages explained delivery, verification, retries and reconciliation without ever\n * naming an event, and the MCP page described a catalogue without naming a tool in it. Both\n * inventories were already being computed — as booleans, to decide whether those pages publish at\n * all — so the reader was one projection away from the list the whole time.\n *\n * Names are the application's own: a tool is `<resource>__<operation>` exactly as an agent must\n * type it, and an event names the resource and operation that produce it. Nothing here is\n * humanized, because every one of these strings is a value someone matches on in code.\n */\nexport const APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:application-integration' as const;\nexport const APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_VERSION = 1;\n\nexport interface ApplicationMcpToolSource {\n /** The exact name an agent calls, `<resource>__<operation>`. */\n readonly toolName: string;\n readonly resourceIdentifier: string;\n readonly operationIdentifier: string;\n}\n\nexport interface ApplicationWebhookEventSource {\n readonly resourceIdentifier: string;\n readonly operationIdentifier: string;\n /** The notification channel that carries it, which is also its delivery scope. */\n readonly channel: string;\n}\n\nexport interface ApplicationIntegrationDocumentationSource {\n readonly mcpTools: readonly ApplicationMcpToolSource[];\n readonly webhookEvents: readonly ApplicationWebhookEventSource[];\n}\n\n/** Named presentations a page may request with `{{APPLICATION_INTEGRATION:<selector>}}`. */\nexport enum ApplicationIntegrationPresentation {\n /** Every tool this application publishes to MCP clients. */\n MCP_TOOLS = 'mcpTools',\n /** Every resource operation that produces an outbound webhook delivery. */\n WEBHOOK_EVENTS = 'webhookEvents',\n}\n\nexport interface ApplicationIntegrationDocumentationFact {\n readonly sourceRef: string;\n readonly sourceVersion: number;\n readonly presentations: Readonly<Record<ApplicationIntegrationPresentation, string>>;\n}\n\nfunction mcpToolsMarkdown(source: ApplicationIntegrationDocumentationSource): string {\n if (source.mcpTools.length === 0) {\n return 'This application publishes no MCP tools, so a connected client will find an empty catalogue.';\n }\n const rows = source.mcpTools\n .map((tool) => `| \\`${tool.toolName}\\` | ${tool.resourceIdentifier} | ${tool.operationIdentifier} |`)\n .join('\\n');\n return `| Tool | Resource | Operation |\\n| --- | --- | --- |\\n${rows}\\n\\nThese are the tools the application publishes. What YOU see is the subset your credential is allowed to call, so a shorter catalogue is an authorization result and not a fault. The API reference carries each operation's exact arguments and response.`;\n}\n\nfunction webhookEventsMarkdown(source: ApplicationIntegrationDocumentationSource): string {\n if (source.webhookEvents.length === 0) {\n return 'This application declares no outbound webhook events, so an endpoint would receive nothing even when one is configured and enabled.';\n }\n const rows = source.webhookEvents\n .map((event) => `| ${event.resourceIdentifier} | ${event.operationIdentifier} | \\`${event.channel}\\` |`)\n .join('\\n');\n return `| Resource | Operation that fires it | Channel |\\n| --- | --- | --- |\\n${rows}\\n\\nEvery enabled endpoint on the matching channel receives every event on that channel: an endpoint is not subscribed to a subset. Route on the signed \\`resourceIdentifier\\` and \\`operationIdentifier\\` claims rather than on the destination URL, and ignore an event your receiver does not handle.`;\n}\n\n/**\n * Projects both integration inventories. A pure function of the source, so two runs over the same\n * application produce identical bytes.\n */\nexport function projectApplicationIntegrationDocumentation(\n source: ApplicationIntegrationDocumentationSource,\n): ApplicationIntegrationDocumentationFact {\n /*\n * Both inventories are ADDRESSES: a tool name is what an agent types, and a (resource, operation,\n * channel) triple is one fact about one delivery. Neither can legitimately appear twice, so a\n * repeat is a producer walking something twice — which is exactly what the companion's collector\n * did, visiting every selected core resource once from the prepared list and once from the core\n * factory sweep. It survived because the collector used to answer a boolean, where duplicates are\n * unobservable.\n *\n * The refusal lives HERE rather than only in that collector because this is the one place every\n * producer passes through, and a duplicated row is worse than a loud failure: it reads as two\n * separate things a reader must tell apart.\n */\n const seenToolNames = new Set<string>();\n for (const tool of source.mcpTools) {\n if (tool.toolName.trim().length === 0) throw new Error('application integration projection received an MCP tool with no name');\n if (seenToolNames.has(tool.toolName)) {\n throw new Error(`application integration projection received the MCP tool '${tool.toolName}' twice — a tool name addresses one operation`);\n }\n seenToolNames.add(tool.toolName);\n }\n const seenEvents = new Set<string>();\n for (const event of source.webhookEvents) {\n if (event.channel.trim().length === 0) throw new Error('application integration projection received a webhook event with no channel');\n const identity = `${event.resourceIdentifier}.${event.operationIdentifier}.${event.channel}`;\n if (seenEvents.has(identity)) {\n throw new Error(`application integration projection received the webhook event '${identity}' twice — one operation on one channel is one event`);\n }\n seenEvents.add(identity);\n }\n return {\n sourceRef: APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_REF,\n sourceVersion: APPLICATION_INTEGRATION_DOCUMENTATION_SOURCE_VERSION,\n presentations: Object.freeze({\n [ApplicationIntegrationPresentation.MCP_TOOLS]: mcpToolsMarkdown(source),\n [ApplicationIntegrationPresentation.WEBHOOK_EVENTS]: webhookEventsMarkdown(source),\n }),\n };\n}\n"]}
@@ -56,6 +56,36 @@ export declare function projectApplicationOrganizationRoleDocumentationSources(c
56
56
  * make the guide disagree with member-management and role-picker UI.
57
57
  */
58
58
  export declare function resolveApplicationOrganizationRoleDocumentation(roles: readonly ApplicationOrganizationRoleDocumentationSource[], primaryLocaleLabels: Readonly<Record<string, string>>): readonly ApplicationOrganizationRoleDocumentation[];
59
+ /**
60
+ * Give every operation's access documentation the role names the APPLICATION authored.
61
+ *
62
+ * ## The defect this closes
63
+ *
64
+ * `roleRequirements[].label` was derived from the role TOKEN in the projector subprocess —
65
+ * `ORG_MANAGER` became "Organization Manager" and `APP_ADMIN_SUPER_ADMIN` became "Application Admin
66
+ * Super Admin". That is invented display text (`.claude/rules/display-text-comes-from-i18n.md`), and
67
+ * it appeared on EVERY documented operation, which is the largest surface the defect had. Meanwhile
68
+ * the same roles carry authored labels resolved from the application's own i18n unit, and
69
+ * publication already refuses to proceed without them — but those labels reached only the roles
70
+ * page. Two names for one role, and the invented one was the one beside every endpoint (#382).
71
+ *
72
+ * ## Why a token is the fallback, and not a prettier guess
73
+ *
74
+ * A label this map does not carry stays the raw token. `ORG_MANAGER` is honest, searchable, and
75
+ * visibly not a product's word — an invented English phrase is none of those, and once printed it is
76
+ * indistinguishable from an authored one. The refusal belongs at the door that PUBLISHES, which
77
+ * already has it; a read that merely generates a document must not fail closed on an authoring gap.
78
+ *
79
+ * Returns new objects; the input projections are left untouched.
80
+ */
81
+ export declare function applyAuthoredRoleLabelsToOperationAccess<T extends {
82
+ readonly access?: {
83
+ readonly roleRequirements: readonly {
84
+ readonly role: string;
85
+ readonly label: string;
86
+ }[];
87
+ };
88
+ }>(operations: readonly T[], labelByRole: Readonly<Record<string, string>>): readonly T[];
59
89
  /**
60
90
  * Materialize the reusable Markdown fact consumed by the Roles and permissions
61
91
  * topic. This function knows no application identity: different applications
@@ -1 +1 @@
1
- {"version":3,"file":"application-organization-role-documentation.d.ts","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-organization-role-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,6CAA6C,EAAE,MAAM,iDAAiD,CAAC;AAErH,eAAO,MAAM,uDAAuD,EAAG,gDAAyD,CAAC;AACjI,4GAA4G;AAC5G,eAAO,MAAM,2DAA2D,IAAI,CAAC;AAE7E,sFAAsF;AACtF,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACxD;AAED;;;;GAIG;AACH,MAAM,WAAW,8CAA8C;IAC7D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,CAAC,GACpD,SAAS,wCAAwC,EAAE,CAMrD;AAED;;;;GAIG;AACH,wBAAgB,mDAAmD,CACjE,KAAK,EAAE,SAAS,wCAAwC,EAAE,GACzD,6CAA6C,CAgC/C"}
1
+ {"version":3,"file":"application-organization-role-documentation.d.ts","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-organization-role-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,KAAK,EAAE,6CAA6C,EAAE,MAAM,iDAAiD,CAAC;AAErH,eAAO,MAAM,uDAAuD,EAAG,gDAAyD,CAAC;AACjI,4GAA4G;AAC5G,eAAO,MAAM,2DAA2D,IAAI,CAAC;AAE7E,sFAAsF;AACtF,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,mBAAmB,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACxD;AAED;;;;GAIG;AACH,MAAM,WAAW,8CAA8C;IAC7D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,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AAE,CAAA;KAAE,CAAA;CAAE,EAC3H,UAAU,EAAE,SAAS,CAAC,EAAE,EAAE,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,CAavF;AAED;;;;GAIG;AACH,wBAAgB,mDAAmD,CACjE,KAAK,EAAE,SAAS,wCAAwC,EAAE,GACzD,6CAA6C,CAgC/C"}
@@ -86,6 +86,44 @@ export function resolveApplicationOrganizationRoleDocumentation(roles, primaryLo
86
86
  description: requiredRoleLabel(primaryLocaleLabels, role.role, 'description'),
87
87
  })));
88
88
  }
89
+ /**
90
+ * Give every operation's access documentation the role names the APPLICATION authored.
91
+ *
92
+ * ## The defect this closes
93
+ *
94
+ * `roleRequirements[].label` was derived from the role TOKEN in the projector subprocess —
95
+ * `ORG_MANAGER` became "Organization Manager" and `APP_ADMIN_SUPER_ADMIN` became "Application Admin
96
+ * Super Admin". That is invented display text (`.claude/rules/display-text-comes-from-i18n.md`), and
97
+ * it appeared on EVERY documented operation, which is the largest surface the defect had. Meanwhile
98
+ * the same roles carry authored labels resolved from the application's own i18n unit, and
99
+ * publication already refuses to proceed without them — but those labels reached only the roles
100
+ * page. Two names for one role, and the invented one was the one beside every endpoint (#382).
101
+ *
102
+ * ## Why a token is the fallback, and not a prettier guess
103
+ *
104
+ * A label this map does not carry stays the raw token. `ORG_MANAGER` is honest, searchable, and
105
+ * visibly not a product's word — an invented English phrase is none of those, and once printed it is
106
+ * indistinguishable from an authored one. The refusal belongs at the door that PUBLISHES, which
107
+ * already has it; a read that merely generates a document must not fail closed on an authoring gap.
108
+ *
109
+ * Returns new objects; the input projections are left untouched.
110
+ */
111
+ export function applyAuthoredRoleLabelsToOperationAccess(operations, labelByRole) {
112
+ return operations.map((operation) => {
113
+ const access = operation.access;
114
+ if (access === undefined || access.roleRequirements.length === 0)
115
+ return operation;
116
+ let changed = false;
117
+ const roleRequirements = access.roleRequirements.map((requirement) => {
118
+ const authored = labelByRole[requirement.role];
119
+ if (authored === undefined || authored === requirement.label)
120
+ return requirement;
121
+ changed = true;
122
+ return { ...requirement, label: authored };
123
+ });
124
+ return changed ? { ...operation, access: { ...access, roleRequirements } } : operation;
125
+ });
126
+ }
89
127
  /**
90
128
  * Materialize the reusable Markdown fact consumed by the Roles and permissions
91
129
  * topic. This function knows no application identity: different applications
@@ -1 +1 @@
1
- {"version":3,"file":"application-organization-role-documentation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-organization-role-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,CAAC,MAAM,uDAAuD,GAAG,gDAAyD,CAAC;AACjI,4GAA4G;AAC5G,MAAM,CAAC,MAAM,2DAA2D,GAAG,CAAC,CAAC;AAyC7E;;;GAGG;AACH,MAAM,UAAU,wCAAwC,CACtD,kBAAuD;IAEvD,MAAM,MAAM,GAAG,IAAI,GAAG,EAA8C,CAAC;IACrE,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAAE,CAAC;QAChE,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,OAAO,SAAS,CAAC,GAAG,KAAK,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;YAAE,SAAS;QAC3G,IAAI,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8EAA8E,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC;QAClH,CAAC;QACD,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE;YACxB,GAAG,EAAE,SAAS,CAAC,GAAG;YAClB,OAAO,EAAE,oBAAoB,CAAC,SAAS,CAAC,OAAO,CAAC;YAChD,YAAY,EAAE,oBAAoB,CAAC,SAAS,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,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC;AACjD,CAAC","sourcesContent":["import {\n CORE_ORG_ROLES,\n DEFAULT_ORGANIZATION_ROLES,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\nimport {\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport type { ApplicationOrganizationRolesDocumentationFact } from './technical-documentation-engine-content-bundle';\n\nexport const APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:organization-roles' as const;\n/** Advances when this projection's shape changes; it is the fact's version wherever provenance cites it. */\nexport const APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_VERSION = 1;\n\n/** Minimal application/engine role specification needed by consumer documentation. */\nexport interface ApplicationRoleDocumentationSource {\n readonly ref: string;\n readonly purpose: string | null;\n readonly businessRole: string | null;\n readonly authorityBoundary: string | null;\n readonly useWhen: string | null;\n readonly avoidWhen: string | null;\n readonly businessConstraints: readonly string[] | null;\n}\n\n/**\n * Application-independent organization-role projection before UI labels are\n * joined. The introspection subprocess can safely emit this JSON-only shape;\n * the parent companion later joins the application's primary-locale labels.\n */\nexport interface ApplicationOrganizationRoleDocumentationSource {\n readonly role: string;\n readonly inheritFrom: string | null;\n readonly purpose: string;\n readonly businessRole: string | null;\n readonly authorityBoundary: string;\n readonly useWhen: string;\n readonly avoidWhen: string;\n readonly businessConstraints: readonly string[];\n}\n\n/** Complete consumer-visible role documentation after the application label join. */\nexport interface ApplicationOrganizationRoleDocumentation extends ApplicationOrganizationRoleDocumentationSource {\n readonly label: string;\n readonly description: string;\n}\n\ninterface ApplicationRoleConfigurationProjectionInput {\n readonly role?: string;\n readonly inheritFrom?: string;\n readonly relatedPrimaryScope: ResourcePrimaryScope;\n}\n\n/**\n * Index companion-exported role specifications by their runtime role token.\n * Engine and application-defined roles intentionally share this namespace.\n */\nexport function indexApplicationRoleDocumentationSources(\n roleSpecifications: Record<string, unknown> | undefined,\n): ReadonlyMap<string, ApplicationRoleDocumentationSource> {\n const result = new Map<string, ApplicationRoleDocumentationSource>();\n for (const candidate of Object.values(roleSpecifications ?? {})) {\n if (!isPlainObject(candidate) || typeof candidate.ref !== 'string' || candidate.ref.length === 0) continue;\n if (result.has(candidate.ref)) {\n throw new Error(`application organization-role projector: duplicate role specification for '${candidate.ref}'`);\n }\n result.set(candidate.ref, {\n ref: candidate.ref,\n purpose: nonEmptyStringOrNull(candidate.purpose),\n businessRole: nonEmptyStringOrNull(candidate.businessRole),\n authorityBoundary: nonEmptyStringOrNull(candidate.authorityBoundary),\n useWhen: nonEmptyStringOrNull(candidate.useWhen),\n avoidWhen: nonEmptyStringOrNull(candidate.avoidWhen),\n businessConstraints: nonEmptyStringArrayOrNull(candidate.businessConstraints),\n });\n }\n return result;\n}\n\n/**\n * Resolve every framework and application-defined organization role from the\n * application's merged runtime registry and authored role specifications.\n * Application-scoped roles are deliberately excluded from this organization\n * administration reference.\n */\nexport function projectApplicationOrganizationRoleDocumentationSources(\n customRoles: Readonly<Record<string, ApplicationRoleConfigurationProjectionInput>> | undefined,\n roleSpecsByRef: ReadonlyMap<string, ApplicationRoleDocumentationSource>,\n): readonly ApplicationOrganizationRoleDocumentationSource[] {\n const configured = new Map<string, ApplicationRoleConfigurationProjectionInput & { readonly role: string }>();\n for (const config of Object.values(DEFAULT_ORGANIZATION_ROLES)) {\n if (typeof config.role !== 'string' || config.role.length === 0) {\n throw new Error('application organization-role projector: framework organization role configuration has no role token');\n }\n configured.set(config.role, { ...config, role: config.role });\n }\n for (const config of Object.values(customRoles ?? {})) {\n if (typeof config.role !== 'string' || config.role.length === 0) {\n throw new Error('application organization-role projector: application organization role configuration has no role token');\n }\n if (configured.has(config.role)) {\n throw new Error(`application organization-role projector: application role '${config.role}' collides with a framework organization role`);\n }\n configured.set(config.role, { ...config, role: config.role });\n }\n\n return Object.freeze([...configured.values()]\n .filter((config) => config.relatedPrimaryScope === ResourcePrimaryScope.ORGANIZATIONS)\n .map((config) => {\n const specification = roleSpecsByRef.get(config.role);\n if (\n specification === undefined\n || specification.purpose === null\n || specification.authorityBoundary === null\n || specification.useWhen === null\n || specification.avoidWhen === null\n || specification.businessConstraints === null\n ) {\n throw new Error(\n `application organization-role projector: organization role '${config.role}' has no companion-exported role specification with complete consumer guidance`,\n );\n }\n return Object.freeze({\n role: config.role,\n inheritFrom: config.inheritFrom ?? null,\n purpose: specification.purpose,\n businessRole: specification.businessRole,\n authorityBoundary: specification.authorityBoundary,\n useWhen: specification.useWhen,\n avoidWhen: specification.avoidWhen,\n businessConstraints: specification.businessConstraints,\n });\n })\n .sort((left, right) => left.role.localeCompare(right.role, 'en-US')));\n}\n\n/**\n * Join role semantics to the exact primary-locale labels shown by the\n * application. Missing values fail closed: publishing a guessed label would\n * make the guide disagree with member-management and role-picker UI.\n */\nexport function resolveApplicationOrganizationRoleDocumentation(\n roles: readonly ApplicationOrganizationRoleDocumentationSource[],\n primaryLocaleLabels: Readonly<Record<string, string>>,\n): readonly ApplicationOrganizationRoleDocumentation[] {\n return Object.freeze(roles.map((role) => Object.freeze({\n ...role,\n label: requiredRoleLabel(primaryLocaleLabels, role.role, 'label'),\n description: requiredRoleLabel(primaryLocaleLabels, role.role, 'description'),\n })));\n}\n\n/**\n * Materialize the reusable Markdown fact consumed by the Roles and permissions\n * topic. This function knows no application identity: different applications\n * receive different role inputs and therefore different facts.\n */\nexport function createApplicationOrganizationRolesDocumentationFact(\n roles: readonly ApplicationOrganizationRoleDocumentation[],\n): ApplicationOrganizationRolesDocumentationFact {\n if (roles.length === 0) throw new Error('technical documentation requires at least one resolved organization role');\n if (new Set(roles.map((role) => role.role)).size !== roles.length) {\n throw new Error('technical documentation received duplicate resolved organization roles');\n }\n\n const roleByIdentifier = new Map(roles.map((role) => [role.role, role]));\n const hierarchyDepthByRole = new Map(roles.map((role) => [role.role, hierarchyDepth(role, roleByIdentifier)]));\n // Readers compare authority from broadest to narrowest. Derive that order\n // from the actual inheritance chain; sibling branches use visible labels and\n // stable role tokens only as deterministic tie-breakers.\n const canonicalRoles = [...roles].sort((left, right) =>\n hierarchyDepthByRole.get(right.role)! - hierarchyDepthByRole.get(left.role)!\n || left.label.localeCompare(right.label, 'en-US')\n || left.role.localeCompare(right.role, 'en-US'));\n\n const roleSections = canonicalRoles.map((role) => {\n const inheritedRole = role.inheritFrom === null ? undefined : roleByIdentifier.get(role.inheritFrom);\n const inheritance = role.inheritFrom === null\n ? 'This role does not inherit another organization role.'\n : `This role includes the permissions of **${markdownText(inheritedRole?.label ?? role.inheritFrom)}** (${inlineCode(role.inheritFrom)}).`;\n const limits = [role.avoidWhen, ...role.businessConstraints]\n .map((constraint) => `- ${markdownProse(constraint)}`)\n .join('\\n');\n return `### ${markdownText(role.label)}\\n\\n${markdownText(role.description)}\\n\\n- **Where it applies:** ${markdownProse(role.authorityBoundary)}\\n- **Inherited access:** ${inheritance}\\n- **Technical identifier:** ${inlineCode(role.role)}\\n\\n#### Can do\\n\\n${markdownProse(role.purpose)}\\n\\n${markdownProse(role.useWhen)}\\n\\n#### Cannot do\\n\\n${limits}\\n\\n#### Can assign\\n\\n${roleAssignmentMarkdown(role, roleByIdentifier)}`;\n }).join('\\n\\n');\n\n return Object.freeze({\n sourceRef: APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_REF,\n markdown: `These are all the organization roles available in this application. Their names and short descriptions match the application's primary-language interface; the technical identifier is included so you can recognize the same role in an access request, audit record, or API response.\\n\\n${roleSections}\\n\\n> **How inherited access works:** when one role includes another, it receives the included role’s permissions as well as its own. The reverse is not true: assigning the included role never grants the higher role.`,\n sourceVersion: APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_VERSION,\n });\n}\n\nfunction hierarchyDepth(\n role: ApplicationOrganizationRoleDocumentation,\n roleByIdentifier: ReadonlyMap<string, ApplicationOrganizationRoleDocumentation>,\n ancestors = new Set<string>(),\n): number {\n if (role.inheritFrom === null) return 0;\n if (ancestors.has(role.role)) {\n throw new Error(`technical documentation organization-role hierarchy contains a cycle at ${role.role}`);\n }\n const inheritedRole = roleByIdentifier.get(role.inheritFrom);\n if (inheritedRole === undefined) {\n throw new Error(`technical documentation organization role ${role.role} inherits absent role ${role.inheritFrom}`);\n }\n return 1 + hierarchyDepth(inheritedRole, roleByIdentifier, new Set([...ancestors, role.role]));\n}\n\n/**\n * Explain the standard organization-role assignment ceiling from the exact\n * application role graph. This deliberately does not flatten custom roles into\n * a total order: sibling custom branches are outside one another's ceiling.\n * A role must also inherit the administrator gate before it can use the\n * standard membership and unit-assignment controls at all.\n */\nfunction roleAssignmentMarkdown(\n role: ApplicationOrganizationRoleDocumentation,\n roleByIdentifier: ReadonlyMap<string, ApplicationOrganizationRoleDocumentation>,\n): string {\n const effectiveRoles: ApplicationOrganizationRoleDocumentation[] = [];\n let current: ApplicationOrganizationRoleDocumentation | undefined = role;\n const visited = new Set<string>();\n while (current !== undefined) {\n if (visited.has(current.role)) {\n throw new Error(`technical documentation organization-role hierarchy contains a cycle at ${current.role}`);\n }\n visited.add(current.role);\n effectiveRoles.push(current);\n current = current.inheritFrom === null ? undefined : roleByIdentifier.get(current.inheritFrom);\n }\n\n if (!effectiveRoles.some((candidate) => candidate.role === CORE_ORG_ROLES.ORG_ADMIN)) {\n return 'This role cannot use the standard organization-membership or organization-unit assignment controls. It therefore cannot assign an organization or unit role through those controls.';\n }\n\n const assignableRoles = effectiveRoles\n .map((candidate) => `**${markdownText(candidate.label)}** (${inlineCode(candidate.role)})`)\n .join(', ');\n return `Through the standard membership and unit-assignment controls, this role can assign: ${assignableRoles}. It cannot assign a role outside this inheritance chain unless the person also holds another organization-wide role whose chain includes it.`;\n}\n\nfunction requiredRoleLabel(\n labels: Readonly<Record<string, string>>,\n role: string,\n field: 'label' | 'description',\n): string {\n const key = `roles.${role}.${field}`;\n const value = labels[key];\n if (typeof value !== 'string' || value.trim().length === 0) {\n throw new Error(\n `application organization-role documentation requires primary-locale label '${key}'; generate the application's role labels before publishing documentation`,\n );\n }\n return value.trim();\n}\n\nfunction nonEmptyStringOrNull(value: unknown): string | null {\n return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;\n}\n\nfunction nonEmptyStringArrayOrNull(value: unknown): readonly string[] | null {\n if (!Array.isArray(value) || value.length === 0) return null;\n const normalized = value.map(nonEmptyStringOrNull);\n return normalized.every((entry): entry is string => entry !== null)\n ? Object.freeze(normalized)\n : null;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction markdownText(value: string): string {\n return value.replaceAll(/\\s+/g, ' ').trim().replaceAll('\\\\', '\\\\\\\\').replaceAll(/([`*_[\\]<>#|])/g, '\\\\$1');\n}\n\n/** Role specifications intentionally author small inline-Markdown semantics. */\nfunction markdownProse(value: string): string {\n return value.replaceAll(/\\s+/g, ' ').trim();\n}\n\nfunction inlineCode(value: string): string {\n return `\\`${value.replaceAll('`', '&#96;')}\\``;\n}\n"]}
1
+ {"version":3,"file":"application-organization-role-documentation.js","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/application-organization-role-documentation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,oBAAoB,GACrB,MAAM,uBAAuB,CAAC;AAM/B,MAAM,CAAC,MAAM,uDAAuD,GAAG,gDAAyD,CAAC;AACjI,4GAA4G;AAC5G,MAAM,CAAC,MAAM,2DAA2D,GAAG,CAAC,CAAC;AAyC7E;;;GAGG;AACH,MAAM,UAAU,wCAAwC,CACtD,kBAAuD;IAEvD,MAAM,MAAM,GAAG,IAAI,GAAG,EAA8C,CAAC;IACrE,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,MAAM,CAAC,kBAAkB,IAAI,EAAE,CAAC,EAAE,CAAC;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E,MAAM,CAAC,CAAC,UAAU,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;AAC7G,CAAC;AAED,gFAAgF;AAChF,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC;AACjD,CAAC","sourcesContent":["import {\n CORE_ORG_ROLES,\n DEFAULT_ORGANIZATION_ROLES,\n ResourcePrimaryScope,\n} from '@wildo-ai/saas-models';\nimport {\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport type { ApplicationOrganizationRolesDocumentationFact } from './technical-documentation-engine-content-bundle';\n\nexport const APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_REF = 'source:companion-projection:organization-roles' as const;\n/** Advances when this projection's shape changes; it is the fact's version wherever provenance cites it. */\nexport const APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_VERSION = 1;\n\n/** Minimal application/engine role specification needed by consumer documentation. */\nexport interface ApplicationRoleDocumentationSource {\n readonly ref: string;\n readonly purpose: string | null;\n readonly businessRole: string | null;\n readonly authorityBoundary: string | null;\n readonly useWhen: string | null;\n readonly avoidWhen: string | null;\n readonly businessConstraints: readonly string[] | null;\n}\n\n/**\n * Application-independent organization-role projection before UI labels are\n * joined. The introspection subprocess can safely emit this JSON-only shape;\n * the parent companion later joins the application's primary-locale labels.\n */\nexport interface ApplicationOrganizationRoleDocumentationSource {\n readonly role: string;\n readonly inheritFrom: string | null;\n readonly purpose: string;\n readonly businessRole: string | null;\n readonly authorityBoundary: string;\n readonly useWhen: string;\n readonly avoidWhen: string;\n readonly businessConstraints: readonly string[];\n}\n\n/** Complete consumer-visible role documentation after the application label join. */\nexport interface ApplicationOrganizationRoleDocumentation extends ApplicationOrganizationRoleDocumentationSource {\n readonly label: string;\n readonly description: string;\n}\n\ninterface ApplicationRoleConfigurationProjectionInput {\n readonly role?: string;\n readonly inheritFrom?: string;\n readonly relatedPrimaryScope: ResourcePrimaryScope;\n}\n\n/**\n * Index companion-exported role specifications by their runtime role token.\n * Engine and application-defined roles intentionally share this namespace.\n */\nexport function indexApplicationRoleDocumentationSources(\n roleSpecifications: Record<string, unknown> | undefined,\n): ReadonlyMap<string, ApplicationRoleDocumentationSource> {\n const result = new Map<string, ApplicationRoleDocumentationSource>();\n for (const candidate of Object.values(roleSpecifications ?? {})) {\n if (!isPlainObject(candidate) || typeof candidate.ref !== 'string' || candidate.ref.length === 0) continue;\n if (result.has(candidate.ref)) {\n throw new Error(`application organization-role projector: duplicate role specification for '${candidate.ref}'`);\n }\n result.set(candidate.ref, {\n ref: candidate.ref,\n purpose: nonEmptyStringOrNull(candidate.purpose),\n businessRole: nonEmptyStringOrNull(candidate.businessRole),\n authorityBoundary: nonEmptyStringOrNull(candidate.authorityBoundary),\n useWhen: nonEmptyStringOrNull(candidate.useWhen),\n avoidWhen: nonEmptyStringOrNull(candidate.avoidWhen),\n businessConstraints: nonEmptyStringArrayOrNull(candidate.businessConstraints),\n });\n }\n return result;\n}\n\n/**\n * Resolve every framework and application-defined organization role from the\n * application's merged runtime registry and authored role specifications.\n * Application-scoped roles are deliberately excluded from this organization\n * administration reference.\n */\nexport function projectApplicationOrganizationRoleDocumentationSources(\n customRoles: Readonly<Record<string, ApplicationRoleConfigurationProjectionInput>> | undefined,\n roleSpecsByRef: ReadonlyMap<string, ApplicationRoleDocumentationSource>,\n): readonly ApplicationOrganizationRoleDocumentationSource[] {\n const configured = new Map<string, ApplicationRoleConfigurationProjectionInput & { readonly role: string }>();\n for (const config of Object.values(DEFAULT_ORGANIZATION_ROLES)) {\n if (typeof config.role !== 'string' || config.role.length === 0) {\n throw new Error('application organization-role projector: framework organization role configuration has no role token');\n }\n configured.set(config.role, { ...config, role: config.role });\n }\n for (const config of Object.values(customRoles ?? {})) {\n if (typeof config.role !== 'string' || config.role.length === 0) {\n throw new Error('application organization-role projector: application organization role configuration has no role token');\n }\n if (configured.has(config.role)) {\n throw new Error(`application organization-role projector: application role '${config.role}' collides with a framework organization role`);\n }\n configured.set(config.role, { ...config, role: config.role });\n }\n\n return Object.freeze([...configured.values()]\n .filter((config) => config.relatedPrimaryScope === ResourcePrimaryScope.ORGANIZATIONS)\n .map((config) => {\n const specification = roleSpecsByRef.get(config.role);\n if (\n specification === undefined\n || specification.purpose === null\n || specification.authorityBoundary === null\n || specification.useWhen === null\n || specification.avoidWhen === null\n || specification.businessConstraints === null\n ) {\n throw new Error(\n `application organization-role projector: organization role '${config.role}' has no companion-exported role specification with complete consumer guidance`,\n );\n }\n return Object.freeze({\n role: config.role,\n inheritFrom: config.inheritFrom ?? null,\n purpose: specification.purpose,\n businessRole: specification.businessRole,\n authorityBoundary: specification.authorityBoundary,\n useWhen: specification.useWhen,\n avoidWhen: specification.avoidWhen,\n businessConstraints: specification.businessConstraints,\n });\n })\n .sort((left, right) => left.role.localeCompare(right.role, 'en-US')));\n}\n\n/**\n * Join role semantics to the exact primary-locale labels shown by the\n * application. Missing values fail closed: publishing a guessed label would\n * make the guide disagree with member-management and role-picker UI.\n */\nexport function resolveApplicationOrganizationRoleDocumentation(\n roles: readonly ApplicationOrganizationRoleDocumentationSource[],\n primaryLocaleLabels: Readonly<Record<string, string>>,\n): readonly ApplicationOrganizationRoleDocumentation[] {\n return Object.freeze(roles.map((role) => Object.freeze({\n ...role,\n label: requiredRoleLabel(primaryLocaleLabels, role.role, 'label'),\n description: requiredRoleLabel(primaryLocaleLabels, role.role, 'description'),\n })));\n}\n\n/**\n * Give every operation's access documentation the role names the APPLICATION authored.\n *\n * ## The defect this closes\n *\n * `roleRequirements[].label` was derived from the role TOKEN in the projector subprocess —\n * `ORG_MANAGER` became \"Organization Manager\" and `APP_ADMIN_SUPER_ADMIN` became \"Application Admin\n * Super Admin\". That is invented display text (`.claude/rules/display-text-comes-from-i18n.md`), and\n * it appeared on EVERY documented operation, which is the largest surface the defect had. Meanwhile\n * the same roles carry authored labels resolved from the application's own i18n unit, and\n * publication already refuses to proceed without them — but those labels reached only the roles\n * page. Two names for one role, and the invented one was the one beside every endpoint (#382).\n *\n * ## Why a token is the fallback, and not a prettier guess\n *\n * A label this map does not carry stays the raw token. `ORG_MANAGER` is honest, searchable, and\n * visibly not a product's word — an invented English phrase is none of those, and once printed it is\n * indistinguishable from an authored one. The refusal belongs at the door that PUBLISHES, which\n * already has it; a read that merely generates a document must not fail closed on an authoring gap.\n *\n * Returns new objects; the input projections are left untouched.\n */\nexport function applyAuthoredRoleLabelsToOperationAccess<\n T extends { readonly access?: { readonly roleRequirements: readonly { readonly role: string; readonly label: string }[] } },\n>(operations: readonly T[], labelByRole: Readonly<Record<string, string>>): readonly T[] {\n return operations.map((operation) => {\n const access = operation.access;\n if (access === undefined || access.roleRequirements.length === 0) return operation;\n let changed = false;\n const roleRequirements = access.roleRequirements.map((requirement) => {\n const authored = labelByRole[requirement.role];\n if (authored === undefined || authored === requirement.label) return requirement;\n changed = true;\n return { ...requirement, label: authored };\n });\n return changed ? { ...operation, access: { ...access, roleRequirements } } : operation;\n });\n}\n\n/**\n * Materialize the reusable Markdown fact consumed by the Roles and permissions\n * topic. This function knows no application identity: different applications\n * receive different role inputs and therefore different facts.\n */\nexport function createApplicationOrganizationRolesDocumentationFact(\n roles: readonly ApplicationOrganizationRoleDocumentation[],\n): ApplicationOrganizationRolesDocumentationFact {\n if (roles.length === 0) throw new Error('technical documentation requires at least one resolved organization role');\n if (new Set(roles.map((role) => role.role)).size !== roles.length) {\n throw new Error('technical documentation received duplicate resolved organization roles');\n }\n\n const roleByIdentifier = new Map(roles.map((role) => [role.role, role]));\n const hierarchyDepthByRole = new Map(roles.map((role) => [role.role, hierarchyDepth(role, roleByIdentifier)]));\n // Readers compare authority from broadest to narrowest. Derive that order\n // from the actual inheritance chain; sibling branches use visible labels and\n // stable role tokens only as deterministic tie-breakers.\n const canonicalRoles = [...roles].sort((left, right) =>\n hierarchyDepthByRole.get(right.role)! - hierarchyDepthByRole.get(left.role)!\n || left.label.localeCompare(right.label, 'en-US')\n || left.role.localeCompare(right.role, 'en-US'));\n\n const roleSections = canonicalRoles.map((role) => {\n const inheritedRole = role.inheritFrom === null ? undefined : roleByIdentifier.get(role.inheritFrom);\n const inheritance = role.inheritFrom === null\n ? 'This role does not inherit another organization role.'\n : `This role includes the permissions of **${markdownText(inheritedRole?.label ?? role.inheritFrom)}** (${inlineCode(role.inheritFrom)}).`;\n const limits = [role.avoidWhen, ...role.businessConstraints]\n .map((constraint) => `- ${markdownProse(constraint)}`)\n .join('\\n');\n return `### ${markdownText(role.label)}\\n\\n${markdownText(role.description)}\\n\\n- **Where it applies:** ${markdownProse(role.authorityBoundary)}\\n- **Inherited access:** ${inheritance}\\n- **Technical identifier:** ${inlineCode(role.role)}\\n\\n#### Can do\\n\\n${markdownProse(role.purpose)}\\n\\n${markdownProse(role.useWhen)}\\n\\n#### Cannot do\\n\\n${limits}\\n\\n#### Can assign\\n\\n${roleAssignmentMarkdown(role, roleByIdentifier)}`;\n }).join('\\n\\n');\n\n return Object.freeze({\n sourceRef: APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_REF,\n markdown: `These are all the organization roles available in this application. Their names and short descriptions match the application's primary-language interface; the technical identifier is included so you can recognize the same role in an access request, audit record, or API response.\\n\\n${roleSections}\\n\\n> **How inherited access works:** when one role includes another, it receives the included role’s permissions as well as its own. The reverse is not true: assigning the included role never grants the higher role.`,\n sourceVersion: APPLICATION_ORGANIZATION_ROLES_DOCUMENTATION_SOURCE_VERSION,\n });\n}\n\nfunction hierarchyDepth(\n role: ApplicationOrganizationRoleDocumentation,\n roleByIdentifier: ReadonlyMap<string, ApplicationOrganizationRoleDocumentation>,\n ancestors = new Set<string>(),\n): number {\n if (role.inheritFrom === null) return 0;\n if (ancestors.has(role.role)) {\n throw new Error(`technical documentation organization-role hierarchy contains a cycle at ${role.role}`);\n }\n const inheritedRole = roleByIdentifier.get(role.inheritFrom);\n if (inheritedRole === undefined) {\n throw new Error(`technical documentation organization role ${role.role} inherits absent role ${role.inheritFrom}`);\n }\n return 1 + hierarchyDepth(inheritedRole, roleByIdentifier, new Set([...ancestors, role.role]));\n}\n\n/**\n * Explain the standard organization-role assignment ceiling from the exact\n * application role graph. This deliberately does not flatten custom roles into\n * a total order: sibling custom branches are outside one another's ceiling.\n * A role must also inherit the administrator gate before it can use the\n * standard membership and unit-assignment controls at all.\n */\nfunction roleAssignmentMarkdown(\n role: ApplicationOrganizationRoleDocumentation,\n roleByIdentifier: ReadonlyMap<string, ApplicationOrganizationRoleDocumentation>,\n): string {\n const effectiveRoles: ApplicationOrganizationRoleDocumentation[] = [];\n let current: ApplicationOrganizationRoleDocumentation | undefined = role;\n const visited = new Set<string>();\n while (current !== undefined) {\n if (visited.has(current.role)) {\n throw new Error(`technical documentation organization-role hierarchy contains a cycle at ${current.role}`);\n }\n visited.add(current.role);\n effectiveRoles.push(current);\n current = current.inheritFrom === null ? undefined : roleByIdentifier.get(current.inheritFrom);\n }\n\n if (!effectiveRoles.some((candidate) => candidate.role === CORE_ORG_ROLES.ORG_ADMIN)) {\n return 'This role cannot use the standard organization-membership or organization-unit assignment controls. It therefore cannot assign an organization or unit role through those controls.';\n }\n\n const assignableRoles = effectiveRoles\n .map((candidate) => `**${markdownText(candidate.label)}** (${inlineCode(candidate.role)})`)\n .join(', ');\n return `Through the standard membership and unit-assignment controls, this role can assign: ${assignableRoles}. It cannot assign a role outside this inheritance chain unless the person also holds another organization-wide role whose chain includes it.`;\n}\n\nfunction requiredRoleLabel(\n labels: Readonly<Record<string, string>>,\n role: string,\n field: 'label' | 'description',\n): string {\n const key = `roles.${role}.${field}`;\n const value = labels[key];\n if (typeof value !== 'string' || value.trim().length === 0) {\n throw new Error(\n `application organization-role documentation requires primary-locale label '${key}'; generate the application's role labels before publishing documentation`,\n );\n }\n return value.trim();\n}\n\nfunction nonEmptyStringOrNull(value: unknown): string | null {\n return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;\n}\n\nfunction nonEmptyStringArrayOrNull(value: unknown): readonly string[] | null {\n if (!Array.isArray(value) || value.length === 0) return null;\n const normalized = value.map(nonEmptyStringOrNull);\n return normalized.every((entry): entry is string => entry !== null)\n ? Object.freeze(normalized)\n : null;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction markdownText(value: string): string {\n return value.replaceAll(/\\s+/g, ' ').trim().replaceAll('\\\\', '\\\\\\\\').replaceAll(/([`*_[\\]<>#|])/g, '\\\\$1');\n}\n\n/** Role specifications intentionally author small inline-Markdown semantics. */\nfunction markdownProse(value: string): string {\n return value.replaceAll(/\\s+/g, ' ').trim();\n}\n\nfunction inlineCode(value: string): string {\n return `\\`${value.replaceAll('`', '&#96;')}\\``;\n}\n"]}
@@ -1,8 +1,9 @@
1
1
  import { type ApplicationConnectionDocumentationFact } from './application-connection-documentation';
2
2
  import { type ApplicationAuthenticationDocumentationFact } from './application-authentication-documentation';
3
3
  import { type ApplicationIntegrationDocumentationFact } from './application-integration-documentation';
4
+ import { type ApplicationDomainDocumentationFact } from './application-domain-documentation';
4
5
  import { type ApplicationAdministrationDocumentationFact } from './application-administration-documentation';
5
- import { TechnicalDocumentationAccessClass, TechnicalDocumentationReaderAudience, TechnicalDocumentationUnitKind, type TechnicalDocumentationApplicabilityRequirementV1, type TechnicalDocumentationApiReferenceTargetV1, type TechnicalDocumentationUnitV1 } from '@wildo-ai/saas-specifications/technical-documentation';
6
+ import { TechnicalDocumentationAccessClass, TechnicalDocumentationEditorialStatus, TechnicalDocumentationReaderAudience, type TechnicalDocumentationAssetRequestV1, TechnicalDocumentationUnitKind, type TechnicalDocumentationApplicabilityRequirementV1, type TechnicalDocumentationApiReferenceTargetV1, type TechnicalDocumentationUnitV1 } from '@wildo-ai/saas-specifications/technical-documentation';
6
7
  import { type EngineDocumentationSpecificationCatalogV1 } from '@wildo-ai/saas-specifications/companion';
7
8
  import type { LoadedApplicationConsumerDocumentationContentBundleV1 } from '../content/application-consumer-documentation-content-loader';
8
9
  import { APPLICATION_CONSUMER_DOCUMENTATION_COMPANION_PROJECTION_SOURCE_PREFIX } from '../../content/application-consumer-documentation-content-manifest.schemas';
@@ -17,6 +18,34 @@ export interface EngineContentUnitDefinition {
17
18
  readonly label: string;
18
19
  readonly target: TechnicalDocumentationApiReferenceTargetV1;
19
20
  }[];
21
+ /**
22
+ * Editorial state of this page. **Omitted means `APPROVED`**, which is what every page authored
23
+ * before 2026-09-08 relied on — the two unit-creation sites hardcoded `APPROVED` and the policy's
24
+ * editorial suppression path therefore had no producer at all (#474).
25
+ *
26
+ * Declare `DRAFT` or `REVIEW_REQUIRED` for a page that exists in the content module and is not
27
+ * ready for a reader. It stays in the private derivation — so it is still built, still linked
28
+ * from the manifest, still visible to whoever is writing it — and the publication policy keeps it
29
+ * out of the portal with `EDITORIAL_NOT_APPROVED`. That is the difference between a page in
30
+ * progress and a page deleted, and until now the framework could only express the second.
31
+ */
32
+ readonly editorialStatus?: TechnicalDocumentationEditorialStatus;
33
+ /**
34
+ * Assets this page asks for — a deterministic diagram, or a product screenshot.
35
+ *
36
+ * Omitted means none, which is what every page meant until 2026-09-08: both unit-creation sites
37
+ * hardcoded `assetRequests: []`, so the screenshot placeholder branch, the deterministic diagram
38
+ * renderer and the whole asset-resolution path were unreachable from shipped content (#474). The
39
+ * pipeline was complete and had no producer.
40
+ *
41
+ * A request is a DECLARATION that the page needs a picture, never a promise that one exists. The
42
+ * resolver decides what arrives: a `DETERMINISTIC_RENDER` diagram is materialized offline and
43
+ * arrives RESOLVED, while a `PLAYWRIGHT_CAPTURE` screenshot with no capture available ships a
44
+ * PLACEHOLDER and the page still publishes — skip the generation, never block the tree on a
45
+ * browser and a live stack. Whether provisional imagery may actually SHIP is an environment
46
+ * decision enforced at publication (`--refuse-provisional-assets`), not an authoring one.
47
+ */
48
+ readonly assetRequests?: readonly TechnicalDocumentationAssetRequestV1[];
20
49
  }
21
50
  /** Public, semantic role inventory supplied by the resolved application companion. */
22
51
  export interface ApplicationOrganizationRolesDocumentationFact {
@@ -32,6 +61,36 @@ export interface ApplicationOrganizationRolesDocumentationFact {
32
61
  * and title; this map owns type, audience, publication posture and navigation
33
62
  * relationships, allowing the projector to reject a mismatched content set.
34
63
  */
64
+ /**
65
+ * The unit-ref namespace generated resource pages live in, and the only place its shape is written.
66
+ *
67
+ * `technical-documentation:unit/manages/<resource>` — an ENGINE ref with a reserved segment, not an
68
+ * application-owned one. The distinction is load-bearing: `pathForUnit` still refuses a unit an
69
+ * application named, and these are engine units whose subject happens to come from the application.
70
+ */
71
+ export declare function applicationDomainResourcePageUnitRef(resourceIdentifier: string): string;
72
+ /** The unit-ref prefix a renderer matches to recognise a generated resource page. */
73
+ export declare const APPLICATION_DOMAIN_RESOURCE_PAGE_UNIT_REF_PREFIX = "technical-documentation:unit/manages/";
74
+ /**
75
+ * Unit kinds this catalog deliberately produces NO unit for, each with the reason.
76
+ *
77
+ * The vocabulary has eight members and, until 2026-09-09, two of them had no producer at all — a
78
+ * silent gap, because a kind nobody authors looks exactly like a kind nobody needed (#474). RUNBOOK
79
+ * now has one. CHANGE does not, and the reason is structural rather than editorial:
80
+ *
81
+ * A CHANGE unit is a record of what changed in ONE application, so only that application could
82
+ * author it — and an application-authored unit cannot be routed. `pathForUnit` admits engine-
83
+ * namespaced slugs and the reserved `unit/manages/` namespace, and refuses everything else with
84
+ * "has no consumer navigation category". Application material reaches the site only as an ENGINE
85
+ * unit carrying application-projected facts, never as an application-authored page. So the engine
86
+ * cannot write a changelog it has no knowledge of, and the party that could has no door.
87
+ *
88
+ * The member is therefore kept rather than retired: what is missing is a route for
89
+ * application-authored units, not the concept. When that route exists, this entry is removed in the
90
+ * same change — and `technical-documentation-engine-content-bundle.test.ts` fails until it is,
91
+ * because the partition below is asserted total over the enum.
92
+ */
93
+ export declare const ENGINE_CONTENT_UNIT_KINDS_WITHOUT_PRODUCER: Readonly<Partial<Record<TechnicalDocumentationUnitKind, string>>>;
35
94
  export declare const ENGINE_CONTENT_UNIT_DEFINITIONS: Readonly<Record<string, EngineContentUnitDefinition>>;
36
95
  /**
37
96
  * The facts only the application knows, which the companion measures and passes in.
@@ -46,6 +105,7 @@ export interface ApplicationDocumentationFacts {
46
105
  readonly authentication?: ApplicationAuthenticationDocumentationFact;
47
106
  readonly administration?: ApplicationAdministrationDocumentationFact;
48
107
  readonly integration?: ApplicationIntegrationDocumentationFact;
108
+ readonly domain?: ApplicationDomainDocumentationFact;
49
109
  }
50
110
  /**
51
111
  * Compiles verified engine content and the application's own facts (organization roles,
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-engine-content-bundle.d.ts","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-engine-content-bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,sCAAsC,EAC5C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAGL,KAAK,0CAA0C,EAChD,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAGL,KAAK,uCAAuC,EAC7C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAGL,KAAK,0CAA0C,EAChD,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAEL,iCAAiC,EAQjC,oCAAoC,EAGpC,8BAA8B,EAE9B,KAAK,gDAAgD,EACrD,KAAK,0CAA0C,EAG/C,KAAK,4BAA4B,EAClC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAGL,KAAK,yCAAyC,EAC/C,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,qDAAqD,EAAE,MAAM,8DAA8D,CAAC;AAC1I,OAAO,EACL,qEAAqE,EAGtE,MAAM,2EAA2E,CAAC;AAEnF,OAAO,EAEL,KAAK,qDAAqD,EAC3D,MAAM,wDAAwD,CAAC;AAEhE,MAAM,WAAW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,EACrE,eAAe,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAAmC,EACxG,gBAAgB,GAAE,6BAAkC,GACnD,4BAA4B,EAAE,CAiIhC"}
1
+ {"version":3,"file":"technical-documentation-engine-content-bundle.d.ts","sourceRoot":"","sources":["../../../../../src/companion/application-documentation/technical-documentation-engine-content-bundle.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,sCAAsC,EAC5C,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAGL,KAAK,0CAA0C,EAChD,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAGL,KAAK,uCAAuC,EAC7C,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAGL,KAAK,kCAAkC,EACxC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAGL,KAAK,0CAA0C,EAChD,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAEL,iCAAiC,EAKjC,qCAAqC,EAGrC,oCAAoC,EAEpC,KAAK,oCAAoC,EAEzC,8BAA8B,EAE9B,KAAK,gDAAgD,EACrD,KAAK,0CAA0C,EAG/C,KAAK,4BAA4B,EAClC,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EAGL,KAAK,yCAAyC,EAC/C,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EAAE,qDAAqD,EAAE,MAAM,8DAA8D,CAAC;AAC1I,OAAO,EACL,qEAAqE,EAGtE,MAAM,2EAA2E,CAAC;AAKnF,OAAO,EAEL,KAAK,qDAAqD,EAC3D,MAAM,wDAAwD,CAAC;AAEhE,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,8BAA8B,CAAC;IAC9C,QAAQ,CAAC,eAAe,EAAE,SAAS,oCAAoC,EAAE,CAAC;IAC1E,QAAQ,CAAC,WAAW,EAAE,iCAAiC,CAAC;IACxD,QAAQ,CAAC,yBAAyB,EAAE,SAAS,gDAAgD,EAAE,CAAC;IAChG,QAAQ,CAAC,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