@wildo-ai/saas-technical-doc 1.1.1

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 (216) hide show
  1. package/LICENSE +34 -0
  2. package/dist/esm/.builder.pid +9 -0
  3. package/dist/esm/build/csp-emit.d.ts +9 -0
  4. package/dist/esm/build/csp-emit.d.ts.map +1 -0
  5. package/dist/esm/build/csp-emit.js +8 -0
  6. package/dist/esm/build/csp-emit.js.map +1 -0
  7. package/dist/esm/build/load-materialized-frontend-providers.d.ts +9 -0
  8. package/dist/esm/build/load-materialized-frontend-providers.d.ts.map +1 -0
  9. package/dist/esm/build/load-materialized-frontend-providers.js +9 -0
  10. package/dist/esm/build/load-materialized-frontend-providers.js.map +1 -0
  11. package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts +66 -0
  12. package/dist/esm/companion/application-documentation/application-organization-role-documentation.d.ts.map +1 -0
  13. package/dist/esm/companion/application-documentation/application-organization-role-documentation.js +195 -0
  14. package/dist/esm/companion/application-documentation/application-organization-role-documentation.js.map +1 -0
  15. package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts +36 -0
  16. package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.d.ts.map +1 -0
  17. package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js +71 -0
  18. package/dist/esm/companion/application-documentation/application-organization-unit-resource-documentation.js.map +1 -0
  19. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts +37 -0
  20. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.d.ts.map +1 -0
  21. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js +1865 -0
  22. package/dist/esm/companion/application-documentation/technical-documentation-engine-content-bundle.js.map +1 -0
  23. package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts +22 -0
  24. package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.d.ts.map +1 -0
  25. package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.js +31 -0
  26. package/dist/esm/companion/application-documentation/technical-documentation-operational-evidence.js.map +1 -0
  27. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts +31 -0
  28. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.d.ts.map +1 -0
  29. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js +33 -0
  30. package/dist/esm/companion/application-documentation/technical-documentation-private-derivation.js.map +1 -0
  31. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts +13 -0
  32. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.d.ts.map +1 -0
  33. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js +93 -0
  34. package/dist/esm/companion/application-documentation/technical-documentation-publication-policy.js.map +1 -0
  35. package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts +52 -0
  36. package/dist/esm/companion/content/application-consumer-documentation-content-loader.d.ts.map +1 -0
  37. package/dist/esm/companion/content/application-consumer-documentation-content-loader.js +191 -0
  38. package/dist/esm/companion/content/application-consumer-documentation-content-loader.js.map +1 -0
  39. package/dist/esm/companion/index.d.ts +39 -0
  40. package/dist/esm/companion/index.d.ts.map +1 -0
  41. package/dist/esm/companion/index.js +39 -0
  42. package/dist/esm/companion/index.js.map +1 -0
  43. package/dist/esm/companion/openapi-generator.d.ts +94 -0
  44. package/dist/esm/companion/openapi-generator.d.ts.map +1 -0
  45. package/dist/esm/companion/openapi-generator.js +1562 -0
  46. package/dist/esm/companion/openapi-generator.js.map +1 -0
  47. package/dist/esm/companion/operation-projection.schemas.d.ts +797 -0
  48. package/dist/esm/companion/operation-projection.schemas.d.ts.map +1 -0
  49. package/dist/esm/companion/operation-projection.schemas.js +610 -0
  50. package/dist/esm/companion/operation-projection.schemas.js.map +1 -0
  51. package/dist/esm/companion/publish-result.types.d.ts +124 -0
  52. package/dist/esm/companion/publish-result.types.d.ts.map +1 -0
  53. package/dist/esm/companion/publish-result.types.js +28 -0
  54. package/dist/esm/companion/publish-result.types.js.map +1 -0
  55. package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts +26 -0
  56. package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.d.ts.map +1 -0
  57. package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.js +63 -0
  58. package/dist/esm/companion/rendering/technical-documentation-authorized-bundle-reader.js.map +1 -0
  59. package/dist/esm/companion/rendering/technical-documentation-build-measurement.d.ts +23 -0
  60. package/dist/esm/companion/rendering/technical-documentation-build-measurement.d.ts.map +1 -0
  61. package/dist/esm/companion/rendering/technical-documentation-build-measurement.js +104 -0
  62. package/dist/esm/companion/rendering/technical-documentation-build-measurement.js.map +1 -0
  63. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts +9 -0
  64. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.d.ts.map +1 -0
  65. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js +421 -0
  66. package/dist/esm/companion/rendering/technical-documentation-docusaurus-renderer.js.map +1 -0
  67. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts +72 -0
  68. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.d.ts.map +1 -0
  69. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js +204 -0
  70. package/dist/esm/companion/rendering/technical-documentation-managed-tree-validator.js.map +1 -0
  71. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts +9 -0
  72. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.d.ts.map +1 -0
  73. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js +106 -0
  74. package/dist/esm/companion/rendering/technical-documentation-markdown-renderer.js.map +1 -0
  75. package/dist/esm/companion/rendering/technical-documentation-mdx-escaping.d.ts +43 -0
  76. package/dist/esm/companion/rendering/technical-documentation-mdx-escaping.d.ts.map +1 -0
  77. package/dist/esm/companion/rendering/technical-documentation-mdx-escaping.js +88 -0
  78. package/dist/esm/companion/rendering/technical-documentation-mdx-escaping.js.map +1 -0
  79. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts +7 -0
  80. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.d.ts.map +1 -0
  81. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js +51 -0
  82. package/dist/esm/companion/rendering/technical-documentation-openapi-renderer.js.map +1 -0
  83. package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts +45 -0
  84. package/dist/esm/companion/rendering/technical-documentation-render-model.d.ts.map +1 -0
  85. package/dist/esm/companion/rendering/technical-documentation-render-model.js +178 -0
  86. package/dist/esm/companion/rendering/technical-documentation-render-model.js.map +1 -0
  87. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts +3 -0
  88. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.d.ts.map +1 -0
  89. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js +49 -0
  90. package/dist/esm/companion/rendering/technical-documentation-search-index-renderer.js.map +1 -0
  91. package/dist/esm/companion/spec-to-operation-doc.d.ts +176 -0
  92. package/dist/esm/companion/spec-to-operation-doc.d.ts.map +1 -0
  93. package/dist/esm/companion/spec-to-operation-doc.js +326 -0
  94. package/dist/esm/companion/spec-to-operation-doc.js.map +1 -0
  95. package/dist/esm/companion/technical-documentation-asset-path.d.ts +16 -0
  96. package/dist/esm/companion/technical-documentation-asset-path.d.ts.map +1 -0
  97. package/dist/esm/companion/technical-documentation-asset-path.js +19 -0
  98. package/dist/esm/companion/technical-documentation-asset-path.js.map +1 -0
  99. package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts +14 -0
  100. package/dist/esm/companion/technical-documentation-capture-execution-port.d.ts.map +1 -0
  101. package/dist/esm/companion/technical-documentation-capture-execution-port.js +1 -0
  102. package/dist/esm/companion/technical-documentation-capture-execution-port.js.map +1 -0
  103. package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts +25 -0
  104. package/dist/esm/companion/technical-documentation-diagram-materializer.d.ts.map +1 -0
  105. package/dist/esm/companion/technical-documentation-diagram-materializer.js +86 -0
  106. package/dist/esm/companion/technical-documentation-diagram-materializer.js.map +1 -0
  107. package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts +17 -0
  108. package/dist/esm/companion/technical-documentation-placeholder-materializer.d.ts.map +1 -0
  109. package/dist/esm/companion/technical-documentation-placeholder-materializer.js +63 -0
  110. package/dist/esm/companion/technical-documentation-placeholder-materializer.js.map +1 -0
  111. package/dist/esm/companion/zod-to-openapi.d.ts +67 -0
  112. package/dist/esm/companion/zod-to-openapi.d.ts.map +1 -0
  113. package/dist/esm/companion/zod-to-openapi.js +211 -0
  114. package/dist/esm/companion/zod-to-openapi.js.map +1 -0
  115. package/dist/esm/companion-exports.d.ts +32 -0
  116. package/dist/esm/companion-exports.d.ts.map +1 -0
  117. package/dist/esm/companion-exports.js +32 -0
  118. package/dist/esm/companion-exports.js.map +1 -0
  119. package/dist/esm/config/define-tech-doc-config.d.ts +38 -0
  120. package/dist/esm/config/define-tech-doc-config.d.ts.map +1 -0
  121. package/dist/esm/config/define-tech-doc-config.js +40 -0
  122. package/dist/esm/config/define-tech-doc-config.js.map +1 -0
  123. package/dist/esm/config/index.d.ts +22 -0
  124. package/dist/esm/config/index.d.ts.map +1 -0
  125. package/dist/esm/config/index.js +22 -0
  126. package/dist/esm/config/index.js.map +1 -0
  127. package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts +204 -0
  128. package/dist/esm/config/wildo-tech-doc-config.schemas.d.ts.map +1 -0
  129. package/dist/esm/config/wildo-tech-doc-config.schemas.js +192 -0
  130. package/dist/esm/config/wildo-tech-doc-config.schemas.js.map +1 -0
  131. package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts +82 -0
  132. package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.d.ts.map +1 -0
  133. package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.js +114 -0
  134. package/dist/esm/content/application-consumer-documentation-content-manifest.schemas.js.map +1 -0
  135. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts +420 -0
  136. package/dist/esm/content/application-consumer-documentation-content.techdoc.d.ts.map +1 -0
  137. package/dist/esm/content/application-consumer-documentation-content.techdoc.js +9619 -0
  138. package/dist/esm/content/application-consumer-documentation-content.techdoc.js.map +1 -0
  139. package/dist/esm/content.exports.d.ts +9 -0
  140. package/dist/esm/content.exports.d.ts.map +1 -0
  141. package/dist/esm/content.exports.js +9 -0
  142. package/dist/esm/content.exports.js.map +1 -0
  143. package/dist/esm/index.d.ts +26 -0
  144. package/dist/esm/index.d.ts.map +1 -0
  145. package/dist/esm/index.js +26 -0
  146. package/dist/esm/index.js.map +1 -0
  147. package/dist/esm/openapi/api-reference-link-index.d.ts +98 -0
  148. package/dist/esm/openapi/api-reference-link-index.d.ts.map +1 -0
  149. package/dist/esm/openapi/api-reference-link-index.js +301 -0
  150. package/dist/esm/openapi/api-reference-link-index.js.map +1 -0
  151. package/dist/esm/openapi/api-reference-targets.d.ts +71 -0
  152. package/dist/esm/openapi/api-reference-targets.d.ts.map +1 -0
  153. package/dist/esm/openapi/api-reference-targets.js +114 -0
  154. package/dist/esm/openapi/api-reference-targets.js.map +1 -0
  155. package/dist/esm/openapi/index.d.ts +20 -0
  156. package/dist/esm/openapi/index.d.ts.map +1 -0
  157. package/dist/esm/openapi/index.js +20 -0
  158. package/dist/esm/openapi/index.js.map +1 -0
  159. package/dist/esm/openapi/openapi-generation-output.schemas.d.ts +80 -0
  160. package/dist/esm/openapi/openapi-generation-output.schemas.d.ts.map +1 -0
  161. package/dist/esm/openapi/openapi-generation-output.schemas.js +76 -0
  162. package/dist/esm/openapi/openapi-generation-output.schemas.js.map +1 -0
  163. package/dist/esm/openapi-reference-model.exports.d.ts +10 -0
  164. package/dist/esm/openapi-reference-model.exports.d.ts.map +1 -0
  165. package/dist/esm/openapi-reference-model.exports.js +10 -0
  166. package/dist/esm/openapi-reference-model.exports.js.map +1 -0
  167. package/dist/esm/runtime/AuthExchangePage.d.ts +84 -0
  168. package/dist/esm/runtime/AuthExchangePage.d.ts.map +1 -0
  169. package/dist/esm/runtime/AuthExchangePage.js +188 -0
  170. package/dist/esm/runtime/AuthExchangePage.js.map +1 -0
  171. package/dist/esm/runtime/DocsAuthContext.d.ts +119 -0
  172. package/dist/esm/runtime/DocsAuthContext.d.ts.map +1 -0
  173. package/dist/esm/runtime/DocsAuthContext.js +171 -0
  174. package/dist/esm/runtime/DocsAuthContext.js.map +1 -0
  175. package/dist/esm/runtime/decode-jwt-claims.d.ts +39 -0
  176. package/dist/esm/runtime/decode-jwt-claims.d.ts.map +1 -0
  177. package/dist/esm/runtime/decode-jwt-claims.js +86 -0
  178. package/dist/esm/runtime/decode-jwt-claims.js.map +1 -0
  179. package/dist/esm/runtime/docs-auth-client.d.ts +193 -0
  180. package/dist/esm/runtime/docs-auth-client.d.ts.map +1 -0
  181. package/dist/esm/runtime/docs-auth-client.js +211 -0
  182. package/dist/esm/runtime/docs-auth-client.js.map +1 -0
  183. package/dist/esm/runtime/docs-auth-session.schemas.d.ts +77 -0
  184. package/dist/esm/runtime/docs-auth-session.schemas.d.ts.map +1 -0
  185. package/dist/esm/runtime/docs-auth-session.schemas.js +50 -0
  186. package/dist/esm/runtime/docs-auth-session.schemas.js.map +1 -0
  187. package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts +17 -0
  188. package/dist/esm/runtime/frontend-provider-registry.techdoc.d.ts.map +1 -0
  189. package/dist/esm/runtime/frontend-provider-registry.techdoc.js +23 -0
  190. package/dist/esm/runtime/frontend-provider-registry.techdoc.js.map +1 -0
  191. package/dist/esm/runtime/index.d.ts +57 -0
  192. package/dist/esm/runtime/index.d.ts.map +1 -0
  193. package/dist/esm/runtime/index.js +76 -0
  194. package/dist/esm/runtime/index.js.map +1 -0
  195. package/dist/esm/runtime/openapi-reference-conservation.d.ts +20 -0
  196. package/dist/esm/runtime/openapi-reference-conservation.d.ts.map +1 -0
  197. package/dist/esm/runtime/openapi-reference-conservation.js +102 -0
  198. package/dist/esm/runtime/openapi-reference-conservation.js.map +1 -0
  199. package/dist/esm/runtime/openapi-reference-model.d.ts +224 -0
  200. package/dist/esm/runtime/openapi-reference-model.d.ts.map +1 -0
  201. package/dist/esm/runtime/openapi-reference-model.js +579 -0
  202. package/dist/esm/runtime/openapi-reference-model.js.map +1 -0
  203. package/dist/esm/runtime/openapi-reference-view.d.ts +13 -0
  204. package/dist/esm/runtime/openapi-reference-view.d.ts.map +1 -0
  205. package/dist/esm/runtime/openapi-reference-view.js +284 -0
  206. package/dist/esm/runtime/openapi-reference-view.js.map +1 -0
  207. package/dist/esm/runtime/use-docs-auth-session.d.ts +26 -0
  208. package/dist/esm/runtime/use-docs-auth-session.d.ts.map +1 -0
  209. package/dist/esm/runtime/use-docs-auth-session.js +34 -0
  210. package/dist/esm/runtime/use-docs-auth-session.js.map +1 -0
  211. package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts +3 -0
  212. package/dist/esm/runtime/use-docs-frontend-provider-registry.d.ts.map +1 -0
  213. package/dist/esm/runtime/use-docs-frontend-provider-registry.js +5 -0
  214. package/dist/esm/runtime/use-docs-frontend-provider-registry.js.map +1 -0
  215. package/dist/tsconfig.build.tsbuildinfo +1 -0
  216. package/package.json +117 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"technical-documentation-openapi-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-openapi-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAC7I,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EACL,wBAAwB,GAEzB,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,6CAA6C,GAE9C,MAAM,wCAAwC,CAAC;AAEhD,MAAM,oBAAoB,GAAG,0CAA0C,CAAC;AAExE,MAAM,UAAU,2CAA2C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AAW,OAAO;oBACvE,WAAW,EAAE,oBAAoB;oBACjC,UAAU,EAAE,gCAAgC,CAAC,gBAAgB;oBAC7D,cAAc;oBACd,sBAAsB,EAAE,WAAW,SAAS,CAAC,IAAI,EAAE;oBACnD,SAAS,EAAE,kBAAkB;oBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC;iBACjC;aACO,CAAC;QACb,CAAC,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { TechnicalDocumentationOutputKind, TechnicalDocumentationRendererKind } from '@wildo-ai/saas-specifications/technical-documentation';\nimport { stringify as stringifyYaml } from 'yaml';\n\nimport {\n OPENAPI_OUTPUT_FILENAMES,\n type OpenApiGenerationOutput,\n} from '../../openapi/openapi-generation-output.schemas';\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRendererResult,\n} from './technical-documentation-render-model';\n\nconst OPENAPI_RENDERER_REF = 'technical-documentation:renderer/openapi';\n\nexport function renderVerifiedTechnicalDocumentationOpenApi(input: {\n readonly documents: OpenApiGenerationOutput;\n readonly sourceUnitRefs: readonly string[];\n}): TechnicalDocumentationRendererResult {\n if (input.sourceUnitRefs.length === 0) throw new Error('technical-documentation OpenAPI rendering requires authorized source units');\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.OPENAPI,\n rendererRef: OPENAPI_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/openapi-3-1-0',\n }),\n files: input.documents.sections.flatMap((section) => {\n const sectionPath = section.section.toLowerCase().replaceAll('_', '-');\n const sourceUnitRefs = [...input.sourceUnitRefs].sort();\n const filenames = OPENAPI_OUTPUT_FILENAMES[section.section];\n const yaml = stringifyYaml(section.document, { lineWidth: 0, sortMapEntries: false });\n const json = `${JSON.stringify(section.document, null, 2)}\\n`;\n /**\n * YAML and JSON are two deterministic serializations of one generator\n * document. YAML is the reviewable/downloadable contract; JSON is the\n * browser renderer input. Neither file contains renderer-authored API\n * meaning.\n */\n return [\n {\n outputRef: `technical-documentation:output/openapi/${sectionPath}/yaml`,\n rendererRef: OPENAPI_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.OPENAPI_DOCUMENT,\n sourceUnitRefs,\n normalizedRelativePath: `openapi/${filenames.yaml}`,\n mediaType: 'application/yaml',\n bytes: Buffer.from(yaml, 'utf8'),\n },\n {\n outputRef: `technical-documentation:output/openapi/${sectionPath}/json`,\n rendererRef: OPENAPI_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.OPENAPI_DOCUMENT,\n sourceUnitRefs,\n normalizedRelativePath: `openapi/${filenames.json}`,\n mediaType: 'application/json',\n bytes: Buffer.from(json, 'utf8'),\n },\n ] as const;\n }),\n };\n}\n"]}
@@ -0,0 +1,45 @@
1
+ import { TechnicalDocumentationOutputKind, TechnicalDocumentationRendererKind, type TechnicalDocumentationAuthorizedBundleManifestV1, type TechnicalDocumentationRenderOutputManifestV1, type TechnicalDocumentationRendererExecutionV1, type TechnicalDocumentationVersionedIdentityV1, type TechnicalDocumentationResolvedAssetBundleManifestV1, type TechnicalDocumentationSupportedApiVersion, type TechnicalDocumentationUnitV1 } from '@wildo-ai/saas-specifications/technical-documentation';
2
+ /**
3
+ * Names opaque emitted bytes, and detects their corruption when a reader compares this against the
4
+ * bytes it actually loaded. That two-sided check is why it survived the 2026-08-27 digest
5
+ * demolition; its string-hashing sibling did not, because every caller of that one was recording
6
+ * agreement between two parts of the repository rather than naming content.
7
+ */
8
+ export declare function technicalDocumentationSha256Bytes(bytes: Uint8Array): string;
9
+ export interface TechnicalDocumentationRenderModel {
10
+ readonly authorizedBundleIdentity: TechnicalDocumentationVersionedIdentityV1;
11
+ readonly channel: TechnicalDocumentationAuthorizedBundleManifestV1['channel'];
12
+ readonly units: readonly TechnicalDocumentationUnitV1[];
13
+ readonly unitPathByRef: ReadonlyMap<string, string>;
14
+ }
15
+ export interface TechnicalDocumentationRenderedFile {
16
+ readonly outputRef: string;
17
+ readonly rendererRef: string;
18
+ readonly outputKind: TechnicalDocumentationOutputKind;
19
+ readonly sourceUnitRefs: readonly string[];
20
+ readonly normalizedRelativePath: string;
21
+ readonly mediaType: string;
22
+ readonly bytes: Uint8Array;
23
+ }
24
+ export interface TechnicalDocumentationRendererResult {
25
+ readonly execution: TechnicalDocumentationRendererExecutionV1;
26
+ readonly files: readonly TechnicalDocumentationRenderedFile[];
27
+ }
28
+ export declare function createTechnicalDocumentationRendererExecution(input: {
29
+ readonly rendererKind: TechnicalDocumentationRendererKind;
30
+ readonly rendererRef: string;
31
+ readonly rendererVersion: number;
32
+ /** Names the renderer's configuration. `rendererRef@rendererVersion` names the implementation. */
33
+ readonly configurationRef: string;
34
+ }): TechnicalDocumentationRendererExecutionV1;
35
+ export declare function createTechnicalDocumentationRenderModel(authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1): TechnicalDocumentationRenderModel;
36
+ export declare function createTechnicalDocumentationAggregateRenderManifest(input: {
37
+ readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;
38
+ readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;
39
+ readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;
40
+ readonly rendererResults: readonly TechnicalDocumentationRendererResult[];
41
+ /** This render's own identity; the publication pointer selects a render by it. */
42
+ readonly renderRef: string;
43
+ readonly renderVersion: number;
44
+ }): TechnicalDocumentationRenderOutputManifestV1;
45
+ //# sourceMappingURL=technical-documentation-render-model.d.ts.map
@@ -0,0 +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,K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ACjE,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"}
@@ -0,0 +1,178 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { createTechnicalDocumentationRenderOutputManifestV1, TechnicalDocumentationNormalizedRelativePathSchema, } from '@wildo-ai/saas-specifications/technical-documentation';
3
+ /**
4
+ * Names opaque emitted bytes, and detects their corruption when a reader compares this against the
5
+ * bytes it actually loaded. That two-sided check is why it survived the 2026-08-27 digest
6
+ * demolition; its string-hashing sibling did not, because every caller of that one was recording
7
+ * agreement between two parts of the repository rather than naming content.
8
+ */
9
+ export function technicalDocumentationSha256Bytes(bytes) {
10
+ return `sha256:${createHash('sha256').update(bytes).digest('hex')}`;
11
+ }
12
+ export function createTechnicalDocumentationRendererExecution(input) {
13
+ /*
14
+ * This built two sha256 fields until 2026-08-27: one over the renderer's own function bodies
15
+ * (`Function.prototype.toString()`), one over its configuration object. Neither was ever compared
16
+ * to anything — they rode into the manifest beside the `rendererRef` and `rendererVersion` that
17
+ * already say which renderer ran, in a form a reader can act on.
18
+ */
19
+ return {
20
+ rendererKind: input.rendererKind,
21
+ rendererRef: input.rendererRef,
22
+ rendererVersion: input.rendererVersion,
23
+ configurationRef: input.configurationRef,
24
+ };
25
+ }
26
+ function slugForUnit(unit) {
27
+ const source = unit.unitRef.split('/').at(-1) ?? unit.unitRef;
28
+ const slug = source.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
29
+ if (slug.length === 0)
30
+ throw new Error(`technical-documentation unit ${unit.unitRef} cannot produce a stable path`);
31
+ return slug;
32
+ }
33
+ /**
34
+ * Maps a published semantic unit to its consumer navigation home.
35
+ *
36
+ * This is deliberately renderer-owned rather than inferred from Markdown file
37
+ * names: the semantic unit is the stable composition input, while a renderer
38
+ * owns audience-facing URLs. The route table is deliberately organized by a
39
+ * customer's product responsibility—not the internal framework that implements
40
+ * it—so readers can find access, organization, security, billing and
41
+ * integration material without learning Wildo vocabulary. Application-domain
42
+ * use cases remain deferred to the app-creator flow, so an application-owned
43
+ * unit fails closed instead of acquiring an implicit route.
44
+ */
45
+ function pathForUnit(unit) {
46
+ const slug = slugForUnit(unit);
47
+ if (unit.unitRef.startsWith('technical-documentation:unit/')) {
48
+ const enginePaths = {
49
+ 'application-orientation': 'get-started',
50
+ authentication: 'access-and-identity/overview',
51
+ 'sign-in-and-mfa': 'access-and-identity/sign-in-and-mfa',
52
+ 'complete-sign-in': 'access-and-identity/complete-sign-in',
53
+ 'mfa-enrollment-and-recovery': 'access-and-identity/mfa-enrollment-and-recovery',
54
+ 'sign-in-troubleshoot': 'access-and-identity/sign-in-troubleshoot',
55
+ 'single-sign-on': 'access-and-identity/single-sign-on',
56
+ 'sso-configure': 'access-and-identity/sso-configure',
57
+ 'sso-rollout-and-recovery': 'access-and-identity/sso-rollout-and-recovery',
58
+ 'sso-troubleshoot': 'access-and-identity/sso-troubleshoot',
59
+ 'api-keys': 'access-and-identity/api-keys',
60
+ 'api-keys-create-and-store': 'access-and-identity/api-keys-create-and-store',
61
+ 'api-keys-lifecycle': 'access-and-identity/api-keys-lifecycle',
62
+ 'api-keys-troubleshoot': 'access-and-identity/api-keys-troubleshoot',
63
+ 'oauth-provider': 'access-and-identity/oauth-provider',
64
+ 'oauth-register-client': 'access-and-identity/oauth-register-client',
65
+ 'oauth-authorize-delegated-access': 'access-and-identity/oauth-authorize-delegated-access',
66
+ 'oauth-operate-and-revoke': 'access-and-identity/oauth-operate-and-revoke',
67
+ 'user-administration': 'user-administration',
68
+ 'manage-users-manually': 'user-administration/manage-users-manually',
69
+ 'invite-and-onboard-user': 'user-administration/invite-and-onboard-user',
70
+ 'organization-roles': 'user-administration/roles-and-permissions',
71
+ 'change-user-access': 'user-administration/change-user-access',
72
+ 'manage-organization-units': 'user-administration/manage-organization-units',
73
+ 'design-organization-unit-hierarchy': 'user-administration/design-organization-unit-hierarchy',
74
+ 'assign-organization-unit-access': 'user-administration/assign-organization-unit-access',
75
+ 'operate-organization-units': 'user-administration/operate-organization-units',
76
+ 'suspend-or-remove-user': 'user-administration/suspend-or-remove-user',
77
+ 'review-users-and-access': 'user-administration/review-users-and-access',
78
+ 'troubleshoot-user-access': 'user-administration/troubleshoot-user-access',
79
+ scim: 'user-administration/scim-provisioning',
80
+ 'scim-protocol-and-payloads': 'user-administration/scim-protocol-and-payloads',
81
+ 'scim-configure': 'user-administration/scim-configure',
82
+ 'scim-microsoft-entra': 'user-administration/scim-microsoft-entra',
83
+ 'scim-okta': 'user-administration/scim-okta',
84
+ 'scim-ldap-and-active-directory': 'user-administration/scim-ldap-and-active-directory',
85
+ 'scim-map-profile-and-units': 'user-administration/scim-map-profile-and-units',
86
+ 'scim-validate-and-roll-out': 'user-administration/scim-validate-and-roll-out',
87
+ 'scim-operate-and-troubleshoot': 'user-administration/scim-operate-and-troubleshoot',
88
+ 'audit-and-siem': 'security-and-audit',
89
+ 'investigate-audit-event': 'security-and-audit/investigate-event',
90
+ 'review-privileged-and-access-changes': 'security-and-audit/review-access-changes',
91
+ 'export-audit-records': 'security-and-audit/export-audit-records',
92
+ 'configure-siem-export': 'security-and-audit/configure-siem',
93
+ 'siem-splunk': 'security-and-audit/siem-splunk',
94
+ 'siem-microsoft-sentinel': 'security-and-audit/siem-microsoft-sentinel',
95
+ 'siem-elastic': 'security-and-audit/siem-elastic',
96
+ 'operate-and-troubleshoot-siem-delivery': 'security-and-audit/operate-siem',
97
+ 'protect-and-retain-audit-evidence': 'security-and-audit/protect-evidence',
98
+ billing: 'billing-and-subscriptions',
99
+ 'understand-billing-plans-and-access': 'billing-and-subscriptions/plans-and-access',
100
+ 'start-billing-subscription': 'billing-and-subscriptions/start-subscription',
101
+ 'change-or-end-billing-subscription': 'billing-and-subscriptions/change-or-end-subscription',
102
+ 'billing-records-and-usage': 'billing-and-subscriptions/billing-records',
103
+ 'manage-invoices-and-payments': 'billing-and-subscriptions/invoices-and-payments',
104
+ 'understand-metered-usage': 'billing-and-subscriptions/metered-usage',
105
+ 'reconcile-billing-and-access': 'billing-and-subscriptions/reconcile-access',
106
+ 'troubleshoot-billing-change': 'billing-and-subscriptions/troubleshoot',
107
+ integrations: 'integrations',
108
+ 'automation-platforms': 'integrations/automation-platforms',
109
+ 'connect-n8n': 'integrations/automation/n8n',
110
+ 'connect-zapier': 'integrations/automation/zapier',
111
+ 'connect-make': 'integrations/automation/make',
112
+ 'ai-coding-tools': 'integrations/ai-coding-tools',
113
+ 'connect-cursor': 'integrations/ai-tools/cursor',
114
+ 'connect-codex': 'integrations/ai-tools/codex',
115
+ 'connect-claude-code': 'integrations/ai-tools/claude-code',
116
+ 'agent-interoperability': 'integrations/agents',
117
+ 'mcp-integrations': 'integrations/mcp',
118
+ 'a2a-integrations': 'integrations/a2a',
119
+ 'first-request': 'integrations/create-your-own-integration',
120
+ 'common-rest-api': 'integrations/rest-api',
121
+ 'send-api-request': 'integrations/rest/send-request',
122
+ 'work-with-api-collections': 'integrations/rest/read-collections',
123
+ 'write-and-reconcile-api-changes': 'integrations/rest/write-and-reconcile',
124
+ 'troubleshoot-api-request': 'integrations/rest/troubleshoot',
125
+ webhooks: 'integrations/webhooks',
126
+ 'configure-and-test-webhook-endpoint': 'integrations/webhooks/configure-and-test',
127
+ 'verify-webhook-delivery': 'integrations/webhooks/verify-delivery',
128
+ 'operate-webhook-deliveries': 'integrations/webhooks/operate-deliveries',
129
+ 'troubleshoot-webhook-deliveries': 'integrations/webhooks/troubleshoot',
130
+ };
131
+ const path = enginePaths[slug];
132
+ if (path !== undefined)
133
+ return path;
134
+ throw new Error(`technical-documentation framework unit ${unit.unitRef} has no consumer navigation path`);
135
+ }
136
+ throw new Error(`technical-documentation unit ${unit.unitRef} has no consumer navigation category`);
137
+ }
138
+ export function createTechnicalDocumentationRenderModel(authorizedBundle) {
139
+ const unitPathByRef = new Map();
140
+ const occupiedPaths = new Set();
141
+ for (const unit of authorizedBundle.units) {
142
+ const path = pathForUnit(unit);
143
+ if (occupiedPaths.has(path))
144
+ throw new Error(`technical-documentation units collide on renderer path ${path}`);
145
+ occupiedPaths.add(path);
146
+ unitPathByRef.set(unit.unitRef, path);
147
+ }
148
+ return Object.freeze({
149
+ authorizedBundleIdentity: Object.freeze({ ref: authorizedBundle.bundleRef, version: authorizedBundle.bundleVersion }),
150
+ channel: authorizedBundle.channel,
151
+ units: Object.freeze([...authorizedBundle.units]),
152
+ unitPathByRef,
153
+ });
154
+ }
155
+ export function createTechnicalDocumentationAggregateRenderManifest(input) {
156
+ const rendererExecutions = input.rendererResults.map((result) => result.execution);
157
+ const outputs = input.rendererResults.flatMap((result) => result.files.map((file) => ({
158
+ outputRef: file.outputRef,
159
+ rendererRef: file.rendererRef,
160
+ outputKind: file.outputKind,
161
+ sourceUnitRefs: [...file.sourceUnitRefs],
162
+ normalizedRelativePath: TechnicalDocumentationNormalizedRelativePathSchema.parse(file.normalizedRelativePath),
163
+ mediaType: file.mediaType,
164
+ byteLength: file.bytes.byteLength,
165
+ byteDigest: technicalDocumentationSha256Bytes(file.bytes),
166
+ })));
167
+ return createTechnicalDocumentationRenderOutputManifestV1({
168
+ schemaVersion: 1,
169
+ renderRef: input.renderRef,
170
+ renderVersion: input.renderVersion,
171
+ authorizedBundleIdentity: { ref: input.authorizedBundle.bundleRef, version: input.authorizedBundle.bundleVersion },
172
+ resolvedAssetBundleIdentity: { ref: input.resolvedAssetBundle.assetBundleRef, version: input.resolvedAssetBundle.assetBundleVersion },
173
+ supportedApiVersion: input.supportedApiVersion,
174
+ rendererExecutions,
175
+ outputs,
176
+ });
177
+ }
178
+ //# sourceMappingURL=technical-documentation-render-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"technical-documentation-render-model.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-render-model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,kDAAkD,EAGlD,kDAAkD,GASnD,MAAM,uDAAuD,CAAC;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,iCAAiC,CAAC,KAAiB;IACjE,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACtE,CAAC;AAwBD,MAAM,UAAU,6CAA6C,CAAC,KAM7D;IACC;;;;;OAKG;IACH,OAAO;QACL,YAAY,EAAE,KAAK,CAAC,YAAY;QAChC,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,eAAe,EAAE,KAAK,CAAC,eAAe;QACtC,gBAAgB,EAAE,KAAK,CAAC,gBAAgB;KACzC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,IAAkC;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC;IAC9D,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;IACpF,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,CAAC,OAAO,+BAA+B,CAAC,CAAC;IACpH,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;GAWG;AAC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derOutputManifestV1,\n canonicalizeTechnicalDocumentationJson,\n TechnicalDocumentationOutputKind,\n TechnicalDocumentationNormalizedRelativePathSchema,\n TechnicalDocumentationRendererKind,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationRenderOutputManifestV1,\n type TechnicalDocumentationRendererExecutionV1,\n type TechnicalDocumentationVersionedIdentityV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationSupportedApiVersion,\n type TechnicalDocumentationUnitV1,\n} from '@wildo-ai/saas-specifications/technical-documentation';\n\n/**\n * Names opaque emitted bytes, and detects their corruption when a reader compares this against the\n * bytes it actually loaded. That two-sided check is why it survived the 2026-08-27 digest\n * demolition; its string-hashing sibling did not, because every caller of that one was recording\n * agreement between two parts of the repository rather than naming content.\n */\nexport function technicalDocumentationSha256Bytes(bytes: Uint8Array): string {\n return `sha256:${createHash('sha256').update(bytes).digest('hex')}`;\n}\n\nexport interface TechnicalDocumentationRenderModel {\n readonly authorizedBundleIdentity: TechnicalDocumentationVersionedIdentityV1;\n readonly channel: TechnicalDocumentationAuthorizedBundleManifestV1['channel'];\n readonly units: readonly TechnicalDocumentationUnitV1[];\n readonly unitPathByRef: ReadonlyMap<string, string>;\n}\n\nexport interface TechnicalDocumentationRenderedFile {\n readonly outputRef: string;\n readonly rendererRef: string;\n readonly outputKind: TechnicalDocumentationOutputKind;\n readonly sourceUnitRefs: readonly string[];\n readonly normalizedRelativePath: string;\n readonly mediaType: string;\n readonly bytes: Uint8Array;\n}\n\nexport interface TechnicalDocumentationRendererResult {\n readonly execution: TechnicalDocumentationRendererExecutionV1;\n readonly files: readonly TechnicalDocumentationRenderedFile[];\n}\n\nexport function createTechnicalDocumentationRendererExecution(input: {\n readonly rendererKind: TechnicalDocumentationRendererKind;\n readonly rendererRef: string;\n readonly rendererVersion: number;\n /** Names the renderer's configuration. `rendererRef@rendererVersion` names the implementation. */\n readonly configurationRef: string;\n}): TechnicalDocumentationRendererExecutionV1 {\n /*\n * This built two sha256 fields until 2026-08-27: one over the renderer's own function bodies\n * (`Function.prototype.toString()`), one over its configuration object. Neither was ever compared\n * to anything — they rode into the manifest beside the `rendererRef` and `rendererVersion` that\n * already say which renderer ran, in a form a reader can act on.\n */\n return {\n rendererKind: input.rendererKind,\n rendererRef: input.rendererRef,\n rendererVersion: input.rendererVersion,\n configurationRef: input.configurationRef,\n };\n}\n\nfunction slugForUnit(unit: TechnicalDocumentationUnitV1): string {\n const source = unit.unitRef.split('/').at(-1) ?? unit.unitRef;\n const slug = source.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');\n if (slug.length === 0) throw new Error(`technical-documentation unit ${unit.unitRef} cannot produce a stable path`);\n return slug;\n}\n\n/**\n * Maps a published semantic unit to its consumer navigation home.\n *\n * This is deliberately renderer-owned rather than inferred from Markdown file\n * names: the semantic unit is the stable composition input, while a renderer\n * owns audience-facing URLs. The route table is deliberately organized by a\n * customer's product responsibility—not the internal framework that implements\n * it—so readers can find access, organization, security, billing and\n * integration material without learning Wildo vocabulary. Application-domain\n * use cases remain deferred to the app-creator flow, so an application-owned\n * unit fails closed instead of acquiring an implicit route.\n */\nfunction pathForUnit(unit: TechnicalDocumentationUnitV1): string {\n const slug = slugForUnit(unit);\n if (unit.unitRef.startsWith('technical-documentation:unit/')) {\n const enginePaths: Readonly<Record<string, string>> = {\n 'application-orientation': 'get-started',\n authentication: 'access-and-identity/overview',\n 'sign-in-and-mfa': 'access-and-identity/sign-in-and-mfa',\n 'complete-sign-in': 'access-and-identity/complete-sign-in',\n 'mfa-enrollment-and-recovery': 'access-and-identity/mfa-enrollment-and-recovery',\n 'sign-in-troubleshoot': 'access-and-identity/sign-in-troubleshoot',\n 'single-sign-on': 'access-and-identity/single-sign-on',\n 'sso-configure': 'access-and-identity/sso-configure',\n 'sso-rollout-and-recovery': 'access-and-identity/sso-rollout-and-recovery',\n 'sso-troubleshoot': 'access-and-identity/sso-troubleshoot',\n 'api-keys': 'access-and-identity/api-keys',\n 'api-keys-create-and-store': 'access-and-identity/api-keys-create-and-store',\n 'api-keys-lifecycle': 'access-and-identity/api-keys-lifecycle',\n 'api-keys-troubleshoot': 'access-and-identity/api-keys-troubleshoot',\n 'oauth-provider': 'access-and-identity/oauth-provider',\n 'oauth-register-client': 'access-and-identity/oauth-register-client',\n 'oauth-authorize-delegated-access': 'access-and-identity/oauth-authorize-delegated-access',\n 'oauth-operate-and-revoke': 'access-and-identity/oauth-operate-and-revoke',\n 'user-administration': 'user-administration',\n 'manage-users-manually': 'user-administration/manage-users-manually',\n 'invite-and-onboard-user': 'user-administration/invite-and-onboard-user',\n 'organization-roles': 'user-administration/roles-and-permissions',\n 'change-user-access': 'user-administration/change-user-access',\n 'manage-organization-units': 'user-administration/manage-organization-units',\n 'design-organization-unit-hierarchy': 'user-administration/design-organization-unit-hierarchy',\n 'assign-organization-unit-access': 'user-administration/assign-organization-unit-access',\n 'operate-organization-units': 'user-administration/operate-organization-units',\n 'suspend-or-remove-user': 'user-administration/suspend-or-remove-user',\n 'review-users-and-access': 'user-administration/review-users-and-access',\n 'troubleshoot-user-access': 'user-administration/troubleshoot-user-access',\n scim: 'user-administration/scim-provisioning',\n 'scim-protocol-and-payloads': 'user-administration/scim-protocol-and-payloads',\n 'scim-configure': 'user-administration/scim-configure',\n 'scim-microsoft-entra': 'user-administration/scim-microsoft-entra',\n 'scim-okta': 'user-administration/scim-okta',\n 'scim-ldap-and-active-directory': 'user-administration/scim-ldap-and-active-directory',\n 'scim-map-profile-and-units': 'user-administration/scim-map-profile-and-units',\n 'scim-validate-and-roll-out': 'user-administration/scim-validate-and-roll-out',\n 'scim-operate-and-troubleshoot': 'user-administration/scim-operate-and-troubleshoot',\n 'audit-and-siem': 'security-and-audit',\n 'investigate-audit-event': 'security-and-audit/investigate-event',\n 'review-privileged-and-access-changes': 'security-and-audit/review-access-changes',\n 'export-audit-records': 'security-and-audit/export-audit-records',\n 'configure-siem-export': 'security-and-audit/configure-siem',\n 'siem-splunk': 'security-and-audit/siem-splunk',\n 'siem-microsoft-sentinel': 'security-and-audit/siem-microsoft-sentinel',\n 'siem-elastic': 'security-and-audit/siem-elastic',\n 'operate-and-troubleshoot-siem-delivery': 'security-and-audit/operate-siem',\n 'protect-and-retain-audit-evidence': 'security-and-audit/protect-evidence',\n billing: 'billing-and-subscriptions',\n 'understand-billing-plans-and-access': 'billing-and-subscriptions/plans-and-access',\n 'start-billing-subscription': 'billing-and-subscriptions/start-subscription',\n 'change-or-end-billing-subscription': 'billing-and-subscriptions/change-or-end-subscription',\n 'billing-records-and-usage': 'billing-and-subscriptions/billing-records',\n 'manage-invoices-and-payments': 'billing-and-subscriptions/invoices-and-payments',\n 'understand-metered-usage': 'billing-and-subscriptions/metered-usage',\n 'reconcile-billing-and-access': 'billing-and-subscriptions/reconcile-access',\n 'troubleshoot-billing-change': 'billing-and-subscriptions/troubleshoot',\n integrations: 'integrations',\n 'automation-platforms': 'integrations/automation-platforms',\n 'connect-n8n': 'integrations/automation/n8n',\n 'connect-zapier': 'integrations/automation/zapier',\n 'connect-make': 'integrations/automation/make',\n 'ai-coding-tools': 'integrations/ai-coding-tools',\n 'connect-cursor': 'integrations/ai-tools/cursor',\n 'connect-codex': 'integrations/ai-tools/codex',\n 'connect-claude-code': 'integrations/ai-tools/claude-code',\n 'agent-interoperability': 'integrations/agents',\n 'mcp-integrations': 'integrations/mcp',\n 'a2a-integrations': 'integrations/a2a',\n 'first-request': 'integrations/create-your-own-integration',\n 'common-rest-api': 'integrations/rest-api',\n 'send-api-request': 'integrations/rest/send-request',\n 'work-with-api-collections': 'integrations/rest/read-collections',\n 'write-and-reconcile-api-changes': 'integrations/rest/write-and-reconcile',\n 'troubleshoot-api-request': 'integrations/rest/troubleshoot',\n webhooks: 'integrations/webhooks',\n 'configure-and-test-webhook-endpoint': 'integrations/webhooks/configure-and-test',\n 'verify-webhook-delivery': 'integrations/webhooks/verify-delivery',\n 'operate-webhook-deliveries': 'integrations/webhooks/operate-deliveries',\n 'troubleshoot-webhook-deliveries': 'integrations/webhooks/troubleshoot',\n };\n const path = enginePaths[slug];\n if (path !== undefined) return path;\n throw new Error(`technical-documentation framework unit ${unit.unitRef} has no consumer navigation path`);\n }\n throw new Error(`technical-documentation unit ${unit.unitRef} has no consumer navigation category`);\n}\n\nexport function createTechnicalDocumentationRenderModel(\n authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1,\n): TechnicalDocumentationRenderModel {\n const unitPathByRef = new Map<string, string>();\n const occupiedPaths = new Set<string>();\n for (const unit of authorizedBundle.units) {\n const path = pathForUnit(unit);\n if (occupiedPaths.has(path)) throw new Error(`technical-documentation units collide on renderer path ${path}`);\n occupiedPaths.add(path);\n unitPathByRef.set(unit.unitRef, path);\n }\n return Object.freeze({\n authorizedBundleIdentity: Object.freeze({ ref: authorizedBundle.bundleRef, version: authorizedBundle.bundleVersion }),\n channel: authorizedBundle.channel,\n units: Object.freeze([...authorizedBundle.units]),\n unitPathByRef,\n });\n}\n\nexport function createTechnicalDocumentationAggregateRenderManifest(input: {\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly rendererResults: readonly TechnicalDocumentationRendererResult[];\n /** This render's own identity; the publication pointer selects a render by it. */\n readonly renderRef: string;\n readonly renderVersion: number;\n}): TechnicalDocumentationRenderOutputManifestV1 {\n const rendererExecutions = input.rendererResults.map((result) => result.execution);\n const outputs = input.rendererResults.flatMap((result) => result.files.map((file) => ({\n outputRef: file.outputRef,\n rendererRef: file.rendererRef,\n outputKind: file.outputKind,\n sourceUnitRefs: [...file.sourceUnitRefs],\n normalizedRelativePath: TechnicalDocumentationNormalizedRelativePathSchema.parse(file.normalizedRelativePath),\n mediaType: file.mediaType,\n byteLength: file.bytes.byteLength,\n byteDigest: technicalDocumentationSha256Bytes(file.bytes),\n })));\n return createTechnicalDocumentationRenderOutputManifestV1({\n schemaVersion: 1,\n renderRef: input.renderRef,\n renderVersion: input.renderVersion,\n authorizedBundleIdentity: { ref: input.authorizedBundle.bundleRef, version: input.authorizedBundle.bundleVersion },\n resolvedAssetBundleIdentity: { ref: input.resolvedAssetBundle.assetBundleRef, version: input.resolvedAssetBundle.assetBundleVersion },\n supportedApiVersion: input.supportedApiVersion,\n rendererExecutions,\n outputs,\n });\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { type TechnicalDocumentationRenderModel, type TechnicalDocumentationRendererResult } from './technical-documentation-render-model';
2
+ export declare function renderTechnicalDocumentationSearchIndexes(model: TechnicalDocumentationRenderModel): TechnicalDocumentationRendererResult;
3
+ //# sourceMappingURL=technical-documentation-search-index-renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"technical-documentation-search-index-renderer.d.ts","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-search-index-renderer.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EAC1C,MAAM,wCAAwC,CAAC;AAIhD,wBAAgB,yCAAyC,CAAC,KAAK,EAAE,iCAAiC,GAAG,oCAAoC,CA4CxI"}
@@ -0,0 +1,49 @@
1
+ import { TechnicalDocumentationOutputKind, TechnicalDocumentationRendererKind } from '@wildo-ai/saas-specifications/technical-documentation';
2
+ import { createTechnicalDocumentationRendererExecution, } from './technical-documentation-render-model.js';
3
+ const SEARCH_RENDERER_REF = 'technical-documentation:renderer/search-index';
4
+ export function renderTechnicalDocumentationSearchIndexes(model) {
5
+ const sourceUnitRefs = model.units.map((unit) => unit.unitRef);
6
+ const navigation = model.units.map((unit) => ({
7
+ unitRef: unit.unitRef,
8
+ title: unit.title,
9
+ kind: unit.kind,
10
+ path: `/${model.unitPathByRef.get(unit.unitRef)}`,
11
+ }));
12
+ const search = model.units.map((unit) => ({
13
+ unitRef: unit.unitRef,
14
+ title: unit.title,
15
+ summary: unit.summary,
16
+ headings: unit.sections.map((section) => section.heading),
17
+ readerAudiences: unit.readerAudiences,
18
+ path: `/${model.unitPathByRef.get(unit.unitRef)}`,
19
+ }));
20
+ return {
21
+ execution: createTechnicalDocumentationRendererExecution({
22
+ rendererKind: TechnicalDocumentationRendererKind.MARKDOWN,
23
+ rendererRef: SEARCH_RENDERER_REF,
24
+ rendererVersion: 1,
25
+ configurationRef: 'technical-documentation:renderer-configuration/search-index-json-v1',
26
+ }),
27
+ files: [
28
+ {
29
+ outputRef: 'technical-documentation:output/navigation-index',
30
+ rendererRef: SEARCH_RENDERER_REF,
31
+ outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,
32
+ sourceUnitRefs,
33
+ normalizedRelativePath: 'indexes/navigation.json',
34
+ mediaType: 'application/json',
35
+ bytes: Buffer.from(`${JSON.stringify({ schemaVersion: 1, units: navigation }, null, 2)}\n`, 'utf8'),
36
+ },
37
+ {
38
+ outputRef: 'technical-documentation:output/search-index',
39
+ rendererRef: SEARCH_RENDERER_REF,
40
+ outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,
41
+ sourceUnitRefs,
42
+ normalizedRelativePath: 'indexes/search.json',
43
+ mediaType: 'application/json',
44
+ bytes: Buffer.from(`${JSON.stringify({ schemaVersion: 1, units: search }, null, 2)}\n`, 'utf8'),
45
+ },
46
+ ],
47
+ };
48
+ }
49
+ //# sourceMappingURL=technical-documentation-search-index-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"technical-documentation-search-index-renderer.js","sourceRoot":"","sources":["../../../../../src/companion/rendering/technical-documentation-search-index-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,kCAAkC,EAAE,MAAM,uDAAuD,CAAC;AAE7I,OAAO,EACL,6CAA6C,GAG9C,MAAM,wCAAwC,CAAC;AAEhD,MAAM,mBAAmB,GAAG,+CAA+C,CAAC;AAE5E,MAAM,UAAU,yCAAyC,CAAC,KAAwC;IAChG,MAAM,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BACjD,SAAS,EAAE,kBAAkB;gBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC;aACpG;YACD;gBACE,SAAS,EAAE,6CAA6C;gBACxD,WAAW,EAAE,mBAAmB;gBAChC,UAAU,EAAE,gCAAgC,CAAC,gBAAgB;gBAC7D,cAAc;gBACd,sBAAsB,EAAE,qBAAqB;gBAC7C,SAAS,EAAE,kBAAkB;gBAC7B,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC;aAChG;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { TechnicalDocumentationOutputKind, TechnicalDocumentationRendererKind } from '@wildo-ai/saas-specifications/technical-documentation';\n\nimport {\n createTechnicalDocumentationRendererExecution,\n type TechnicalDocumentationRenderModel,\n type TechnicalDocumentationRendererResult,\n} from './technical-documentation-render-model';\n\nconst SEARCH_RENDERER_REF = 'technical-documentation:renderer/search-index';\n\nexport function renderTechnicalDocumentationSearchIndexes(model: TechnicalDocumentationRenderModel): TechnicalDocumentationRendererResult {\n const sourceUnitRefs = model.units.map((unit) => unit.unitRef);\n const navigation = model.units.map((unit) => ({\n unitRef: unit.unitRef,\n title: unit.title,\n kind: unit.kind,\n path: `/${model.unitPathByRef.get(unit.unitRef)}`,\n }));\n const search = model.units.map((unit) => ({\n unitRef: unit.unitRef,\n title: unit.title,\n summary: unit.summary,\n headings: unit.sections.map((section) => section.heading),\n readerAudiences: unit.readerAudiences,\n path: `/${model.unitPathByRef.get(unit.unitRef)}`,\n }));\n return {\n execution: createTechnicalDocumentationRendererExecution({\n rendererKind: TechnicalDocumentationRendererKind.MARKDOWN,\n rendererRef: SEARCH_RENDERER_REF,\n rendererVersion: 1,\n configurationRef: 'technical-documentation:renderer-configuration/search-index-json-v1',\n }),\n files: [\n {\n outputRef: 'technical-documentation:output/navigation-index',\n rendererRef: SEARCH_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,\n sourceUnitRefs,\n normalizedRelativePath: 'indexes/navigation.json',\n mediaType: 'application/json',\n bytes: Buffer.from(`${JSON.stringify({ schemaVersion: 1, units: navigation }, null, 2)}\\n`, 'utf8'),\n },\n {\n outputRef: 'technical-documentation:output/search-index',\n rendererRef: SEARCH_RENDERER_REF,\n outputKind: TechnicalDocumentationOutputKind.NAVIGATION_INDEX,\n sourceUnitRefs,\n normalizedRelativePath: 'indexes/search.json',\n mediaType: 'application/json',\n bytes: Buffer.from(`${JSON.stringify({ schemaVersion: 1, units: search }, null, 2)}\\n`, 'utf8'),\n },\n ],\n };\n}\n"]}
@@ -0,0 +1,176 @@
1
+ /**
2
+ * @wildo-package @wildo-ai/saas-technical-doc/companion (spec → OpenAPI enrichment)
3
+ *
4
+ * Pure mappers from a resource SPECIFICATION's authored prose into OpenAPI:
5
+ * - **Tier 1** `buildOperationDocFromSpec` — operation `purpose` / `outcome` /
6
+ * `whenToUse` (with per-variant overrides) → operation `description` on an
7
+ * `OperationProjection`. The `summary` (operation TITLE) is intentionally NOT
8
+ * produced here: it is a short verb-first label the generator derives
9
+ * (`buildDefaultSummary`), kept separate from the authored prose.
10
+ * - **Tier 2** `injectFieldDocsIntoJsonSchema` — per-field `meaning` /
11
+ * `whyItMatters` / `relationshipContext` / enum-value meanings → property
12
+ * `description` + `x-enum-descriptions` on a request/response JSON-Schema
13
+ * fragment.
14
+ *
15
+ * See `.claude/plans/technical-doc-openapi-spec-integration.md`. Without authored
16
+ * spec prose the description is empty and the operation falls back to the
17
+ * generator's humanized verb-first title alone (e.g. `"List users"`) with no
18
+ * field documentation — the "quality will be very poor" failure mode this
19
+ * integration removes.
20
+ *
21
+ * @wildo-boundary
22
+ * Imports NOTHING — pure string composition. It deliberately declares its
23
+ * own NARROW structural input types instead of importing
24
+ * `ResourceOperationSpecification` / `ResourceOperationVariantSpecification`
25
+ * from `@wildo-ai/saas-specifications`. Same K-3 boundary reasoning the rest
26
+ * of `companion/` follows (see `operation-projection.schemas.ts`): pulling
27
+ * the spec package would drag a heavy type graph into the decorator-free
28
+ * technical-doc companion bundle. The types below MUST remain a structural
29
+ * SUBSET of the authored spec types — only the prose fields this mapper
30
+ * reads. If the spec layer renames a prose field, update these in lockstep.
31
+ */
32
+ /**
33
+ * Narrow structural view of a per-variant operation spec — the prose fields
34
+ * a variant may override. Subset of `ResourceOperationVariantSpecification`.
35
+ */
36
+ export interface OperationSpecVariantProse {
37
+ purpose?: string;
38
+ outcome?: string;
39
+ whenToUse?: string;
40
+ /** Complete OpenAPI example replacement for this response-shape variant. */
41
+ examples?: Array<{
42
+ title: string;
43
+ request?: unknown;
44
+ response?: unknown;
45
+ forStatus?: string;
46
+ }>;
47
+ }
48
+ /**
49
+ * Narrow structural view of an operation spec — the base prose plus the
50
+ * per-variant overrides map. Subset of `ResourceOperationSpecification`.
51
+ * `variants` is keyed by the named variant key, with the reserved `'default'`
52
+ * key for the no-`variantKey` (default-variant) path.
53
+ */
54
+ export interface OperationSpecProse {
55
+ purpose?: string;
56
+ outcome?: string;
57
+ whenToUse?: string;
58
+ variants?: Record<string, OperationSpecVariantProse | undefined>;
59
+ }
60
+ /** The OpenAPI prose this mapper produces. Both fields optional. */
61
+ export interface OperationDoc {
62
+ summary?: string;
63
+ description?: string;
64
+ }
65
+ /**
66
+ * Strip implementation-only noise that authored spec prose carries for the
67
+ * FRAMEWORK-KNOWLEDGE audience but that means nothing to an API consumer
68
+ * reading the generated docs:
69
+ * - Parentheticals naming a runtime variant — `(API_CALL in factory)`,
70
+ * `(REPOSITORY_ONLY create in factory — …)`.
71
+ * - Dangling `in factory` / `in the factory` phrases.
72
+ * Then normalise the leftover spacing/punctuation. Conservative by design — it
73
+ * only removes parentheticals that actually contain a variant marker, so
74
+ * ordinary parenthetical prose survives.
75
+ *
76
+ * This is the single canonical "spec prose → consumer prose" cleaner, applied
77
+ * to EVERY prose surface that reaches the OpenAPI output: the Tier-1 operation
78
+ * `description` (here), Tier-2 field descriptions + `x-enum-descriptions`
79
+ * (`composeFieldDescription` / `cleanEnumMeanings`), Tier-3 response/error/
80
+ * example/rate-limit prose (`asCleanProse`), and the resource `tags[].description`
81
+ * (applied by the generator — `openapi-generator.ts` imports this). Exported so
82
+ * those out-of-module surfaces clean prose identically rather than diverging.
83
+ */
84
+ export declare const stripImplementationNoise: (value: string) => string;
85
+ /**
86
+ * Resolve the EFFECTIVE prose for an operation, applying variant overlay
87
+ * semantics: a present variant field REPLACES the base field; an absent
88
+ * variant field falls back to the base. `variantKey === undefined` resolves
89
+ * the reserved `'default'` variant.
90
+ *
91
+ * Returns `{}` when the spec is absent or carries no prose at all — callers
92
+ * leave `OperationProjection.summary` / `.description` unset so the
93
+ * generator's humanized fallback applies (graceful degradation for
94
+ * operations / resources with no authored spec).
95
+ */
96
+ export declare const buildOperationDocFromSpec: (operationSpec: OperationSpecProse | undefined, variantKey: string | undefined) => OperationDoc;
97
+ /**
98
+ * Narrow structural view of one field's authored documentation. Built by the
99
+ * companion projector from the extracted resource field specs and consumed by
100
+ * `injectFieldDocsIntoJsonSchema`. Boundary-clean (no `@wildo-ai/saas-specifications`
101
+ * import): the projector maps `ExtractedFieldSpec.params.{meaning,whyItMatters,
102
+ * relationshipContext,values}` into this shape before calling the injector.
103
+ */
104
+ export interface FieldDoc {
105
+ /** Business meaning of the field (becomes the lead of the property description). */
106
+ meaning?: string;
107
+ /** Why the field is included (appended to the description). */
108
+ whyItMatters?: string;
109
+ /** For foreign keys: the relationship this field expresses. */
110
+ relationshipContext?: string;
111
+ /** For enum fields: enum value string → authored meaning. */
112
+ enumValueMeanings?: Record<string, string>;
113
+ }
114
+ /**
115
+ * Enrich the TOP-LEVEL properties of an OpenAPI/JSON-Schema object fragment
116
+ * (a `requestBodySchema` / `responseBodySchema` produced by
117
+ * `convertZodSchemaToOpenApiSchema`) with authored field documentation.
118
+ * Mutates `fragment` in place.
119
+ *
120
+ * Rules:
121
+ * - Property `description` is composed from the field's docs ONLY when the
122
+ * property has no existing `description` — a Zod `.describe()` authored on
123
+ * the DTO field wins (it is closer to the wire contract).
124
+ * - `x-enum-descriptions` (value → meaning) is set whenever enum meanings
125
+ * exist, independent of the description-clobber rule, for machine consumers.
126
+ *
127
+ * Only top-level properties are walked: the field-spec extractor produces
128
+ * specs for top-level schema fields only, so nested-object properties have no
129
+ * authored docs to apply. No-op for non-object fragments (`null`, scalars).
130
+ * Joins by EXACT property-name match — DTO property names that diverge from
131
+ * the resource's field names (renamed / computed / backend-stripped fields)
132
+ * are simply left undocumented rather than mis-documented.
133
+ */
134
+ export declare const injectFieldDocsIntoJsonSchema: (fragment: unknown, fieldDocsByName: Record<string, FieldDoc>) => void;
135
+ /**
136
+ * Projection-shaped HTTP documentation for one operation (Tier 3). Mirrors the
137
+ * authored `ResourceOperationSpecification` HTTP fields, normalized to plain
138
+ * JSON the OpenAPI generator emits as `responses` / `examples` / extensions.
139
+ */
140
+ export interface OperationHttpDoc {
141
+ responseStatuses?: Array<{
142
+ code: string;
143
+ meaning: string;
144
+ }>;
145
+ errorScenarios?: Array<{
146
+ code: string;
147
+ when: string;
148
+ errorCode?: string;
149
+ }>;
150
+ idempotent?: boolean;
151
+ rateLimitNote?: string;
152
+ examples?: Array<{
153
+ title: string;
154
+ request?: unknown;
155
+ response?: unknown;
156
+ forStatus?: string;
157
+ }>;
158
+ }
159
+ /**
160
+ * Extract + normalize the Tier-3 HTTP-documentation fields from a raw authored
161
+ * operation spec into the projection shape. Variant examples are a complete
162
+ * overlay: when `variants.<key>.examples` is present it replaces the base
163
+ * operation examples, rather than merging a payload that may target a different
164
+ * response schema. Defensive: a malformed entry is dropped rather than
165
+ * poisoning the whole projection (the generator re-validates via Zod). Returns
166
+ * `{}` when the operation authored no HTTP docs.
167
+ *
168
+ * Prose fields (`meaning` / `when` / `title` / `rateLimitNote`) are cleaned of
169
+ * implementation-only noise via `asCleanProse`, consistent with the Tier-1
170
+ * `description` and Tier-2 field descriptions. `code` / `forStatus` /
171
+ * `errorCode` are `HttpResponseStatusCode` / error-code enum values whose
172
+ * runtime string value (`'200'`, …) is the OpenAPI `responses` key / a machine
173
+ * code, so they pass through untouched as strings.
174
+ */
175
+ export declare const buildOperationHttpDocFromSpec: (operationSpec: unknown, variantKey?: string) => OperationHttpDoc;
176
+ //# sourceMappingURL=spec-to-operation-doc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-to-operation-doc.d.ts","sourceRoot":"","sources":["../../../../src/companion/spec-to-operation-doc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChG;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,GAAG,SAAS,CAAC,CAAC;CAClE;AAED,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,OAAO,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