@wildo-ai/dev-companion 1.1.14 → 1.1.16

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 (191) hide show
  1. package/dist/esm/.tsbuildinfo +1 -1
  2. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts +233 -6
  3. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.d.ts.map +1 -1
  4. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js +316 -13
  5. package/dist/esm/claude-cli/models/coding-agent-dispatch.models.js.map +1 -1
  6. package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts +48 -2
  7. package/dist/esm/claude-cli/models/concurrent-coding-runs.models.d.ts.map +1 -1
  8. package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js +41 -3
  9. package/dist/esm/claude-cli/models/concurrent-coding-runs.models.js.map +1 -1
  10. package/dist/esm/claude-cli/models/isolated-recheck-interference.models.d.ts +68 -0
  11. package/dist/esm/claude-cli/models/isolated-recheck-interference.models.d.ts.map +1 -0
  12. package/dist/esm/claude-cli/models/isolated-recheck-interference.models.js +198 -0
  13. package/dist/esm/claude-cli/models/isolated-recheck-interference.models.js.map +1 -0
  14. package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts +6 -0
  15. package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.d.ts.map +1 -1
  16. package/dist/esm/claude-cli/models/shared-tree-reconciliation.models.js.map +1 -1
  17. package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts +19 -5
  18. package/dist/esm/claude-cli/models/verification-tool-availability.models.d.ts.map +1 -1
  19. package/dist/esm/claude-cli/models/verification-tool-availability.models.js +17 -5
  20. package/dist/esm/claude-cli/models/verification-tool-availability.models.js.map +1 -1
  21. package/dist/esm/claude-cli/models/workspace-path-claims.models.d.ts +138 -0
  22. package/dist/esm/claude-cli/models/workspace-path-claims.models.d.ts.map +1 -0
  23. package/dist/esm/claude-cli/models/workspace-path-claims.models.js +204 -0
  24. package/dist/esm/claude-cli/models/workspace-path-claims.models.js.map +1 -0
  25. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts +36 -1
  26. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.d.ts.map +1 -1
  27. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js +71 -16
  28. package/dist/esm/claude-cli/services/accepted-change-commit.companion.service.js.map +1 -1
  29. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts +234 -9
  30. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.d.ts.map +1 -1
  31. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js +1073 -182
  32. package/dist/esm/claude-cli/services/coding-agent-dispatch.companion.service.js.map +1 -1
  33. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts +14 -0
  34. package/dist/esm/claude-cli/services/research-evidence-store.companion.d.ts.map +1 -1
  35. package/dist/esm/claude-cli/services/research-evidence-store.companion.js +35 -0
  36. package/dist/esm/claude-cli/services/research-evidence-store.companion.js.map +1 -1
  37. package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts +36 -0
  38. package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.d.ts.map +1 -0
  39. package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js +134 -0
  40. package/dist/esm/claude-cli/services/unrecorded-provider-directories.companion.js.map +1 -0
  41. package/dist/esm/companion-api/controllers/companion.controller.d.ts.map +1 -1
  42. package/dist/esm/companion-api/controllers/companion.controller.js +7 -1
  43. package/dist/esm/companion-api/controllers/companion.controller.js.map +1 -1
  44. package/dist/esm/core/introspection/resources/creation-home-projection.companion.js +1 -1
  45. package/dist/esm/core/introspection/resources/creation-home-projection.companion.js.map +1 -1
  46. package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts +3 -2
  47. package/dist/esm/core/introspection/services/translation-placement.companion.service.d.ts.map +1 -1
  48. package/dist/esm/core/introspection/services/translation-placement.companion.service.js.map +1 -1
  49. package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.d.ts +13 -0
  50. package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.d.ts.map +1 -1
  51. package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.js +98 -16
  52. package/dist/esm/core/introspection/subprocess/app-shell-placement-content.behavior.js.map +1 -1
  53. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.d.ts.map +1 -1
  54. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js +24 -14
  55. package/dist/esm/core/introspection/subprocess/companion-introspection-behavior-handlers.js.map +1 -1
  56. package/dist/esm/core/introspection/workspace-element-index.companion.d.ts +42 -0
  57. package/dist/esm/core/introspection/workspace-element-index.companion.d.ts.map +1 -1
  58. package/dist/esm/core/introspection/workspace-element-index.companion.js +42 -0
  59. package/dist/esm/core/introspection/workspace-element-index.companion.js.map +1 -1
  60. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts +53 -0
  61. package/dist/esm/core/runtime/dev-compile-quiet.companion.d.ts.map +1 -1
  62. package/dist/esm/core/runtime/dev-compile-quiet.companion.js +119 -2
  63. package/dist/esm/core/runtime/dev-compile-quiet.companion.js.map +1 -1
  64. package/dist/esm/core/runtime/services/start-companion-application.service.d.ts.map +1 -1
  65. package/dist/esm/core/runtime/services/start-companion-application.service.js +13 -1
  66. package/dist/esm/core/runtime/services/start-companion-application.service.js.map +1 -1
  67. package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts +2 -2
  68. package/dist/esm/core/runtime/utils/companion-platform-config.companion.d.ts.map +1 -1
  69. package/dist/esm/core/runtime/utils/companion-platform-config.companion.js +6 -6
  70. package/dist/esm/core/runtime/utils/companion-platform-config.companion.js.map +1 -1
  71. package/dist/esm/email/services/email-template.companion.service.d.ts +5 -0
  72. package/dist/esm/email/services/email-template.companion.service.d.ts.map +1 -1
  73. package/dist/esm/email/services/email-template.companion.service.js +44 -11
  74. package/dist/esm/email/services/email-template.companion.service.js.map +1 -1
  75. package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts +26 -2
  76. package/dist/esm/email/utils/email-template-fs-discovery.utils.d.ts.map +1 -1
  77. package/dist/esm/email/utils/email-template-fs-discovery.utils.js +41 -2
  78. package/dist/esm/email/utils/email-template-fs-discovery.utils.js.map +1 -1
  79. package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts +19 -0
  80. package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.d.ts.map +1 -0
  81. package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js +171 -0
  82. package/dist/esm/email/utils/email-template-scanner-calls.companion.utils.js.map +1 -0
  83. package/dist/esm/email/utils/module-email-root.companion.utils.d.ts +75 -0
  84. package/dist/esm/email/utils/module-email-root.companion.utils.d.ts.map +1 -0
  85. package/dist/esm/email/utils/module-email-root.companion.utils.js +162 -0
  86. package/dist/esm/email/utils/module-email-root.companion.utils.js.map +1 -0
  87. package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts +21 -1
  88. package/dist/esm/expert-personas/services/expert-persona.companion.service.d.ts.map +1 -1
  89. package/dist/esm/expert-personas/services/expert-persona.companion.service.js +35 -3
  90. package/dist/esm/expert-personas/services/expert-persona.companion.service.js.map +1 -1
  91. package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.d.ts +62 -0
  92. package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.d.ts.map +1 -0
  93. package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.js +62 -0
  94. package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.en.js.map +1 -0
  95. package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.d.ts +62 -0
  96. package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.d.ts.map +1 -0
  97. package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.js +62 -0
  98. package/dist/esm/i18n/components/APP_LAYOUTS_AGENT_ACTIVITY_SETTINGS.fr.js.map +1 -0
  99. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts +1 -0
  100. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.d.ts.map +1 -1
  101. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js +1 -0
  102. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.en.js.map +1 -1
  103. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts +1 -0
  104. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.d.ts.map +1 -1
  105. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js +1 -0
  106. package/dist/esm/i18n/components/LOW_LEVEL_AI_AGENT_CONFIG.fr.js.map +1 -1
  107. package/dist/esm/i18n/resources/workbenchAspects.en.d.ts.map +1 -1
  108. package/dist/esm/i18n/resources/workbenchAspects.en.js +4 -0
  109. package/dist/esm/i18n/resources/workbenchAspects.en.js.map +1 -1
  110. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts +35 -0
  111. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.d.ts.map +1 -1
  112. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js +12 -0
  113. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.en.js.map +1 -1
  114. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts +536 -531
  115. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.d.ts.map +1 -1
  116. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js +536 -531
  117. package/dist/esm/i18n/resources/workbenchSpecificationArtifacts.fr.js.map +1 -1
  118. package/dist/esm/i18n/system_enums/workbench-build.en.d.ts +3 -3
  119. package/dist/esm/i18n/system_enums/workbench-build.en.js +3 -3
  120. package/dist/esm/i18n/system_enums/workbench-build.en.js.map +1 -1
  121. package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.d.ts.map +1 -1
  122. package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js +7 -3
  123. package/dist/esm/i18n-labelling/services/email-template-labelling-units.companion.service.js.map +1 -1
  124. package/dist/esm/meta-workflows/models/carried-verification-failure.models.d.ts +23 -0
  125. package/dist/esm/meta-workflows/models/carried-verification-failure.models.d.ts.map +1 -1
  126. package/dist/esm/meta-workflows/models/carried-verification-failure.models.js +14 -0
  127. package/dist/esm/meta-workflows/models/carried-verification-failure.models.js.map +1 -1
  128. package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts +21 -1
  129. package/dist/esm/meta-workflows/models/creation-journey-timeline.models.d.ts.map +1 -1
  130. package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js +117 -3
  131. package/dist/esm/meta-workflows/models/creation-journey-timeline.models.js.map +1 -1
  132. package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts +5 -0
  133. package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.d.ts.map +1 -1
  134. package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js +22 -1
  135. package/dist/esm/meta-workflows/services/application-assembly-checks.companion.utils.js.map +1 -1
  136. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts +98 -24
  137. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.d.ts.map +1 -1
  138. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js +439 -93
  139. package/dist/esm/meta-workflows/services/application-build-dispatch.companion.service.js.map +1 -1
  140. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts +21 -8
  141. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.d.ts.map +1 -1
  142. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js +74 -12
  143. package/dist/esm/meta-workflows/services/application-build-follow-up-derivation.companion.js.map +1 -1
  144. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts +47 -1
  145. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.d.ts.map +1 -1
  146. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js +98 -9
  147. package/dist/esm/meta-workflows/services/application-build-generation-step.companion.service.js.map +1 -1
  148. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts +39 -3
  149. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.d.ts.map +1 -1
  150. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js +224 -48
  151. package/dist/esm/meta-workflows/services/application-build-task-coding-policy.companion.service.js.map +1 -1
  152. package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts +45 -0
  153. package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.d.ts.map +1 -1
  154. package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js +74 -0
  155. package/dist/esm/meta-workflows/services/application-build-website-context.companion.service.js.map +1 -1
  156. package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts +12 -0
  157. package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.d.ts.map +1 -1
  158. package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js +30 -1
  159. package/dist/esm/meta-workflows/services/build-task-brief-application-facts.companion.js.map +1 -1
  160. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.d.ts.map +1 -1
  161. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js +21 -2
  162. package/dist/esm/meta-workflows/services/creation-run-report.companion.service.js.map +1 -1
  163. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts +71 -5
  164. package/dist/esm/meta-workflows/services/playbook-run.companion.service.d.ts.map +1 -1
  165. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js +219 -17
  166. package/dist/esm/meta-workflows/services/playbook-run.companion.service.js.map +1 -1
  167. package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts +55 -1
  168. package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.d.ts.map +1 -1
  169. package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js +157 -10
  170. package/dist/esm/meta-workflows/services/provider-registry-brief.companion.utils.js.map +1 -1
  171. package/dist/esm/meta-workflows/services/website-demo-facts.models.d.ts +19 -1
  172. package/dist/esm/meta-workflows/services/website-demo-facts.models.d.ts.map +1 -1
  173. package/dist/esm/meta-workflows/services/website-demo-facts.models.js +7 -5
  174. package/dist/esm/meta-workflows/services/website-demo-facts.models.js.map +1 -1
  175. package/dist/esm/module-layout/module-layout-convention.companion.d.ts +158 -0
  176. package/dist/esm/module-layout/module-layout-convention.companion.d.ts.map +1 -0
  177. package/dist/esm/module-layout/module-layout-convention.companion.js +272 -0
  178. package/dist/esm/module-layout/module-layout-convention.companion.js.map +1 -0
  179. package/dist/esm/module-layout/module-layout-inspection.companion.d.ts +42 -0
  180. package/dist/esm/module-layout/module-layout-inspection.companion.d.ts.map +1 -0
  181. package/dist/esm/module-layout/module-layout-inspection.companion.js +290 -0
  182. package/dist/esm/module-layout/module-layout-inspection.companion.js.map +1 -0
  183. package/dist/esm/module-layout/module-source-files.companion.d.ts +3 -0
  184. package/dist/esm/module-layout/module-source-files.companion.d.ts.map +1 -0
  185. package/dist/esm/module-layout/module-source-files.companion.js +45 -0
  186. package/dist/esm/module-layout/module-source-files.companion.js.map +1 -0
  187. package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts +2 -0
  188. package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.d.ts.map +1 -1
  189. package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js +3 -1
  190. package/dist/esm/technical-doc/services/technical-documentation-pilot.companion.service.js.map +1 -1
  191. package/package.json +17 -17
@@ -1 +1 @@
1
- {"version":3,"file":"technical-documentation-pilot.companion.service.js","sourceRoot":"","sources":["../../../../src/technical-doc/services/technical-documentation-pilot.companion.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,iDAAiD,EAEjD,2CAA2C,EAC3C,6BAA6B,GAM9B,MAAM,uDAAuD,CAAC;AAC/D,OAAO,EACL,mDAAmD,EACnD,uCAAuC,EACvC,+CAA+C,EAC/C,sCAAsC,EACtC,yCAAyC,EACzC,2CAA2C,EAC3C,iCAAiC,EACjC,yCAAyC,GAK1C,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,iDAAiD,EAAE,MAAM,0DAA0D,CAAC;AAE7H,MAAM,4BAA4B,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,wBAAwB,CAAC,CAAC;AAC9G,MAAM,0CAA0C,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC;AACnH,MAAM,yBAAyB,GAAG,6BAA6B,CAAC;AAChE,MAAM,iCAAiC,GAAG,uDAAuD,CAAC;AAClG,MAAM,uDAAuD,GAAG,IAAI,CAAC,IAAI,CACvE,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,uCAAuC,CACxC,CAAC;AACF,MAAM,0BAA0B,GAAG,IAAI,GAAG,EAAyB,CAAC;AAmCpE,SAAS,gBAAgB,CAAC,MAAc,EAAE,KAAa;IACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CA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C,CAAC;YACvD,IAAI,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC;gBACnD,MAAM,iBAAiB,GAAG,CAAC,GAAG,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC;gBACjH,IAAI,CAAC,iBAAiB;oBAAE,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;;oBAC/D,MAAM,IAAI,CAAC,2BAA2B,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;YACrF,CAAC;iBAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC5C,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { constants } from 'node:fs';\nimport { access, lstat, mkdir, open, readFile, readdir, rename, rm, writeFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport {\n TechnicalDocumentationApplicabilityEvidenceStatus,\n type TechnicalDocumentationApiReferenceTargetV1,\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationChannel,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationPrivateDerivationManifestV1,\n type TechnicalDocumentationVersionedIdentityV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationSupportedApiVersion,\n} from '@wildo-ai/saas-specifications/technical-documentation';\nimport {\n createTechnicalDocumentationAggregateRenderManifest,\n createTechnicalDocumentationRenderModel,\n readTechnicalDocumentationAuthorizedRenderInput,\n renderTechnicalDocumentationDocusaurus,\n renderTechnicalDocumentationSearchIndexes,\n renderVerifiedTechnicalDocumentationOpenApi,\n technicalDocumentationSha256Bytes,\n validateTechnicalDocumentationManagedTree,\n type OpenApiGenerationOutput,\n type TechnicalDocumentationOutputBudgets,\n type TechnicalDocumentationRenderedFile,\n type TechnicalDocumentationRendererResult,\n} from '@wildo-ai/saas-technical-doc/companion';\n\nimport { TechnicalDocumentationPilotAssetsCompanionService } from './technical-documentation-pilot-assets.companion.service';\n\nconst GENERATED_ROOT_RELATIVE_PATH = path.join('technical-doc', 'src', 'generated', 'consumer-documentation');\nconst API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH = path.join('technical-doc', 'src', 'generated', 'api-reference');\nconst RENDER_MANIFEST_FILE_NAME = 'render-output-manifest.json';\nconst CONSUMER_DOCUMENTATION_RENDER_REF = 'technical-documentation:render/consumer-documentation';\nconst CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH = path.join(\n '.wildo-saas',\n 'runtime-signals',\n 'technical-documentation',\n 'consumer-documentation-published.json',\n);\nconst publicationOperationQueues = new Map<string, Promise<void>>();\n\nexport interface TechnicalDocumentationPilotPublicationResult {\n readonly rootPath: string;\n readonly contentPath: string;\n readonly manifest: ReturnType<typeof createTechnicalDocumentationAggregateRenderManifest>;\n readonly validation: ReturnType<typeof validateTechnicalDocumentationManagedTree>;\n}\n\nexport interface TechnicalDocumentationPilotOperationResult extends TechnicalDocumentationPilotPublicationResult {\n /**\n * Which exact stage outputs this operation joined, named `ref@version`. Four sha256 fields until\n * 2026-08-27 — unreadable in a log, unmergeable across branches, and never compared to anything.\n */\n readonly causalIdentities: {\n readonly derivation: TechnicalDocumentationVersionedIdentityV1;\n readonly authorizedBundle: TechnicalDocumentationVersionedIdentityV1;\n readonly resolvedAssetBundle: TechnicalDocumentationVersionedIdentityV1;\n readonly render: TechnicalDocumentationVersionedIdentityV1;\n };\n readonly channelCounts: { readonly publicUnits: number };\n readonly suppressions: readonly { readonly unitRef: string; readonly reason: string }[];\n readonly evidenceLimitations: readonly { readonly axis: string; readonly subjectRef: string; readonly status: string; readonly reason: string }[];\n readonly assetStates: readonly { readonly assetRef: string; readonly status: string; readonly byteDigest: string | null }[];\n readonly freshnessEvaluatedAt: string;\n}\n\nexport interface TechnicalDocumentationPilotCompositionDerivation {\n readonly privateDerivation: Pick<\n TechnicalDocumentationPrivateDerivationManifestV1,\n 'derivationRef' | 'derivationVersion' | 'environmentEvidenceSnapshot'\n >;\n readonly publicBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n}\n\nfunction assertPathWithin(parent: string, child: string): void {\n const relative = path.relative(parent, child);\n if (relative === '' || relative.startsWith('..') || path.isAbsolute(relative)) {\n throw new Error(`technical-documentation managed path escapes its root: ${child}`);\n }\n}\n\nasync function pathExists(target: string): Promise<boolean> {\n try {\n await access(target, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function fsyncPath(target: string): Promise<void> {\n const handle = await open(target, 'r');\n try {\n await handle.sync();\n } finally {\n await handle.close();\n }\n}\n\nasync function listRegularFiles(root: string, relative = ''): Promise<string[]> {\n const current = relative === '' ? root : path.join(root, relative);\n const entries = await readdir(current, { withFileTypes: true });\n const files: string[] = [];\n for (const entry of entries) {\n const childRelative = relative === '' ? entry.name : path.join(relative, entry.name);\n const child = path.join(root, childRelative);\n const info = await lstat(child);\n if (info.isSymbolicLink()) throw new Error(`technical-documentation generated tree rejects symbolic links: ${childRelative}`);\n if (info.isDirectory()) files.push(...await listRegularFiles(root, childRelative));\n else if (info.isFile()) files.push(childRelative.split(path.sep).join('/'));\n else throw new Error(`technical-documentation generated tree rejects non-regular entry: ${childRelative}`);\n }\n return files.sort();\n}\n\n/**\n * Companion-owned generation boundary for application-consumer documentation.\n *\n * The complete result is synchronized into one stable, generator-owned tree.\n * API-reference files are managed directly at stable semantic paths with no\n * checksum manifest or content-addressed identity. Previous versions, diffs,\n * and rollback are intentionally delegated to Git.\n */\nexport class TechnicalDocumentationPilotCompanionService {\n public constructor(private readonly saasRoot: string) {}\n\n private async withExclusivePublicationOperation<T>(rootPath: string, operation: () => Promise<T>): Promise<T> {\n const predecessor = publicationOperationQueues.get(rootPath) ?? Promise.resolve();\n let release!: () => void;\n const currentOperation = new Promise<void>((resolve) => {\n release = resolve;\n });\n const queueTail = predecessor.catch(() => undefined).then(() => currentOperation);\n publicationOperationQueues.set(rootPath, queueTail);\n await predecessor.catch(() => undefined);\n try {\n return await operation();\n } finally {\n release();\n if (publicationOperationQueues.get(rootPath) === queueTail) publicationOperationQueues.delete(rootPath);\n }\n }\n\n public async generateValidateAndPublish(input: {\n readonly derivation: TechnicalDocumentationPilotCompositionDerivation;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly refuseProvisionalAssets?: boolean;\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n /** Returns `null` when this application does not publish the target — the link degrades to plain text (#472). */\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null;\n readonly resolvedAt?: string;\n readonly publishedAt?: string;\n }): Promise<TechnicalDocumentationPilotOperationResult> {\n const publicationEvaluatedAt = input.publishedAt ?? new Date().toISOString();\n const publicationEvaluatedAtEpochMs = Date.parse(publicationEvaluatedAt);\n const freshnessEvaluatedAtEpochMs = Date.parse(input.derivation.privateDerivation.environmentEvidenceSnapshot.freshnessEvaluatedAt);\n if (publicationEvaluatedAtEpochMs < freshnessEvaluatedAtEpochMs) {\n throw new Error('technical-documentation publication time cannot precede the derivation freshness evaluation');\n }\n const assets = await new TechnicalDocumentationPilotAssetsCompanionService().resolve({\n authorizedBundle: input.derivation.publicBundle,\n ...(input.resolvedAt === undefined ? {} : { resolvedAt: input.resolvedAt }),\n });\n if (input.refuseProvisionalAssets === true) {\n const provisional = assets.resolvedAssetBundle.resolvedAssetSet.assets\n .filter((asset) => asset.status === TechnicalDocumentationAssetResolutionStatus.PLACEHOLDER)\n .map((asset) => asset.assetRef);\n if (provisional.length > 0) {\n throw new Error(`technical-documentation publication refuses provisional assets in this environment: ${provisional.join(', ')}`);\n }\n }\n\n const verified = readTechnicalDocumentationAuthorizedRenderInput({\n authorizedBundle: input.derivation.publicBundle,\n resolvedAssetBundle: assets.resolvedAssetBundle,\n assetBytesByPath: assets.assetBytesByPath,\n });\n for (const observation of input.derivation.privateDerivation.environmentEvidenceSnapshot.observations) {\n if (\n observation.validUntil !== null\n && [\n TechnicalDocumentationApplicabilityEvidenceStatus.PROVEN,\n TechnicalDocumentationApplicabilityEvidenceStatus.DISPROVEN,\n TechnicalDocumentationApplicabilityEvidenceStatus.CONFLICTED,\n ].includes(observation.status)\n && Date.parse(observation.validUntil) <= publicationEvaluatedAtEpochMs\n ) {\n throw new Error(`technical-documentation publication requires re-derivation because evidence expired during asset resolution: ${observation.axis}/${observation.subjectRef}`);\n }\n }\n\n const renderModel = createTechnicalDocumentationRenderModel(verified.authorizedBundle);\n /*\n * Two renderers, not three. A portable-markdown family was rendered here for as long as this\n * pipeline existed and NOTHING ever read it: the site mounts `docusaurus/docs`,\n * `docusaurus/sidebars.json` and `docusaurus/static`, and `src/pages/search.tsx` reads\n * `indexes/search.json` — measured with a positive control, so the empty result is a real\n * absence rather than a bad probe. It cost 81 files and 511 KB per publication, half the\n * published bytes, and it silently DOUBLED the operator-facing page budget: both families emit\n * `MARKDOWN_DOCUMENT`, so a 81-page application counted 162 against `maximumPageCount` (#274).\n */\n const rendererResults = [\n renderTechnicalDocumentationSearchIndexes(renderModel),\n renderTechnicalDocumentationDocusaurus({ model: renderModel, resolvedAssetBundle: verified.resolvedAssetBundle, assetBytesByPath: assets.assetBytesByPath, resolveApiReferenceTarget: input.resolveApiReferenceTarget }),\n ];\n const publication = await this.publish({\n authorizedBundle: verified.authorizedBundle,\n resolvedAssetBundle: verified.resolvedAssetBundle,\n supportedApiVersion: input.supportedApiVersion,\n rendererResults,\n forbiddenPublicSentinels: input.forbiddenPublicSentinels,\n budgets: input.budgets,\n publishedAt: publicationEvaluatedAt,\n });\n const evidenceLimitations = input.derivation.privateDerivation.environmentEvidenceSnapshot.observations\n .filter((observation) => observation.status !== TechnicalDocumentationApplicabilityEvidenceStatus.PROVEN)\n .map((observation) => ({ axis: observation.axis, subjectRef: observation.subjectRef, status: observation.status, reason: observation.reason }));\n\n return Object.freeze({\n ...publication,\n causalIdentities: Object.freeze({\n derivation: { ref: input.derivation.privateDerivation.derivationRef, version: input.derivation.privateDerivation.derivationVersion },\n authorizedBundle: { ref: verified.authorizedBundle.bundleRef, version: verified.authorizedBundle.bundleVersion },\n resolvedAssetBundle: { ref: verified.resolvedAssetBundle.assetBundleRef, version: verified.resolvedAssetBundle.assetBundleVersion },\n render: { ref: publication.manifest.renderRef, version: publication.manifest.renderVersion },\n }),\n channelCounts: Object.freeze({ publicUnits: input.derivation.publicBundle.units.length }),\n suppressions: Object.freeze(input.derivation.publicBundle.decisions\n .filter((decision) => decision.publishedUnitVersion === null)\n .map((decision) => ({ unitRef: decision.unitRef, reason: decision.reason }))),\n evidenceLimitations: Object.freeze(evidenceLimitations),\n assetStates: Object.freeze(assets.resolvedAssetBundle.resolvedAssetSet.assets.map((asset) => ({\n assetRef: asset.assetRef,\n status: asset.status,\n byteDigest: asset.byteDigest,\n }))),\n freshnessEvaluatedAt: input.derivation.privateDerivation.environmentEvidenceSnapshot.freshnessEvaluatedAt,\n });\n }\n\n public async publish(input: {\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly rendererResults: readonly TechnicalDocumentationRendererResult[];\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n readonly publishedAt?: string;\n }): Promise<TechnicalDocumentationPilotPublicationResult> {\n const rootPath = path.resolve(this.saasRoot, GENERATED_ROOT_RELATIVE_PATH);\n return this.withExclusivePublicationOperation(rootPath, async () => {\n if (input.authorizedBundle.channel !== TechnicalDocumentationChannel.PUBLIC_PORTAL) {\n throw new Error('technical-documentation consumer publisher accepts only a PUBLIC_PORTAL bundle');\n }\n const manifest = createTechnicalDocumentationAggregateRenderManifest({\n ...input,\n renderRef: CONSUMER_DOCUMENTATION_RENDER_REF,\n // One render per authorized bundle version: re-rendering the same bundle is the same render.\n renderVersion: input.authorizedBundle.bundleVersion,\n });\n const files = input.rendererResults.flatMap((result) => result.files);\n const validation = validateTechnicalDocumentationManagedTree({ ...input, manifest, files });\n assertPathWithin(path.resolve(this.saasRoot), rootPath);\n await this.synchronizeGeneratedTree(rootPath, RENDER_MANIFEST_FILE_NAME, manifest, files);\n await this.writeConsumerDocumentationPublicationSignal({\n renderRef: manifest.renderRef,\n renderVersion: manifest.renderVersion,\n publishedAt: input.publishedAt ?? new Date().toISOString(),\n });\n return Object.freeze({ rootPath, contentPath: rootPath, manifest, validation });\n });\n }\n\n /** Publishes only renderer-produced OpenAPI files into the separate API tree. */\n public async publishOpenApiDocuments(input: {\n readonly documents: OpenApiGenerationOutput;\n readonly sourceUnitRefs: readonly string[];\n }): Promise<{ readonly rootPath: string; readonly outputPaths: readonly string[] }> {\n const rootPath = path.resolve(this.saasRoot, API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH);\n return this.withExclusivePublicationOperation(rootPath, async () => {\n assertPathWithin(path.resolve(this.saasRoot), rootPath);\n const renderer = renderVerifiedTechnicalDocumentationOpenApi(input);\n await this.synchronizeGeneratedFiles(rootPath, renderer.files);\n return Object.freeze({\n rootPath,\n outputPaths: Object.freeze(renderer.files.map((file) => file.normalizedRelativePath).sort()),\n });\n });\n }\n\n /**\n * Synchronizes a generated tree from semantic paths alone.\n *\n * The API reference is reproducible output checked into Git, so a parallel\n * checksum inventory adds a second representation without adding product\n * meaning. Exact path inventory still prevents stale generated files from\n * surviving a section or filename change.\n */\n private async synchronizeGeneratedFiles(\n rootPath: string,\n files: readonly Pick<TechnicalDocumentationRenderedFile, 'normalizedRelativePath' | 'bytes'>[],\n ): Promise<void> {\n await mkdir(rootPath, { recursive: true });\n const rootInfo = await lstat(rootPath);\n if (!rootInfo.isDirectory() || rootInfo.isSymbolicLink()) {\n throw new Error('technical-documentation generated root must be a regular directory');\n }\n\n const expectedPaths = new Set(files.map((file) => file.normalizedRelativePath));\n for (const file of files) await this.writeGeneratedFile(rootPath, file.normalizedRelativePath, file.bytes);\n await this.removeStaleGeneratedEntries(rootPath, expectedPaths);\n\n const inventory = await listRegularFiles(rootPath);\n if (inventory.join('\\0') !== [...expectedPaths].sort().join('\\0')) {\n throw new Error('technical-documentation generated tree inventory does not match the render result');\n }\n await fsyncPath(rootPath);\n }\n\n private async synchronizeGeneratedTree(\n rootPath: string,\n manifestFileName: string,\n manifest: { readonly outputs: readonly { readonly normalizedRelativePath: string; readonly byteLength: number; readonly byteDigest: string }[] },\n files: readonly TechnicalDocumentationRenderedFile[],\n ): Promise<void> {\n await mkdir(rootPath, { recursive: true });\n const rootInfo = await lstat(rootPath);\n if (!rootInfo.isDirectory() || rootInfo.isSymbolicLink()) {\n throw new Error('technical-documentation generated root must be a regular directory');\n }\n\n const expectedPaths = new Set<string>([\n manifestFileName,\n ...files.map((file) => file.normalizedRelativePath),\n ]);\n for (const file of files) await this.writeGeneratedFile(rootPath, file.normalizedRelativePath, file.bytes);\n await this.writeGeneratedFile(rootPath, manifestFileName, `${JSON.stringify(manifest, null, 2)}\\n`);\n await this.removeStaleGeneratedEntries(rootPath, expectedPaths);\n\n const inventory = await listRegularFiles(rootPath);\n if (inventory.join('\\0') !== [...expectedPaths].sort().join('\\0')) {\n throw new Error('technical-documentation generated tree inventory does not match the render result');\n }\n for (const output of manifest.outputs) {\n const bytes = await readFile(path.join(rootPath, output.normalizedRelativePath));\n if (bytes.byteLength !== output.byteLength || technicalDocumentationSha256Bytes(bytes) !== output.byteDigest) {\n throw new Error(`technical-documentation generated tree byte mismatch: ${output.normalizedRelativePath}`);\n }\n }\n await fsyncPath(rootPath);\n }\n\n /**\n * Tells the local docs host that a complete, verified publication is ready.\n *\n * This signal is deliberately outside the checked-in generated tree. The\n * tree remains a stable, content-addressed-by-manifest publication owned by\n * Git; the signal is ephemeral local-dev orchestration state. It is written\n * only after all rendered bytes and the manifest have been synchronized and\n * re-verified, so a Docusaurus reload cannot observe a half-publication.\n */\n private async writeConsumerDocumentationPublicationSignal(input: {\n readonly renderRef: string;\n readonly renderVersion: number;\n readonly publishedAt: string;\n }): Promise<void> {\n const signalPath = path.resolve(this.saasRoot, CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH);\n assertPathWithin(path.resolve(this.saasRoot), signalPath);\n const signalDirectory = path.dirname(signalPath);\n await mkdir(signalDirectory, { recursive: true });\n const temporaryPath = path.join(signalDirectory, `.${path.basename(signalPath)}.wildo-tmp-${randomUUID()}`);\n try {\n await writeFile(temporaryPath, `${JSON.stringify({ schemaVersion: 1, ...input }, null, 2)}\\n`);\n await fsyncPath(temporaryPath);\n await rename(temporaryPath, signalPath);\n await fsyncPath(signalDirectory);\n } catch (error) {\n await rm(temporaryPath, { force: true });\n throw error;\n }\n }\n\n private async writeGeneratedFile(rootPath: string, relativePath: string, bytes: Uint8Array | string): Promise<void> {\n const target = path.resolve(rootPath, relativePath);\n assertPathWithin(rootPath, target);\n await this.prepareGeneratedParent(rootPath, path.dirname(target));\n if (await pathExists(target)) {\n const targetInfo = await lstat(target);\n if (targetInfo.isDirectory()) await rm(target, { recursive: true });\n else if (targetInfo.isFile()) {\n const currentBytes = await readFile(target);\n const nextBytes = typeof bytes === 'string' ? Buffer.from(bytes, 'utf8') : bytes;\n if (currentBytes.equals(nextBytes)) return;\n }\n }\n const temporary = path.join(path.dirname(target), `.${path.basename(target)}.wildo-tmp-${randomUUID()}`);\n try {\n await writeFile(temporary, bytes);\n await fsyncPath(temporary);\n await rename(temporary, target);\n await fsyncPath(path.dirname(target));\n } catch (error) {\n await rm(temporary, { force: true });\n throw error;\n }\n }\n\n private async prepareGeneratedParent(rootPath: string, parentPath: string): Promise<void> {\n const relative = path.relative(rootPath, parentPath);\n if (relative === '') return;\n let current = rootPath;\n for (const segment of relative.split(path.sep)) {\n current = path.join(current, segment);\n let directoryExists = false;\n if (await pathExists(current)) {\n const info = await lstat(current);\n if (info.isSymbolicLink()) throw new Error(`technical-documentation generated path rejects symbolic-link parent: ${current}`);\n if (!info.isDirectory()) await rm(current);\n else directoryExists = true;\n }\n if (!directoryExists) await mkdir(current);\n }\n }\n\n private async removeStaleGeneratedEntries(\n rootPath: string,\n expectedPaths: ReadonlySet<string>,\n relativeDirectory = '',\n ): Promise<void> {\n const directory = relativeDirectory === '' ? rootPath : path.join(rootPath, relativeDirectory);\n for (const entry of await readdir(directory, { withFileTypes: true })) {\n const relativePath = (relativeDirectory === '' ? entry.name : `${relativeDirectory}/${entry.name}`).split(path.sep).join('/');\n const absolutePath = path.join(rootPath, relativePath);\n if (entry.isDirectory() && !entry.isSymbolicLink()) {\n const directoryIsNeeded = [...expectedPaths].some((expectedPath) => expectedPath.startsWith(`${relativePath}/`));\n if (!directoryIsNeeded) await rm(absolutePath, { recursive: true });\n else await this.removeStaleGeneratedEntries(rootPath, expectedPaths, relativePath);\n } else if (!expectedPaths.has(relativePath)) {\n await rm(absolutePath, { force: true });\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"technical-documentation-pilot.companion.service.js","sourceRoot":"","sources":["../../../../src/technical-doc/services/technical-documentation-pilot.companion.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxG,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,iDAAiD,EAEjD,2CAA2C,EAC3C,6BAA6B,GAM9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AAI,CAAC,2BAA2B,CAAC,QAAQ,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;YACrF,CAAC;iBAAM,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC5C,MAAM,EAAE,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { constants } from 'node:fs';\nimport { access, lstat, mkdir, open, readFile, readdir, rename, rm, writeFile } from 'node:fs/promises';\nimport path from 'node:path';\n\nimport {\n TechnicalDocumentationApplicabilityEvidenceStatus,\n type TechnicalDocumentationApiReferenceTargetV1,\n TechnicalDocumentationAssetResolutionStatus,\n TechnicalDocumentationChannel,\n type TechnicalDocumentationAuthorizedBundleManifestV1,\n type TechnicalDocumentationPrivateDerivationManifestV1,\n type TechnicalDocumentationVersionedIdentityV1,\n type TechnicalDocumentationResolvedAssetBundleManifestV1,\n type TechnicalDocumentationSupportedApiVersion,\n} from '@wildo-ai/saas-specifications/technical-documentation';\nimport {\n createTechnicalDocumentationAggregateRenderManifest,\n createTechnicalDocumentationRenderModel,\n readTechnicalDocumentationAuthorizedRenderInput,\n renderTechnicalDocumentationDocusaurus,\n renderTechnicalDocumentationSearchIndexes,\n renderVerifiedTechnicalDocumentationOpenApi,\n technicalDocumentationSha256Bytes,\n validateTechnicalDocumentationManagedTree,\n type OpenApiGenerationOutput,\n type TechnicalDocumentationOutputBudgets,\n type TechnicalDocumentationRenderedFile,\n type TechnicalDocumentationRendererResult,\n} from '@wildo-ai/saas-technical-doc/companion';\n\nimport { TechnicalDocumentationPilotAssetsCompanionService } from './technical-documentation-pilot-assets.companion.service';\n\nconst GENERATED_ROOT_RELATIVE_PATH = path.join('technical-doc', 'src', 'generated', 'consumer-documentation');\n/** Where the publish writes the API reference, application-root relative (also the documentation step's write scope). */\nexport const API_REFERENCE_GENERATED_ROOT = 'technical-doc/src/generated/api-reference';\nconst API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH = path.join(...API_REFERENCE_GENERATED_ROOT.split('/'));\nconst RENDER_MANIFEST_FILE_NAME = 'render-output-manifest.json';\nconst CONSUMER_DOCUMENTATION_RENDER_REF = 'technical-documentation:render/consumer-documentation';\nconst CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH = path.join(\n '.wildo-saas',\n 'runtime-signals',\n 'technical-documentation',\n 'consumer-documentation-published.json',\n);\nconst publicationOperationQueues = new Map<string, Promise<void>>();\n\nexport interface TechnicalDocumentationPilotPublicationResult {\n readonly rootPath: string;\n readonly contentPath: string;\n readonly manifest: ReturnType<typeof createTechnicalDocumentationAggregateRenderManifest>;\n readonly validation: ReturnType<typeof validateTechnicalDocumentationManagedTree>;\n}\n\nexport interface TechnicalDocumentationPilotOperationResult extends TechnicalDocumentationPilotPublicationResult {\n /**\n * Which exact stage outputs this operation joined, named `ref@version`. Four sha256 fields until\n * 2026-08-27 — unreadable in a log, unmergeable across branches, and never compared to anything.\n */\n readonly causalIdentities: {\n readonly derivation: TechnicalDocumentationVersionedIdentityV1;\n readonly authorizedBundle: TechnicalDocumentationVersionedIdentityV1;\n readonly resolvedAssetBundle: TechnicalDocumentationVersionedIdentityV1;\n readonly render: TechnicalDocumentationVersionedIdentityV1;\n };\n readonly channelCounts: { readonly publicUnits: number };\n readonly suppressions: readonly { readonly unitRef: string; readonly reason: string }[];\n readonly evidenceLimitations: readonly { readonly axis: string; readonly subjectRef: string; readonly status: string; readonly reason: string }[];\n readonly assetStates: readonly { readonly assetRef: string; readonly status: string; readonly byteDigest: string | null }[];\n readonly freshnessEvaluatedAt: string;\n}\n\nexport interface TechnicalDocumentationPilotCompositionDerivation {\n readonly privateDerivation: Pick<\n TechnicalDocumentationPrivateDerivationManifestV1,\n 'derivationRef' | 'derivationVersion' | 'environmentEvidenceSnapshot'\n >;\n readonly publicBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n}\n\nfunction assertPathWithin(parent: string, child: string): void {\n const relative = path.relative(parent, child);\n if (relative === '' || relative.startsWith('..') || path.isAbsolute(relative)) {\n throw new Error(`technical-documentation managed path escapes its root: ${child}`);\n }\n}\n\nasync function pathExists(target: string): Promise<boolean> {\n try {\n await access(target, constants.F_OK);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function fsyncPath(target: string): Promise<void> {\n const handle = await open(target, 'r');\n try {\n await handle.sync();\n } finally {\n await handle.close();\n }\n}\n\nasync function listRegularFiles(root: string, relative = ''): Promise<string[]> {\n const current = relative === '' ? root : path.join(root, relative);\n const entries = await readdir(current, { withFileTypes: true });\n const files: string[] = [];\n for (const entry of entries) {\n const childRelative = relative === '' ? entry.name : path.join(relative, entry.name);\n const child = path.join(root, childRelative);\n const info = await lstat(child);\n if (info.isSymbolicLink()) throw new Error(`technical-documentation generated tree rejects symbolic links: ${childRelative}`);\n if (info.isDirectory()) files.push(...await listRegularFiles(root, childRelative));\n else if (info.isFile()) files.push(childRelative.split(path.sep).join('/'));\n else throw new Error(`technical-documentation generated tree rejects non-regular entry: ${childRelative}`);\n }\n return files.sort();\n}\n\n/**\n * Companion-owned generation boundary for application-consumer documentation.\n *\n * The complete result is synchronized into one stable, generator-owned tree.\n * API-reference files are managed directly at stable semantic paths with no\n * checksum manifest or content-addressed identity. Previous versions, diffs,\n * and rollback are intentionally delegated to Git.\n */\nexport class TechnicalDocumentationPilotCompanionService {\n public constructor(private readonly saasRoot: string) {}\n\n private async withExclusivePublicationOperation<T>(rootPath: string, operation: () => Promise<T>): Promise<T> {\n const predecessor = publicationOperationQueues.get(rootPath) ?? Promise.resolve();\n let release!: () => void;\n const currentOperation = new Promise<void>((resolve) => {\n release = resolve;\n });\n const queueTail = predecessor.catch(() => undefined).then(() => currentOperation);\n publicationOperationQueues.set(rootPath, queueTail);\n await predecessor.catch(() => undefined);\n try {\n return await operation();\n } finally {\n release();\n if (publicationOperationQueues.get(rootPath) === queueTail) publicationOperationQueues.delete(rootPath);\n }\n }\n\n public async generateValidateAndPublish(input: {\n readonly derivation: TechnicalDocumentationPilotCompositionDerivation;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly refuseProvisionalAssets?: boolean;\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n /** Returns `null` when this application does not publish the target — the link degrades to plain text (#472). */\n readonly resolveApiReferenceTarget?: (target: TechnicalDocumentationApiReferenceTargetV1) => string | null;\n readonly resolvedAt?: string;\n readonly publishedAt?: string;\n }): Promise<TechnicalDocumentationPilotOperationResult> {\n const publicationEvaluatedAt = input.publishedAt ?? new Date().toISOString();\n const publicationEvaluatedAtEpochMs = Date.parse(publicationEvaluatedAt);\n const freshnessEvaluatedAtEpochMs = Date.parse(input.derivation.privateDerivation.environmentEvidenceSnapshot.freshnessEvaluatedAt);\n if (publicationEvaluatedAtEpochMs < freshnessEvaluatedAtEpochMs) {\n throw new Error('technical-documentation publication time cannot precede the derivation freshness evaluation');\n }\n const assets = await new TechnicalDocumentationPilotAssetsCompanionService().resolve({\n authorizedBundle: input.derivation.publicBundle,\n ...(input.resolvedAt === undefined ? {} : { resolvedAt: input.resolvedAt }),\n });\n if (input.refuseProvisionalAssets === true) {\n const provisional = assets.resolvedAssetBundle.resolvedAssetSet.assets\n .filter((asset) => asset.status === TechnicalDocumentationAssetResolutionStatus.PLACEHOLDER)\n .map((asset) => asset.assetRef);\n if (provisional.length > 0) {\n throw new Error(`technical-documentation publication refuses provisional assets in this environment: ${provisional.join(', ')}`);\n }\n }\n\n const verified = readTechnicalDocumentationAuthorizedRenderInput({\n authorizedBundle: input.derivation.publicBundle,\n resolvedAssetBundle: assets.resolvedAssetBundle,\n assetBytesByPath: assets.assetBytesByPath,\n });\n for (const observation of input.derivation.privateDerivation.environmentEvidenceSnapshot.observations) {\n if (\n observation.validUntil !== null\n && [\n TechnicalDocumentationApplicabilityEvidenceStatus.PROVEN,\n TechnicalDocumentationApplicabilityEvidenceStatus.DISPROVEN,\n TechnicalDocumentationApplicabilityEvidenceStatus.CONFLICTED,\n ].includes(observation.status)\n && Date.parse(observation.validUntil) <= publicationEvaluatedAtEpochMs\n ) {\n throw new Error(`technical-documentation publication requires re-derivation because evidence expired during asset resolution: ${observation.axis}/${observation.subjectRef}`);\n }\n }\n\n const renderModel = createTechnicalDocumentationRenderModel(verified.authorizedBundle);\n /*\n * Two renderers, not three. A portable-markdown family was rendered here for as long as this\n * pipeline existed and NOTHING ever read it: the site mounts `docusaurus/docs`,\n * `docusaurus/sidebars.json` and `docusaurus/static`, and `src/pages/search.tsx` reads\n * `indexes/search.json` — measured with a positive control, so the empty result is a real\n * absence rather than a bad probe. It cost 81 files and 511 KB per publication, half the\n * published bytes, and it silently DOUBLED the operator-facing page budget: both families emit\n * `MARKDOWN_DOCUMENT`, so a 81-page application counted 162 against `maximumPageCount` (#274).\n */\n const rendererResults = [\n renderTechnicalDocumentationSearchIndexes(renderModel),\n renderTechnicalDocumentationDocusaurus({ model: renderModel, resolvedAssetBundle: verified.resolvedAssetBundle, assetBytesByPath: assets.assetBytesByPath, resolveApiReferenceTarget: input.resolveApiReferenceTarget }),\n ];\n const publication = await this.publish({\n authorizedBundle: verified.authorizedBundle,\n resolvedAssetBundle: verified.resolvedAssetBundle,\n supportedApiVersion: input.supportedApiVersion,\n rendererResults,\n forbiddenPublicSentinels: input.forbiddenPublicSentinels,\n budgets: input.budgets,\n publishedAt: publicationEvaluatedAt,\n });\n const evidenceLimitations = input.derivation.privateDerivation.environmentEvidenceSnapshot.observations\n .filter((observation) => observation.status !== TechnicalDocumentationApplicabilityEvidenceStatus.PROVEN)\n .map((observation) => ({ axis: observation.axis, subjectRef: observation.subjectRef, status: observation.status, reason: observation.reason }));\n\n return Object.freeze({\n ...publication,\n causalIdentities: Object.freeze({\n derivation: { ref: input.derivation.privateDerivation.derivationRef, version: input.derivation.privateDerivation.derivationVersion },\n authorizedBundle: { ref: verified.authorizedBundle.bundleRef, version: verified.authorizedBundle.bundleVersion },\n resolvedAssetBundle: { ref: verified.resolvedAssetBundle.assetBundleRef, version: verified.resolvedAssetBundle.assetBundleVersion },\n render: { ref: publication.manifest.renderRef, version: publication.manifest.renderVersion },\n }),\n channelCounts: Object.freeze({ publicUnits: input.derivation.publicBundle.units.length }),\n suppressions: Object.freeze(input.derivation.publicBundle.decisions\n .filter((decision) => decision.publishedUnitVersion === null)\n .map((decision) => ({ unitRef: decision.unitRef, reason: decision.reason }))),\n evidenceLimitations: Object.freeze(evidenceLimitations),\n assetStates: Object.freeze(assets.resolvedAssetBundle.resolvedAssetSet.assets.map((asset) => ({\n assetRef: asset.assetRef,\n status: asset.status,\n byteDigest: asset.byteDigest,\n }))),\n freshnessEvaluatedAt: input.derivation.privateDerivation.environmentEvidenceSnapshot.freshnessEvaluatedAt,\n });\n }\n\n public async publish(input: {\n readonly authorizedBundle: TechnicalDocumentationAuthorizedBundleManifestV1;\n readonly resolvedAssetBundle: TechnicalDocumentationResolvedAssetBundleManifestV1;\n readonly supportedApiVersion: TechnicalDocumentationSupportedApiVersion;\n readonly rendererResults: readonly TechnicalDocumentationRendererResult[];\n readonly forbiddenPublicSentinels: readonly string[];\n readonly budgets: TechnicalDocumentationOutputBudgets;\n readonly publishedAt?: string;\n }): Promise<TechnicalDocumentationPilotPublicationResult> {\n const rootPath = path.resolve(this.saasRoot, GENERATED_ROOT_RELATIVE_PATH);\n return this.withExclusivePublicationOperation(rootPath, async () => {\n if (input.authorizedBundle.channel !== TechnicalDocumentationChannel.PUBLIC_PORTAL) {\n throw new Error('technical-documentation consumer publisher accepts only a PUBLIC_PORTAL bundle');\n }\n const manifest = createTechnicalDocumentationAggregateRenderManifest({\n ...input,\n renderRef: CONSUMER_DOCUMENTATION_RENDER_REF,\n // One render per authorized bundle version: re-rendering the same bundle is the same render.\n renderVersion: input.authorizedBundle.bundleVersion,\n });\n const files = input.rendererResults.flatMap((result) => result.files);\n const validation = validateTechnicalDocumentationManagedTree({ ...input, manifest, files });\n assertPathWithin(path.resolve(this.saasRoot), rootPath);\n await this.synchronizeGeneratedTree(rootPath, RENDER_MANIFEST_FILE_NAME, manifest, files);\n await this.writeConsumerDocumentationPublicationSignal({\n renderRef: manifest.renderRef,\n renderVersion: manifest.renderVersion,\n publishedAt: input.publishedAt ?? new Date().toISOString(),\n });\n return Object.freeze({ rootPath, contentPath: rootPath, manifest, validation });\n });\n }\n\n /** Publishes only renderer-produced OpenAPI files into the separate API tree. */\n public async publishOpenApiDocuments(input: {\n readonly documents: OpenApiGenerationOutput;\n readonly sourceUnitRefs: readonly string[];\n }): Promise<{ readonly rootPath: string; readonly outputPaths: readonly string[] }> {\n const rootPath = path.resolve(this.saasRoot, API_REFERENCE_GENERATED_ROOT_RELATIVE_PATH);\n return this.withExclusivePublicationOperation(rootPath, async () => {\n assertPathWithin(path.resolve(this.saasRoot), rootPath);\n const renderer = renderVerifiedTechnicalDocumentationOpenApi(input);\n await this.synchronizeGeneratedFiles(rootPath, renderer.files);\n return Object.freeze({\n rootPath,\n outputPaths: Object.freeze(renderer.files.map((file) => file.normalizedRelativePath).sort()),\n });\n });\n }\n\n /**\n * Synchronizes a generated tree from semantic paths alone.\n *\n * The API reference is reproducible output checked into Git, so a parallel\n * checksum inventory adds a second representation without adding product\n * meaning. Exact path inventory still prevents stale generated files from\n * surviving a section or filename change.\n */\n private async synchronizeGeneratedFiles(\n rootPath: string,\n files: readonly Pick<TechnicalDocumentationRenderedFile, 'normalizedRelativePath' | 'bytes'>[],\n ): Promise<void> {\n await mkdir(rootPath, { recursive: true });\n const rootInfo = await lstat(rootPath);\n if (!rootInfo.isDirectory() || rootInfo.isSymbolicLink()) {\n throw new Error('technical-documentation generated root must be a regular directory');\n }\n\n const expectedPaths = new Set(files.map((file) => file.normalizedRelativePath));\n for (const file of files) await this.writeGeneratedFile(rootPath, file.normalizedRelativePath, file.bytes);\n await this.removeStaleGeneratedEntries(rootPath, expectedPaths);\n\n const inventory = await listRegularFiles(rootPath);\n if (inventory.join('\\0') !== [...expectedPaths].sort().join('\\0')) {\n throw new Error('technical-documentation generated tree inventory does not match the render result');\n }\n await fsyncPath(rootPath);\n }\n\n private async synchronizeGeneratedTree(\n rootPath: string,\n manifestFileName: string,\n manifest: { readonly outputs: readonly { readonly normalizedRelativePath: string; readonly byteLength: number; readonly byteDigest: string }[] },\n files: readonly TechnicalDocumentationRenderedFile[],\n ): Promise<void> {\n await mkdir(rootPath, { recursive: true });\n const rootInfo = await lstat(rootPath);\n if (!rootInfo.isDirectory() || rootInfo.isSymbolicLink()) {\n throw new Error('technical-documentation generated root must be a regular directory');\n }\n\n const expectedPaths = new Set<string>([\n manifestFileName,\n ...files.map((file) => file.normalizedRelativePath),\n ]);\n for (const file of files) await this.writeGeneratedFile(rootPath, file.normalizedRelativePath, file.bytes);\n await this.writeGeneratedFile(rootPath, manifestFileName, `${JSON.stringify(manifest, null, 2)}\\n`);\n await this.removeStaleGeneratedEntries(rootPath, expectedPaths);\n\n const inventory = await listRegularFiles(rootPath);\n if (inventory.join('\\0') !== [...expectedPaths].sort().join('\\0')) {\n throw new Error('technical-documentation generated tree inventory does not match the render result');\n }\n for (const output of manifest.outputs) {\n const bytes = await readFile(path.join(rootPath, output.normalizedRelativePath));\n if (bytes.byteLength !== output.byteLength || technicalDocumentationSha256Bytes(bytes) !== output.byteDigest) {\n throw new Error(`technical-documentation generated tree byte mismatch: ${output.normalizedRelativePath}`);\n }\n }\n await fsyncPath(rootPath);\n }\n\n /**\n * Tells the local docs host that a complete, verified publication is ready.\n *\n * This signal is deliberately outside the checked-in generated tree. The\n * tree remains a stable, content-addressed-by-manifest publication owned by\n * Git; the signal is ephemeral local-dev orchestration state. It is written\n * only after all rendered bytes and the manifest have been synchronized and\n * re-verified, so a Docusaurus reload cannot observe a half-publication.\n */\n private async writeConsumerDocumentationPublicationSignal(input: {\n readonly renderRef: string;\n readonly renderVersion: number;\n readonly publishedAt: string;\n }): Promise<void> {\n const signalPath = path.resolve(this.saasRoot, CONSUMER_DOCUMENTATION_PUBLICATION_SIGNAL_RELATIVE_PATH);\n assertPathWithin(path.resolve(this.saasRoot), signalPath);\n const signalDirectory = path.dirname(signalPath);\n await mkdir(signalDirectory, { recursive: true });\n const temporaryPath = path.join(signalDirectory, `.${path.basename(signalPath)}.wildo-tmp-${randomUUID()}`);\n try {\n await writeFile(temporaryPath, `${JSON.stringify({ schemaVersion: 1, ...input }, null, 2)}\\n`);\n await fsyncPath(temporaryPath);\n await rename(temporaryPath, signalPath);\n await fsyncPath(signalDirectory);\n } catch (error) {\n await rm(temporaryPath, { force: true });\n throw error;\n }\n }\n\n private async writeGeneratedFile(rootPath: string, relativePath: string, bytes: Uint8Array | string): Promise<void> {\n const target = path.resolve(rootPath, relativePath);\n assertPathWithin(rootPath, target);\n await this.prepareGeneratedParent(rootPath, path.dirname(target));\n if (await pathExists(target)) {\n const targetInfo = await lstat(target);\n if (targetInfo.isDirectory()) await rm(target, { recursive: true });\n else if (targetInfo.isFile()) {\n const currentBytes = await readFile(target);\n const nextBytes = typeof bytes === 'string' ? Buffer.from(bytes, 'utf8') : bytes;\n if (currentBytes.equals(nextBytes)) return;\n }\n }\n const temporary = path.join(path.dirname(target), `.${path.basename(target)}.wildo-tmp-${randomUUID()}`);\n try {\n await writeFile(temporary, bytes);\n await fsyncPath(temporary);\n await rename(temporary, target);\n await fsyncPath(path.dirname(target));\n } catch (error) {\n await rm(temporary, { force: true });\n throw error;\n }\n }\n\n private async prepareGeneratedParent(rootPath: string, parentPath: string): Promise<void> {\n const relative = path.relative(rootPath, parentPath);\n if (relative === '') return;\n let current = rootPath;\n for (const segment of relative.split(path.sep)) {\n current = path.join(current, segment);\n let directoryExists = false;\n if (await pathExists(current)) {\n const info = await lstat(current);\n if (info.isSymbolicLink()) throw new Error(`technical-documentation generated path rejects symbolic-link parent: ${current}`);\n if (!info.isDirectory()) await rm(current);\n else directoryExists = true;\n }\n if (!directoryExists) await mkdir(current);\n }\n }\n\n private async removeStaleGeneratedEntries(\n rootPath: string,\n expectedPaths: ReadonlySet<string>,\n relativeDirectory = '',\n ): Promise<void> {\n const directory = relativeDirectory === '' ? rootPath : path.join(rootPath, relativeDirectory);\n for (const entry of await readdir(directory, { withFileTypes: true })) {\n const relativePath = (relativeDirectory === '' ? entry.name : `${relativeDirectory}/${entry.name}`).split(path.sep).join('/');\n const absolutePath = path.join(rootPath, relativePath);\n if (entry.isDirectory() && !entry.isSymbolicLink()) {\n const directoryIsNeeded = [...expectedPaths].some((expectedPath) => expectedPath.startsWith(`${relativePath}/`));\n if (!directoryIsNeeded) await rm(absolutePath, { recursive: true });\n else await this.removeStaleGeneratedEntries(rootPath, expectedPaths, relativePath);\n } else if (!expectedPaths.has(relativePath)) {\n await rm(absolutePath, { force: true });\n }\n }\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildo-ai/dev-companion",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "description": "Wildo.ai Dev Companion — local development management and introspection service. Canonical source home; applications receive only the built dist below their .wildo-saas/wildo-dev-companion drop.",
5
5
  "author": "Wildo AI",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -46,22 +46,22 @@
46
46
  "@radix-ui/react-tooltip": "^1.2.8",
47
47
  "@react-email/components": "^1.0.8",
48
48
  "@react-email/render": "^2.0.4",
49
- "@wildo-ai/application-creation-runtime": "1.1.14",
50
- "@wildo-ai/external-connectors-models": "1.1.14",
51
- "@wildo-ai/framework-knowledge": "1.1.14",
52
- "@wildo-ai/platform-config-lib": "1.1.14",
53
- "@wildo-ai/platform-core-backend": "1.1.14",
54
- "@wildo-ai/platform-core-shared": "1.1.14",
55
- "@wildo-ai/platform-shared-lib": "1.1.14",
56
- "@wildo-ai/presets-components-models": "1.1.14",
57
- "@wildo-ai/saas-backend-lib": "1.1.14",
58
- "@wildo-ai/saas-frontend-lib": "1.1.14",
59
- "@wildo-ai/saas-models": "1.1.14",
60
- "@wildo-ai/saas-specifications": "1.1.14",
61
- "@wildo-ai/saas-technical-doc": "1.1.14",
62
- "@wildo-ai/saas-website": "1.1.14",
63
- "@wildo-ai/wildo-module-client": "1.1.14",
64
- "@wildo-ai/zod-decorators": "1.1.14",
49
+ "@wildo-ai/application-creation-runtime": "1.1.16",
50
+ "@wildo-ai/external-connectors-models": "1.1.16",
51
+ "@wildo-ai/framework-knowledge": "1.1.16",
52
+ "@wildo-ai/platform-config-lib": "1.1.16",
53
+ "@wildo-ai/platform-core-backend": "1.1.16",
54
+ "@wildo-ai/platform-core-shared": "1.1.16",
55
+ "@wildo-ai/platform-shared-lib": "1.1.16",
56
+ "@wildo-ai/presets-components-models": "1.1.16",
57
+ "@wildo-ai/saas-backend-lib": "1.1.16",
58
+ "@wildo-ai/saas-frontend-lib": "1.1.16",
59
+ "@wildo-ai/saas-models": "1.1.16",
60
+ "@wildo-ai/saas-specifications": "1.1.16",
61
+ "@wildo-ai/saas-technical-doc": "1.1.16",
62
+ "@wildo-ai/saas-website": "1.1.16",
63
+ "@wildo-ai/wildo-module-client": "1.1.16",
64
+ "@wildo-ai/zod-decorators": "1.1.16",
65
65
  "@xyflow/react": "^12.9.3",
66
66
  "big.js": "^6.2.2",
67
67
  "cors": "^2.8.5",