@wildo-ai/wildo-cli 1.1.9 → 1.1.10

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 (833) hide show
  1. package/dist/bin/wildo.d.ts.map +1 -1
  2. package/dist/bin/wildo.js +0 -0
  3. package/dist/bin/wildo.js.map +1 -1
  4. package/dist/src/commands/acp/probe.command.d.ts.map +1 -1
  5. package/dist/src/commands/acp/probe.command.js.map +1 -1
  6. package/dist/src/commands/align-deps.command.d.ts.map +1 -1
  7. package/dist/src/commands/align-deps.command.js.map +1 -1
  8. package/dist/src/commands/assets/sync.command.d.ts.map +1 -1
  9. package/dist/src/commands/assets/sync.command.js.map +1 -1
  10. package/dist/src/commands/brand/propagate.command.d.ts.map +1 -1
  11. package/dist/src/commands/brand/propagate.command.js.map +1 -1
  12. package/dist/src/commands/build/accept.command.d.ts.map +1 -1
  13. package/dist/src/commands/build/accept.command.js.map +1 -1
  14. package/dist/src/commands/build/dispatches.command.d.ts.map +1 -1
  15. package/dist/src/commands/build/dispatches.command.js.map +1 -1
  16. package/dist/src/commands/build/next.command.d.ts.map +1 -1
  17. package/dist/src/commands/build/next.command.js.map +1 -1
  18. package/dist/src/commands/build/rearm.command.d.ts.map +1 -1
  19. package/dist/src/commands/build/rearm.command.js.map +1 -1
  20. package/dist/src/commands/build/run.command.d.ts.map +1 -1
  21. package/dist/src/commands/build/run.command.js.map +1 -1
  22. package/dist/src/commands/build/tasks.command.d.ts.map +1 -1
  23. package/dist/src/commands/build/tasks.command.js.map +1 -1
  24. package/dist/src/commands/compose.command.d.ts.map +1 -1
  25. package/dist/src/commands/compose.command.js.map +1 -1
  26. package/dist/src/commands/config/check-resources.command.d.ts +50 -0
  27. package/dist/src/commands/config/check-resources.command.d.ts.map +1 -0
  28. package/dist/src/commands/config/check-resources.command.js +121 -0
  29. package/dist/src/commands/config/check-resources.command.js.map +1 -0
  30. package/dist/src/commands/config/data-retention.command.d.ts.map +1 -1
  31. package/dist/src/commands/config/data-retention.command.js.map +1 -1
  32. package/dist/src/commands/config/document-releases.command.d.ts.map +1 -1
  33. package/dist/src/commands/config/document-releases.command.js.map +1 -1
  34. package/dist/src/commands/config/legal-notice.command.d.ts +17 -0
  35. package/dist/src/commands/config/legal-notice.command.d.ts.map +1 -0
  36. package/dist/src/commands/config/legal-notice.command.js +59 -0
  37. package/dist/src/commands/config/legal-notice.command.js.map +1 -0
  38. package/dist/src/commands/config/mutate.command.d.ts.map +1 -1
  39. package/dist/src/commands/config/mutate.command.js.map +1 -1
  40. package/dist/src/commands/config/reapply-declaration.command.d.ts.map +1 -1
  41. package/dist/src/commands/config/reapply-declaration.command.js.map +1 -1
  42. package/dist/src/commands/config/service-consent.command.d.ts.map +1 -1
  43. package/dist/src/commands/config/service-consent.command.js.map +1 -1
  44. package/dist/src/commands/config/subject-data-recipients.command.d.ts.map +1 -1
  45. package/dist/src/commands/config/subject-data-recipients.command.js.map +1 -1
  46. package/dist/src/commands/config/sync.command.d.ts.map +1 -1
  47. package/dist/src/commands/config/sync.command.js.map +1 -1
  48. package/dist/src/commands/config/validate.command.d.ts +8 -0
  49. package/dist/src/commands/config/validate.command.d.ts.map +1 -1
  50. package/dist/src/commands/config/validate.command.js +65 -4
  51. package/dist/src/commands/config/validate.command.js.map +1 -1
  52. package/dist/src/commands/context/assurance-basis.command.d.ts.map +1 -1
  53. package/dist/src/commands/context/assurance-basis.command.js.map +1 -1
  54. package/dist/src/commands/context/coherence.command.d.ts.map +1 -1
  55. package/dist/src/commands/context/coherence.command.js.map +1 -1
  56. package/dist/src/commands/context/context-command.utils.d.ts.map +1 -1
  57. package/dist/src/commands/context/context-command.utils.js.map +1 -1
  58. package/dist/src/commands/context/elements.command.d.ts.map +1 -1
  59. package/dist/src/commands/context/elements.command.js.map +1 -1
  60. package/dist/src/commands/context/health.command.d.ts.map +1 -1
  61. package/dist/src/commands/context/health.command.js.map +1 -1
  62. package/dist/src/commands/context/info.command.d.ts.map +1 -1
  63. package/dist/src/commands/context/info.command.js.map +1 -1
  64. package/dist/src/commands/context/journey.command.d.ts +8 -2
  65. package/dist/src/commands/context/journey.command.d.ts.map +1 -1
  66. package/dist/src/commands/context/journey.command.js +102 -12
  67. package/dist/src/commands/context/journey.command.js.map +1 -1
  68. package/dist/src/commands/context/jurisdictions.command.d.ts.map +1 -1
  69. package/dist/src/commands/context/jurisdictions.command.js.map +1 -1
  70. package/dist/src/commands/context/launch-blockers.command.d.ts +2 -1
  71. package/dist/src/commands/context/launch-blockers.command.d.ts.map +1 -1
  72. package/dist/src/commands/context/launch-blockers.command.js +3 -2
  73. package/dist/src/commands/context/launch-blockers.command.js.map +1 -1
  74. package/dist/src/commands/context/list.command.d.ts.map +1 -1
  75. package/dist/src/commands/context/list.command.js.map +1 -1
  76. package/dist/src/commands/context/pipelines.command.d.ts.map +1 -1
  77. package/dist/src/commands/context/pipelines.command.js.map +1 -1
  78. package/dist/src/commands/context/workspace.command.d.ts.map +1 -1
  79. package/dist/src/commands/context/workspace.command.js.map +1 -1
  80. package/dist/src/commands/creation/accept.command.d.ts +4 -0
  81. package/dist/src/commands/creation/accept.command.d.ts.map +1 -1
  82. package/dist/src/commands/creation/accept.command.js +29 -4
  83. package/dist/src/commands/creation/accept.command.js.map +1 -1
  84. package/dist/src/commands/creation/answer.command.d.ts.map +1 -1
  85. package/dist/src/commands/creation/answer.command.js.map +1 -1
  86. package/dist/src/commands/creation/brand-logo.command.d.ts +18 -0
  87. package/dist/src/commands/creation/brand-logo.command.d.ts.map +1 -0
  88. package/dist/src/commands/creation/brand-logo.command.js +43 -0
  89. package/dist/src/commands/creation/brand-logo.command.js.map +1 -0
  90. package/dist/src/commands/creation/brief.command.d.ts.map +1 -1
  91. package/dist/src/commands/creation/brief.command.js.map +1 -1
  92. package/dist/src/commands/creation/deliberate.command.d.ts +2 -2
  93. package/dist/src/commands/creation/deliberate.command.d.ts.map +1 -1
  94. package/dist/src/commands/creation/deliberate.command.js +2 -2
  95. package/dist/src/commands/creation/deliberate.command.js.map +1 -1
  96. package/dist/src/commands/creation/depth.command.d.ts.map +1 -1
  97. package/dist/src/commands/creation/depth.command.js +1 -1
  98. package/dist/src/commands/creation/depth.command.js.map +1 -1
  99. package/dist/src/commands/creation/diff.command.d.ts.map +1 -1
  100. package/dist/src/commands/creation/diff.command.js.map +1 -1
  101. package/dist/src/commands/creation/feed.command.d.ts.map +1 -1
  102. package/dist/src/commands/creation/feed.command.js.map +1 -1
  103. package/dist/src/commands/creation/loop.command.d.ts.map +1 -1
  104. package/dist/src/commands/creation/loop.command.js.map +1 -1
  105. package/dist/src/commands/creation/persona.command.d.ts +3 -2
  106. package/dist/src/commands/creation/persona.command.d.ts.map +1 -1
  107. package/dist/src/commands/creation/persona.command.js +10 -3
  108. package/dist/src/commands/creation/persona.command.js.map +1 -1
  109. package/dist/src/commands/creation/preflight.command.d.ts.map +1 -1
  110. package/dist/src/commands/creation/preflight.command.js.map +1 -1
  111. package/dist/src/commands/creation/prompt-hook.command.d.ts.map +1 -1
  112. package/dist/src/commands/creation/prompt-hook.command.js.map +1 -1
  113. package/dist/src/commands/creation/propose.command.d.ts.map +1 -1
  114. package/dist/src/commands/creation/propose.command.js.map +1 -1
  115. package/dist/src/commands/creation/pulse.command.d.ts.map +1 -1
  116. package/dist/src/commands/creation/pulse.command.js.map +1 -1
  117. package/dist/src/commands/creation/questions.command.d.ts.map +1 -1
  118. package/dist/src/commands/creation/questions.command.js.map +1 -1
  119. package/dist/src/commands/creation/reason.command.d.ts.map +1 -1
  120. package/dist/src/commands/creation/reason.command.js.map +1 -1
  121. package/dist/src/commands/creation/report.command.d.ts.map +1 -1
  122. package/dist/src/commands/creation/report.command.js.map +1 -1
  123. package/dist/src/commands/creation/revert.command.d.ts.map +1 -1
  124. package/dist/src/commands/creation/revert.command.js.map +1 -1
  125. package/dist/src/commands/creation/run.command.d.ts.map +1 -1
  126. package/dist/src/commands/creation/run.command.js.map +1 -1
  127. package/dist/src/commands/creation/statusline.command.d.ts.map +1 -1
  128. package/dist/src/commands/creation/statusline.command.js.map +1 -1
  129. package/dist/src/commands/creation/watch.command.d.ts.map +1 -1
  130. package/dist/src/commands/creation/watch.command.js.map +1 -1
  131. package/dist/src/commands/creation/why.command.d.ts +3 -1
  132. package/dist/src/commands/creation/why.command.d.ts.map +1 -1
  133. package/dist/src/commands/creation/why.command.js +28 -9
  134. package/dist/src/commands/creation/why.command.js.map +1 -1
  135. package/dist/src/commands/creation/writes.command.d.ts.map +1 -1
  136. package/dist/src/commands/creation/writes.command.js.map +1 -1
  137. package/dist/src/commands/db/db-schema-plan-migration.utils.d.ts.map +1 -1
  138. package/dist/src/commands/db/db-schema-plan-migration.utils.js.map +1 -1
  139. package/dist/src/commands/db/db-schema-plan.utils.d.ts.map +1 -1
  140. package/dist/src/commands/db/db-schema-plan.utils.js.map +1 -1
  141. package/dist/src/commands/db/diff.command.d.ts.map +1 -1
  142. package/dist/src/commands/db/diff.command.js.map +1 -1
  143. package/dist/src/commands/db/generate.command.d.ts.map +1 -1
  144. package/dist/src/commands/db/generate.command.js.map +1 -1
  145. package/dist/src/commands/db/migrate.command.d.ts.map +1 -1
  146. package/dist/src/commands/db/migrate.command.js.map +1 -1
  147. package/dist/src/commands/db/resolve.command.d.ts.map +1 -1
  148. package/dist/src/commands/db/resolve.command.js.map +1 -1
  149. package/dist/src/commands/dev/charts-audit.command.d.ts.map +1 -1
  150. package/dist/src/commands/dev/charts-audit.command.js.map +1 -1
  151. package/dist/src/commands/dev/design-tokens-generate.command.d.ts.map +1 -1
  152. package/dist/src/commands/dev/design-tokens-generate.command.js.map +1 -1
  153. package/dist/src/commands/dev/design-tokens-init.command.d.ts.map +1 -1
  154. package/dist/src/commands/dev/design-tokens-init.command.js.map +1 -1
  155. package/dist/src/commands/dev/design-tokens-validate.command.d.ts.map +1 -1
  156. package/dist/src/commands/dev/design-tokens-validate.command.js.map +1 -1
  157. package/dist/src/commands/dev/force-stop.command.d.ts.map +1 -1
  158. package/dist/src/commands/dev/force-stop.command.js.map +1 -1
  159. package/dist/src/commands/dev/resources.command.d.ts.map +1 -1
  160. package/dist/src/commands/dev/resources.command.js.map +1 -1
  161. package/dist/src/commands/dev/start.command.d.ts.map +1 -1
  162. package/dist/src/commands/dev/start.command.js.map +1 -1
  163. package/dist/src/commands/dev/stop-all.command.d.ts.map +1 -1
  164. package/dist/src/commands/dev/stop-all.command.js.map +1 -1
  165. package/dist/src/commands/dev/sync-csp.command.d.ts.map +1 -1
  166. package/dist/src/commands/dev/sync-csp.command.js.map +1 -1
  167. package/dist/src/commands/docs/publish.command.d.ts.map +1 -1
  168. package/dist/src/commands/docs/publish.command.js.map +1 -1
  169. package/dist/src/commands/frontend/publish.command.d.ts.map +1 -1
  170. package/dist/src/commands/frontend/publish.command.js.map +1 -1
  171. package/dist/src/commands/fwk/audit.command.d.ts.map +1 -1
  172. package/dist/src/commands/fwk/audit.command.js.map +1 -1
  173. package/dist/src/commands/fwk/dev-skills.command.d.ts.map +1 -1
  174. package/dist/src/commands/fwk/dev-skills.command.js.map +1 -1
  175. package/dist/src/commands/fwk/generate-docs.command.d.ts.map +1 -1
  176. package/dist/src/commands/fwk/generate-docs.command.js.map +1 -1
  177. package/dist/src/commands/fwk/generate-providers.command.d.ts.map +1 -1
  178. package/dist/src/commands/fwk/generate-providers.command.js.map +1 -1
  179. package/dist/src/commands/fwk/graph.command.d.ts.map +1 -1
  180. package/dist/src/commands/fwk/graph.command.js.map +1 -1
  181. package/dist/src/commands/fwk/publish-all.command.d.ts.map +1 -1
  182. package/dist/src/commands/fwk/publish-all.command.js.map +1 -1
  183. package/dist/src/commands/fwk/publish-docker.command.d.ts.map +1 -1
  184. package/dist/src/commands/fwk/publish-docker.command.js.map +1 -1
  185. package/dist/src/commands/fwk/publish-npm.command.d.ts.map +1 -1
  186. package/dist/src/commands/fwk/publish-npm.command.js.map +1 -1
  187. package/dist/src/commands/fwk/version-bump.command.d.ts.map +1 -1
  188. package/dist/src/commands/fwk/version-bump.command.js.map +1 -1
  189. package/dist/src/commands/fwk/version-set.command.d.ts.map +1 -1
  190. package/dist/src/commands/fwk/version-set.command.js.map +1 -1
  191. package/dist/src/commands/fwk/version-show.command.d.ts.map +1 -1
  192. package/dist/src/commands/fwk/version-show.command.js.map +1 -1
  193. package/dist/src/commands/fwk/version-sync.command.d.ts.map +1 -1
  194. package/dist/src/commands/fwk/version-sync.command.js.map +1 -1
  195. package/dist/src/commands/fwk/what-touches.command.d.ts.map +1 -1
  196. package/dist/src/commands/fwk/what-touches.command.js.map +1 -1
  197. package/dist/src/commands/fwk/wt-status.command.d.ts.map +1 -1
  198. package/dist/src/commands/fwk/wt-status.command.js.map +1 -1
  199. package/dist/src/commands/fwk/wt-tail.command.d.ts.map +1 -1
  200. package/dist/src/commands/fwk/wt-tail.command.js.map +1 -1
  201. package/dist/src/commands/generate/email-command.utils.d.ts.map +1 -1
  202. package/dist/src/commands/generate/email-command.utils.js.map +1 -1
  203. package/dist/src/commands/generate/email-preview.command.d.ts.map +1 -1
  204. package/dist/src/commands/generate/email-preview.command.js.map +1 -1
  205. package/dist/src/commands/generate/email-status.command.d.ts.map +1 -1
  206. package/dist/src/commands/generate/email-status.command.js.map +1 -1
  207. package/dist/src/commands/generate/email-test-send.command.d.ts.map +1 -1
  208. package/dist/src/commands/generate/email-test-send.command.js.map +1 -1
  209. package/dist/src/commands/generate/email-translate.command.d.ts.map +1 -1
  210. package/dist/src/commands/generate/email-translate.command.js.map +1 -1
  211. package/dist/src/commands/generate/email.command.d.ts.map +1 -1
  212. package/dist/src/commands/generate/email.command.js.map +1 -1
  213. package/dist/src/commands/generate/labelling-command.utils.d.ts.map +1 -1
  214. package/dist/src/commands/generate/labelling-command.utils.js.map +1 -1
  215. package/dist/src/commands/generate/labels-plan.command.d.ts.map +1 -1
  216. package/dist/src/commands/generate/labels-plan.command.js.map +1 -1
  217. package/dist/src/commands/generate/labels.command.d.ts.map +1 -1
  218. package/dist/src/commands/generate/labels.command.js.map +1 -1
  219. package/dist/src/commands/generate/translate.command.d.ts.map +1 -1
  220. package/dist/src/commands/generate/translate.command.js.map +1 -1
  221. package/dist/src/commands/help.command.d.ts.map +1 -1
  222. package/dist/src/commands/help.command.js.map +1 -1
  223. package/dist/src/commands/init.command.d.ts.map +1 -1
  224. package/dist/src/commands/init.command.js.map +1 -1
  225. package/dist/src/commands/local/deregister.command.d.ts.map +1 -1
  226. package/dist/src/commands/local/deregister.command.js.map +1 -1
  227. package/dist/src/commands/local/dev-status.command.d.ts.map +1 -1
  228. package/dist/src/commands/local/dev-status.command.js.map +1 -1
  229. package/dist/src/commands/local/dev.command.d.ts.map +1 -1
  230. package/dist/src/commands/local/dev.command.js.map +1 -1
  231. package/dist/src/commands/local/doctor.command.d.ts.map +1 -1
  232. package/dist/src/commands/local/doctor.command.js.map +1 -1
  233. package/dist/src/commands/local/down.command.d.ts.map +1 -1
  234. package/dist/src/commands/local/down.command.js.map +1 -1
  235. package/dist/src/commands/local/init.command.d.ts.map +1 -1
  236. package/dist/src/commands/local/init.command.js.map +1 -1
  237. package/dist/src/commands/local/logs.command.d.ts.map +1 -1
  238. package/dist/src/commands/local/logs.command.js.map +1 -1
  239. package/dist/src/commands/local/reinit.command.d.ts.map +1 -1
  240. package/dist/src/commands/local/reinit.command.js.map +1 -1
  241. package/dist/src/commands/local/reset.command.d.ts.map +1 -1
  242. package/dist/src/commands/local/reset.command.js.map +1 -1
  243. package/dist/src/commands/local/restore.command.d.ts.map +1 -1
  244. package/dist/src/commands/local/restore.command.js.map +1 -1
  245. package/dist/src/commands/local/smoke.command.d.ts.map +1 -1
  246. package/dist/src/commands/local/smoke.command.js.map +1 -1
  247. package/dist/src/commands/local/status.command.d.ts.map +1 -1
  248. package/dist/src/commands/local/status.command.js.map +1 -1
  249. package/dist/src/commands/local/up.command.d.ts.map +1 -1
  250. package/dist/src/commands/local/up.command.js.map +1 -1
  251. package/dist/src/commands/local-defaults/capture.command.d.ts.map +1 -1
  252. package/dist/src/commands/local-defaults/capture.command.js.map +1 -1
  253. package/dist/src/commands/lock/check.command.d.ts.map +1 -1
  254. package/dist/src/commands/lock/check.command.js.map +1 -1
  255. package/dist/src/commands/market/generate.command.d.ts.map +1 -1
  256. package/dist/src/commands/market/generate.command.js.map +1 -1
  257. package/dist/src/commands/market/market-command.utils.d.ts.map +1 -1
  258. package/dist/src/commands/market/market-command.utils.js.map +1 -1
  259. package/dist/src/commands/prefs/set.command.d.ts.map +1 -1
  260. package/dist/src/commands/prefs/set.command.js.map +1 -1
  261. package/dist/src/commands/providers/show.command.d.ts.map +1 -1
  262. package/dist/src/commands/providers/show.command.js.map +1 -1
  263. package/dist/src/commands/registry/add.command.d.ts.map +1 -1
  264. package/dist/src/commands/registry/add.command.js.map +1 -1
  265. package/dist/src/commands/registry/info.command.d.ts.map +1 -1
  266. package/dist/src/commands/registry/info.command.js.map +1 -1
  267. package/dist/src/commands/registry/key.command.d.ts.map +1 -1
  268. package/dist/src/commands/registry/key.command.js.map +1 -1
  269. package/dist/src/commands/registry/lockfile-smoke.command.d.ts.map +1 -1
  270. package/dist/src/commands/registry/lockfile-smoke.command.js.map +1 -1
  271. package/dist/src/commands/registry/login.command.d.ts.map +1 -1
  272. package/dist/src/commands/registry/login.command.js.map +1 -1
  273. package/dist/src/commands/registry/logout.command.d.ts.map +1 -1
  274. package/dist/src/commands/registry/logout.command.js.map +1 -1
  275. package/dist/src/commands/registry/outdated.command.d.ts.map +1 -1
  276. package/dist/src/commands/registry/outdated.command.js.map +1 -1
  277. package/dist/src/commands/registry/ping.command.d.ts.map +1 -1
  278. package/dist/src/commands/registry/ping.command.js.map +1 -1
  279. package/dist/src/commands/registry/publish.command.d.ts.map +1 -1
  280. package/dist/src/commands/registry/publish.command.js.map +1 -1
  281. package/dist/src/commands/registry/registry-transport.constants.d.ts.map +1 -1
  282. package/dist/src/commands/registry/registry-transport.constants.js.map +1 -1
  283. package/dist/src/commands/registry/remove.command.d.ts.map +1 -1
  284. package/dist/src/commands/registry/remove.command.js.map +1 -1
  285. package/dist/src/commands/registry/repair-lockfile.command.d.ts.map +1 -1
  286. package/dist/src/commands/registry/repair-lockfile.command.js.map +1 -1
  287. package/dist/src/commands/registry/search.command.d.ts.map +1 -1
  288. package/dist/src/commands/registry/search.command.js.map +1 -1
  289. package/dist/src/commands/registry/status.command.d.ts.map +1 -1
  290. package/dist/src/commands/registry/status.command.js.map +1 -1
  291. package/dist/src/commands/registry/update.command.d.ts.map +1 -1
  292. package/dist/src/commands/registry/update.command.js.map +1 -1
  293. package/dist/src/commands/registry/whoami.command.d.ts.map +1 -1
  294. package/dist/src/commands/registry/whoami.command.js.map +1 -1
  295. package/dist/src/commands/registry/yank.command.d.ts.map +1 -1
  296. package/dist/src/commands/registry/yank.command.js.map +1 -1
  297. package/dist/src/commands/remote/create.command.d.ts.map +1 -1
  298. package/dist/src/commands/remote/create.command.js.map +1 -1
  299. package/dist/src/commands/remote/list.command.d.ts.map +1 -1
  300. package/dist/src/commands/remote/list.command.js.map +1 -1
  301. package/dist/src/commands/remote/status.command.d.ts.map +1 -1
  302. package/dist/src/commands/remote/status.command.js.map +1 -1
  303. package/dist/src/commands/remote/sync.command.d.ts.map +1 -1
  304. package/dist/src/commands/remote/sync.command.js.map +1 -1
  305. package/dist/src/commands/secrets/github.command.d.ts.map +1 -1
  306. package/dist/src/commands/secrets/github.command.js.map +1 -1
  307. package/dist/src/commands/secrets/list.command.d.ts.map +1 -1
  308. package/dist/src/commands/secrets/list.command.js.map +1 -1
  309. package/dist/src/commands/secrets/set.command.d.ts.map +1 -1
  310. package/dist/src/commands/secrets/set.command.js.map +1 -1
  311. package/dist/src/commands/secrets/unset.command.d.ts.map +1 -1
  312. package/dist/src/commands/secrets/unset.command.js.map +1 -1
  313. package/dist/src/commands/setup.command.d.ts.map +1 -1
  314. package/dist/src/commands/setup.command.js.map +1 -1
  315. package/dist/src/commands/update.command.d.ts.map +1 -1
  316. package/dist/src/commands/update.command.js.map +1 -1
  317. package/dist/src/commands/version.command.d.ts.map +1 -1
  318. package/dist/src/commands/version.command.js.map +1 -1
  319. package/dist/src/commands/website/audit.command.d.ts.map +1 -1
  320. package/dist/src/commands/website/audit.command.js.map +1 -1
  321. package/dist/src/commands/workbench/open.command.d.ts.map +1 -1
  322. package/dist/src/commands/workbench/open.command.js.map +1 -1
  323. package/dist/src/commands/workbench/parallelism.command.d.ts.map +1 -1
  324. package/dist/src/commands/workbench/parallelism.command.js.map +1 -1
  325. package/dist/src/commands/workbench/status.command.d.ts.map +1 -1
  326. package/dist/src/commands/workbench/status.command.js.map +1 -1
  327. package/dist/src/infrastructure/errors/error.utils.d.ts.map +1 -1
  328. package/dist/src/infrastructure/errors/error.utils.js.map +1 -1
  329. package/dist/src/infrastructure/io/file.utils.d.ts.map +1 -1
  330. package/dist/src/infrastructure/io/file.utils.js.map +1 -1
  331. package/dist/src/infrastructure/io/io.schemas.d.ts.map +1 -1
  332. package/dist/src/infrastructure/io/io.schemas.js.map +1 -1
  333. package/dist/src/infrastructure/io/template-processor.d.ts.map +1 -1
  334. package/dist/src/infrastructure/io/template-processor.js.map +1 -1
  335. package/dist/src/infrastructure/logger/logger.service.d.ts.map +1 -1
  336. package/dist/src/infrastructure/logger/logger.service.js.map +1 -1
  337. package/dist/src/infrastructure/process/spawn.utils.d.ts.map +1 -1
  338. package/dist/src/infrastructure/process/spawn.utils.js.map +1 -1
  339. package/dist/src/infrastructure/ui/formatting.service.d.ts.map +1 -1
  340. package/dist/src/infrastructure/ui/formatting.service.js.map +1 -1
  341. package/dist/src/infrastructure/ui/interaction-engine.service.d.ts.map +1 -1
  342. package/dist/src/infrastructure/ui/interaction-engine.service.js.map +1 -1
  343. package/dist/src/infrastructure/ui/markdown-renderer.service.d.ts.map +1 -1
  344. package/dist/src/infrastructure/ui/markdown-renderer.service.js.map +1 -1
  345. package/dist/src/infrastructure/ui/ui.schemas.d.ts.map +1 -1
  346. package/dist/src/infrastructure/ui/ui.schemas.js.map +1 -1
  347. package/dist/src/infrastructure/utils/string.utils.d.ts.map +1 -1
  348. package/dist/src/infrastructure/utils/string.utils.js.map +1 -1
  349. package/dist/src/infrastructure/validation/validator.service.d.ts.map +1 -1
  350. package/dist/src/infrastructure/validation/validator.service.js.map +1 -1
  351. package/dist/src/kernel/base-command.d.ts.map +1 -1
  352. package/dist/src/kernel/base-command.js.map +1 -1
  353. package/dist/src/kernel/bootstrap.d.ts.map +1 -1
  354. package/dist/src/kernel/bootstrap.js.map +1 -1
  355. package/dist/src/kernel/command-index-cache.d.ts.map +1 -1
  356. package/dist/src/kernel/command-index-cache.js.map +1 -1
  357. package/dist/src/kernel/command-registry.d.ts.map +1 -1
  358. package/dist/src/kernel/command-registry.js.map +1 -1
  359. package/dist/src/kernel/command-runner.d.ts.map +1 -1
  360. package/dist/src/kernel/command-runner.js.map +1 -1
  361. package/dist/src/kernel/command-scope-utils.d.ts.map +1 -1
  362. package/dist/src/kernel/command-scope-utils.js.map +1 -1
  363. package/dist/src/kernel/flag-utils.d.ts.map +1 -1
  364. package/dist/src/kernel/flag-utils.js.map +1 -1
  365. package/dist/src/kernel/hooks.d.ts.map +1 -1
  366. package/dist/src/kernel/hooks.js.map +1 -1
  367. package/dist/src/kernel/logger.d.ts.map +1 -1
  368. package/dist/src/kernel/logger.js.map +1 -1
  369. package/dist/src/kernel/types.d.ts.map +1 -1
  370. package/dist/src/kernel/types.js.map +1 -1
  371. package/dist/src/main.d.ts.map +1 -1
  372. package/dist/src/main.js.map +1 -1
  373. package/dist/src/modules/domain/credentials/admin-user.module.d.ts.map +1 -1
  374. package/dist/src/modules/domain/credentials/admin-user.module.js.map +1 -1
  375. package/dist/src/modules/domain/credentials/approver-user.module.d.ts.map +1 -1
  376. package/dist/src/modules/domain/credentials/approver-user.module.js.map +1 -1
  377. package/dist/src/modules/domain/credentials/creation-essentials.module.d.ts.map +1 -1
  378. package/dist/src/modules/domain/credentials/creation-essentials.module.js.map +1 -1
  379. package/dist/src/modules/domain/credentials/module.types.d.ts.map +1 -1
  380. package/dist/src/modules/domain/credentials/module.types.js.map +1 -1
  381. package/dist/src/modules/domain/environment/database-config.module.d.ts.map +1 -1
  382. package/dist/src/modules/domain/environment/database-config.module.js.map +1 -1
  383. package/dist/src/modules/domain/environment/module.types.d.ts.map +1 -1
  384. package/dist/src/modules/domain/environment/module.types.js.map +1 -1
  385. package/dist/src/modules/domain/environment/paths-config.module.d.ts.map +1 -1
  386. package/dist/src/modules/domain/environment/paths-config.module.js.map +1 -1
  387. package/dist/src/modules/domain/environment/runtime-selector.module.d.ts.map +1 -1
  388. package/dist/src/modules/domain/environment/runtime-selector.module.js.map +1 -1
  389. package/dist/src/modules/domain/environment/runtime-semantics.module.d.ts.map +1 -1
  390. package/dist/src/modules/domain/environment/runtime-semantics.module.js.map +1 -1
  391. package/dist/src/modules/domain/module.types.d.ts.map +1 -1
  392. package/dist/src/modules/domain/module.types.js.map +1 -1
  393. package/dist/src/services/application/app-bootstrap.service.d.ts.map +1 -1
  394. package/dist/src/services/application/app-bootstrap.service.js.map +1 -1
  395. package/dist/src/services/application/app-env.service.d.ts.map +1 -1
  396. package/dist/src/services/application/app-env.service.js.map +1 -1
  397. package/dist/src/services/application/app-local-runtime-addresses.service.d.ts.map +1 -1
  398. package/dist/src/services/application/app-local-runtime-addresses.service.js.map +1 -1
  399. package/dist/src/services/application/app-runtime-targets.service.d.ts.map +1 -1
  400. package/dist/src/services/application/app-runtime-targets.service.js.map +1 -1
  401. package/dist/src/services/application/app-schema-bootstrap.service.d.ts.map +1 -1
  402. package/dist/src/services/application/app-schema-bootstrap.service.js.map +1 -1
  403. package/dist/src/services/application/application-assets-delivery.service.d.ts.map +1 -1
  404. package/dist/src/services/application/application-assets-delivery.service.js.map +1 -1
  405. package/dist/src/services/application/application-browser-smoke.service.d.ts.map +1 -1
  406. package/dist/src/services/application/application-browser-smoke.service.js.map +1 -1
  407. package/dist/src/services/application/application-creation-readiness.service.d.ts.map +1 -1
  408. package/dist/src/services/application/application-creation-readiness.service.js.map +1 -1
  409. package/dist/src/services/application/application-dependency-alignment.service.d.ts.map +1 -1
  410. package/dist/src/services/application/application-dependency-alignment.service.js.map +1 -1
  411. package/dist/src/services/application/application-dev-port-offsets.d.ts.map +1 -1
  412. package/dist/src/services/application/application-dev-port-offsets.js.map +1 -1
  413. package/dist/src/services/application/application-initialization-verification.service.d.ts.map +1 -1
  414. package/dist/src/services/application/application-initialization-verification.service.js.map +1 -1
  415. package/dist/src/services/application/application-root.utils.d.ts.map +1 -1
  416. package/dist/src/services/application/application-root.utils.js.map +1 -1
  417. package/dist/src/services/application/application-runtime-bootstrap.service.d.ts.map +1 -1
  418. package/dist/src/services/application/application-runtime-bootstrap.service.js.map +1 -1
  419. package/dist/src/services/application/backend-config.paths.d.ts.map +1 -1
  420. package/dist/src/services/application/backend-config.paths.js.map +1 -1
  421. package/dist/src/services/application/composition-provider-plan.service.d.ts.map +1 -1
  422. package/dist/src/services/application/composition-provider-plan.service.js.map +1 -1
  423. package/dist/src/services/application/creation-host-readiness.service.d.ts.map +1 -1
  424. package/dist/src/services/application/creation-host-readiness.service.js.map +1 -1
  425. package/dist/src/services/application/creation-preflight.service.d.ts.map +1 -1
  426. package/dist/src/services/application/creation-preflight.service.js.map +1 -1
  427. package/dist/src/services/application/degraded-registration-declaration-convergence.service.d.ts.map +1 -1
  428. package/dist/src/services/application/degraded-registration-declaration-convergence.service.js.map +1 -1
  429. package/dist/src/services/application/dev-orchestrator.service.d.ts.map +1 -1
  430. package/dist/src/services/application/dev-orchestrator.service.js.map +1 -1
  431. package/dist/src/services/application/dev-schema-drift.service.d.ts.map +1 -1
  432. package/dist/src/services/application/dev-schema-drift.service.js.map +1 -1
  433. package/dist/src/services/application/environment-provider-configurations.service.d.ts.map +1 -1
  434. package/dist/src/services/application/environment-provider-configurations.service.js.map +1 -1
  435. package/dist/src/services/application/existing-app-bootstrap.service.d.ts.map +1 -1
  436. package/dist/src/services/application/existing-app-bootstrap.service.js.map +1 -1
  437. package/dist/src/services/application/frontend-provider-source.service.d.ts.map +1 -1
  438. package/dist/src/services/application/frontend-provider-source.service.js.map +1 -1
  439. package/dist/src/services/application/frontend-public-config-secret-screen.service.d.ts.map +1 -1
  440. package/dist/src/services/application/frontend-public-config-secret-screen.service.js.map +1 -1
  441. package/dist/src/services/application/local-app-reinit.service.d.ts.map +1 -1
  442. package/dist/src/services/application/local-app-reinit.service.js.map +1 -1
  443. package/dist/src/services/application/local-application-initialization.service.d.ts.map +1 -1
  444. package/dist/src/services/application/local-application-initialization.service.js.map +1 -1
  445. package/dist/src/services/application/provider-package-links.service.d.ts.map +1 -1
  446. package/dist/src/services/application/provider-package-links.service.js.map +1 -1
  447. package/dist/src/services/application/provider-runtime-sync.service.d.ts.map +1 -1
  448. package/dist/src/services/application/provider-runtime-sync.service.js.map +1 -1
  449. package/dist/src/services/application/saas-scaffold.service.d.ts.map +1 -1
  450. package/dist/src/services/application/saas-scaffold.service.js.map +1 -1
  451. package/dist/src/services/application/saas-skeleton.service.d.ts.map +1 -1
  452. package/dist/src/services/application/saas-skeleton.service.js.map +1 -1
  453. package/dist/src/services/application/stored-declaration-currency.service.d.ts.map +1 -1
  454. package/dist/src/services/application/stored-declaration-currency.service.js.map +1 -1
  455. package/dist/src/services/application/systems-of-record-library.service.d.ts.map +1 -1
  456. package/dist/src/services/application/systems-of-record-library.service.js.map +1 -1
  457. package/dist/src/services/catalog/service-address-resolver.service.d.ts.map +1 -1
  458. package/dist/src/services/catalog/service-address-resolver.service.js.map +1 -1
  459. package/dist/src/services/catalog/service-catalog.schemas.d.ts.map +1 -1
  460. package/dist/src/services/catalog/service-catalog.schemas.js.map +1 -1
  461. package/dist/src/services/coding-agents/acp-conformance-probe.service.d.ts.map +1 -1
  462. package/dist/src/services/coding-agents/acp-conformance-probe.service.js.map +1 -1
  463. package/dist/src/services/coding-agents/coding-agent-login.service.d.ts.map +1 -1
  464. package/dist/src/services/coding-agents/coding-agent-login.service.js.map +1 -1
  465. package/dist/src/services/companion/build-console.service.d.ts +62 -2
  466. package/dist/src/services/companion/build-console.service.d.ts.map +1 -1
  467. package/dist/src/services/companion/build-console.service.js +70 -5
  468. package/dist/src/services/companion/build-console.service.js.map +1 -1
  469. package/dist/src/services/companion/companion-client-options.utils.d.ts.map +1 -1
  470. package/dist/src/services/companion/companion-client-options.utils.js.map +1 -1
  471. package/dist/src/services/companion/companion-client.service.d.ts.map +1 -1
  472. package/dist/src/services/companion/companion-client.service.js.map +1 -1
  473. package/dist/src/services/companion/companion-health-hint.utils.d.ts.map +1 -1
  474. package/dist/src/services/companion/companion-health-hint.utils.js.map +1 -1
  475. package/dist/src/services/companion/companion-lifecycle.service.d.ts.map +1 -1
  476. package/dist/src/services/companion/companion-lifecycle.service.js.map +1 -1
  477. package/dist/src/services/companion/companion-local-token.utils.d.ts.map +1 -1
  478. package/dist/src/services/companion/companion-local-token.utils.js.map +1 -1
  479. package/dist/src/services/companion/companion.schemas.d.ts.map +1 -1
  480. package/dist/src/services/companion/companion.schemas.js.map +1 -1
  481. package/dist/src/services/companion/console-fast-path.d.ts +21 -3
  482. package/dist/src/services/companion/console-fast-path.d.ts.map +1 -1
  483. package/dist/src/services/companion/console-fast-path.js +57 -12
  484. package/dist/src/services/companion/console-fast-path.js.map +1 -1
  485. package/dist/src/services/companion/console-verb.utils.d.ts.map +1 -1
  486. package/dist/src/services/companion/console-verb.utils.js.map +1 -1
  487. package/dist/src/services/companion/creation-console.service.d.ts +76 -0
  488. package/dist/src/services/companion/creation-console.service.d.ts.map +1 -1
  489. package/dist/src/services/companion/creation-console.service.js +124 -11
  490. package/dist/src/services/companion/creation-console.service.js.map +1 -1
  491. package/dist/src/services/companion/creation-run-report.models.d.ts.map +1 -1
  492. package/dist/src/services/companion/creation-run-report.models.js.map +1 -1
  493. package/dist/src/services/companion/git-helper.service.d.ts.map +1 -1
  494. package/dist/src/services/companion/git-helper.service.js.map +1 -1
  495. package/dist/src/services/companion/local-companion-authority.service.d.ts.map +1 -1
  496. package/dist/src/services/companion/local-companion-authority.service.js.map +1 -1
  497. package/dist/src/services/companion/workbench-browser-launcher.service.d.ts.map +1 -1
  498. package/dist/src/services/companion/workbench-browser-launcher.service.js.map +1 -1
  499. package/dist/src/services/companion/workbench-cli.service.d.ts.map +1 -1
  500. package/dist/src/services/companion/workbench-cli.service.js.map +1 -1
  501. package/dist/src/services/compliance/data-retention-schedule.generator.d.ts.map +1 -1
  502. package/dist/src/services/compliance/data-retention-schedule.generator.js.map +1 -1
  503. package/dist/src/services/compliance/generated-compliance-module-wiring.d.ts +5 -3
  504. package/dist/src/services/compliance/generated-compliance-module-wiring.d.ts.map +1 -1
  505. package/dist/src/services/compliance/generated-compliance-module-wiring.js +4 -2
  506. package/dist/src/services/compliance/generated-compliance-module-wiring.js.map +1 -1
  507. package/dist/src/services/compliance/governed-document-releases.generator.d.ts.map +1 -1
  508. package/dist/src/services/compliance/governed-document-releases.generator.js.map +1 -1
  509. package/dist/src/services/compliance/legal-notice.generator.d.ts +45 -0
  510. package/dist/src/services/compliance/legal-notice.generator.d.ts.map +1 -0
  511. package/dist/src/services/compliance/legal-notice.generator.js +97 -0
  512. package/dist/src/services/compliance/legal-notice.generator.js.map +1 -0
  513. package/dist/src/services/compliance/service-consent-requirement.generator.d.ts.map +1 -1
  514. package/dist/src/services/compliance/service-consent-requirement.generator.js.map +1 -1
  515. package/dist/src/services/compliance/subject-data-recipients.generator.d.ts.map +1 -1
  516. package/dist/src/services/compliance/subject-data-recipients.generator.js.map +1 -1
  517. package/dist/src/services/context/context-manager.service.d.ts.map +1 -1
  518. package/dist/src/services/context/context-manager.service.js.map +1 -1
  519. package/dist/src/services/context/context.schemas.d.ts.map +1 -1
  520. package/dist/src/services/context/context.schemas.js.map +1 -1
  521. package/dist/src/services/context/machine-preferences.writer.d.ts.map +1 -1
  522. package/dist/src/services/context/machine-preferences.writer.js.map +1 -1
  523. package/dist/src/services/context/state-manager.service.d.ts.map +1 -1
  524. package/dist/src/services/context/state-manager.service.js.map +1 -1
  525. package/dist/src/services/credentials/application-secret-owners.service.d.ts.map +1 -1
  526. package/dist/src/services/credentials/application-secret-owners.service.js.map +1 -1
  527. package/dist/src/services/credentials/application-secrets.service.d.ts.map +1 -1
  528. package/dist/src/services/credentials/application-secrets.service.js.map +1 -1
  529. package/dist/src/services/credentials/ci-secrets-adapter.service.d.ts.map +1 -1
  530. package/dist/src/services/credentials/ci-secrets-adapter.service.js.map +1 -1
  531. package/dist/src/services/credentials/composed-provider-catalogue.d.ts.map +1 -1
  532. package/dist/src/services/credentials/composed-provider-catalogue.js.map +1 -1
  533. package/dist/src/services/credentials/credentials.schemas.d.ts.map +1 -1
  534. package/dist/src/services/credentials/credentials.schemas.js.map +1 -1
  535. package/dist/src/services/credentials/credentials.service.d.ts.map +1 -1
  536. package/dist/src/services/credentials/credentials.service.js.map +1 -1
  537. package/dist/src/services/credentials/framework-managed-secrets.d.ts.map +1 -1
  538. package/dist/src/services/credentials/framework-managed-secrets.js.map +1 -1
  539. package/dist/src/services/credentials/local-defaults.service.d.ts.map +1 -1
  540. package/dist/src/services/credentials/local-defaults.service.js.map +1 -1
  541. package/dist/src/services/credentials/local-secrets-store.service.d.ts.map +1 -1
  542. package/dist/src/services/credentials/local-secrets-store.service.js.map +1 -1
  543. package/dist/src/services/credentials/provider-env-vars.utils.d.ts.map +1 -1
  544. package/dist/src/services/credentials/provider-env-vars.utils.js.map +1 -1
  545. package/dist/src/services/credentials/provider-secret-format.d.ts.map +1 -1
  546. package/dist/src/services/credentials/provider-secret-format.js.map +1 -1
  547. package/dist/src/services/credentials/remote-secrets-store.service.d.ts.map +1 -1
  548. package/dist/src/services/credentials/remote-secrets-store.service.js.map +1 -1
  549. package/dist/src/services/credentials/secret-requirements.service.d.ts.map +1 -1
  550. package/dist/src/services/credentials/secret-requirements.service.js.map +1 -1
  551. package/dist/src/services/credentials/secrets-provisioning.service.d.ts.map +1 -1
  552. package/dist/src/services/credentials/secrets-provisioning.service.js.map +1 -1
  553. package/dist/src/services/credentials/secrets-reader.service.d.ts.map +1 -1
  554. package/dist/src/services/credentials/secrets-reader.service.js.map +1 -1
  555. package/dist/src/services/credentials/secrets-rotation.service.d.ts.map +1 -1
  556. package/dist/src/services/credentials/secrets-rotation.service.js.map +1 -1
  557. package/dist/src/services/credentials/secrets-writer.service.d.ts.map +1 -1
  558. package/dist/src/services/credentials/secrets-writer.service.js.map +1 -1
  559. package/dist/src/services/data-services/data-services.schemas.d.ts.map +1 -1
  560. package/dist/src/services/data-services/data-services.schemas.js.map +1 -1
  561. package/dist/src/services/data-services/data-services.service.d.ts.map +1 -1
  562. package/dist/src/services/data-services/data-services.service.js.map +1 -1
  563. package/dist/src/services/deployment/apps-manager-diagnostics.service.d.ts.map +1 -1
  564. package/dist/src/services/deployment/apps-manager-diagnostics.service.js.map +1 -1
  565. package/dist/src/services/deployment/ci-deploy-generator.service.d.ts.map +1 -1
  566. package/dist/src/services/deployment/ci-deploy-generator.service.js.map +1 -1
  567. package/dist/src/services/deployment/ci-workflow-generator.service.d.ts.map +1 -1
  568. package/dist/src/services/deployment/ci-workflow-generator.service.js.map +1 -1
  569. package/dist/src/services/deployment/docker/backing-service-health-watch.d.ts.map +1 -1
  570. package/dist/src/services/deployment/docker/backing-service-health-watch.js.map +1 -1
  571. package/dist/src/services/deployment/docker/compose-service-health.d.ts.map +1 -1
  572. package/dist/src/services/deployment/docker/compose-service-health.js.map +1 -1
  573. package/dist/src/services/deployment/docker/docker-compose-generator.service.d.ts.map +1 -1
  574. package/dist/src/services/deployment/docker/docker-compose-generator.service.js.map +1 -1
  575. package/dist/src/services/deployment/docker/docker-compose-readiness.service.d.ts.map +1 -1
  576. package/dist/src/services/deployment/docker/docker-compose-readiness.service.js.map +1 -1
  577. package/dist/src/services/deployment/docker/docker.schemas.d.ts.map +1 -1
  578. package/dist/src/services/deployment/docker/docker.schemas.js.map +1 -1
  579. package/dist/src/services/deployment/docker/docker.service.d.ts.map +1 -1
  580. package/dist/src/services/deployment/docker/docker.service.js.map +1 -1
  581. package/dist/src/services/deployment/docker/local-data-adoption.service.d.ts.map +1 -1
  582. package/dist/src/services/deployment/docker/local-data-adoption.service.js.map +1 -1
  583. package/dist/src/services/deployment/host-toolchain-readiness.service.d.ts.map +1 -1
  584. package/dist/src/services/deployment/host-toolchain-readiness.service.js.map +1 -1
  585. package/dist/src/services/deployment/infra-writer.service.d.ts.map +1 -1
  586. package/dist/src/services/deployment/infra-writer.service.js.map +1 -1
  587. package/dist/src/services/deployment/k8s/cluster-controller-charts.constants.d.ts.map +1 -1
  588. package/dist/src/services/deployment/k8s/cluster-controller-charts.constants.js.map +1 -1
  589. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.d.ts.map +1 -1
  590. package/dist/src/services/deployment/k8s/k8s-bootstrap.service.js.map +1 -1
  591. package/dist/src/services/deployment/k8s/k8s-local-infra-readiness.service.d.ts.map +1 -1
  592. package/dist/src/services/deployment/k8s/k8s-local-infra-readiness.service.js.map +1 -1
  593. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.d.ts.map +1 -1
  594. package/dist/src/services/deployment/k8s/k8s-manifest-generator.service.js.map +1 -1
  595. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.d.ts.map +1 -1
  596. package/dist/src/services/deployment/k8s/k8s-manifest.schemas.js.map +1 -1
  597. package/dist/src/services/deployment/k8s/k8s-operations.service.d.ts.map +1 -1
  598. package/dist/src/services/deployment/k8s/k8s-operations.service.js.map +1 -1
  599. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.d.ts.map +1 -1
  600. package/dist/src/services/deployment/k8s/k8s-secrets-generator.service.js.map +1 -1
  601. package/dist/src/services/deployment/k8s/k8s.schemas.d.ts.map +1 -1
  602. package/dist/src/services/deployment/k8s/k8s.schemas.js.map +1 -1
  603. package/dist/src/services/deployment/k8s/kind.service.d.ts.map +1 -1
  604. package/dist/src/services/deployment/k8s/kind.service.js.map +1 -1
  605. package/dist/src/services/deployment/k8s/local-k8s-application-pruning.service.d.ts.map +1 -1
  606. package/dist/src/services/deployment/k8s/local-k8s-application-pruning.service.js.map +1 -1
  607. package/dist/src/services/deployment/local-dev-observer-lifecycle.d.ts.map +1 -1
  608. package/dist/src/services/deployment/local-dev-observer-lifecycle.js.map +1 -1
  609. package/dist/src/services/deployment/local-dev-output-boundary.d.ts.map +1 -1
  610. package/dist/src/services/deployment/local-dev-output-boundary.js.map +1 -1
  611. package/dist/src/services/deployment/local-dev-session-lease.service.d.ts.map +1 -1
  612. package/dist/src/services/deployment/local-dev-session-lease.service.js.map +1 -1
  613. package/dist/src/services/deployment/local-dev-shutdown-coordinator.d.ts.map +1 -1
  614. package/dist/src/services/deployment/local-dev-shutdown-coordinator.js.map +1 -1
  615. package/dist/src/services/deployment/local-infrastructure-initialization.service.d.ts.map +1 -1
  616. package/dist/src/services/deployment/local-infrastructure-initialization.service.js.map +1 -1
  617. package/dist/src/services/deployment/local-precondition-checks.schemas.d.ts.map +1 -1
  618. package/dist/src/services/deployment/local-precondition-checks.schemas.js.map +1 -1
  619. package/dist/src/services/deployment/local-precondition-checks.service.d.ts.map +1 -1
  620. package/dist/src/services/deployment/local-precondition-checks.service.js.map +1 -1
  621. package/dist/src/services/deployment/local-runtime-process-cleanup.service.d.ts.map +1 -1
  622. package/dist/src/services/deployment/local-runtime-process-cleanup.service.js.map +1 -1
  623. package/dist/src/services/deployment/platform-lifecycle.service.d.ts.map +1 -1
  624. package/dist/src/services/deployment/platform-lifecycle.service.js.map +1 -1
  625. package/dist/src/services/deployment/platform-runtime-policy.service.d.ts.map +1 -1
  626. package/dist/src/services/deployment/platform-runtime-policy.service.js.map +1 -1
  627. package/dist/src/services/deployment/version-compare.utils.d.ts.map +1 -1
  628. package/dist/src/services/deployment/version-compare.utils.js.map +1 -1
  629. package/dist/src/services/design-tokens/design-tokens-command.service.d.ts.map +1 -1
  630. package/dist/src/services/design-tokens/design-tokens-command.service.js.map +1 -1
  631. package/dist/src/services/design-tokens/design-tokens-config.service.d.ts.map +1 -1
  632. package/dist/src/services/design-tokens/design-tokens-config.service.js.map +1 -1
  633. package/dist/src/services/design-tokens/design-tokens-config.template.d.ts.map +1 -1
  634. package/dist/src/services/design-tokens/design-tokens-config.template.js.map +1 -1
  635. package/dist/src/services/design-tokens/design-tokens-css-block.service.d.ts.map +1 -1
  636. package/dist/src/services/design-tokens/design-tokens-css-block.service.js.map +1 -1
  637. package/dist/src/services/design-tokens/design-tokens-paths.service.d.ts.map +1 -1
  638. package/dist/src/services/design-tokens/design-tokens-paths.service.js.map +1 -1
  639. package/dist/src/services/design-tokens/design-tokens.constants.d.ts.map +1 -1
  640. package/dist/src/services/design-tokens/design-tokens.constants.js.map +1 -1
  641. package/dist/src/services/design-tokens/design-tokens.models.d.ts.map +1 -1
  642. package/dist/src/services/design-tokens/design-tokens.models.js.map +1 -1
  643. package/dist/src/services/environment/application-backing-service-addressing.utils.d.ts.map +1 -1
  644. package/dist/src/services/environment/application-backing-service-addressing.utils.js.map +1 -1
  645. package/dist/src/services/environment/authored-infra-config.utils.d.ts.map +1 -1
  646. package/dist/src/services/environment/authored-infra-config.utils.js.map +1 -1
  647. package/dist/src/services/environment/env-configuration-generator.service.d.ts.map +1 -1
  648. package/dist/src/services/environment/env-configuration-generator.service.js.map +1 -1
  649. package/dist/src/services/environment/env-sync.service.d.ts.map +1 -1
  650. package/dist/src/services/environment/env-sync.service.js.map +1 -1
  651. package/dist/src/services/environment/env-vars-builder.service.d.ts.map +1 -1
  652. package/dist/src/services/environment/env-vars-builder.service.js.map +1 -1
  653. package/dist/src/services/environment/environment-hydration.utils.d.ts.map +1 -1
  654. package/dist/src/services/environment/environment-hydration.utils.js.map +1 -1
  655. package/dist/src/services/environment/environment-lifecycle.service.d.ts.map +1 -1
  656. package/dist/src/services/environment/environment-lifecycle.service.js.map +1 -1
  657. package/dist/src/services/environment/environment-paths.service.d.ts.map +1 -1
  658. package/dist/src/services/environment/environment-paths.service.js.map +1 -1
  659. package/dist/src/services/environment/environment-registry.service.d.ts.map +1 -1
  660. package/dist/src/services/environment/environment-registry.service.js.map +1 -1
  661. package/dist/src/services/environment/environment-setup.service.d.ts.map +1 -1
  662. package/dist/src/services/environment/environment-setup.service.js.map +1 -1
  663. package/dist/src/services/environment/environment.schemas.d.ts.map +1 -1
  664. package/dist/src/services/environment/environment.schemas.js.map +1 -1
  665. package/dist/src/services/environment/environment.service.d.ts.map +1 -1
  666. package/dist/src/services/environment/environment.service.js.map +1 -1
  667. package/dist/src/services/environment/hosted-infrastructure-leftovers.service.d.ts.map +1 -1
  668. package/dist/src/services/environment/hosted-infrastructure-leftovers.service.js.map +1 -1
  669. package/dist/src/services/environment/infrastructure-host.service.d.ts.map +1 -1
  670. package/dist/src/services/environment/infrastructure-host.service.js.map +1 -1
  671. package/dist/src/services/environment/platform-engine-change.utils.d.ts.map +1 -1
  672. package/dist/src/services/environment/platform-engine-change.utils.js.map +1 -1
  673. package/dist/src/services/environment/platform-runtime-state.service.d.ts.map +1 -1
  674. package/dist/src/services/environment/platform-runtime-state.service.js.map +1 -1
  675. package/dist/src/services/environment/platform-runtime.schemas.d.ts.map +1 -1
  676. package/dist/src/services/environment/platform-runtime.schemas.js.map +1 -1
  677. package/dist/src/services/environment/runtime-bootstrap.service.d.ts.map +1 -1
  678. package/dist/src/services/environment/runtime-bootstrap.service.js.map +1 -1
  679. package/dist/src/services/framework/application-claude-settings.d.ts +39 -5
  680. package/dist/src/services/framework/application-claude-settings.d.ts.map +1 -1
  681. package/dist/src/services/framework/application-claude-settings.js +100 -25
  682. package/dist/src/services/framework/application-claude-settings.js.map +1 -1
  683. package/dist/src/services/framework/application-rule-imports.d.ts.map +1 -1
  684. package/dist/src/services/framework/application-rule-imports.js.map +1 -1
  685. package/dist/src/services/framework/claude-plugin-compiler.d.ts.map +1 -1
  686. package/dist/src/services/framework/claude-plugin-compiler.js +3 -2
  687. package/dist/src/services/framework/claude-plugin-compiler.js.map +1 -1
  688. package/dist/src/services/framework/dev-compile-status.paths.d.ts.map +1 -1
  689. package/dist/src/services/framework/dev-compile-status.paths.js.map +1 -1
  690. package/dist/src/services/framework/framework-development-skills-sync.service.d.ts.map +1 -1
  691. package/dist/src/services/framework/framework-development-skills-sync.service.js.map +1 -1
  692. package/dist/src/services/framework/framework-docker-publish.service.d.ts.map +1 -1
  693. package/dist/src/services/framework/framework-docker-publish.service.js.map +1 -1
  694. package/dist/src/services/framework/framework-knowledge-application-guidance.validator.d.ts.map +1 -1
  695. package/dist/src/services/framework/framework-knowledge-application-guidance.validator.js.map +1 -1
  696. package/dist/src/services/framework/framework-knowledge-audit.service.d.ts.map +1 -1
  697. package/dist/src/services/framework/framework-knowledge-audit.service.js.map +1 -1
  698. package/dist/src/services/framework/framework-knowledge-generation.service.d.ts.map +1 -1
  699. package/dist/src/services/framework/framework-knowledge-generation.service.js.map +1 -1
  700. package/dist/src/services/framework/framework-knowledge-scan.constants.d.ts.map +1 -1
  701. package/dist/src/services/framework/framework-knowledge-scan.constants.js.map +1 -1
  702. package/dist/src/services/framework/framework-npm-publish.service.d.ts.map +1 -1
  703. package/dist/src/services/framework/framework-npm-publish.service.js.map +1 -1
  704. package/dist/src/services/framework/framework-publish-manifest.service.d.ts.map +1 -1
  705. package/dist/src/services/framework/framework-publish-manifest.service.js.map +1 -1
  706. package/dist/src/services/framework/framework-release.service.d.ts.map +1 -1
  707. package/dist/src/services/framework/framework-release.service.js.map +1 -1
  708. package/dist/src/services/framework/framework-update.service.d.ts.map +1 -1
  709. package/dist/src/services/framework/framework-update.service.js.map +1 -1
  710. package/dist/src/services/framework/framework-version.service.d.ts.map +1 -1
  711. package/dist/src/services/framework/framework-version.service.js.map +1 -1
  712. package/dist/src/services/framework/frontend-component-catalog.generator.d.ts.map +1 -1
  713. package/dist/src/services/framework/frontend-component-catalog.generator.js.map +1 -1
  714. package/dist/src/services/framework/frontend-library-root-exports.d.ts.map +1 -1
  715. package/dist/src/services/framework/frontend-library-root-exports.js.map +1 -1
  716. package/dist/src/services/framework/installed-framework-assets.service.d.ts.map +1 -1
  717. package/dist/src/services/framework/installed-framework-assets.service.js.map +1 -1
  718. package/dist/src/services/framework/npm-registry-output.d.ts.map +1 -1
  719. package/dist/src/services/framework/npm-registry-output.js.map +1 -1
  720. package/dist/src/services/framework/package-install.service.d.ts.map +1 -1
  721. package/dist/src/services/framework/package-install.service.js.map +1 -1
  722. package/dist/src/services/framework/provider-transposition/activepieces-source.reader.d.ts.map +1 -1
  723. package/dist/src/services/framework/provider-transposition/activepieces-source.reader.js.map +1 -1
  724. package/dist/src/services/framework/provider-transposition/api-version-settlement.d.ts.map +1 -1
  725. package/dist/src/services/framework/provider-transposition/api-version-settlement.js.map +1 -1
  726. package/dist/src/services/framework/provider-transposition/base-url-settlement.d.ts.map +1 -1
  727. package/dist/src/services/framework/provider-transposition/base-url-settlement.js.map +1 -1
  728. package/dist/src/services/framework/provider-transposition/openapi-enrichment.d.ts.map +1 -1
  729. package/dist/src/services/framework/provider-transposition/openapi-enrichment.js.map +1 -1
  730. package/dist/src/services/framework/provider-transposition/openapi-source.reader.d.ts.map +1 -1
  731. package/dist/src/services/framework/provider-transposition/openapi-source.reader.js.map +1 -1
  732. package/dist/src/services/framework/provider-transposition/provider-catalogue-record.d.ts.map +1 -1
  733. package/dist/src/services/framework/provider-transposition/provider-catalogue-record.js.map +1 -1
  734. package/dist/src/services/framework/provider-transposition/provider-merge.d.ts.map +1 -1
  735. package/dist/src/services/framework/provider-transposition/provider-merge.js.map +1 -1
  736. package/dist/src/services/framework/provider-transposition/provider-package.emitter.d.ts.map +1 -1
  737. package/dist/src/services/framework/provider-transposition/provider-package.emitter.js.map +1 -1
  738. package/dist/src/services/framework/provider-transposition/request-helper-url.d.ts.map +1 -1
  739. package/dist/src/services/framework/provider-transposition/request-helper-url.js.map +1 -1
  740. package/dist/src/services/framework/provider-transposition/sim-source.reader.d.ts.map +1 -1
  741. package/dist/src/services/framework/provider-transposition/sim-source.reader.js.map +1 -1
  742. package/dist/src/services/framework/provider-transposition/source-static-evaluator.d.ts.map +1 -1
  743. package/dist/src/services/framework/provider-transposition/source-static-evaluator.js.map +1 -1
  744. package/dist/src/services/framework/provider-transposition/transposed-provider.model.d.ts.map +1 -1
  745. package/dist/src/services/framework/provider-transposition/transposed-provider.model.js.map +1 -1
  746. package/dist/src/services/framework/provider-transposition/url-template.extractor.d.ts.map +1 -1
  747. package/dist/src/services/framework/provider-transposition/url-template.extractor.js.map +1 -1
  748. package/dist/src/services/frontend/cloudflare-cdn.service.d.ts.map +1 -1
  749. package/dist/src/services/frontend/cloudflare-cdn.service.js.map +1 -1
  750. package/dist/src/services/frontend/frontend-dist-uploader.service.d.ts.map +1 -1
  751. package/dist/src/services/frontend/frontend-dist-uploader.service.js.map +1 -1
  752. package/dist/src/services/frontend/frontend-publish.service.d.ts.map +1 -1
  753. package/dist/src/services/frontend/frontend-publish.service.js.map +1 -1
  754. package/dist/src/services/generation/domain-generator.service.d.ts.map +1 -1
  755. package/dist/src/services/generation/domain-generator.service.js.map +1 -1
  756. package/dist/src/services/generation/generator.schemas.d.ts.map +1 -1
  757. package/dist/src/services/generation/generator.schemas.js.map +1 -1
  758. package/dist/src/services/generation/operation-generator.service.d.ts.map +1 -1
  759. package/dist/src/services/generation/operation-generator.service.js.map +1 -1
  760. package/dist/src/services/generation/resource-generator.service.d.ts.map +1 -1
  761. package/dist/src/services/generation/resource-generator.service.js.map +1 -1
  762. package/dist/src/services/generation/template-registry.service.d.ts.map +1 -1
  763. package/dist/src/services/generation/template-registry.service.js.map +1 -1
  764. package/dist/src/services/registry/artifact-extractor.utils.d.ts.map +1 -1
  765. package/dist/src/services/registry/artifact-extractor.utils.js.map +1 -1
  766. package/dist/src/services/registry/artifact-trust.utils.d.ts.map +1 -1
  767. package/dist/src/services/registry/artifact-trust.utils.js.map +1 -1
  768. package/dist/src/services/registry/boundary-fanout.utils.d.ts.map +1 -1
  769. package/dist/src/services/registry/boundary-fanout.utils.js.map +1 -1
  770. package/dist/src/services/registry/git-ignored-paths.utils.d.ts.map +1 -1
  771. package/dist/src/services/registry/git-ignored-paths.utils.js.map +1 -1
  772. package/dist/src/services/registry/index.d.ts.map +1 -1
  773. package/dist/src/services/registry/index.js.map +1 -1
  774. package/dist/src/services/registry/installed-file-state.utils.d.ts.map +1 -1
  775. package/dist/src/services/registry/installed-file-state.utils.js.map +1 -1
  776. package/dist/src/services/registry/local-checkout-module-source.service.d.ts.map +1 -1
  777. package/dist/src/services/registry/local-checkout-module-source.service.js.map +1 -1
  778. package/dist/src/services/registry/migration-obligation.utils.d.ts.map +1 -1
  779. package/dist/src/services/registry/migration-obligation.utils.js.map +1 -1
  780. package/dist/src/services/registry/module-acquisition.utils.d.ts.map +1 -1
  781. package/dist/src/services/registry/module-acquisition.utils.js.map +1 -1
  782. package/dist/src/services/registry/module-artifact-files.utils.d.ts.map +1 -1
  783. package/dist/src/services/registry/module-artifact-files.utils.js.map +1 -1
  784. package/dist/src/services/registry/module-registration.service.d.ts.map +1 -1
  785. package/dist/src/services/registry/module-registration.service.js.map +1 -1
  786. package/dist/src/services/registry/module-requirements.service.d.ts.map +1 -1
  787. package/dist/src/services/registry/module-requirements.service.js.map +1 -1
  788. package/dist/src/services/registry/provider-install-step.d.ts.map +1 -1
  789. package/dist/src/services/registry/provider-install-step.js.map +1 -1
  790. package/dist/src/services/registry/provider-module-checks.service.d.ts.map +1 -1
  791. package/dist/src/services/registry/provider-module-checks.service.js.map +1 -1
  792. package/dist/src/services/registry/provider-module-identity.service.d.ts.map +1 -1
  793. package/dist/src/services/registry/provider-module-identity.service.js.map +1 -1
  794. package/dist/src/services/registry/provider-wiring.service.d.ts.map +1 -1
  795. package/dist/src/services/registry/provider-wiring.service.js.map +1 -1
  796. package/dist/src/services/registry/registry-command.utils.d.ts.map +1 -1
  797. package/dist/src/services/registry/registry-command.utils.js.map +1 -1
  798. package/dist/src/services/registry/registry-config-resolver.service.d.ts.map +1 -1
  799. package/dist/src/services/registry/registry-config-resolver.service.js.map +1 -1
  800. package/dist/src/services/registry/registry-credentials.service.d.ts.map +1 -1
  801. package/dist/src/services/registry/registry-credentials.service.js.map +1 -1
  802. package/dist/src/services/registry/saas-root-required.error.d.ts.map +1 -1
  803. package/dist/src/services/registry/saas-root-required.error.js.map +1 -1
  804. package/dist/src/services/security/csp-sync.service.d.ts.map +1 -1
  805. package/dist/src/services/security/csp-sync.service.js.map +1 -1
  806. package/dist/src/services/tools/utility-tools.service.d.ts.map +1 -1
  807. package/dist/src/services/tools/utility-tools.service.js.map +1 -1
  808. package/dist/src/services/tracker/creation-run-tracker.service.d.ts.map +1 -1
  809. package/dist/src/services/tracker/creation-run-tracker.service.js.map +1 -1
  810. package/dist/src/services/website/website-label-pack-audit.service.d.ts.map +1 -1
  811. package/dist/src/services/website/website-label-pack-audit.service.js.map +1 -1
  812. package/dist/src/services/website/website-structured-data-audit.service.d.ts.map +1 -1
  813. package/dist/src/services/website/website-structured-data-audit.service.js.map +1 -1
  814. package/dist/src/services/website/website-workspace.service.d.ts.map +1 -1
  815. package/dist/src/services/website/website-workspace.service.js.map +1 -1
  816. package/dist/tsconfig.build.tsbuildinfo +1 -0
  817. package/dist/tsconfig.tsbuildinfo +1 -0
  818. package/package.json +17 -17
  819. package/templates/saas/i18n/email/email-template-definitions.ts +5 -1
  820. package/templates/saas/scenarios/add-locale/files/website/src/i18n/__localePath__.json.hbs +21 -1
  821. package/templates/saas/scenarios/add-locale/files/website/src/pages/__localePath__/index.astro +1 -0
  822. package/templates/saas/scenarios/add-marketing-page/files/website/src/pages/__pageRef__.astro.hbs +1 -0
  823. package/templates/saas/scenarios/add-module/scenario.json +5 -0
  824. package/templates/saas/scenarios/add-website/files/website/src/components/FooterComponent.tsx.hbs +14 -6
  825. package/templates/saas/scenarios/add-website/files/website/src/content/llms.txt.hbs +3 -3
  826. package/templates/saas/scenarios/add-website/files/website/src/i18n/en.json.hbs +4 -0
  827. package/templates/saas/scenarios/add-website/files/website/src/pages/index.astro +1 -0
  828. package/templates/saas/scenarios/add-website/files/website/src/pages/llms.txt.ts +3 -1
  829. package/templates/saas/scenarios/add-website/files/website/src/styles/website.css +14 -0
  830. package/templates/saas/skeleton/backend-api/src/engine/email/email-template-definitions.ts +5 -1
  831. package/templates/saas/skeleton/shared-lib/src/engine/roles.ts +10 -2
  832. package/templates/saas/skeleton/specifications/src/companion-exports.ts +28 -3
  833. package/wildo-framework.info.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"saas-scaffold.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/saas-scaffold.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAmB,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAMxF,SAAS,MAAM,CAAC,IAAY;IAC1B,OAAO,IAAI;SACR,IAAI,EAAE;SACN,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;AAC7B,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,gGAAgG;IAChG,6FAA6F;IAC7F,OAAO,IAAI;SACR,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,aAAa,CAAC,OAA4B;IACjD,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;IACvC,6FAA6F;IAC7F,MAAM,WAAW,GAAG,aAAa,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC;IAE7D,OAAO;;;;;;;;;;;;;WAaE,IAAI;WACJ,IAAI;kBACG,WAAW;;;;;sBAKP,IAAI;;;;;sBAKJ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAgCD,IAAI;;;oBAGT,IAAI;;;uBAGD,IAAI;;;;CAI1B,CAAC;AACF,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,QAAQ,CAAC,GAAW,EAAE,OAA4B;QAChD,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACpD,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC","sourcesContent":["/**\n * SaasScaffoldService — create a minimal `wildo.saas.config.ts`.\n *\n * The scaffold intentionally stays lean: it establishes the canonical\n * app-owned declaration root and sensible default service/data-service\n * identities without pretending to generate a full application.\n */\n\nimport { writeFileSync } from 'fs';\nimport { join } from 'path';\nimport { AppFrontendType, WORKSPACE_CONFIG_NAMES } from '@wildo-ai/platform-config-lib';\n\nexport interface SaasScaffoldOptions {\n name: string;\n}\n\nfunction toSlug(name: string): string {\n return name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\nfunction toDisplayName(name: string): string {\n // invented-display-text: a SCAFFOLD SEED, written once into a new application's own config file\n // where its author edits it. It is a starting value in source, not text resolved at runtime.\n return name\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, c => c.toUpperCase());\n}\n\nfunction buildTemplate(options: SaasScaffoldOptions): string {\n const safeName = options.name.replace(/['\"\\\\]/g, '');\n const slug = toSlug(safeName) || 'app';\n // invented-display-text: a scaffold seed written into the new application's own config file.\n const displayName = toDisplayName(safeName || slug) || 'App';\n\n return `import { AppFrontendType, defineSaaSProviders, defineSaasConfig } from '@wildo-ai/platform-config-lib';\nimport { EngineCapability } from '@wildo-ai/saas-models';\n\n/**\n * Domain MODULES and the service runtimes each is bound to — the \\`add-module\\`\n * scenario's insertion anchor. A scenario appends into a top-level exported\n * object, never into a property nested inside the \\`defineSaasConfig(...)\\`\n * argument, so an inline \\`modules: {}\\` here would make \\`add-module\\` REFUSE on\n * any application scaffolded through \\`wildo init --config-only\\`.\n */\nexport const applicationModules = {};\n\nexport default defineSaasConfig({\n name: '${slug}',\n slug: '${slug}',\n displayName: '${displayName}',\n type: 'saas',\n services: {\n backendApi: {\n path: './backend-api',\n serviceName: '${slug}-backend-api',\n defaultPort: 4241,\n },\n app: {\n path: './frontend',\n serviceName: '${slug}-app',\n defaultPort: 4242,\n frontendType: AppFrontendType.SAAS_APP,\n },\n },\n modules: applicationModules,\n engineCapabilities: {\n [EngineCapability.ORGANIZATIONS]: { enabled: false },\n [EngineCapability.BILLING]: { enabled: false },\n [EngineCapability.MULTI_LANGUAGE]: { enabled: false },\n },\n providerConfigurations: {},\n /*\n * At least one organization type is required: every organization carries a type naming an entry here,\n * and a member of an organization whose type is not declared cannot sign in.\n */\n organizationTypes: {\n workspace: {\n userTypes: ['member'],\n },\n },\n providers: defineSaaSProviders({\n scopes: {\n backend: { providers: {} },\n companion: { providers: {} },\n frontendServices: {\n app: { providers: {} },\n },\n },\n }),\n dataServices: {\n mongodb: {\n databasePrefix: '${slug}',\n },\n redis: {\n keyPrefix: '${slug}:',\n },\n s3: {\n bucketPrefix: '${slug}',\n },\n },\n});\n`;\n}\n\nexport const SaasScaffoldService = {\n scaffold(cwd: string, options: SaasScaffoldOptions): string {\n const content = buildTemplate(options);\n const path = join(cwd, WORKSPACE_CONFIG_NAMES.SAAS);\n writeFileSync(path, content, 'utf-8');\n return path;\n },\n};\n"]}
1
+ {"version":3,"file":"saas-scaffold.service.js","sourceRoot":"","sources":["../../../../src/services/application/saas-scaffold.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AACnC,OAAO,EAA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E,OAAO,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAC","sourcesContent":["/**\n * SaasScaffoldService — create a minimal `wildo.saas.config.ts`.\n *\n * The scaffold intentionally stays lean: it establishes the canonical\n * app-owned declaration root and sensible default service/data-service\n * identities without pretending to generate a full application.\n */\n\nimport { writeFileSync } from 'fs';\nimport { join } from 'path';\nimport { AppFrontendType, WORKSPACE_CONFIG_NAMES } from '@wildo-ai/platform-config-lib';\n\nexport interface SaasScaffoldOptions {\n name: string;\n}\n\nfunction toSlug(name: string): string {\n return name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\nfunction toDisplayName(name: string): string {\n // invented-display-text: a SCAFFOLD SEED, written once into a new application's own config file\n // where its author edits it. It is a starting value in source, not text resolved at runtime.\n return name\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, c => c.toUpperCase());\n}\n\nfunction buildTemplate(options: SaasScaffoldOptions): string {\n const safeName = options.name.replace(/['\"\\\\]/g, '');\n const slug = toSlug(safeName) || 'app';\n // invented-display-text: a scaffold seed written into the new application's own config file.\n const displayName = toDisplayName(safeName || slug) || 'App';\n\n return `import { AppFrontendType, defineSaaSProviders, defineSaasConfig } from '@wildo-ai/platform-config-lib';\nimport { EngineCapability } from '@wildo-ai/saas-models';\n\n/**\n * Domain MODULES and the service runtimes each is bound to — the \\`add-module\\`\n * scenario's insertion anchor. A scenario appends into a top-level exported\n * object, never into a property nested inside the \\`defineSaasConfig(...)\\`\n * argument, so an inline \\`modules: {}\\` here would make \\`add-module\\` REFUSE on\n * any application scaffolded through \\`wildo init --config-only\\`.\n */\nexport const applicationModules = {};\n\nexport default defineSaasConfig({\n name: '${slug}',\n slug: '${slug}',\n displayName: '${displayName}',\n type: 'saas',\n services: {\n backendApi: {\n path: './backend-api',\n serviceName: '${slug}-backend-api',\n defaultPort: 4241,\n },\n app: {\n path: './frontend',\n serviceName: '${slug}-app',\n defaultPort: 4242,\n frontendType: AppFrontendType.SAAS_APP,\n },\n },\n modules: applicationModules,\n engineCapabilities: {\n [EngineCapability.ORGANIZATIONS]: { enabled: false },\n [EngineCapability.BILLING]: { enabled: false },\n [EngineCapability.MULTI_LANGUAGE]: { enabled: false },\n },\n providerConfigurations: {},\n /*\n * At least one organization type is required: every organization carries a type naming an entry here,\n * and a member of an organization whose type is not declared cannot sign in.\n */\n organizationTypes: {\n workspace: {\n userTypes: ['member'],\n },\n },\n providers: defineSaaSProviders({\n scopes: {\n backend: { providers: {} },\n companion: { providers: {} },\n frontendServices: {\n app: { providers: {} },\n },\n },\n }),\n dataServices: {\n mongodb: {\n databasePrefix: '${slug}',\n },\n redis: {\n keyPrefix: '${slug}:',\n },\n s3: {\n bucketPrefix: '${slug}',\n },\n },\n});\n`;\n}\n\nexport const SaasScaffoldService = {\n scaffold(cwd: string, options: SaasScaffoldOptions): string {\n const content = buildTemplate(options);\n const path = join(cwd, WORKSPACE_CONFIG_NAMES.SAAS);\n writeFileSync(path, content, 'utf-8');\n return path;\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"saas-skeleton.service.d.ts","sourceRoot":"","sources":["../../../../../../src/services/application/saas-skeleton.service.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAgB/D;;;;GAIG;AACH,oBAAY,YAAY;IACtB;;;;OAIG;IACH,aAAa,kBAAkB;IAC/B;;;;;OAKG;IACH,WAAW,gBAAgB;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE,YA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,MAAM,qCAAqC,mHAIxC,CAAC;AAOX,iBAAS,kBAAkB,CAAC,KAAK,EAAE;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,YAAY,CAAC;CACpB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAyEzB;AA2ED;;;;;;;;GAQG;AACH,eAAO,MAAM,2CAA2C,UAAU,CAAC;AAEnE,+FAA+F;AAC/F,wBAAgB,4BAA4B,CAAC,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAK7E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAkEvH;AAED,4EAA4E;AAC5E,eAAO,MAAM,mCAAmC,QAAwD,CAAC;AAEzG;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,CAqBT;AA0SD,eAAO,MAAM,mBAAmB;;;;sBAKZ,MAAM,WAAW,mBAAmB,GAAG,kBAAkB;CA8P5E,CAAC"}
1
+ {"version":3,"file":"saas-skeleton.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/saas-skeleton.service.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAgB/D;;;;GAIG;AACH,oBAAY,YAAY;IACtB;;;;OAIG;IACH,aAAa,kBAAkB;IAC/B;;;;;OAKG;IACH,WAAW,gBAAgB;CAC5B;AAED,MAAM,WAAW,aAAa;IAC5B,OA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aasSkeletonService — materialize a full, bootable-after-setup application\n * skeleton from `templates/saas/skeleton/` (issue #51, T1–T10).\n *\n * The template tree carries three file classes:\n * - plain files, copied verbatim (`tsconfig.common.json`, package sources, …);\n * - `*.hbs` files, rendered through the shared Handlebars `TemplateProcessor`\n * with the app identity + ALLOCATED ports (D4: two applications sharing a\n * framework checkout must never collide on ports);\n * - `gitignore`, written as `.gitignore` (a literal dotfile inside the\n * template tree would make git ignore the template's own files).\n *\n * Two files are DERIVED rather than templated, per the T4 rule (\"derived from\n * the framework's current override set, never a frozen copy\"):\n * - the root `package.json` — its `pnpm.overrides` are computed live from\n * `scripts/app-dependency-alignment/propagated-engine-overrides.json`\n * (names) joined with the framework root's `pnpm.overrides` (versions),\n * plus, in framework-developer mode, `file:` links for every\n * `frameworkFileLinkPackages` entry resolved through the framework's own\n * pnpm-workspace;\n * - `.wildo-saas/dev-framework-scripts/run-dev-stack.sh` — its\n * `pnpm --filter` package lists are the scaffolded workspace members.\n *\n * DUAL MODE (D7 — both modes authored from the start). Both are live: the npm\n * publish lane put all twenty declared packages on the registry at 1.1.1 on\n * 2026-08-31, `@wildo-ai/dev-companion` among them, so app-creator mode installs\n * and delivers like any other consumer:\n * - `framework-dev`: `file:` overrides into the checkout, dev-framework\n * scripts installed, companion dist delivered via\n * `scripts/dev-orchestrator/dev-companion-deliver.mjs`;\n * - `app-creator`: `@wildo-ai/*` overrides pinned to the published framework\n * version; the companion drop is a re-export shim over the published\n * `@wildo-ai/dev-companion`, keeping the framework-dev entry layout.\n */\nimport { spawnSync } from 'child_process';\nimport { appendFileSync, copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync, chmodSync } from 'fs';\nimport { dirname, join, relative } from 'path';\nimport { parse as parseYaml } from 'yaml';\nimport { gte as semverGte, valid as semverValid } from 'semver';\nimport { DatabaseEngine } from '@wildo-ai/platform-config-lib';\nimport { TemplateProcessor } from '~wildo-cli/infrastructure/io/template-processor';\nimport { COMPANION_PORT_OFFSET, WORKBENCH_PORT_OFFSET } from '~wildo-cli/services/application/application-dev-port-offsets';\nimport {\n APPLICATION_DEPENDENCY_EXCLUSIONS_RELATIVE,\n ApplicationDependencyAlignmentService,\n} from '~wildo-cli/services/application/application-dependency-alignment.service';\nimport {\n FRAMEWORK_OVERRIDES_MANIFEST_RELATIVE,\n ProviderPackageLinksService,\n readFrameworkWorkspacePackages,\n readOptInFrameworkPackages,\n type OptInFrameworkPackageRecord,\n} from '~wildo-cli/services/application/provider-package-links.service';\nimport { resolveFrameworkRootManifestPath } from '~wildo-cli/services/framework/installed-framework-assets.service';\n\n/**\n * The two delivery modes every skeleton artifact is authored for (issue #51 D7).\n * The mode decides the root manifest's dependency story and which dev tooling\n * the scaffold materializes — it never changes the application's own sources.\n */\nexport enum SkeletonMode {\n /**\n * In-repo example app beside the framework checkout: `file:` overrides into\n * the checkout's workspace packages, dev-framework scripts installed, and the\n * companion dist delivered straight from the framework build.\n */\n FRAMEWORK_DEV = 'framework-dev',\n /**\n * Standalone app consuming published `@wildo-ai/*` versions. No framework\n * scripts; the companion arrives as a shim over the published\n * `@wildo-ai/dev-companion` rather than as a hard-linked build mirror. The\n * root `dev` script runs the workspace members' own dev scripts.\n */\n APP_CREATOR = 'app-creator',\n}\n\nexport interface SkeletonPorts {\n backend: number;\n app: number;\n companion: number;\n workbench: number;\n}\n\nexport interface SaasSkeletonOptions {\n name: string;\n frameworkPath: string | null;\n mode: SkeletonMode;\n /**\n * The APPLICATION's own store, as answered at `wildo init`. It decides what the scaffold AUTHORS —\n * `applicationDatabase`, the backing service it names, and the `dataServices` prefix — because on\n * PostgreSQL a resource's table is built by a migration and by nothing else, so an application that\n * says PostgreSQL and is authored as MongoDB is not the application anybody asked for.\n *\n * Absent scaffolds MongoDB — and the scaffold then AUTHORS `applicationDatabase: { engine: MONGODB }`\n * explicitly, because on the infra descriptor an absent `applicationDatabase` means PostgreSQL\n * (#1571). This option is the answer to a prompt; the descriptor must never be left to silence.\n */\n database?: DatabaseEngine;\n /**\n * The application whose platform this one runs on, as a path RELATIVE to the new application root\n * (`'../wonder-todos'`) — or absent when this application owns its environment's infrastructure.\n *\n * Several applications share one platform per environment. One OWNS it — its compose project, its\n * backing services, apps-manager, module-registry, crontabs — and the others declare it as their\n * `infrastructureHost` and merely REGISTER against it. Scaffolding every application as an owner is\n * what made a second application's `wildo config sync` offer to rewrite the shared platform\n * generation, and made stopping the first application look like a precondition for creating the\n * second. It is not: a hosted application's `wildo local init` resolves to the register-only path on\n * its own, and the host keeps running — the property that has to hold in remote, where the first\n * application is live traffic.\n *\n * Absent means this application owns the environment, which is right for the FIRST application on a\n * machine and wrong for every one after it.\n */\n infrastructureHost?: string;\n portBase?: number;\n skipInstall?: boolean;\n log: { info(message: string): void; warn(message: string): void };\n}\n\nexport interface SaasSkeletonResult {\n slug: string;\n ports: SkeletonPorts;\n filesWritten: number;\n companionDelivered: boolean;\n installed: boolean;\n built: boolean;\n}\n\nconst SKELETON_TEMPLATE_RELATIVE = 'templates/saas/skeleton';\n/**\n * The skeleton's ownership manifest, a SIBLING of the skeleton directory so it is never materialized\n * into an application. Its `frameworkDevLoop.templatePaths` is the one list of skeleton files that stay\n * framework-owned after `wildo init`: this walker leaves them out of an app-creator install (no framework\n * source to run them against), and the derived-artifact currency sweep\n * (`scripts/dev-orchestrator/derived-artifact-currency.mjs`, surface `skeleton-dev-loop`) reports a\n * framework-dev application that lacks one, or whose verbatim copy drifted — the gap #1063 measured when\n * the workbench launcher joined the skeleton and never reached an application scaffolded before it.\n */\nexport const SKELETON_OWNERSHIP_MANIFEST_NAME = 'skeleton-ownership.json';\n\ninterface SkeletonOwnershipManifest {\n schemaVersion: number;\n frameworkDevLoop: { templatePaths: string[]; generatedPaths: string[] };\n}\n\n/** Read the ownership manifest beside `templateRoot`; refuses a missing or foreign-shaped one rather than guessing. */\nexport function readSkeletonOwnership(templateRoot: string): SkeletonOwnershipManifest {\n const manifestPath = join(dirname(templateRoot), SKELETON_OWNERSHIP_MANIFEST_NAME);\n const parsed = JSON.parse(readFileSync(manifestPath, 'utf8')) as Partial<SkeletonOwnershipManifest>;\n if (\n parsed.schemaVersion !== 1\n || !Array.isArray(parsed.frameworkDevLoop?.templatePaths)\n || !Array.isArray(parsed.frameworkDevLoop?.generatedPaths)\n ) {\n throw new Error(`Skeleton ownership manifest is missing or malformed at ${manifestPath}.`);\n }\n return parsed as SkeletonOwnershipManifest;\n}\n\n/** Is this template-relative path (as authored) one of the framework-dev loop files? A directory entry covers its subtree. */\nexport function isFrameworkDevLoopTemplatePath(relativeTemplatePath: string, ownership: SkeletonOwnershipManifest): boolean {\n const normalized = relativeTemplatePath.split('\\\\').join('/');\n return ownership.frameworkDevLoop.templatePaths.some((entry) => normalized === entry || normalized.startsWith(`${entry}/`));\n}\nconst OVERRIDES_MANIFEST_RELATIVE = FRAMEWORK_OVERRIDES_MANIFEST_RELATIVE;\nconst COMPANION_DELIVER_RELATIVE = 'scripts/dev-orchestrator/dev-companion-deliver.mjs';\n/**\n * The workspace members `buildWorkspaceYaml` declares, minus the two GENERATED drops (their\n * manifests are written by their own generators and would overwrite anything injected here).\n * Kept beside that function on purpose: the two lists describe the same scaffold and must move\n * together.\n */\nconst SCAFFOLDED_WORKSPACE_MEMBERS = ['.', 'specifications', 'shared-lib', 'backend-api', 'frontend'] as const;\n\nconst DEFAULT_PORT_BASE = 4241;\nconst PORT_BASE_STRIDE = 10;\n\nfunction toSlug(name: string): string {\n return name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\nfunction toDisplayName(name: string): string {\n // invented-display-text: a SCAFFOLD SEED, written once into a new application's own config file\n // where its author edits it. It is a starting value in source, not text resolved at runtime.\n return name\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, c => c.toUpperCase());\n}\n\n/**\n * Allocate the app's port base by scanning every sibling application's AUTHORED\n * port declarations under `<framework>/examples/*` (saas config `defaultPort:`\n * plus infra `port:` values). The next free `PORT_BASE_STRIDE` block above the\n * highest occupied one wins, so a second app lands at 4251 beside Wonder\n * Todos' 4241–4244 instead of silently colliding (the exact failure of the\n * 2026-08-25 hand bootstrap that T8/D4 records).\n */\nfunction allocatePortBase(frameworkPath: string | null): number {\n const used = collectUsedApplicationPorts(frameworkPath);\n // Walk stride-aligned bases upward until BOTH the service block (base..base+stride-1)\n // and the derived companion port (base+offset) are free of every scanned port.\n for (let base = DEFAULT_PORT_BASE; base < 5000; base += PORT_BASE_STRIDE) {\n if (portBlockIsFree(base, used)) {\n return base;\n }\n }\n // Exhaustion must REFUSE, not silently hand back the default base — returning\n // 4241 here would scaffold an app directly onto Wonder Todos' ports, which is\n // the exact collision this allocator exists to prevent.\n throw new Error(\n 'No free application port block found in the 4000-4999 tier (stride 10 + companion offset 100). '\n + 'Pass an explicit --port-base outside the scanned range, or retire an unused sibling application.',\n );\n}\n\n/** True when the whole service block AND both derived tool ports avoid every scanned port. */\nfunction portBlockIsFree(base: number, used: ReadonlySet<number>): boolean {\n const blockPorts = Array.from({ length: PORT_BASE_STRIDE }, (_, i) => base + i);\n return blockPorts.every((port) => !used.has(port))\n && !used.has(base + COMPANION_PORT_OFFSET)\n && !used.has(base + WORKBENCH_PORT_OFFSET);\n}\n\n/** Collect every authored sibling port (saas `defaultPort:` + infra `port:`) in the 4xxx tier. */\nfunction collectUsedApplicationPorts(frameworkPath: string | null): Set<number> {\n const usedPorts: number[] = [];\n if (frameworkPath) {\n const examplesHome = join(frameworkPath, 'examples');\n if (existsSync(examplesHome)) {\n for (const entry of readdirSync(examplesHome, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n const appRoot = join(examplesHome, entry.name);\n for (const candidate of [\n join(appRoot, 'wildo.saas.config.ts'),\n join(appRoot, 'infrastructure/local/wildo.infra.local.config.ts'),\n ]) {\n if (!existsSync(candidate)) continue;\n const source = readFileSync(candidate, 'utf8');\n for (const match of source.matchAll(/(?:defaultPort|port)\\s*:\\s*(\\d{4,5})/g)) {\n usedPorts.push(Number(match[1]));\n }\n }\n }\n }\n }\n return new Set(usedPorts.filter((port) => port >= 4000 && port < 5000));\n}\n\n\n/**\n * The published framework packages an app-creator application pins BESIDE the file-link core.\n *\n * `frameworkFileLinkPackages` is the core every application links; these two are not in it, and in\n * app-creator mode neither was pinned by anything:\n *\n * - `@wildo-ai/framework-knowledge` is a root devDependency declared `\"*\"`. With no override the\n * lockfile keeps whatever it resolved first, so bumping the core left the delivered skills, rules\n * and docs on the scaffold-time release.\n * - `@wildo-ai/dev-companion` is the companion drop's only dependency. Pinning it at the root makes\n * the workspace agree with the drop's own exact pin rather than only with itself.\n * - `@wildo-ai/application-creation-workbench` is the workbench drop's only dependency, for the same\n * reason (see {@link writeAppCreatorWorkbenchDrop}).\n *\n * Kept out of `frameworkFileLinkPackages` on purpose: that list also drives framework-DEVELOPER\n * `file:` links and the dogfood alignment script, where the companion is delivered as a hard-linked\n * dist mirror and the knowledge through `wildo fwk dev-skills`. `wildo update` pins exactly the\n * union, so the two writers cannot disagree about the set.\n */\nexport const APP_CREATOR_ADDITIONAL_FRAMEWORK_PINS = [\n '@wildo-ai/framework-knowledge',\n '@wildo-ai/dev-companion',\n '@wildo-ai/application-creation-workbench',\n] as const;\n\ninterface OverridesManifest {\n propagatedOverrideKeys?: string[];\n frameworkFileLinkPackages?: string[];\n}\n\nfunction buildRootOverrides(input: {\n appRoot: string;\n frameworkPath: string;\n mode: SkeletonMode;\n}): Record<string, string> {\n const manifest = JSON.parse(\n readFileSync(join(input.frameworkPath, OVERRIDES_MANIFEST_RELATIVE), 'utf8'),\n ) as OverridesManifest;\n // Through the resolver, never `<root>/package.json`: in an INSTALLED framework-assets root that\n // file is the CLI's own manifest, and the framework root manifest ships beside it under another\n // name (`installed-framework-assets.service.ts`).\n const frameworkRootManifest = JSON.parse(\n readFileSync(resolveFrameworkRootManifestPath(input.frameworkPath), 'utf8'),\n ) as { version?: string; pnpm?: { overrides?: Record<string, string> } };\n const frameworkOverrides = frameworkRootManifest.pnpm?.overrides ?? {};\n const frameworkInfo = JSON.parse(\n readFileSync(join(input.frameworkPath, 'wildo-framework.info.json'), 'utf8'),\n ) as { version: string };\n\n const overrides: Record<string, string> = {};\n\n /*\n * The framework CORE — every application links all of it, so the authored list is the decision.\n * The PROVIDER packages are handled below and are demand-driven: see\n * `ProviderPackageLinksService`. Keeping the two apart is what stops a scaffolded application\n * carrying two hundred `file:` links to packages it never imports (plan D7, issue #334).\n */\n if (input.mode === SkeletonMode.FRAMEWORK_DEV) {\n const workspacePackages = readFrameworkWorkspacePackages(input.frameworkPath);\n for (const packageName of manifest.frameworkFileLinkPackages ?? []) {\n const workspacePackage = workspacePackages.get(packageName);\n if (!workspacePackage) {\n throw new Error(\n `frameworkFileLinkPackages names '${packageName}' but no framework workspace member carries that name — `\n + `fix ${OVERRIDES_MANIFEST_RELATIVE} or the workspace.`,\n );\n }\n overrides[packageName] = `file:${relative(input.appRoot, workspacePackage.root)}`;\n }\n } else {\n for (const packageName of [...(manifest.frameworkFileLinkPackages ?? []), ...APP_CREATOR_ADDITIONAL_FRAMEWORK_PINS]) {\n overrides[packageName] = frameworkInfo.version;\n }\n }\n\n /*\n * Provider packages and OPT-IN framework packages (#1836) the application ALREADY declares. At\n * `wildo init` both are empty by construction — a fresh scaffold declares neither — and that is the\n * point: such a link, and an opt-in package's pins, appear only after `wildo compose` writes the\n * dependency, and only for what was declared. The same resolution runs again after every\n * `wildo compose`, which is what makes the scenario a single command rather than a scenario plus a\n * hand-written override. An application that never declares the 3D layout package never carries\n * a byte of it.\n */\n const providerLinks = ProviderPackageLinksService.resolveProviderOverrides({\n applicationRoot: input.appRoot,\n frameworkWorkspacePackages: input.mode === SkeletonMode.FRAMEWORK_DEV\n ? readFrameworkWorkspacePackages(input.frameworkPath)\n : null,\n frameworkVersion: frameworkInfo.version,\n optIn: readOptInFrameworkPackages(input.frameworkPath),\n });\n for (const [packageName, overrideValue] of Object.entries(providerLinks.overrides)) {\n overrides[packageName] = overrideValue;\n }\n\n for (const key of manifest.propagatedOverrideKeys ?? []) {\n const version = frameworkOverrides[key];\n if (!version) {\n throw new Error(\n `propagatedOverrideKeys names '${key}' but the framework root pnpm.overrides carries no version for it.`,\n );\n }\n overrides[key] = version;\n }\n\n return Object.fromEntries(Object.entries(overrides).sort(([a], [b]) => a.localeCompare(b)));\n}\n\nfunction buildRootPackageJson(input: {\n slug: string;\n appRoot: string;\n frameworkPath: string | null;\n mode: SkeletonMode;\n}): string {\n const frameworkRootManifest = input.frameworkPath\n ? JSON.parse(readFileSync(resolveFrameworkRootManifestPath(input.frameworkPath), 'utf8')) as { packageManager?: string }\n : {};\n\n const manifest: Record<string, unknown> = {\n name: `@${input.slug}/root`,\n version: '1.0.0',\n private: true,\n ...(frameworkRootManifest.packageManager ? { packageManager: frameworkRootManifest.packageManager } : {}),\n scripts: {\n // `run-dev-stack.sh` is only WRITTEN in framework-dev mode; an app-creator\n // manifest pointing at it would ship a `pnpm dev` that fails on a missing\n // file. App-creator runs the workspace members' own dev scripts directly.\n ...(input.mode === SkeletonMode.FRAMEWORK_DEV\n ? {\n dev: 'bash .wildo-saas/dev-framework-scripts/run-dev-stack.sh full',\n 'dev:sync': 'bash .wildo-saas/dev-framework-scripts/sync-engine.sh',\n }\n : { dev: 'pnpm --parallel --no-bail -r run dev' }),\n build: 'turbo build',\n clean: 'turbo run clean',\n },\n ...(input.frameworkPath\n ? { pnpm: { overrides: buildRootOverrides({ appRoot: input.appRoot, frameworkPath: input.frameworkPath, mode: input.mode }) } }\n : {}),\n devDependencies: {\n '@wildo-ai/external-connectors-models': '*',\n // The compiled agent knowledge (skills, rules, references) `wildo assets sync` delivers into\n // `.claude/` and `.wildo-saas/docs/`. Declared at the ROOT so the CLI resolves it from the\n // application without knowing which workspace member happens to depend on it transitively.\n '@wildo-ai/framework-knowledge': '*',\n '@wildo-ai/platform-config-lib': '*',\n '@wildo-ai/saas-models': '*',\n tsx: '^4.21.0',\n turbo: '^2.8.11',\n },\n };\n return `${JSON.stringify(manifest, null, 2)}\\n`;\n}\n\nfunction buildWorkspaceYaml(): string {\n return [\n 'packages:',\n \" - 'specifications'\",\n \" - 'shared-lib'\",\n \" - 'backend-api'\",\n \" - 'frontend'\",\n ' # The dev companion drop: a GENERATED dist-only delivery (see the app',\n ' # .gitignore); its manifest is a workspace member so its dependencies',\n ' # resolve like every other package.',\n \" - '.wildo-saas/wildo-dev-companion'\",\n ' # The application-creation workbench drop. What it holds depends on who installed',\n ' # the framework: for a framework developer a LAUNCHER that runs Vite over the',\n ' # workbench source in the checkout; for an application creator a member that',\n ' # depends on the published @wildo-ai/application-creation-workbench and serves its',\n ' # built bundle in front of the companion (written by `wildo init` and `wildo update`).',\n ' # Either way it is a workspace member, which is what puts it in the dev stack',\n ' # (`wildo local dev` runs every member\\'s `dev`) beside everything else.',\n ' #',\n ' # An entry naming a directory that does not exist yet is safe, measured rather than',\n ' # assumed: `pnpm install` ignores it silently. The companion entry above relies on',\n ' # the same behaviour until its drop is delivered.',\n \" - '.wildo-saas/application-creation-workbench'\",\n '',\n ].join('\\n');\n}\n\n/**\n * The first `@wildo-ai/dev-companion` release that ships the `wildo-dev-companion-supervised` bin (#2226).\n *\n * The drop pins the companion to the framework's version EXACTLY, and a CLI built from a checkout carries the\n * checkout's version — `1.1.8` when the bin landed, a release that has no such bin. A supervised `dev` pinned\n * to it would be `command not found` and start NO companion, which is worse than the unsupervised command it\n * replaces. So a drop pinned below this version keeps the plain `node` command. Published versions at the time:\n * up to `1.1.8`, so the next release, whatever its number, carries the bin.\n */\nexport const FIRST_DEV_COMPANION_VERSION_WITH_SUPERVISOR = '1.1.9';\n\n/** The app-creator companion drop's `dev` script for the companion version it pins (#2226). */\nexport function appCreatorCompanionDevScript(companionVersion: string): string {\n const supervised = semverValid(companionVersion) !== null && semverGte(companionVersion, FIRST_DEV_COMPANION_VERSION_WITH_SUPERVISOR);\n return supervised\n ? 'wildo-dev-companion-supervised -- --env-file-if-exists=.env dist/esm/index.js'\n : 'node --env-file-if-exists=.env dist/esm/index.js';\n}\n\n/**\n * Write the app-creator companion drop: `.wildo-saas/wildo-dev-companion/`, a workspace member whose\n * only dependency is the published `@wildo-ai/dev-companion` at `companionVersion`, plus the\n * re-export shim that keeps the `dist/esm/index.js` entry layout a framework-dev delivery has.\n *\n * Written by `wildo init` (app-creator mode) and REWRITTEN by `wildo update`, which is why it lives\n * here rather than inline: the drop pins the companion EXACTLY, `wildo align-deps` skips every\n * `.wildo-saas/*` member, and the shim is gitignored — so without a second writer an upgrade left\n * the companion on the scaffold-time version forever, and a fresh clone had no entry file at all.\n * One writer means the two cannot describe different drops.\n *\n * Returns the number of files written (always 2).\n */\nexport function writeAppCreatorCompanionDrop(input: { appRoot: string; slug: string; companionVersion: string }): number {\n const { appRoot, slug, companionVersion } = input;\n const companionDropRoot = join(appRoot, '.wildo-saas', 'wildo-dev-companion');\n mkdirSync(join(companionDropRoot, 'dist', 'esm'), { recursive: true });\n writeFileSync(\n join(companionDropRoot, 'dist', 'esm', 'index.js'),\n [\n '// GENERATED by `wildo init` / `wildo update` (app-creator mode). Do not edit.',\n '//',\n '// The companion itself is the published `@wildo-ai/dev-companion` package, installed as a',\n '// dependency of this workspace member. This file exists so the drop keeps the same entry',\n '// layout as a framework-dev delivery, where `dist/` is a hard-linked mirror instead.',\n '//',\n '// `export *` evaluates the module, which is what starts the companion when this file is',\n '// executed by the `start` script.',\n \"export * from '@wildo-ai/dev-companion';\",\n '',\n ].join('\\n'),\n 'utf8',\n );\n writeFileSync(\n join(companionDropRoot, 'package.json'),\n `${JSON.stringify({\n name: `@${slug}/wildo-dev-companion`,\n version: companionVersion,\n description:\n 'Wildo.ai Dev Companion — app-creator delivery. A shim over the published '\n + '@wildo-ai/dev-companion package; generated by `wildo init` / `wildo update`, do not edit by hand.',\n private: true,\n type: 'module',\n main: 'dist/esm/index.js',\n scripts: {\n /*\n * `dev` runs the SAME companion as `start`, under the published package's own supervisor.\n *\n * `scripts/dev-supervised.sh` is a framework-developer script: it resolves\n * `framework.repositoryRoot` and supervises a watcher that recompiles the companion\n * from framework source. An app creator has neither — this drop is a shim over the\n * PUBLISHED `@wildo-ai/dev-companion`, already built, with nothing to watch.\n *\n * Pointing `dev` at it was fatal rather than merely useless, because the application\n * root's `dev` was `pnpm --parallel -r run dev`: the companion exited 1 and\n * `--parallel` tore down the backend, frontend and specifications watchers with it\n * (every generated dev command now passes `--no-bail`, 2026-09-24),\n * so `wildo local dev` started NO application runtime at all. Measured 2026-09-10 —\n * first \"Missing resolve-home-path helper\", then, once that was in place,\n * `Resolved home field \"framework.repositoryRoot\" is missing or empty`. Two symptoms,\n * one cause: a framework-only script on an app-creator install.\n *\n * Plain `node` then left NO supervisor at all (#2226): when the companion died mid build wave on\n * 2026-10-01, `--no-bail` kept the backend and frontend up and nothing brought the companion back.\n * `wildo-dev-companion-supervised` ships in `@wildo-ai/dev-companion` (so `wildo update` delivers its\n * fixes), needs no framework checkout, restarts a crashed companion with backoff and gives up after\n * a crash loop with one line — from the first release that ships it\n * ({@link FIRST_DEV_COMPANION_VERSION_WITH_SUPERVISOR}). `start` stays a single unsupervised run.\n */\n dev: appCreatorCompanionDevScript(companionVersion),\n start: 'node --env-file-if-exists=.env dist/esm/index.js',\n },\n dependencies: {\n '@wildo-ai/dev-companion': companionVersion,\n },\n }, null, 2)}\\n`,\n 'utf8',\n );\n return 2;\n}\n\n/** Where an app-creator workbench drop lives, beside the companion drop. */\nexport const APP_CREATOR_WORKBENCH_DROP_RELATIVE = join('.wildo-saas', 'application-creation-workbench');\n\n/**\n * Write the app-creator WORKBENCH drop: `.wildo-saas/application-creation-workbench/package.json`, a\n * workspace member whose only dependency is the published `@wildo-ai/application-creation-workbench`\n * at `workbenchVersion`, and whose `dev` / `start` run that package's `wildo-workbench-serve` in front\n * of this application's companion.\n *\n * The framework-developer drop at the same path is a LAUNCHER that runs Vite over the workbench SOURCE\n * in the checkout, so an application creator had no workbench at all — the operator UI of application\n * creation — and `wildo workbench open` sent them to a port nothing listened on. The published package\n * carries the BUILT bundle and a dependency-free server doing what the dev proxy does (one origin, `/api`\n * and `/health` forwarded, `Origin` untouched), so this drop is the whole delivery.\n *\n * `wildo local dev` starts it with the rest of the stack: an app-creator root `dev` runs every workspace\n * member's `dev` (`pnpm --parallel --no-bail -r run dev`), and the skeleton's workspace already lists this\n * path. The ports are written as flags so the script is one portable command line on every shell.\n *\n * Written by `wildo init` (app-creator mode) and REWRITTEN by `wildo update`. Returns the files written (1).\n */\nexport function writeAppCreatorWorkbenchDrop(input: {\n appRoot: string;\n slug: string;\n workbenchVersion: string;\n companionPort: number;\n workbenchPort: number;\n}): number {\n const dropRoot = join(input.appRoot, APP_CREATOR_WORKBENCH_DROP_RELATIVE);\n mkdirSync(dropRoot, { recursive: true });\n const serve = `wildo-workbench-serve --companion http://localhost:${input.companionPort} --port ${input.workbenchPort}`;\n writeFileSync(\n join(dropRoot, 'package.json'),\n `${JSON.stringify({\n name: `@${input.slug}/application-creation-workbench`,\n version: input.workbenchVersion,\n description:\n 'Wildo.ai application-creation workbench — app-creator delivery. Serves the published '\n + '@wildo-ai/application-creation-workbench in front of this application\\'s companion; generated by '\n + '`wildo init` / `wildo update`, do not edit by hand.',\n private: true,\n type: 'module',\n scripts: { dev: serve, start: serve },\n dependencies: { '@wildo-ai/application-creation-workbench': input.workbenchVersion },\n }, null, 2)}\\n`,\n 'utf8',\n );\n return 1;\n}\n\nfunction buildRunDevStack(slug: string): string {\n return `#!/bin/bash\n\n# GENERATED by \\`wildo init\\` (issue #51 T9) — the mode→package dispatch mirrors\n# this application's workspace members. Regenerate by re-running the scaffolder\n# rather than hand-editing the filter lists.\n#\n# \\`full\\` DERIVES its set rather than listing it, and that is the whole point of the\n# mode. An application GROWS workspace members after \\`wildo init\\` — \\`wildo compose\n# add-website\\`, \\`add-technical-doc\\`, \\`add-minion\\`, \\`add-worker-node\\` each append one\n# — and no scenario edits this file. A hand-written list here is therefore a second\n# enumeration of a population somebody else owns, and it drifted exactly that way: a\n# composed documentation portal was a declared service, a workspace member, and an\n# allocated port, and \\`full\\` never started it. Nothing reported that, because an\n# unlisted package simply does not appear.\n#\n# \\`pnpm -r\\` runs \\`dev\\` in every workspace package that HAS one, which is the honest\n# reading of \"the full stack\" and cannot fall behind a scenario. The narrow modes below\n# stay explicit: each names a deliberate subset, so listing is what they are for.\n#\n# \\`--no-bail\\` on every mode: one package whose \\`dev\\` exits must not end the others. Without\n# it pnpm stops every sibling on the first failure, and \\`wildo local dev\\` then reads the whole\n# application tree as exited and tears the stack down. Measured twice: a companion script that\n# exited 1 on an app-creator install left NO runtime running (2026-09-10), and a documentation\n# site whose config failed to load took the companion and backend down with it on every start\n# (2026-09-24, #1273). The runtimes are supervised individually and a supervisor can pause one\n# while the rest keep running, so a dead package is reported by the diagnostics, not by stopping\n# every other one.\n\nset -u\nset -o pipefail\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"$0\")\" && pwd)\"\nMODE=\"\\${1:-full}\"\n\ncase \"$MODE\" in\n full)\n STACK_COMMAND=(\n pnpm --parallel --no-bail -r\n run dev\n )\n ;;\n backend)\n STACK_COMMAND=(\n pnpm --parallel --no-bail\n --filter @${slug}/specifications\n --filter @${slug}/shared-lib\n --filter @${slug}/backend-api\n --filter './providers/**'\n run dev\n )\n ;;\n companion)\n STACK_COMMAND=(\n pnpm --parallel --no-bail\n --filter @${slug}/specifications\n --filter @${slug}/shared-lib\n --filter @wildo-ai/dev-companion\n run dev\n )\n ;;\n frontend)\n STACK_COMMAND=(\n pnpm --parallel --no-bail\n --filter @${slug}/main-app\n --filter './providers/**'\n run dev\n )\n ;;\n # The workbench ALONE, for iterating on the tool itself. It talks to a companion over HTTP\n # rather than importing it, so it runs perfectly well against a companion already started by\n # another mode — and starting it here does not drag the application's stack along.\n workbench)\n STACK_COMMAND=(\n pnpm --parallel --no-bail\n --filter @wildo-ai/application-creation-workbench\n run dev\n )\n ;;\n *)\n echo \"[dev-stack] Unknown mode: $MODE\"\n echo \"[dev-stack] Expected one of: full, backend, companion, frontend, workbench\"\n exit 1\n ;;\nesac\n\nif [ -f \"$SCRIPT_DIR/sync-engine.sh\" ]; then\n \"$SCRIPT_DIR/sync-engine.sh\" &\n SYNC_PID=$!\n HAS_CLEANED_UP=0\n\n cleanup() {\n if [ \"$HAS_CLEANED_UP\" -eq 1 ]; then\n return\n fi\n HAS_CLEANED_UP=1\n if kill -0 \"$SYNC_PID\" 2>/dev/null; then\n kill \"$SYNC_PID\" 2>/dev/null || true\n wait \"$SYNC_PID\" 2>/dev/null || true\n fi\n }\n\n trap cleanup EXIT INT TERM\nfi\n\n\"\\${STACK_COMMAND[@]}\"\n`;\n}\n\n/**\n * Declare, in every scaffolded workspace package, the engine peers it must SUPPLY (issue #167).\n *\n * A pnpm override rewrites a specifier that some manifest wrote down; it never creates one. A peer\n * nobody declares therefore falls to `autoInstallPeers`, whose resolution is STICKY: correct on a\n * fresh lockfile, and frozen at whatever predates the override otherwise. So an application that\n * does not declare the engine's peers cannot receive a later pin bump — moving a root pin from `^6`\n * to `^7` leaves it on 6 with a warning and no remedy short of deleting its lockfile.\n *\n * Each name is written as `\"*\"`, never a version: the root `pnpm.overrides` block written beside it\n * already carries the pin, so a framework bump reaches the application with no edit here.\n *\n * The name set is READ from the generated `enginePeerClosure` rather than re-derived. That map is\n * produced and gated by `scripts/app-dependency-alignment.mjs`; only the trivial union lookup is\n * repeated here, because this service is compiled TypeScript in another package and cannot import\n * the repository's `.mjs` derivation.\n *\n * Nothing is ever removed — the same restraint the reconciler applies. A template-authored peer that\n * the closure does not require (`ufo`, today) is the application's own declaration, and a shared name\n * is not evidence of shared ownership.\n */\nfunction declareEnginePeersInScaffoldedPackages(input: { appRoot: string; frameworkPath: string }): void {\n const manifestPath = join(input.frameworkPath, OVERRIDES_MANIFEST_RELATIVE);\n if (!existsSync(manifestPath)) return;\n const { enginePeerClosure, deliveredNotImported, optInPackageRecords } = JSON.parse(readFileSync(manifestPath, 'utf8')) as {\n enginePeerClosure?: Record<string, string[]>;\n deliveredNotImported?: string[];\n optInPackageRecords?: Record<string, OptInFrameworkPackageRecord>;\n };\n if (!enginePeerClosure) return;\n /*\n * Packages a SCAFFOLDED APPLICATION links for their FILES and never loads as code, so it owes\n * none of their transitive peers. Read from the same generated manifest as the closure, for the\n * same reason: this service cannot import the repository's `.mjs` derivation, so the authored\n * answer travels as data rather than being repeated as a judgement.\n *\n * Without it, `@wildo-ai/framework-knowledge` — linked so `wildo assets sync` can read\n * `dist/knowledge/**` off disk — would plant its whole transitive frontend closure (63 names:\n * radix, react-router, echarts) into every application this scaffolds.\n */\n const deliveryOnly = new Set(deliveredNotImported ?? []);\n\n for (const member of SCAFFOLDED_WORKSPACE_MEMBERS) {\n const packageJsonPath = join(input.appRoot, member, 'package.json');\n if (!existsSync(packageJsonPath)) continue;\n const manifest = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as Record<string, Record<string, string> | unknown>;\n\n const frameworkDependencies = new Set<string>();\n for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {\n for (const name of Object.keys((manifest[field] as Record<string, string> | undefined) ?? {})) {\n if (name.startsWith('@wildo-ai/') && !deliveryOnly.has(name)) frameworkDependencies.add(name);\n }\n }\n const required = new Set<string>();\n for (const dependencyName of frameworkDependencies) {\n // An opt-in framework package (#1836) answers from its own generated record; a package declares one\n // only when it chose to, so this lookup is inert for every package that did not.\n const closure = enginePeerClosure[dependencyName] ?? optInPackageRecords?.[dependencyName]?.peerClosure ?? [];\n for (const peerName of closure) required.add(peerName);\n }\n // A name the package already declares as a real dependency needs no peer entry: the override\n // reaches it there.\n for (const field of ['dependencies', 'devDependencies', 'optionalDependencies']) {\n for (const name of Object.keys((manifest[field] as Record<string, string> | undefined) ?? {})) required.delete(name);\n }\n if (required.size === 0) continue;\n\n const peers = { ...((manifest.peerDependencies as Record<string, string> | undefined) ?? {}) };\n for (const name of required) peers[name] = '*';\n manifest.peerDependencies = Object.fromEntries(Object.keys(peers).sort().map((name) => [name, peers[name]]));\n writeFileSync(packageJsonPath, `${JSON.stringify(manifest, null, 2)}\\n`, 'utf8');\n }\n}\n\n/**\n * Seed the application's dependency-exclusion list from the framework's own `deliberatelyExcluded`\n * (issue #222).\n *\n * The list names third-party packages that `wildo align-deps` must NEVER pin to the engine's version\n * because the application's own toolchain owns them — `esbuild` follows vite, `express` follows\n * webpack-dev-server, `mime` follows express, plus astro / docusaurus / jest / tailwindcss /\n * typescript. Each entry was measured against a real collision, not guessed.\n *\n * SEEDED, then APPLICATION-OWNED. The framework's copy is a judgement about a typical application's\n * stack; a real application knows its own better, and it is the one that breaks when the judgement is\n * wrong. The cost is that a later framework exclusion does not reach an existing application — which\n * is the right trade, because the conflict being described is the application's, not the framework's.\n */\nfunction seedDependencyExclusions(input: { appRoot: string; frameworkPath: string }): void {\n const excludedNames = ApplicationDependencyAlignmentService.readFrameworkExclusions(input.frameworkPath);\n if (Object.keys(excludedNames).length === 0) return;\n const targetPath = join(input.appRoot, APPLICATION_DEPENDENCY_EXCLUSIONS_RELATIVE);\n mkdirSync(dirname(targetPath), { recursive: true });\n writeFileSync(targetPath, `${JSON.stringify({\n 'purpose-note':\n 'Names `wildo align-deps` must never pin to the framework version, because THIS application\\'s '\n + 'toolchain owns them. Seeded at `wildo init` from the framework of the day and yours from here: '\n + 'edit it when your stack needs a major the framework does not pin. A key ending in `*` is a '\n + 'prefix match. The value is the reason, and is never read by any tool — it is for whoever '\n + 'reads this file next.',\n excludedNames,\n }, null, 2)}\\n`, 'utf8');\n}\n\n/** Recursively materialize the template tree into the app root. */\nfunction materializeTemplateTree(input: {\n templateRoot: string;\n appRoot: string;\n mode: SkeletonMode;\n variables: Record<string, unknown>;\n processor: TemplateProcessor;\n}): number {\n let written = 0;\n // Framework-checkout dev-loop files: an app-creator install has no framework scripts to call\n // into, so neither the dev-framework-scripts home, the workbench drop (it launches Vite against\n // FRAMEWORK SOURCE — materialized in an app-creator install it would exit with \"the workbench runs\n // against framework source\" on every start), nor the supervised dev wrappers (frontend, backend-api,\n // and the companion's — the one an earlier inline list here missed, which shipped it into every\n // app-creator application as the drop's `dev` script) are materialized there. The list is the\n // ownership manifest's, not this function's, so the sweep that reports these files MISSING from an\n // existing framework-dev application reads the same population (#1063).\n const ownership = readSkeletonOwnership(input.templateRoot);\n const walk = (relativeDir: string) => {\n for (const entry of readdirSync(join(input.templateRoot, relativeDir), { withFileTypes: true })) {\n const relativePath = relativeDir ? join(relativeDir, entry.name) : entry.name;\n if (entry.isDirectory()) {\n walk(relativePath);\n continue;\n }\n if (!entry.isFile()) continue;\n\n if (input.mode === SkeletonMode.APP_CREATOR && isFrameworkDevLoopTemplatePath(relativePath, ownership)) {\n continue;\n }\n\n let targetRelative = relativePath;\n let content: string | null = null;\n if (entry.name.endsWith('.init.hbs')) {\n // `.init.hbs` marks the INIT-time variant of a file whose later evolution belongs to a\n // service or scenario (e.g. `wildo.saas.config.ts.init.hbs` — the config service owns\n // post-init parametrization). Rendered once here, then never re-templated.\n targetRelative = relativePath.slice(0, -'.init.hbs'.length);\n content = input.processor.processTemplate(relativePath, input.variables);\n } else if (entry.name.endsWith('.hbs')) {\n targetRelative = relativePath.slice(0, -'.hbs'.length);\n content = input.processor.processTemplate(relativePath, input.variables);\n } else if ((entry.name === 'gitignore' || entry.name === 'dockerignore' || entry.name === 'prettierignore') && relativeDir === '') {\n // Authored un-dotted so a published package keeps them (npm drops a `.gitignore`), rendered\n // dotted at the application root. The `.dockerignore` is what makes every service Dockerfile's\n // `COPY . .` safe: it keeps the host's `node_modules` and every env/secret file out of the\n // image build context (#984). The `.prettierignore` keeps a formatter off installed provider\n // modules, whose per-file install hashes decide what `wildo registry update` may replace (#2014).\n targetRelative = `.${entry.name}`;\n }\n\n const targetPath = join(input.appRoot, targetRelative);\n mkdirSync(dirname(targetPath), { recursive: true });\n if (content !== null) {\n writeFileSync(targetPath, content, 'utf8');\n } else {\n copyFileSync(join(input.templateRoot, relativePath), targetPath);\n }\n // Keyed on the RENDERED name so a future `*.sh.hbs` template still lands executable.\n if (targetRelative.endsWith('.sh')) chmodSync(targetPath, 0o755);\n written += 1;\n }\n };\n walk('');\n return written;\n}\n\nfunction runStep(input: {\n log: SaasSkeletonOptions['log'];\n label: string;\n command: string;\n args: string[];\n cwd: string;\n}): boolean {\n input.log.info(` ${input.label}…`);\n const result = spawnSync(input.command, input.args, { cwd: input.cwd, stdio: 'inherit' });\n if (result.status !== 0) {\n input.log.warn(` ${input.label} failed (exit ${result.status ?? 'signal'}). Fix and re-run manually.`);\n return false;\n }\n return true;\n}\n\nexport const SaasSkeletonService = {\n allocatePortBase,\n collectUsedApplicationPorts,\n buildRootOverrides,\n\n scaffold(appRoot: string, options: SaasSkeletonOptions): SaasSkeletonResult {\n const safeName = options.name.replace(/['\"\\\\]/g, '');\n const slug = toSlug(safeName) || 'app';\n // invented-display-text: a scaffold seed written into the new application's own config file.\n const displayName = toDisplayName(safeName || slug) || 'App';\n\n if (options.mode === SkeletonMode.FRAMEWORK_DEV && !options.frameworkPath) {\n throw new Error('framework-dev skeleton mode requires a resolved framework checkout.');\n }\n\n // Initial scaffolding owns a whole empty directory; it is not a merge.\n // Inspect every entry (including hidden files and directories), not selected\n // project markers: nested source can exist without a root package.json.\n // This preflight precedes template, manifest, dependency and companion writes.\n // InitCommand routes an existing own-root application to repair before here.\n const existingEntries = existsSync(appRoot) ? readdirSync(appRoot).sort() : [];\n if (existingEntries.length > 0) {\n throw new Error(\n `Target directory already contains ${existingEntries.join(', ')} — refusing to scaffold over an existing project. `\n + 'Use an empty directory for a new application. To repair an existing Wildo application, run `wildo init` at its root.',\n );\n }\n\n // An EXPLICIT --port-base is validated against the same sibling scan the\n // allocator uses — accepting a colliding base would recreate the exact\n // hand-bootstrap failure the allocator was built to prevent.\n if (options.portBase !== undefined) {\n const used = collectUsedApplicationPorts(options.frameworkPath);\n if (!portBlockIsFree(options.portBase, used)) {\n throw new Error(\n `--port-base ${options.portBase} collides with a sibling application's authored ports `\n + `(block ${options.portBase}-${options.portBase + PORT_BASE_STRIDE - 1} or companion port ${options.portBase + COMPANION_PORT_OFFSET}). `\n + `Next free base: ${allocatePortBase(options.frameworkPath)}.`,\n );\n }\n }\n const portBase = options.portBase ?? allocatePortBase(options.frameworkPath);\n const ports: SkeletonPorts = {\n backend: portBase,\n app: portBase + 1,\n companion: portBase + COMPANION_PORT_OFFSET,\n workbench: portBase + WORKBENCH_PORT_OFFSET,\n };\n\n const templateRoot = options.frameworkPath\n ? join(options.frameworkPath, SKELETON_TEMPLATE_RELATIVE)\n : null;\n if (!templateRoot || !existsSync(templateRoot)) {\n throw new Error(\n 'Application skeleton templates not found'\n + (templateRoot ? ` at ${templateRoot}` : ' (no framework-assets root resolved)')\n + '. The full-skeleton scaffold needs the framework templates: a framework checkout, or a `@wildo-ai/wildo-cli` '\n + 'installed from npm (which ships them). Use --config-only to write only wildo.saas.config.ts.',\n );\n }\n\n const variables = {\n slug,\n displayName,\n backendPort: ports.backend,\n appPort: ports.app,\n companionPort: ports.companion,\n workbenchPort: ports.workbench,\n // Mode conditionals inside `.hbs` templates ({{#if isFrameworkDev}}): framework-dev\n // renders engine-source aliasing/tsconfig-paths/dev-supervision; app-creator renders\n // the standalone shape (published packages, plain vite dev).\n isFrameworkDev: options.mode === SkeletonMode.FRAMEWORK_DEV,\n // Store conditionals ({{#if isPostgreSql}}): which backing service the environment declares, and\n // whether it declares `applicationDatabase` at all. See `SaasSkeletonOptions.database`.\n isPostgreSql: options.database === DatabaseEngine.POSTGRESQL,\n // Ownership conditional ({{#if infrastructureHost}}): a hosted environment reads its runtime,\n // engine and backing-service ADDRESSES from the host rather than restating them, so the two\n // cannot disagree. See `SaasSkeletonOptions.infrastructureHost`.\n infrastructureHost: options.infrastructureHost ?? null,\n };\n\n const processor = new TemplateProcessor(templateRoot);\n let filesWritten = materializeTemplateTree({\n templateRoot,\n appRoot,\n mode: options.mode,\n variables,\n processor,\n });\n\n // `.claude/` is framework-delivered in framework-dev mode (materialized by `wildo fwk\n // dev-skills`, synchronized on framework update) — ignoring it avoids duplicating the\n // compiled knowledge product in git. App-creator applications COMMIT their `.claude`, so\n // the block is mode-conditional rather than part of the template gitignore.\n if (options.mode === SkeletonMode.FRAMEWORK_DEV) {\n appendFileSync(\n join(appRoot, '.gitignore'),\n '\\n# Framework-delivered agent knowledge (framework-dev mode only) — materialized by\\n'\n + '# `wildo fwk dev-skills`, synchronized on framework update; never commit in this mode.\\n'\n + '.claude/\\n',\n 'utf8',\n );\n }\n\n writeFileSync(join(appRoot, 'package.json'), buildRootPackageJson({\n slug,\n appRoot,\n frameworkPath: options.frameworkPath,\n mode: options.mode,\n }), 'utf8');\n writeFileSync(join(appRoot, 'pnpm-workspace.yaml'), buildWorkspaceYaml(), 'utf8');\n\n if (options.frameworkPath) {\n declareEnginePeersInScaffoldedPackages({ appRoot, frameworkPath: options.frameworkPath });\n seedDependencyExclusions({ appRoot, frameworkPath: options.frameworkPath });\n }\n\n // Deliver the engine EMAIL CANON (system + engine-resource templates) into the backend's\n // engine tree. System emails are runtime behavior — a fresh app without them has no welcome\n // email, no invitation email, etc. The canon at `templates/saas/i18n/email` is harvested from\n // Wonder Todos by `scripts/i18n/refresh-template-label-base.mjs` (run by every framework-dev\n // application's sync loop), and the app owns its copy from here: an engine template added later\n // is seeded by the companion's `wildo generate email` from the delivered canon, never overwriting.\n const emailCanonRoot = join(options.frameworkPath ?? '', 'templates', 'saas', 'i18n', 'email');\n if (options.frameworkPath && existsSync(emailCanonRoot)) {\n const emailTarget = join(appRoot, 'backend-api', 'src', 'engine', 'email');\n const copyTree = (relativeDir: string) => {\n for (const entry of readdirSync(join(emailCanonRoot, relativeDir), { withFileTypes: true })) {\n const entryRelative = relativeDir ? join(relativeDir, entry.name) : entry.name;\n if (entry.isDirectory()) {\n copyTree(entryRelative);\n } else if (entry.isFile()) {\n const targetPath = join(emailTarget, entryRelative);\n mkdirSync(dirname(targetPath), { recursive: true });\n copyFileSync(join(emailCanonRoot, entryRelative), targetPath);\n filesWritten += 1;\n }\n }\n };\n // The canon's own aggregator files are also shipped by the skeleton tree; the canon copy\n // wins nothing over them (byte-identical), so copying the whole tree is safe.\n copyTree('');\n } else {\n options.log.warn(' Email canon not found — backend system emails will be missing until delivered.');\n }\n const devScriptsDir = join(appRoot, '.wildo-saas', 'dev-framework-scripts');\n if (options.mode === SkeletonMode.FRAMEWORK_DEV) {\n mkdirSync(devScriptsDir, { recursive: true });\n const runDevStackPath = join(devScriptsDir, 'run-dev-stack.sh');\n writeFileSync(runDevStackPath, buildRunDevStack(slug), 'utf8');\n chmodSync(runDevStackPath, 0o755);\n filesWritten += 1;\n }\n filesWritten += 2;\n\n let companionDelivered = false;\n if (options.mode === SkeletonMode.FRAMEWORK_DEV && options.frameworkPath) {\n const deliverScript = join(options.frameworkPath, COMPANION_DELIVER_RELATIVE);\n const result = spawnSync(process.execPath, [\n deliverScript,\n '--framework-root', options.frameworkPath,\n '--app-root', appRoot,\n '--mode', SkeletonMode.FRAMEWORK_DEV,\n ], { stdio: 'inherit' });\n companionDelivered = result.status === 0;\n if (!companionDelivered) {\n options.log.warn(\n ' Companion delivery failed — build @wildo-ai/dev-companion in the framework, then re-run '\n + `node ${COMPANION_DELIVER_RELATIVE} --app-root ${appRoot}`,\n );\n }\n } else if (options.mode === SkeletonMode.APP_CREATOR) {\n /*\n * App-creator delivery is a SHIM, not a dist mirror.\n *\n * `dev-companion-deliver.mjs` hard-links the companion's `dist/` out of a local framework\n * checkout. An app-creator has no checkout — it has the published CLI and a registry — so that\n * path cannot serve this mode. What it CAN do is what every other package in the generated app\n * already does: declare a dependency and let `pnpm install` fetch it.\n *\n * The drop is a WORKSPACE MEMBER (see the `pnpm-workspace.yaml` this skeleton writes), so its\n * dependencies resolve exactly like `specifications/` or `backend-api/`.\n *\n * Why a re-export file rather than repointing `main` into `node_modules`: 31 files in this\n * repository address the drop through the fixed `dist/esm/index.js` layout. Keeping that layout\n * byte-for-byte means no consumer can tell the two delivery modes apart, which is the whole\n * point — a targeted shim beats a 31-file resolution refactor with no lasting architectural\n * gain.\n *\n * Location-sensitivity was ENUMERATED before trusting this, not assumed. The companion has six\n * `import.meta.url` sites; five resolve to files inside its own package and stay correct when\n * that package lives in `node_modules`. The sixth is `dotenv` looking for `../.env` from\n * `dist/esm`, i.e. `dist/.env` — which no delivered drop has ever contained (the drop's `.env`\n * sits at its root).\n *\n * ⚠️ \"Already a no-op, so the shim does not regress it\" was true and was not enough — corrected\n * 2026-09-13 (#594). A no-op loader means NOTHING loads the drop's `.env`. In framework-developer\n * mode the runtime supervisor injects the environment, so the gap was invisible there; an\n * app-creator install has no supervisor, and once `local init` began writing the drop's `.env`\n * (4cdc6d50) the companion still died on `APPLICATION_ID ... undefined`, beside a file holding the\n * value. The scripts below therefore load it themselves with `--env-file-if-exists` — Node's own\n * loader, resolved against the drop root the scripts run in, and a no-op when the file is absent.\n */\n const companionVersion = options.frameworkPath !== null\n ? (JSON.parse(\n readFileSync(join(options.frameworkPath, 'wildo-framework.info.json'), 'utf8'),\n ) as { version: string }).version\n : null;\n\n if (companionVersion === null) {\n options.log.warn(\n ' Companion delivery skipped: no framework-assets root is reachable (neither a checkout nor an '\n + 'npm-installed `@wildo-ai/wildo-cli`), so the published `@wildo-ai/dev-companion` version to pin '\n + 'could not be determined.',\n );\n } else {\n filesWritten += writeAppCreatorCompanionDrop({ appRoot, slug, companionVersion });\n companionDelivered = true;\n filesWritten += writeAppCreatorWorkbenchDrop({\n appRoot,\n slug,\n workbenchVersion: companionVersion,\n companionPort: ports.companion,\n workbenchPort: ports.workbench,\n });\n }\n }\n\n let installed = false;\n let built = false;\n /*\n * App-creator mode INSTALLS. It used to refuse, because the `@wildo-ai/*` packages a generated\n * application depends on were not all on the registry — four of the thirteen declared for publish\n * had never landed, `saas-specifications` among them, which a generated `specifications/` package\n * depends on directly.\n *\n * All thirteen are published at 1.1.0 as of 2026-08-31 (#151), and the generated manifests pin\n * `*`, so they resolve to it. Measured BEFORE removing the refusal rather than after: a scaffolded\n * app-creator application installs in ~24s with every `@wildo-ai` dependency resolved from the\n * registry.\n *\n * A refusal that outlives its cause is worse than no refusal — it teaches an operator that a\n * working path is broken, and this one named packages that are now present.\n */\n if (options.skipInstall !== true) {\n installed = runStep({ log: options.log, label: 'pnpm install', command: 'pnpm', args: ['install'], cwd: appRoot });\n if (installed) {\n built = runStep({\n log: options.log,\n label: 'build specifications + backend-api',\n command: 'pnpm',\n args: ['--filter', `@${slug}/specifications`, '--filter', `@${slug}/shared-lib`, '--filter', `@${slug}/backend-api`, 'build'],\n cwd: appRoot,\n });\n }\n }\n\n return { slug, ports, filesWritten, companionDelivered, installed, built };\n },\n};\n"]}
1
+ {"version":3,"file":"saas-skeleton.service.js","sourceRoot":"","sources":["../../../../src/services/application/saas-skeleton.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC9H,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE/C,OAAO,EAAE,GAAG,IAAI,SAAS,EAAE,KAAK,IAAI,WAAW,EAAE,MAAM,QAAQ,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AAC5H,OAAO,EACL,0CAA0C,EAC1C,qCAAqC,GACtC,MAAM,0EAA0E,CAAC;AAClF,OAAO,EACL,qCAAqC,EACrC,2BAA2B,EAC3B,8BAA8B,EAC9B,0BAA0B,GAE3B,MAAM,gEAAgE,CAAC;AACxE,OAAO,EAAE,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AG,EAAE,OAAO,CAAC,GAAG;oBAChB,KAAK,EAAE,oCAAoC;oBAC3C,OAAO,EAAE,MAAM;oBACf,IAAI,EAAE,CAAC,UAAU,EAAE,IAAI,IAAI,iBAAiB,EAAE,UAAU,EAAE,IAAI,IAAI,aAAa,EAAE,UAAU,EAAE,IAAI,IAAI,cAAc,EAAE,OAAO,CAAC;oBAC7H,GAAG,EAAE,OAAO;iBACb,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC7E,CAAC;CACF,CAAC","sourcesContent":["/**\n * SaasSkeletonService — materialize a full, bootable-after-setup application\n * skeleton from `templates/saas/skeleton/` (issue #51, T1–T10).\n *\n * The template tree carries three file classes:\n * - plain files, copied verbatim (`tsconfig.common.json`, package sources, …);\n * - `*.hbs` files, rendered through the shared Handlebars `TemplateProcessor`\n * with the app identity + ALLOCATED ports (D4: two applications sharing a\n * framework checkout must never collide on ports);\n * - `gitignore`, written as `.gitignore` (a literal dotfile inside the\n * template tree would make git ignore the template's own files).\n *\n * Two files are DERIVED rather than templated, per the T4 rule (\"derived from\n * the framework's current override set, never a frozen copy\"):\n * - the root `package.json` — its `pnpm.overrides` are computed live from\n * `scripts/app-dependency-alignment/propagated-engine-overrides.json`\n * (names) joined with the framework root's `pnpm.overrides` (versions),\n * plus, in framework-developer mode, `file:` links for every\n * `frameworkFileLinkPackages` entry resolved through the framework's own\n * pnpm-workspace;\n * - `.wildo-saas/dev-framework-scripts/run-dev-stack.sh` — its\n * `pnpm --filter` package lists are the scaffolded workspace members.\n *\n * DUAL MODE (D7 — both modes authored from the start). Both are live: the npm\n * publish lane put all twenty declared packages on the registry at 1.1.1 on\n * 2026-08-31, `@wildo-ai/dev-companion` among them, so app-creator mode installs\n * and delivers like any other consumer:\n * - `framework-dev`: `file:` overrides into the checkout, dev-framework\n * scripts installed, companion dist delivered via\n * `scripts/dev-orchestrator/dev-companion-deliver.mjs`;\n * - `app-creator`: `@wildo-ai/*` overrides pinned to the published framework\n * version; the companion drop is a re-export shim over the published\n * `@wildo-ai/dev-companion`, keeping the framework-dev entry layout.\n */\nimport { spawnSync } from 'child_process';\nimport { appendFileSync, copyFileSync, existsSync, mkdirSync, readFileSync, readdirSync, writeFileSync, chmodSync } from 'fs';\nimport { dirname, join, relative } from 'path';\nimport { parse as parseYaml } from 'yaml';\nimport { gte as semverGte, valid as semverValid } from 'semver';\nimport { DatabaseEngine } from '@wildo-ai/platform-config-lib';\nimport { TemplateProcessor } from '~wildo-cli/infrastructure/io/template-processor';\nimport { COMPANION_PORT_OFFSET, WORKBENCH_PORT_OFFSET } from '~wildo-cli/services/application/application-dev-port-offsets';\nimport {\n APPLICATION_DEPENDENCY_EXCLUSIONS_RELATIVE,\n ApplicationDependencyAlignmentService,\n} from '~wildo-cli/services/application/application-dependency-alignment.service';\nimport {\n FRAMEWORK_OVERRIDES_MANIFEST_RELATIVE,\n ProviderPackageLinksService,\n readFrameworkWorkspacePackages,\n readOptInFrameworkPackages,\n type OptInFrameworkPackageRecord,\n} from '~wildo-cli/services/application/provider-package-links.service';\nimport { resolveFrameworkRootManifestPath } from '~wildo-cli/services/framework/installed-framework-assets.service';\n\n/**\n * The two delivery modes every skeleton artifact is authored for (issue #51 D7).\n * The mode decides the root manifest's dependency story and which dev tooling\n * the scaffold materializes — it never changes the application's own sources.\n */\nexport enum SkeletonMode {\n /**\n * In-repo example app beside the framework checkout: `file:` overrides into\n * the checkout's workspace packages, dev-framework scripts installed, and the\n * companion dist delivered straight from the framework build.\n */\n FRAMEWORK_DEV = 'framework-dev',\n /**\n * Standalone app consuming published `@wildo-ai/*` versions. No framework\n * scripts; the companion arrives as a shim over the published\n * `@wildo-ai/dev-companion` rather than as a hard-linked build mirror. The\n * root `dev` script runs the workspace members' own dev scripts.\n */\n APP_CREATOR = 'app-creator',\n}\n\nexport interface SkeletonPorts {\n backend: number;\n app: number;\n companion: number;\n workbench: number;\n}\n\nexport interface SaasSkeletonOptions {\n name: string;\n frameworkPath: string | null;\n mode: SkeletonMode;\n /**\n * The APPLICATION's own store, as answered at `wildo init`. It decides what the scaffold AUTHORS —\n * `applicationDatabase`, the backing service it names, and the `dataServices` prefix — because on\n * PostgreSQL a resource's table is built by a migration and by nothing else, so an application that\n * says PostgreSQL and is authored as MongoDB is not the application anybody asked for.\n *\n * Absent scaffolds MongoDB — and the scaffold then AUTHORS `applicationDatabase: { engine: MONGODB }`\n * explicitly, because on the infra descriptor an absent `applicationDatabase` means PostgreSQL\n * (#1571). This option is the answer to a prompt; the descriptor must never be left to silence.\n */\n database?: DatabaseEngine;\n /**\n * The application whose platform this one runs on, as a path RELATIVE to the new application root\n * (`'../wonder-todos'`) — or absent when this application owns its environment's infrastructure.\n *\n * Several applications share one platform per environment. One OWNS it — its compose project, its\n * backing services, apps-manager, module-registry, crontabs — and the others declare it as their\n * `infrastructureHost` and merely REGISTER against it. Scaffolding every application as an owner is\n * what made a second application's `wildo config sync` offer to rewrite the shared platform\n * generation, and made stopping the first application look like a precondition for creating the\n * second. It is not: a hosted application's `wildo local init` resolves to the register-only path on\n * its own, and the host keeps running — the property that has to hold in remote, where the first\n * application is live traffic.\n *\n * Absent means this application owns the environment, which is right for the FIRST application on a\n * machine and wrong for every one after it.\n */\n infrastructureHost?: string;\n portBase?: number;\n skipInstall?: boolean;\n log: { info(message: string): void; warn(message: string): void };\n}\n\nexport interface SaasSkeletonResult {\n slug: string;\n ports: SkeletonPorts;\n filesWritten: number;\n companionDelivered: boolean;\n installed: boolean;\n built: boolean;\n}\n\nconst SKELETON_TEMPLATE_RELATIVE = 'templates/saas/skeleton';\n/**\n * The skeleton's ownership manifest, a SIBLING of the skeleton directory so it is never materialized\n * into an application. Its `frameworkDevLoop.templatePaths` is the one list of skeleton files that stay\n * framework-owned after `wildo init`: this walker leaves them out of an app-creator install (no framework\n * source to run them against), and the derived-artifact currency sweep\n * (`scripts/dev-orchestrator/derived-artifact-currency.mjs`, surface `skeleton-dev-loop`) reports a\n * framework-dev application that lacks one, or whose verbatim copy drifted — the gap #1063 measured when\n * the workbench launcher joined the skeleton and never reached an application scaffolded before it.\n */\nexport const SKELETON_OWNERSHIP_MANIFEST_NAME = 'skeleton-ownership.json';\n\ninterface SkeletonOwnershipManifest {\n schemaVersion: number;\n frameworkDevLoop: { templatePaths: string[]; generatedPaths: string[] };\n}\n\n/** Read the ownership manifest beside `templateRoot`; refuses a missing or foreign-shaped one rather than guessing. */\nexport function readSkeletonOwnership(templateRoot: string): SkeletonOwnershipManifest {\n const manifestPath = join(dirname(templateRoot), SKELETON_OWNERSHIP_MANIFEST_NAME);\n const parsed = JSON.parse(readFileSync(manifestPath, 'utf8')) as Partial<SkeletonOwnershipManifest>;\n if (\n parsed.schemaVersion !== 1\n || !Array.isArray(parsed.frameworkDevLoop?.templatePaths)\n || !Array.isArray(parsed.frameworkDevLoop?.generatedPaths)\n ) {\n throw new Error(`Skeleton ownership manifest is missing or malformed at ${manifestPath}.`);\n }\n return parsed as SkeletonOwnershipManifest;\n}\n\n/** Is this template-relative path (as authored) one of the framework-dev loop files? A directory entry covers its subtree. */\nexport function isFrameworkDevLoopTemplatePath(relativeTemplatePath: string, ownership: SkeletonOwnershipManifest): boolean {\n const normalized = relativeTemplatePath.split('\\\\').join('/');\n return ownership.frameworkDevLoop.templatePaths.some((entry) => normalized === entry || normalized.startsWith(`${entry}/`));\n}\nconst OVERRIDES_MANIFEST_RELATIVE = FRAMEWORK_OVERRIDES_MANIFEST_RELATIVE;\nconst COMPANION_DELIVER_RELATIVE = 'scripts/dev-orchestrator/dev-companion-deliver.mjs';\n/**\n * The workspace members `buildWorkspaceYaml` declares, minus the two GENERATED drops (their\n * manifests are written by their own generators and would overwrite anything injected here).\n * Kept beside that function on purpose: the two lists describe the same scaffold and must move\n * together.\n */\nconst SCAFFOLDED_WORKSPACE_MEMBERS = ['.', 'specifications', 'shared-lib', 'backend-api', 'frontend'] as const;\n\nconst DEFAULT_PORT_BASE = 4241;\nconst PORT_BASE_STRIDE = 10;\n\nfunction toSlug(name: string): string {\n return name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\nfunction toDisplayName(name: string): string {\n // invented-display-text: a SCAFFOLD SEED, written once into a new application's own config file\n // where its author edits it. It is a starting value in source, not text resolved at runtime.\n return name\n .replace(/[-_]+/g, ' ')\n .replace(/\\b\\w/g, c => c.toUpperCase());\n}\n\n/**\n * Allocate the app's port base by scanning every sibling application's AUTHORED\n * port declarations under `<framework>/examples/*` (saas config `defaultPort:`\n * plus infra `port:` values). The next free `PORT_BASE_STRIDE` block above the\n * highest occupied one wins, so a second app lands at 4251 beside Wonder\n * Todos' 4241–4244 instead of silently colliding (the exact failure of the\n * 2026-08-25 hand bootstrap that T8/D4 records).\n */\nfunction allocatePortBase(frameworkPath: string | null): number {\n const used = collectUsedApplicationPorts(frameworkPath);\n // Walk stride-aligned bases upward until BOTH the service block (base..base+stride-1)\n // and the derived companion port (base+offset) are free of every scanned port.\n for (let base = DEFAULT_PORT_BASE; base < 5000; base += PORT_BASE_STRIDE) {\n if (portBlockIsFree(base, used)) {\n return base;\n }\n }\n // Exhaustion must REFUSE, not silently hand back the default base — returning\n // 4241 here would scaffold an app directly onto Wonder Todos' ports, which is\n // the exact collision this allocator exists to prevent.\n throw new Error(\n 'No free application port block found in the 4000-4999 tier (stride 10 + companion offset 100). '\n + 'Pass an explicit --port-base outside the scanned range, or retire an unused sibling application.',\n );\n}\n\n/** True when the whole service block AND both derived tool ports avoid every scanned port. */\nfunction portBlockIsFree(base: number, used: ReadonlySet<number>): boolean {\n const blockPorts = Array.from({ length: PORT_BASE_STRIDE }, (_, i) => base + i);\n return blockPorts.every((port) => !used.has(port))\n && !used.has(base + COMPANION_PORT_OFFSET)\n && !used.has(base + WORKBENCH_PORT_OFFSET);\n}\n\n/** Collect every authored sibling port (saas `defaultPort:` + infra `port:`) in the 4xxx tier. */\nfunction collectUsedApplicationPorts(frameworkPath: string | null): Set<number> {\n const usedPorts: number[] = [];\n if (frameworkPath) {\n const examplesHome = join(frameworkPath, 'examples');\n if (existsSync(examplesHome)) {\n for (const entry of readdirSync(examplesHome, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n const appRoot = join(examplesHome, entry.name);\n for (const candidate of [\n join(appRoot, 'wildo.saas.config.ts'),\n join(appRoot, 'infrastructure/local/wildo.infra.local.config.ts'),\n ]) {\n if (!existsSync(candidate)) continue;\n const source = readFileSync(candidate, 'utf8');\n for (const match of source.matchAll(/(?:defaultPort|port)\\s*:\\s*(\\d{4,5})/g)) {\n usedPorts.push(Number(match[1]));\n }\n }\n }\n }\n }\n return new Set(usedPorts.filter((port) => port >= 4000 && port < 5000));\n}\n\n\n/**\n * The published framework packages an app-creator application pins BESIDE the file-link core.\n *\n * `frameworkFileLinkPackages` is the core every application links; these two are not in it, and in\n * app-creator mode neither was pinned by anything:\n *\n * - `@wildo-ai/framework-knowledge` is a root devDependency declared `\"*\"`. With no override the\n * lockfile keeps whatever it resolved first, so bumping the core left the delivered skills, rules\n * and docs on the scaffold-time release.\n * - `@wildo-ai/dev-companion` is the companion drop's only dependency. Pinning it at the root makes\n * the workspace agree with the drop's own exact pin rather than only with itself.\n * - `@wildo-ai/application-creation-workbench` is the workbench drop's only dependency, for the same\n * reason (see {@link writeAppCreatorWorkbenchDrop}).\n *\n * Kept out of `frameworkFileLinkPackages` on purpose: that list also drives framework-DEVELOPER\n * `file:` links and the dogfood alignment script, where the companion is delivered as a hard-linked\n * dist mirror and the knowledge through `wildo fwk dev-skills`. `wildo update` pins exactly the\n * union, so the two writers cannot disagree about the set.\n */\nexport const APP_CREATOR_ADDITIONAL_FRAMEWORK_PINS = [\n '@wildo-ai/framework-knowledge',\n '@wildo-ai/dev-companion',\n '@wildo-ai/application-creation-workbench',\n] as const;\n\ninterface OverridesManifest {\n propagatedOverrideKeys?: string[];\n frameworkFileLinkPackages?: string[];\n}\n\nfunction buildRootOverrides(input: {\n appRoot: string;\n frameworkPath: string;\n mode: SkeletonMode;\n}): Record<string, string> {\n const manifest = JSON.parse(\n readFileSync(join(input.frameworkPath, OVERRIDES_MANIFEST_RELATIVE), 'utf8'),\n ) as OverridesManifest;\n // Through the resolver, never `<root>/package.json`: in an INSTALLED framework-assets root that\n // file is the CLI's own manifest, and the framework root manifest ships beside it under another\n // name (`installed-framework-assets.service.ts`).\n const frameworkRootManifest = JSON.parse(\n readFileSync(resolveFrameworkRootManifestPath(input.frameworkPath), 'utf8'),\n ) as { version?: string; pnpm?: { overrides?: Record<string, string> } };\n const frameworkOverrides = frameworkRootManifest.pnpm?.overrides ?? {};\n const frameworkInfo = JSON.parse(\n readFileSync(join(input.frameworkPath, 'wildo-framework.info.json'), 'utf8'),\n ) as { version: string };\n\n const overrides: Record<string, string> = {};\n\n /*\n * The framework CORE — every application links all of it, so the authored list is the decision.\n * The PROVIDER packages are handled below and are demand-driven: see\n * `ProviderPackageLinksService`. Keeping the two apart is what stops a scaffolded application\n * carrying two hundred `file:` links to packages it never imports (plan D7, issue #334).\n */\n if (input.mode === SkeletonMode.FRAMEWORK_DEV) {\n const workspacePackages = readFrameworkWorkspacePackages(input.frameworkPath);\n for (const packageName of manifest.frameworkFileLinkPackages ?? []) {\n const workspacePackage = workspacePackages.get(packageName);\n if (!workspacePackage) {\n throw new Error(\n `frameworkFileLinkPackages names '${packageName}' but no framework workspace member carries that name — `\n + `fix ${OVERRIDES_MANIFEST_RELATIVE} or the workspace.`,\n );\n }\n overrides[packageName] = `file:${relative(input.appRoot, workspacePackage.root)}`;\n }\n } else {\n for (const packageName of [...(manifest.frameworkFileLinkPackages ?? []), ...APP_CREATOR_ADDITIONAL_FRAMEWORK_PINS]) {\n overrides[packageName] = frameworkInfo.version;\n }\n }\n\n /*\n * Provider packages and OPT-IN framework packages (#1836) the application ALREADY declares. At\n * `wildo init` both are empty by construction — a fresh scaffold declares neither — and that is the\n * point: such a link, and an opt-in package's pins, appear only after `wildo compose` writes the\n * dependency, and only for what was declared. The same resolution runs again after every\n * `wildo compose`, which is what makes the scenario a single command rather than a scenario plus a\n * hand-written override. An application that never declares the 3D layout package never carries\n * a byte of it.\n */\n const providerLinks = ProviderPackageLinksService.resolveProviderOverrides({\n applicationRoot: input.appRoot,\n frameworkWorkspacePackages: input.mode === SkeletonMode.FRAMEWORK_DEV\n ? readFrameworkWorkspacePackages(input.frameworkPath)\n : null,\n frameworkVersion: frameworkInfo.version,\n optIn: readOptInFrameworkPackages(input.frameworkPath),\n });\n for (const [packageName, overrideValue] of Object.entries(providerLinks.overrides)) {\n overrides[packageName] = overrideValue;\n }\n\n for (const key of manifest.propagatedOverrideKeys ?? []) {\n const version = frameworkOverrides[key];\n if (!version) {\n throw new Error(\n `propagatedOverrideKeys names '${key}' but the framework root pnpm.overrides carries no version for it.`,\n );\n }\n overrides[key] = version;\n }\n\n return Object.fromEntries(Object.entries(overrides).sort(([a], [b]) => a.localeCompare(b)));\n}\n\nfunction buildRootPackageJson(input: {\n slug: string;\n appRoot: string;\n frameworkPath: string | null;\n mode: SkeletonMode;\n}): string {\n const frameworkRootManifest = input.frameworkPath\n ? JSON.parse(readFileSync(resolveFrameworkRootManifestPath(input.frameworkPath), 'utf8')) as { packageManager?: string }\n : {};\n\n const manifest: Record<string, unknown> = {\n name: `@${input.slug}/root`,\n version: '1.0.0',\n private: true,\n ...(frameworkRootManifest.packageManager ? { packageManager: frameworkRootManifest.packageManager } : {}),\n scripts: {\n // `run-dev-stack.sh` is only WRITTEN in framework-dev mode; an app-creator\n // manifest pointing at it would ship a `pnpm dev` that fails on a missing\n // file. App-creator runs the workspace members' own dev scripts directly.\n ...(input.mode === SkeletonMode.FRAMEWORK_DEV\n ? {\n dev: 'bash .wildo-saas/dev-framework-scripts/run-dev-stack.sh full',\n 'dev:sync': 'bash .wildo-saas/dev-framework-scripts/sync-engine.sh',\n }\n : { dev: 'pnpm --parallel --no-bail -r run dev' }),\n build: 'turbo build',\n clean: 'turbo run clean',\n },\n ...(input.frameworkPath\n ? { pnpm: { overrides: buildRootOverrides({ appRoot: input.appRoot, frameworkPath: input.frameworkPath, mode: input.mode }) } }\n : {}),\n devDependencies: {\n '@wildo-ai/external-connectors-models': '*',\n // The compiled agent knowledge (skills, rules, references) `wildo assets sync` delivers into\n // `.claude/` and `.wildo-saas/docs/`. Declared at the ROOT so the CLI resolves it from the\n // application without knowing which workspace member happens to depend on it transitively.\n '@wildo-ai/framework-knowledge': '*',\n '@wildo-ai/platform-config-lib': '*',\n '@wildo-ai/saas-models': '*',\n tsx: '^4.21.0',\n turbo: '^2.8.11',\n },\n };\n return `${JSON.stringify(manifest, null, 2)}\\n`;\n}\n\nfunction buildWorkspaceYaml(): string {\n return [\n 'packages:',\n \" - 'specifications'\",\n \" - 'shared-lib'\",\n \" - 'backend-api'\",\n \" - 'frontend'\",\n ' # The dev companion drop: a GENERATED dist-only delivery (see the app',\n ' # .gitignore); its manifest is a workspace member so its dependencies',\n ' # resolve like every other package.',\n \" - '.wildo-saas/wildo-dev-companion'\",\n ' # The application-creation workbench drop. What it holds depends on who installed',\n ' # the framework: for a framework developer a LAUNCHER that runs Vite over the',\n ' # workbench source in the checkout; for an application creator a member that',\n ' # depends on the published @wildo-ai/application-creation-workbench and serves its',\n ' # built bundle in front of the companion (written by `wildo init` and `wildo update`).',\n ' # Either way it is a workspace member, which is what puts it in the dev stack',\n ' # (`wildo local dev` runs every member\\'s `dev`) beside everything else.',\n ' #',\n ' # An entry naming a directory that does not exist yet is safe, measured rather than',\n ' # assumed: `pnpm install` ignores it silently. The companion entry above relies on',\n ' # the same behaviour until its drop is delivered.',\n \" - '.wildo-saas/application-creation-workbench'\",\n '',\n ].join('\\n');\n}\n\n/**\n * The first `@wildo-ai/dev-companion` release that ships the `wildo-dev-companion-supervised` bin (#2226).\n *\n * The drop pins the companion to the framework's version EXACTLY, and a CLI built from a checkout carries the\n * checkout's version — `1.1.8` when the bin landed, a release that has no such bin. A supervised `dev` pinned\n * to it would be `command not found` and start NO companion, which is worse than the unsupervised command it\n * replaces. So a drop pinned below this version keeps the plain `node` command. Published versions at the time:\n * up to `1.1.8`, so the next release, whatever its number, carries the bin.\n */\nexport const FIRST_DEV_COMPANION_VERSION_WITH_SUPERVISOR = '1.1.9';\n\n/** The app-creator companion drop's `dev` script for the companion version it pins (#2226). */\nexport function appCreatorCompanionDevScript(companionVersion: string): string {\n const supervised = semverValid(companionVersion) !== null && semverGte(companionVersion, FIRST_DEV_COMPANION_VERSION_WITH_SUPERVISOR);\n return supervised\n ? 'wildo-dev-companion-supervised -- --env-file-if-exists=.env dist/esm/index.js'\n : 'node --env-file-if-exists=.env dist/esm/index.js';\n}\n\n/**\n * Write the app-creator companion drop: `.wildo-saas/wildo-dev-companion/`, a workspace member whose\n * only dependency is the published `@wildo-ai/dev-companion` at `companionVersion`, plus the\n * re-export shim that keeps the `dist/esm/index.js` entry layout a framework-dev delivery has.\n *\n * Written by `wildo init` (app-creator mode) and REWRITTEN by `wildo update`, which is why it lives\n * here rather than inline: the drop pins the companion EXACTLY, `wildo align-deps` skips every\n * `.wildo-saas/*` member, and the shim is gitignored — so without a second writer an upgrade left\n * the companion on the scaffold-time version forever, and a fresh clone had no entry file at all.\n * One writer means the two cannot describe different drops.\n *\n * Returns the number of files written (always 2).\n */\nexport function writeAppCreatorCompanionDrop(input: { appRoot: string; slug: string; companionVersion: string }): number {\n const { appRoot, slug, companionVersion } = input;\n const companionDropRoot = join(appRoot, '.wildo-saas', 'wildo-dev-companion');\n mkdirSync(join(companionDropRoot, 'dist', 'esm'), { recursive: true });\n writeFileSync(\n join(companionDropRoot, 'dist', 'esm', 'index.js'),\n [\n '// GENERATED by `wildo init` / `wildo update` (app-creator mode). Do not edit.',\n '//',\n '// The companion itself is the published `@wildo-ai/dev-companion` package, installed as a',\n '// dependency of this workspace member. This file exists so the drop keeps the same entry',\n '// layout as a framework-dev delivery, where `dist/` is a hard-linked mirror instead.',\n '//',\n '// `export *` evaluates the module, which is what starts the companion when this file is',\n '// executed by the `start` script.',\n \"export * from '@wildo-ai/dev-companion';\",\n '',\n ].join('\\n'),\n 'utf8',\n );\n writeFileSync(\n join(companionDropRoot, 'package.json'),\n `${JSON.stringify({\n name: `@${slug}/wildo-dev-companion`,\n version: companionVersion,\n description:\n 'Wildo.ai Dev Companion — app-creator delivery. A shim over the published '\n + '@wildo-ai/dev-companion package; generated by `wildo init` / `wildo update`, do not edit by hand.',\n private: true,\n type: 'module',\n main: 'dist/esm/index.js',\n scripts: {\n /*\n * `dev` runs the SAME companion as `start`, under the published package's own supervisor.\n *\n * `scripts/dev-supervised.sh` is a framework-developer script: it resolves\n * `framework.repositoryRoot` and supervises a watcher that recompiles the companion\n * from framework source. An app creator has neither — this drop is a shim over the\n * PUBLISHED `@wildo-ai/dev-companion`, already built, with nothing to watch.\n *\n * Pointing `dev` at it was fatal rather than merely useless, because the application\n * root's `dev` was `pnpm --parallel -r run dev`: the companion exited 1 and\n * `--parallel` tore down the backend, frontend and specifications watchers with it\n * (every generated dev command now passes `--no-bail`, 2026-09-24),\n * so `wildo local dev` started NO application runtime at all. Measured 2026-09-10 —\n * first \"Missing resolve-home-path helper\", then, once that was in place,\n * `Resolved home field \"framework.repositoryRoot\" is missing or empty`. Two symptoms,\n * one cause: a framework-only script on an app-creator install.\n *\n * Plain `node` then left NO supervisor at all (#2226): when the companion died mid build wave on\n * 2026-10-01, `--no-bail` kept the backend and frontend up and nothing brought the companion back.\n * `wildo-dev-companion-supervised` ships in `@wildo-ai/dev-companion` (so `wildo update` delivers its\n * fixes), needs no framework checkout, restarts a crashed companion with backoff and gives up after\n * a crash loop with one line — from the first release that ships it\n * ({@link FIRST_DEV_COMPANION_VERSION_WITH_SUPERVISOR}). `start` stays a single unsupervised run.\n */\n dev: appCreatorCompanionDevScript(companionVersion),\n start: 'node --env-file-if-exists=.env dist/esm/index.js',\n },\n dependencies: {\n '@wildo-ai/dev-companion': companionVersion,\n },\n }, null, 2)}\\n`,\n 'utf8',\n );\n return 2;\n}\n\n/** Where an app-creator workbench drop lives, beside the companion drop. */\nexport const APP_CREATOR_WORKBENCH_DROP_RELATIVE = join('.wildo-saas', 'application-creation-workbench');\n\n/**\n * Write the app-creator WORKBENCH drop: `.wildo-saas/application-creation-workbench/package.json`, a\n * workspace member whose only dependency is the published `@wildo-ai/application-creation-workbench`\n * at `workbenchVersion`, and whose `dev` / `start` run that package's `wildo-workbench-serve` in front\n * of this application's companion.\n *\n * The framework-developer drop at the same path is a LAUNCHER that runs Vite over the workbench SOURCE\n * in the checkout, so an application creator had no workbench at all — the operator UI of application\n * creation — and `wildo workbench open` sent them to a port nothing listened on. The published package\n * carries the BUILT bundle and a dependency-free server doing what the dev proxy does (one origin, `/api`\n * and `/health` forwarded, `Origin` untouched), so this drop is the whole delivery.\n *\n * `wildo local dev` starts it with the rest of the stack: an app-creator root `dev` runs every workspace\n * member's `dev` (`pnpm --parallel --no-bail -r run dev`), and the skeleton's workspace already lists this\n * path. The ports are written as flags so the script is one portable command line on every shell.\n *\n * Written by `wildo init` (app-creator mode) and REWRITTEN by `wildo update`. Returns the files written (1).\n */\nexport function writeAppCreatorWorkbenchDrop(input: {\n appRoot: string;\n slug: string;\n workbenchVersion: string;\n companionPort: number;\n workbenchPort: number;\n}): number {\n const dropRoot = join(input.appRoot, APP_CREATOR_WORKBENCH_DROP_RELATIVE);\n mkdirSync(dropRoot, { recursive: true });\n const serve = `wildo-workbench-serve --companion http://localhost:${input.companionPort} --port ${input.workbenchPort}`;\n writeFileSync(\n join(dropRoot, 'package.json'),\n `${JSON.stringify({\n name: `@${input.slug}/application-creation-workbench`,\n version: input.workbenchVersion,\n description:\n 'Wildo.ai application-creation workbench — app-creator delivery. Serves the published '\n + '@wildo-ai/application-creation-workbench in front of this application\\'s companion; generated by '\n + '`wildo init` / `wildo update`, do not edit by hand.',\n private: true,\n type: 'module',\n scripts: { dev: serve, start: serve },\n dependencies: { '@wildo-ai/application-creation-workbench': input.workbenchVersion },\n }, null, 2)}\\n`,\n 'utf8',\n );\n return 1;\n}\n\nfunction buildRunDevStack(slug: string): string {\n return `#!/bin/bash\n\n# GENERATED by \\`wildo init\\` (issue #51 T9) — the mode→package dispatch mirrors\n# this application's workspace members. Regenerate by re-running the scaffolder\n# rather than hand-editing the filter lists.\n#\n# \\`full\\` DERIVES its set rather than listing it, and that is the whole point of the\n# mode. An application GROWS workspace members after \\`wildo init\\` — \\`wildo compose\n# add-website\\`, \\`add-technical-doc\\`, \\`add-minion\\`, \\`add-worker-node\\` each append one\n# — and no scenario edits this file. A hand-written list here is therefore a second\n# enumeration of a population somebody else owns, and it drifted exactly that way: a\n# composed documentation portal was a declared service, a workspace member, and an\n# allocated port, and \\`full\\` never started it. Nothing reported that, because an\n# unlisted package simply does not appear.\n#\n# \\`pnpm -r\\` runs \\`dev\\` in every workspace package that HAS one, which is the honest\n# reading of \"the full stack\" and cannot fall behind a scenario. The narrow modes below\n# stay explicit: each names a deliberate subset, so listing is what they are for.\n#\n# \\`--no-bail\\` on every mode: one package whose \\`dev\\` exits must not end the others. Without\n# it pnpm stops every sibling on the first failure, and \\`wildo local dev\\` then reads the whole\n# application tree as exited and tears the stack down. Measured twice: a companion script that\n# exited 1 on an app-creator install left NO runtime running (2026-09-10), and a documentation\n# site whose config failed to load took the companion and backend down with it on every start\n# (2026-09-24, #1273). The runtimes are supervised individually and a supervisor can pause one\n# while the rest keep running, so a dead package is reported by the diagnostics, not by stopping\n# every other one.\n\nset -u\nset -o pipefail\n\nSCRIPT_DIR=\"$(cd \"$(dirname \"$0\")\" && pwd)\"\nMODE=\"\\${1:-full}\"\n\ncase \"$MODE\" in\n full)\n STACK_COMMAND=(\n pnpm --parallel --no-bail -r\n run dev\n )\n ;;\n backend)\n STACK_COMMAND=(\n pnpm --parallel --no-bail\n --filter @${slug}/specifications\n --filter @${slug}/shared-lib\n --filter @${slug}/backend-api\n --filter './providers/**'\n run dev\n )\n ;;\n companion)\n STACK_COMMAND=(\n pnpm --parallel --no-bail\n --filter @${slug}/specifications\n --filter @${slug}/shared-lib\n --filter @wildo-ai/dev-companion\n run dev\n )\n ;;\n frontend)\n STACK_COMMAND=(\n pnpm --parallel --no-bail\n --filter @${slug}/main-app\n --filter './providers/**'\n run dev\n )\n ;;\n # The workbench ALONE, for iterating on the tool itself. It talks to a companion over HTTP\n # rather than importing it, so it runs perfectly well against a companion already started by\n # another mode — and starting it here does not drag the application's stack along.\n workbench)\n STACK_COMMAND=(\n pnpm --parallel --no-bail\n --filter @wildo-ai/application-creation-workbench\n run dev\n )\n ;;\n *)\n echo \"[dev-stack] Unknown mode: $MODE\"\n echo \"[dev-stack] Expected one of: full, backend, companion, frontend, workbench\"\n exit 1\n ;;\nesac\n\nif [ -f \"$SCRIPT_DIR/sync-engine.sh\" ]; then\n \"$SCRIPT_DIR/sync-engine.sh\" &\n SYNC_PID=$!\n HAS_CLEANED_UP=0\n\n cleanup() {\n if [ \"$HAS_CLEANED_UP\" -eq 1 ]; then\n return\n fi\n HAS_CLEANED_UP=1\n if kill -0 \"$SYNC_PID\" 2>/dev/null; then\n kill \"$SYNC_PID\" 2>/dev/null || true\n wait \"$SYNC_PID\" 2>/dev/null || true\n fi\n }\n\n trap cleanup EXIT INT TERM\nfi\n\n\"\\${STACK_COMMAND[@]}\"\n`;\n}\n\n/**\n * Declare, in every scaffolded workspace package, the engine peers it must SUPPLY (issue #167).\n *\n * A pnpm override rewrites a specifier that some manifest wrote down; it never creates one. A peer\n * nobody declares therefore falls to `autoInstallPeers`, whose resolution is STICKY: correct on a\n * fresh lockfile, and frozen at whatever predates the override otherwise. So an application that\n * does not declare the engine's peers cannot receive a later pin bump — moving a root pin from `^6`\n * to `^7` leaves it on 6 with a warning and no remedy short of deleting its lockfile.\n *\n * Each name is written as `\"*\"`, never a version: the root `pnpm.overrides` block written beside it\n * already carries the pin, so a framework bump reaches the application with no edit here.\n *\n * The name set is READ from the generated `enginePeerClosure` rather than re-derived. That map is\n * produced and gated by `scripts/app-dependency-alignment.mjs`; only the trivial union lookup is\n * repeated here, because this service is compiled TypeScript in another package and cannot import\n * the repository's `.mjs` derivation.\n *\n * Nothing is ever removed — the same restraint the reconciler applies. A template-authored peer that\n * the closure does not require (`ufo`, today) is the application's own declaration, and a shared name\n * is not evidence of shared ownership.\n */\nfunction declareEnginePeersInScaffoldedPackages(input: { appRoot: string; frameworkPath: string }): void {\n const manifestPath = join(input.frameworkPath, OVERRIDES_MANIFEST_RELATIVE);\n if (!existsSync(manifestPath)) return;\n const { enginePeerClosure, deliveredNotImported, optInPackageRecords } = JSON.parse(readFileSync(manifestPath, 'utf8')) as {\n enginePeerClosure?: Record<string, string[]>;\n deliveredNotImported?: string[];\n optInPackageRecords?: Record<string, OptInFrameworkPackageRecord>;\n };\n if (!enginePeerClosure) return;\n /*\n * Packages a SCAFFOLDED APPLICATION links for their FILES and never loads as code, so it owes\n * none of their transitive peers. Read from the same generated manifest as the closure, for the\n * same reason: this service cannot import the repository's `.mjs` derivation, so the authored\n * answer travels as data rather than being repeated as a judgement.\n *\n * Without it, `@wildo-ai/framework-knowledge` — linked so `wildo assets sync` can read\n * `dist/knowledge/**` off disk — would plant its whole transitive frontend closure (63 names:\n * radix, react-router, echarts) into every application this scaffolds.\n */\n const deliveryOnly = new Set(deliveredNotImported ?? []);\n\n for (const member of SCAFFOLDED_WORKSPACE_MEMBERS) {\n const packageJsonPath = join(input.appRoot, member, 'package.json');\n if (!existsSync(packageJsonPath)) continue;\n const manifest = JSON.parse(readFileSync(packageJsonPath, 'utf8')) as Record<string, Record<string, string> | unknown>;\n\n const frameworkDependencies = new Set<string>();\n for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {\n for (const name of Object.keys((manifest[field] as Record<string, string> | undefined) ?? {})) {\n if (name.startsWith('@wildo-ai/') && !deliveryOnly.has(name)) frameworkDependencies.add(name);\n }\n }\n const required = new Set<string>();\n for (const dependencyName of frameworkDependencies) {\n // An opt-in framework package (#1836) answers from its own generated record; a package declares one\n // only when it chose to, so this lookup is inert for every package that did not.\n const closure = enginePeerClosure[dependencyName] ?? optInPackageRecords?.[dependencyName]?.peerClosure ?? [];\n for (const peerName of closure) required.add(peerName);\n }\n // A name the package already declares as a real dependency needs no peer entry: the override\n // reaches it there.\n for (const field of ['dependencies', 'devDependencies', 'optionalDependencies']) {\n for (const name of Object.keys((manifest[field] as Record<string, string> | undefined) ?? {})) required.delete(name);\n }\n if (required.size === 0) continue;\n\n const peers = { ...((manifest.peerDependencies as Record<string, string> | undefined) ?? {}) };\n for (const name of required) peers[name] = '*';\n manifest.peerDependencies = Object.fromEntries(Object.keys(peers).sort().map((name) => [name, peers[name]]));\n writeFileSync(packageJsonPath, `${JSON.stringify(manifest, null, 2)}\\n`, 'utf8');\n }\n}\n\n/**\n * Seed the application's dependency-exclusion list from the framework's own `deliberatelyExcluded`\n * (issue #222).\n *\n * The list names third-party packages that `wildo align-deps` must NEVER pin to the engine's version\n * because the application's own toolchain owns them — `esbuild` follows vite, `express` follows\n * webpack-dev-server, `mime` follows express, plus astro / docusaurus / jest / tailwindcss /\n * typescript. Each entry was measured against a real collision, not guessed.\n *\n * SEEDED, then APPLICATION-OWNED. The framework's copy is a judgement about a typical application's\n * stack; a real application knows its own better, and it is the one that breaks when the judgement is\n * wrong. The cost is that a later framework exclusion does not reach an existing application — which\n * is the right trade, because the conflict being described is the application's, not the framework's.\n */\nfunction seedDependencyExclusions(input: { appRoot: string; frameworkPath: string }): void {\n const excludedNames = ApplicationDependencyAlignmentService.readFrameworkExclusions(input.frameworkPath);\n if (Object.keys(excludedNames).length === 0) return;\n const targetPath = join(input.appRoot, APPLICATION_DEPENDENCY_EXCLUSIONS_RELATIVE);\n mkdirSync(dirname(targetPath), { recursive: true });\n writeFileSync(targetPath, `${JSON.stringify({\n 'purpose-note':\n 'Names `wildo align-deps` must never pin to the framework version, because THIS application\\'s '\n + 'toolchain owns them. Seeded at `wildo init` from the framework of the day and yours from here: '\n + 'edit it when your stack needs a major the framework does not pin. A key ending in `*` is a '\n + 'prefix match. The value is the reason, and is never read by any tool — it is for whoever '\n + 'reads this file next.',\n excludedNames,\n }, null, 2)}\\n`, 'utf8');\n}\n\n/** Recursively materialize the template tree into the app root. */\nfunction materializeTemplateTree(input: {\n templateRoot: string;\n appRoot: string;\n mode: SkeletonMode;\n variables: Record<string, unknown>;\n processor: TemplateProcessor;\n}): number {\n let written = 0;\n // Framework-checkout dev-loop files: an app-creator install has no framework scripts to call\n // into, so neither the dev-framework-scripts home, the workbench drop (it launches Vite against\n // FRAMEWORK SOURCE — materialized in an app-creator install it would exit with \"the workbench runs\n // against framework source\" on every start), nor the supervised dev wrappers (frontend, backend-api,\n // and the companion's — the one an earlier inline list here missed, which shipped it into every\n // app-creator application as the drop's `dev` script) are materialized there. The list is the\n // ownership manifest's, not this function's, so the sweep that reports these files MISSING from an\n // existing framework-dev application reads the same population (#1063).\n const ownership = readSkeletonOwnership(input.templateRoot);\n const walk = (relativeDir: string) => {\n for (const entry of readdirSync(join(input.templateRoot, relativeDir), { withFileTypes: true })) {\n const relativePath = relativeDir ? join(relativeDir, entry.name) : entry.name;\n if (entry.isDirectory()) {\n walk(relativePath);\n continue;\n }\n if (!entry.isFile()) continue;\n\n if (input.mode === SkeletonMode.APP_CREATOR && isFrameworkDevLoopTemplatePath(relativePath, ownership)) {\n continue;\n }\n\n let targetRelative = relativePath;\n let content: string | null = null;\n if (entry.name.endsWith('.init.hbs')) {\n // `.init.hbs` marks the INIT-time variant of a file whose later evolution belongs to a\n // service or scenario (e.g. `wildo.saas.config.ts.init.hbs` — the config service owns\n // post-init parametrization). Rendered once here, then never re-templated.\n targetRelative = relativePath.slice(0, -'.init.hbs'.length);\n content = input.processor.processTemplate(relativePath, input.variables);\n } else if (entry.name.endsWith('.hbs')) {\n targetRelative = relativePath.slice(0, -'.hbs'.length);\n content = input.processor.processTemplate(relativePath, input.variables);\n } else if ((entry.name === 'gitignore' || entry.name === 'dockerignore' || entry.name === 'prettierignore') && relativeDir === '') {\n // Authored un-dotted so a published package keeps them (npm drops a `.gitignore`), rendered\n // dotted at the application root. The `.dockerignore` is what makes every service Dockerfile's\n // `COPY . .` safe: it keeps the host's `node_modules` and every env/secret file out of the\n // image build context (#984). The `.prettierignore` keeps a formatter off installed provider\n // modules, whose per-file install hashes decide what `wildo registry update` may replace (#2014).\n targetRelative = `.${entry.name}`;\n }\n\n const targetPath = join(input.appRoot, targetRelative);\n mkdirSync(dirname(targetPath), { recursive: true });\n if (content !== null) {\n writeFileSync(targetPath, content, 'utf8');\n } else {\n copyFileSync(join(input.templateRoot, relativePath), targetPath);\n }\n // Keyed on the RENDERED name so a future `*.sh.hbs` template still lands executable.\n if (targetRelative.endsWith('.sh')) chmodSync(targetPath, 0o755);\n written += 1;\n }\n };\n walk('');\n return written;\n}\n\nfunction runStep(input: {\n log: SaasSkeletonOptions['log'];\n label: string;\n command: string;\n args: string[];\n cwd: string;\n}): boolean {\n input.log.info(` ${input.label}…`);\n const result = spawnSync(input.command, input.args, { cwd: input.cwd, stdio: 'inherit' });\n if (result.status !== 0) {\n input.log.warn(` ${input.label} failed (exit ${result.status ?? 'signal'}). Fix and re-run manually.`);\n return false;\n }\n return true;\n}\n\nexport const SaasSkeletonService = {\n allocatePortBase,\n collectUsedApplicationPorts,\n buildRootOverrides,\n\n scaffold(appRoot: string, options: SaasSkeletonOptions): SaasSkeletonResult {\n const safeName = options.name.replace(/['\"\\\\]/g, '');\n const slug = toSlug(safeName) || 'app';\n // invented-display-text: a scaffold seed written into the new application's own config file.\n const displayName = toDisplayName(safeName || slug) || 'App';\n\n if (options.mode === SkeletonMode.FRAMEWORK_DEV && !options.frameworkPath) {\n throw new Error('framework-dev skeleton mode requires a resolved framework checkout.');\n }\n\n // Initial scaffolding owns a whole empty directory; it is not a merge.\n // Inspect every entry (including hidden files and directories), not selected\n // project markers: nested source can exist without a root package.json.\n // This preflight precedes template, manifest, dependency and companion writes.\n // InitCommand routes an existing own-root application to repair before here.\n const existingEntries = existsSync(appRoot) ? readdirSync(appRoot).sort() : [];\n if (existingEntries.length > 0) {\n throw new Error(\n `Target directory already contains ${existingEntries.join(', ')} — refusing to scaffold over an existing project. `\n + 'Use an empty directory for a new application. To repair an existing Wildo application, run `wildo init` at its root.',\n );\n }\n\n // An EXPLICIT --port-base is validated against the same sibling scan the\n // allocator uses — accepting a colliding base would recreate the exact\n // hand-bootstrap failure the allocator was built to prevent.\n if (options.portBase !== undefined) {\n const used = collectUsedApplicationPorts(options.frameworkPath);\n if (!portBlockIsFree(options.portBase, used)) {\n throw new Error(\n `--port-base ${options.portBase} collides with a sibling application's authored ports `\n + `(block ${options.portBase}-${options.portBase + PORT_BASE_STRIDE - 1} or companion port ${options.portBase + COMPANION_PORT_OFFSET}). `\n + `Next free base: ${allocatePortBase(options.frameworkPath)}.`,\n );\n }\n }\n const portBase = options.portBase ?? allocatePortBase(options.frameworkPath);\n const ports: SkeletonPorts = {\n backend: portBase,\n app: portBase + 1,\n companion: portBase + COMPANION_PORT_OFFSET,\n workbench: portBase + WORKBENCH_PORT_OFFSET,\n };\n\n const templateRoot = options.frameworkPath\n ? join(options.frameworkPath, SKELETON_TEMPLATE_RELATIVE)\n : null;\n if (!templateRoot || !existsSync(templateRoot)) {\n throw new Error(\n 'Application skeleton templates not found'\n + (templateRoot ? ` at ${templateRoot}` : ' (no framework-assets root resolved)')\n + '. The full-skeleton scaffold needs the framework templates: a framework checkout, or a `@wildo-ai/wildo-cli` '\n + 'installed from npm (which ships them). Use --config-only to write only wildo.saas.config.ts.',\n );\n }\n\n const variables = {\n slug,\n displayName,\n backendPort: ports.backend,\n appPort: ports.app,\n companionPort: ports.companion,\n workbenchPort: ports.workbench,\n // Mode conditionals inside `.hbs` templates ({{#if isFrameworkDev}}): framework-dev\n // renders engine-source aliasing/tsconfig-paths/dev-supervision; app-creator renders\n // the standalone shape (published packages, plain vite dev).\n isFrameworkDev: options.mode === SkeletonMode.FRAMEWORK_DEV,\n // Store conditionals ({{#if isPostgreSql}}): which backing service the environment declares, and\n // whether it declares `applicationDatabase` at all. See `SaasSkeletonOptions.database`.\n isPostgreSql: options.database === DatabaseEngine.POSTGRESQL,\n // Ownership conditional ({{#if infrastructureHost}}): a hosted environment reads its runtime,\n // engine and backing-service ADDRESSES from the host rather than restating them, so the two\n // cannot disagree. See `SaasSkeletonOptions.infrastructureHost`.\n infrastructureHost: options.infrastructureHost ?? null,\n };\n\n const processor = new TemplateProcessor(templateRoot);\n let filesWritten = materializeTemplateTree({\n templateRoot,\n appRoot,\n mode: options.mode,\n variables,\n processor,\n });\n\n // `.claude/` is framework-delivered in framework-dev mode (materialized by `wildo fwk\n // dev-skills`, synchronized on framework update) — ignoring it avoids duplicating the\n // compiled knowledge product in git. App-creator applications COMMIT their `.claude`, so\n // the block is mode-conditional rather than part of the template gitignore.\n if (options.mode === SkeletonMode.FRAMEWORK_DEV) {\n appendFileSync(\n join(appRoot, '.gitignore'),\n '\\n# Framework-delivered agent knowledge (framework-dev mode only) — materialized by\\n'\n + '# `wildo fwk dev-skills`, synchronized on framework update; never commit in this mode.\\n'\n + '.claude/\\n',\n 'utf8',\n );\n }\n\n writeFileSync(join(appRoot, 'package.json'), buildRootPackageJson({\n slug,\n appRoot,\n frameworkPath: options.frameworkPath,\n mode: options.mode,\n }), 'utf8');\n writeFileSync(join(appRoot, 'pnpm-workspace.yaml'), buildWorkspaceYaml(), 'utf8');\n\n if (options.frameworkPath) {\n declareEnginePeersInScaffoldedPackages({ appRoot, frameworkPath: options.frameworkPath });\n seedDependencyExclusions({ appRoot, frameworkPath: options.frameworkPath });\n }\n\n // Deliver the engine EMAIL CANON (system + engine-resource templates) into the backend's\n // engine tree. System emails are runtime behavior — a fresh app without them has no welcome\n // email, no invitation email, etc. The canon at `templates/saas/i18n/email` is harvested from\n // Wonder Todos by `scripts/i18n/refresh-template-label-base.mjs` (run by every framework-dev\n // application's sync loop), and the app owns its copy from here: an engine template added later\n // is seeded by the companion's `wildo generate email` from the delivered canon, never overwriting.\n const emailCanonRoot = join(options.frameworkPath ?? '', 'templates', 'saas', 'i18n', 'email');\n if (options.frameworkPath && existsSync(emailCanonRoot)) {\n const emailTarget = join(appRoot, 'backend-api', 'src', 'engine', 'email');\n const copyTree = (relativeDir: string) => {\n for (const entry of readdirSync(join(emailCanonRoot, relativeDir), { withFileTypes: true })) {\n const entryRelative = relativeDir ? join(relativeDir, entry.name) : entry.name;\n if (entry.isDirectory()) {\n copyTree(entryRelative);\n } else if (entry.isFile()) {\n const targetPath = join(emailTarget, entryRelative);\n mkdirSync(dirname(targetPath), { recursive: true });\n copyFileSync(join(emailCanonRoot, entryRelative), targetPath);\n filesWritten += 1;\n }\n }\n };\n // The canon's own aggregator files are also shipped by the skeleton tree; the canon copy\n // wins nothing over them (byte-identical), so copying the whole tree is safe.\n copyTree('');\n } else {\n options.log.warn(' Email canon not found — backend system emails will be missing until delivered.');\n }\n const devScriptsDir = join(appRoot, '.wildo-saas', 'dev-framework-scripts');\n if (options.mode === SkeletonMode.FRAMEWORK_DEV) {\n mkdirSync(devScriptsDir, { recursive: true });\n const runDevStackPath = join(devScriptsDir, 'run-dev-stack.sh');\n writeFileSync(runDevStackPath, buildRunDevStack(slug), 'utf8');\n chmodSync(runDevStackPath, 0o755);\n filesWritten += 1;\n }\n filesWritten += 2;\n\n let companionDelivered = false;\n if (options.mode === SkeletonMode.FRAMEWORK_DEV && options.frameworkPath) {\n const deliverScript = join(options.frameworkPath, COMPANION_DELIVER_RELATIVE);\n const result = spawnSync(process.execPath, [\n deliverScript,\n '--framework-root', options.frameworkPath,\n '--app-root', appRoot,\n '--mode', SkeletonMode.FRAMEWORK_DEV,\n ], { stdio: 'inherit' });\n companionDelivered = result.status === 0;\n if (!companionDelivered) {\n options.log.warn(\n ' Companion delivery failed — build @wildo-ai/dev-companion in the framework, then re-run '\n + `node ${COMPANION_DELIVER_RELATIVE} --app-root ${appRoot}`,\n );\n }\n } else if (options.mode === SkeletonMode.APP_CREATOR) {\n /*\n * App-creator delivery is a SHIM, not a dist mirror.\n *\n * `dev-companion-deliver.mjs` hard-links the companion's `dist/` out of a local framework\n * checkout. An app-creator has no checkout — it has the published CLI and a registry — so that\n * path cannot serve this mode. What it CAN do is what every other package in the generated app\n * already does: declare a dependency and let `pnpm install` fetch it.\n *\n * The drop is a WORKSPACE MEMBER (see the `pnpm-workspace.yaml` this skeleton writes), so its\n * dependencies resolve exactly like `specifications/` or `backend-api/`.\n *\n * Why a re-export file rather than repointing `main` into `node_modules`: 31 files in this\n * repository address the drop through the fixed `dist/esm/index.js` layout. Keeping that layout\n * byte-for-byte means no consumer can tell the two delivery modes apart, which is the whole\n * point — a targeted shim beats a 31-file resolution refactor with no lasting architectural\n * gain.\n *\n * Location-sensitivity was ENUMERATED before trusting this, not assumed. The companion has six\n * `import.meta.url` sites; five resolve to files inside its own package and stay correct when\n * that package lives in `node_modules`. The sixth is `dotenv` looking for `../.env` from\n * `dist/esm`, i.e. `dist/.env` — which no delivered drop has ever contained (the drop's `.env`\n * sits at its root).\n *\n * ⚠️ \"Already a no-op, so the shim does not regress it\" was true and was not enough — corrected\n * 2026-09-13 (#594). A no-op loader means NOTHING loads the drop's `.env`. In framework-developer\n * mode the runtime supervisor injects the environment, so the gap was invisible there; an\n * app-creator install has no supervisor, and once `local init` began writing the drop's `.env`\n * (4cdc6d50) the companion still died on `APPLICATION_ID ... undefined`, beside a file holding the\n * value. The scripts below therefore load it themselves with `--env-file-if-exists` — Node's own\n * loader, resolved against the drop root the scripts run in, and a no-op when the file is absent.\n */\n const companionVersion = options.frameworkPath !== null\n ? (JSON.parse(\n readFileSync(join(options.frameworkPath, 'wildo-framework.info.json'), 'utf8'),\n ) as { version: string }).version\n : null;\n\n if (companionVersion === null) {\n options.log.warn(\n ' Companion delivery skipped: no framework-assets root is reachable (neither a checkout nor an '\n + 'npm-installed `@wildo-ai/wildo-cli`), so the published `@wildo-ai/dev-companion` version to pin '\n + 'could not be determined.',\n );\n } else {\n filesWritten += writeAppCreatorCompanionDrop({ appRoot, slug, companionVersion });\n companionDelivered = true;\n filesWritten += writeAppCreatorWorkbenchDrop({\n appRoot,\n slug,\n workbenchVersion: companionVersion,\n companionPort: ports.companion,\n workbenchPort: ports.workbench,\n });\n }\n }\n\n let installed = false;\n let built = false;\n /*\n * App-creator mode INSTALLS. It used to refuse, because the `@wildo-ai/*` packages a generated\n * application depends on were not all on the registry — four of the thirteen declared for publish\n * had never landed, `saas-specifications` among them, which a generated `specifications/` package\n * depends on directly.\n *\n * All thirteen are published at 1.1.0 as of 2026-08-31 (#151), and the generated manifests pin\n * `*`, so they resolve to it. Measured BEFORE removing the refusal rather than after: a scaffolded\n * app-creator application installs in ~24s with every `@wildo-ai` dependency resolved from the\n * registry.\n *\n * A refusal that outlives its cause is worse than no refusal — it teaches an operator that a\n * working path is broken, and this one named packages that are now present.\n */\n if (options.skipInstall !== true) {\n installed = runStep({ log: options.log, label: 'pnpm install', command: 'pnpm', args: ['install'], cwd: appRoot });\n if (installed) {\n built = runStep({\n log: options.log,\n label: 'build specifications + backend-api',\n command: 'pnpm',\n args: ['--filter', `@${slug}/specifications`, '--filter', `@${slug}/shared-lib`, '--filter', `@${slug}/backend-api`, 'build'],\n cwd: appRoot,\n });\n }\n }\n\n return { slug, ports, filesWritten, companionDelivered, installed, built };\n },\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"stored-declaration-currency.service.d.ts","sourceRoot":"","sources":["../../../../../../src/services/application/stored-declaration-currency.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAG5G,oBAAY,yBAAyB;IACnC,2FAA2F;IAC3F,OAAO,YAAY;IACnB,2EAA2E;IAC3E,KAAK,UAAU;IACf,oFAAoF;IACpF,UAAU,eAAe;CAC1B;AAED,MAAM,MAAM,+BAA+B,GACvC;IAAE,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,QAAQ,EAAE,yBAAyB,CAAC,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACrG;IAAE,QAAQ,EAAE,yBAAyB,CAAC,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,qBAAa,gCAAgC;WAC9B,MAAM,CAAC,KAAK,EAAE;QACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACpC,GAAG,EAAE,gCAAgC,GAAG,IAAI,GAAG,SAAS,CAAC;KAC1D,GAAG,OAAO,CAAC,+BAA+B,CAAC;CA2C7C"}
1
+ {"version":3,"file":"stored-declaration-currency.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/stored-declaration-currency.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAKH,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAG5G,oBAAY,yBAAyB;IACnC,2FAA2F;IAC3F,OAAO,YAAY;IACnB,2EAA2E;IAC3E,KAAK,UAAU;IACf,oFAAoF;IACpF,UAAU,eAAe;CAC1B;AAED,MAAM,MAAM,+BAA+B,GACvC;IAAE,QAAQ,EAAE,yBAAyB,CAAC,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAChE;IAAE,QAAQ,EAAE,yBAAyB,CAAC,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GACrG;IAAE,QAAQ,EAAE,yBAAyB,CAAC,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,qBAAa,gCAAgC;WAC9B,MAAM,CAAC,KAAK,EAAE;QACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;QACpC,GAAG,EAAE,gCAAgC,GAAG,IAAI,GAAG,SAAS,CAAC;KAC1D,GAAG,OAAO,CAAC,+BAA+B,CAAC;CA2C7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"stored-declaration-currency.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/stored-declaration-currency.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC5F,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC;AAEvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAEvF,MAAM,CAAN,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,2FAA2F;IAC3F,gDAAmB,CAAA;IACnB,2EAA2E;IAC3E,4CAAe,CAAA;IACf,oFAAoF;IACpF,sDAAyB,CAAA;AAC3B,CAAC,EAPW,yBAAyB,KAAzB,yBAAyB,QAOpC;AAOD,MAAM,OAAO,gCAAgC;IAC3C,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAGnB;QACC,MAAM,SAAS,GAAG,CAAC,MAAc,EAAmC,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,yBAAyB,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC;QAEpI,IAAI,CAAC,KAAK,CAAC,QAAQ;YAAE,OAAO,SAAS,CAAC,wDAAwD,CAAC,CAAC;QAChG,IAAI,CAAC,KAAK,CAAC,GAAG;YAAE,OAAO,SAAS,CAAC,2BAA2B,CAAC,CAAC;QAE9D,MAAM,WAAW,GAAG,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrE,IAAI,CAAC,WAAW;YAAE,OAAO,S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Aa,CAAC,OAAO,EAAE;SAC1E,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * Is the application config apps-manager STORED behind `wildo.saas.config.ts`?\n *\n * The runtime reads the stored declaration, not the authored file, so an edit to a\n * declaration-managed slice (`engineCapabilities`, providers, frontend services, …) does nothing\n * until something applies it: `/initialize` (every `wildo local dev` / `wildo config sync`), or\n * `wildo config reapply-declaration`. This answers whether that has happened yet.\n *\n * One function, two readers — `wildo local doctor` and `wildo config validate` — because both ask the\n * same question, and two copies of it would be two call sites of one invariant. The comparison itself\n * is not implemented here either: it is apps-manager's dry-run reapply, so the answer comes from the\n * one component that owns the projection.\n *\n * Never throws. Every honest reason the comparison cannot be made — no app root, no environment, no\n * secrets yet, the app not registered, apps-manager down, no apps-manager at all in CI — is\n * `NOT_PROBED` with the reason, never drift: a check that cries wolf on a fresh machine or in a pull\n * request is one operators learn to skim.\n */\n\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { AppBootstrapService } from '~wildo-cli/services/application/app-bootstrap.service';\nimport { AppRuntimeTargetsService } from '~wildo-cli/services/application/app-runtime-targets.service';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\n\nexport enum StoredDeclarationCurrency {\n /** The stored config matches `wildo.saas.config.ts` on every declaration-managed slice. */\n CURRENT = 'current',\n /** At least one slice is behind; the runtime is using the stored value. */\n STALE = 'stale',\n /** The comparison could not be made; `reason` says why. Not evidence either way. */\n NOT_PROBED = 'not-probed',\n}\n\nexport type StoredDeclarationCurrencyResult =\n | { currency: StoredDeclarationCurrency.CURRENT; appSlug: string }\n | { currency: StoredDeclarationCurrency.STALE; appSlug: string; staleSlices: string[]; remedy: string }\n | { currency: StoredDeclarationCurrency.NOT_PROBED; reason: string };\n\nexport class StoredDeclarationCurrencyService {\n static async assess(input: {\n saasRoot: string | null | undefined;\n env: PlatformEnvironmentConfiguration | null | undefined;\n }): Promise<StoredDeclarationCurrencyResult> {\n const notProbed = (reason: string): StoredDeclarationCurrencyResult => ({ currency: StoredDeclarationCurrency.NOT_PROBED, reason });\n\n if (!input.saasRoot) return notProbed('no app root with wildo.saas.config.ts is resolved here');\n if (!input.env) return notProbed('no registered environment');\n\n const credentials = EnvironmentUtils.loadSecretsJson(input.env.name);\n if (!credentials) return notProbed(`no secrets stored for '${input.env.name}' yet — run \\`wildo init\\``);\n\n let runtimeTarget: Awaited<ReturnType<typeof AppRuntimeTargetsService.resolve>>;\n try {\n // Bound to the environment: the comparison is against THAT environment's stored config.\n runtimeTarget = await AppRuntimeTargetsService.resolve(input.saasRoot, { environmentName: input.env.name });\n } catch (error) {\n return notProbed(`wildo.saas.config.ts could not be read: ${ErrorUtils.extractErrorMessage(error)}`);\n }\n if (!runtimeTarget) return notProbed('no application could be resolved from wildo.saas.config.ts');\n\n let staleSlices: string[];\n try {\n const preview = await AppBootstrapService.reapplyApplicationDeclaration(input.env, credentials, {\n appSlug: runtimeTarget.appSlug,\n managedDeclaration: runtimeTarget.managedDeclaration,\n dryRun: true,\n });\n staleSlices = preview.updatedFields;\n } catch (error) {\n // An unreachable or unregistered app is the normal state of a stopped or fresh stack.\n return notProbed(\n `apps-manager could not compare it (app not registered, or platform down): ${ErrorUtils.extractErrorMessage(error)}`,\n );\n }\n\n if (staleSlices.length === 0) {\n return { currency: StoredDeclarationCurrency.CURRENT, appSlug: runtimeTarget.appSlug };\n }\n return {\n currency: StoredDeclarationCurrency.STALE,\n appSlug: runtimeTarget.appSlug,\n staleSlices,\n remedy: `wildo config reapply-declaration --app ${runtimeTarget.appSlug}`,\n };\n }\n}\n"]}
1
+ {"version":3,"file":"stored-declaration-currency.service.js","sourceRoot":"","sources":["../../../../src/services/application/stored-declaration-currency.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,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AC,EAAE,CAAC,CAAC;QACvG,CAAC;QACD,IAAI,CAAC,aAAa;YAAE,OAAO,SAAS,CAAC,4DAA4D,CAAC,CAAC;QAEnG,IAAI,WAAqB,CAAC;QAC1B,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,mBAAmB,CAAC,6BAA6B,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE;gBAC9F,OAAO,EAAE,aAAa,CAAC,OAAO;gBAC9B,kBAAkB,EAAE,aAAa,CAAC,kBAAkB;gBACpD,MAAM,EAAE,IAAI;aACb,CAAC,CAAC;YACH,WAAW,GAAG,OAAO,CAAC,aAAa,CAAC;QACtC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,sFAAsF;YACtF,OAAO,SAAS,CACd,6EAA6E,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CACrH,CAAC;QACJ,CAAC;QAED,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,EAAE,QAAQ,EAAE,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;QACzF,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,yBAAyB,CAAC,KAAK;YACzC,OAAO,EAAE,aAAa,CAAC,OAAO;YAC9B,WAAW;YACX,MAAM,EAAE,0CAA0C,aAAa,CAAC,OAAO,EAAE;SAC1E,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * Is the application config apps-manager STORED behind `wildo.saas.config.ts`?\n *\n * The runtime reads the stored declaration, not the authored file, so an edit to a\n * declaration-managed slice (`engineCapabilities`, providers, frontend services, …) does nothing\n * until something applies it: `/initialize` (every `wildo local dev` / `wildo config sync`), or\n * `wildo config reapply-declaration`. This answers whether that has happened yet.\n *\n * One function, two readers — `wildo local doctor` and `wildo config validate` — because both ask the\n * same question, and two copies of it would be two call sites of one invariant. The comparison itself\n * is not implemented here either: it is apps-manager's dry-run reapply, so the answer comes from the\n * one component that owns the projection.\n *\n * Never throws. Every honest reason the comparison cannot be made — no app root, no environment, no\n * secrets yet, the app not registered, apps-manager down, no apps-manager at all in CI — is\n * `NOT_PROBED` with the reason, never drift: a check that cries wolf on a fresh machine or in a pull\n * request is one operators learn to skim.\n */\n\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { AppBootstrapService } from '~wildo-cli/services/application/app-bootstrap.service';\nimport { AppRuntimeTargetsService } from '~wildo-cli/services/application/app-runtime-targets.service';\nimport type { PlatformEnvironmentConfiguration } from '~wildo-cli/services/environment/environment.schemas';\nimport { EnvironmentUtils } from '~wildo-cli/services/environment/environment.service';\n\nexport enum StoredDeclarationCurrency {\n /** The stored config matches `wildo.saas.config.ts` on every declaration-managed slice. */\n CURRENT = 'current',\n /** At least one slice is behind; the runtime is using the stored value. */\n STALE = 'stale',\n /** The comparison could not be made; `reason` says why. Not evidence either way. */\n NOT_PROBED = 'not-probed',\n}\n\nexport type StoredDeclarationCurrencyResult =\n | { currency: StoredDeclarationCurrency.CURRENT; appSlug: string }\n | { currency: StoredDeclarationCurrency.STALE; appSlug: string; staleSlices: string[]; remedy: string }\n | { currency: StoredDeclarationCurrency.NOT_PROBED; reason: string };\n\nexport class StoredDeclarationCurrencyService {\n static async assess(input: {\n saasRoot: string | null | undefined;\n env: PlatformEnvironmentConfiguration | null | undefined;\n }): Promise<StoredDeclarationCurrencyResult> {\n const notProbed = (reason: string): StoredDeclarationCurrencyResult => ({ currency: StoredDeclarationCurrency.NOT_PROBED, reason });\n\n if (!input.saasRoot) return notProbed('no app root with wildo.saas.config.ts is resolved here');\n if (!input.env) return notProbed('no registered environment');\n\n const credentials = EnvironmentUtils.loadSecretsJson(input.env.name);\n if (!credentials) return notProbed(`no secrets stored for '${input.env.name}' yet — run \\`wildo init\\``);\n\n let runtimeTarget: Awaited<ReturnType<typeof AppRuntimeTargetsService.resolve>>;\n try {\n // Bound to the environment: the comparison is against THAT environment's stored config.\n runtimeTarget = await AppRuntimeTargetsService.resolve(input.saasRoot, { environmentName: input.env.name });\n } catch (error) {\n return notProbed(`wildo.saas.config.ts could not be read: ${ErrorUtils.extractErrorMessage(error)}`);\n }\n if (!runtimeTarget) return notProbed('no application could be resolved from wildo.saas.config.ts');\n\n let staleSlices: string[];\n try {\n const preview = await AppBootstrapService.reapplyApplicationDeclaration(input.env, credentials, {\n appSlug: runtimeTarget.appSlug,\n managedDeclaration: runtimeTarget.managedDeclaration,\n dryRun: true,\n });\n staleSlices = preview.updatedFields;\n } catch (error) {\n // An unreachable or unregistered app is the normal state of a stopped or fresh stack.\n return notProbed(\n `apps-manager could not compare it (app not registered, or platform down): ${ErrorUtils.extractErrorMessage(error)}`,\n );\n }\n\n if (staleSlices.length === 0) {\n return { currency: StoredDeclarationCurrency.CURRENT, appSlug: runtimeTarget.appSlug };\n }\n return {\n currency: StoredDeclarationCurrency.STALE,\n appSlug: runtimeTarget.appSlug,\n staleSlices,\n remedy: `wildo config reapply-declaration --app ${runtimeTarget.appSlug}`,\n };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"systems-of-record-library.service.d.ts","sourceRoot":"","sources":["../../../../../../src/services/application/systems-of-record-library.service.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAuC,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAY1G,MAAM,WAAW,iCAAiC;IAChD,kHAAkH;IAClH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC9B,iGAAiG;IACjG,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;CAC/B;AAID;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC3G,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IACnF,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,iCAAiC,CAgCpC"}
1
+ {"version":3,"file":"systems-of-record-library.service.d.ts","sourceRoot":"","sources":["../../../../src/services/application/systems-of-record-library.service.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAuC,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAY1G,MAAM,WAAW,iCAAiC;IAChD,kHAAkH;IAClH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC9B,iGAAiG;IACjG,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;CAC/B;AAID;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE;IACnD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC3G,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,QAAQ,CAAC,GAAG,EAAE;QAAE,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAC;IACnF,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC1B,GAAG,iCAAiC,CAgCpC"}
@@ -1 +1 @@
1
- {"version":3,"file":"systems-of-record-library.service.js","sourceRoot":"","sources":["../../../../../../src/services/application/systems-of-record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KAAK,CAAC,aAAa;QAClC,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,KAAK;KACN,CAAC,CAAC;IACH,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,wDAAwD,CAAC,CAAC;IAChI,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;AACvF,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,YAAoC,EAAE,IAAY,EAAE,SAAiB;IAC3F,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACxC,2HAA2H;IAC3H,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,CAAE,IAAI,OAAO,CAAC,CAAC;IAC5F,MAAM,MAAM,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACtD,IAAI,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IAC3B,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["/**\n * Declares the system-of-record facet library on an application that declares a system of record (#2013).\n *\n * Called by the provider-runtime artifact sync (`syncProviderRuntimeArtifactsForApp`) before discovery, so every door\n * that generates those artifacts — `wildo config sync`, `wildo dev start`, `wildo dev sync-csp`, `wildo frontend\n * publish`, `wildo local dev`'s missing-or-refused-module repair — declares it, not one of them. `wildo update` declares\n * and installs it itself, before it runs `dev sync-csp`, because there the sync would meet a manifest edited after\n * the last install (#2253 review).\n *\n * ## Why the CLI writes a dependency at all\n *\n * The vendor facets — Odoo, SAP S/4HANA, Dataverse, Business Central, NetSuite, Salesforce, generic OData — live in\n * `@wildo-ai/systems-of-record`, an OPT-IN framework package (`optInFrameworkPackages`, #1836): an application links it\n * only by declaring it in one of its own manifests. An application that declares `systemsOfRecord` in\n * `wildo.saas.config.ts` has already said everything that decides the answer, so asking it to also remember a package\n * name would be a second declaration of one fact, free to disagree with the first (`derive-before-you-ask.md`). The\n * alternative — refusing until someone adds it by hand — was rejected for that reason.\n *\n * ## What it writes, and where\n *\n * - the dependency, on every BACKEND service (a service with no `frontendType`): the backend is the process that reads\n * facets at boot, and `wildo secrets` resolves the facet module from the backend's own manifest;\n * - the root `pnpm.overrides` link, through {@link ProviderPackageLinksService} — the same reconciliation `wildo compose`\n * runs, which links every declared opt-in package (`file:` in framework development, the release version otherwise).\n *\n * It never REMOVES either. An application that stops declaring systems of record keeps the dependency until a person\n * removes it, like every other dependency it declares: removing a manifest entry silently is how a reconciler becomes\n * an outage (the same rule the link service states).\n *\n * The dependency takes effect after the package manager installs it. Until then discovery cannot record the library's\n * facet module and `wildo config sync` refuses, naming the remedy (`describeUndiscoveredSystemsOfRecordLibrary` in\n * `@wildo-ai/platform-config-lib`), because an artifact without it boots a backend that refuses every instance.\n */\nimport { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join, relative } from 'node:path';\nimport { FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE, type WildoSaasConfig } from '@wildo-ai/platform-config-lib';\nimport { ProviderPackageLinksService } from './provider-package-links.service';\n\n/** The dependency fields a declaration may already sit in; any of them means the backend declares the library. */\nconst DEPENDENCY_FIELDS = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'] as const;\n\n/**\n * The specifier written. `\"*\"` because every `@wildo-ai/*` dependency of an application's own packages is written that\n * way: the version comes from the root `pnpm.overrides` link, never from the importer.\n */\nconst LIBRARY_SPECIFIER = '*';\n\nexport interface SystemsOfRecordLibraryDeclaration {\n /** Backend manifests that gained the dependency, relative to the application root. Empty when nothing changed. */\n readonly declaredIn: string[];\n /** Root `pnpm.overrides` entries the link reconciliation wrote (or would write on a dry run). */\n readonly linksAdded: string[];\n}\n\nconst NOTHING_DECLARED: SystemsOfRecordLibraryDeclaration = { declaredIn: [], linksAdded: [] };\n\n/**\n * Add `@wildo-ai/systems-of-record` to every backend service's manifest, and link it, when the application declares at\n * least one system-of-record instance. Pure over the files it reads; `write: false` computes without writing.\n */\nexport function declareSystemsOfRecordLibrary(input: {\n readonly saasRoot: string;\n readonly saasConfig: Pick<WildoSaasConfig, 'services'> & Partial<Pick<WildoSaasConfig, 'systemsOfRecord'>>;\n readonly frameworkPath: string | null;\n readonly log: { info: (message: string) => void; warn: (message: string) => void };\n readonly write?: boolean;\n}): SystemsOfRecordLibraryDeclaration {\n const instances = Object.keys(input.saasConfig.systemsOfRecord ?? {});\n if (instances.length === 0) return NOTHING_DECLARED;\n const write = input.write !== false;\n\n const declaredIn: string[] = [];\n for (const [serviceKey, service] of Object.entries(input.saasConfig.services ?? {})) {\n if (service.frontendType !== undefined) continue;\n const manifestPath = join(input.saasRoot, service.path, 'package.json');\n if (!existsSync(manifestPath)) {\n input.log.warn(` ! service \"${serviceKey}\" has no package.json at ${relative(input.saasRoot, manifestPath)}, so ${FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE} was not declared on it.`);\n continue;\n }\n const text = readFileSync(manifestPath, 'utf8');\n const manifest = JSON.parse(text) as Record<string, unknown> & Partial<Record<(typeof DEPENDENCY_FIELDS)[number], Record<string, string>>>;\n if (DEPENDENCY_FIELDS.some((field) => manifest[field]?.[FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE] !== undefined)) continue;\n\n manifest.dependencies = withDependency(manifest.dependencies ?? {}, FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE, LIBRARY_SPECIFIER);\n if (write) writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}${text.endsWith('\\n') ? '\\n' : ''}`, 'utf8');\n declaredIn.push(relative(input.saasRoot, manifestPath));\n input.log.info(` ~ ${relative(input.saasRoot, manifestPath)} (dependencies ${FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE} — systemsOfRecord declares ${instances.join(', ')})`);\n }\n\n // Links every declared opt-in package, this one included; a no-op when the link is already there.\n const links = ProviderPackageLinksService.reconcileAndReport({\n applicationRoot: input.saasRoot,\n frameworkPath: input.frameworkPath,\n log: input.log,\n write,\n });\n if (declaredIn.length > 0 && links.added.length === 0) input.log.info(' → run `pnpm install` so the new dependency resolves.');\n return { declaredIn, linksAdded: links.added.map(({ packageName }) => packageName) };\n}\n\n/**\n * The dependency map with one entry added. Kept in alphabetical order when it already was, so an ordered manifest stays\n * ordered; appended otherwise, so an author's own grouping is never reshuffled.\n */\nfunction withDependency(dependencies: Record<string, string>, name: string, specifier: string): Record<string, string> {\n const names = Object.keys(dependencies);\n // Code-unit order, which is what `JSON`-sorting tools and pnpm write; `localeCompare` would weigh `@` and `/` differently.\n const sorted = names.every((current, index) => index === 0 || names[index - 1]! <= current);\n const merged = { ...dependencies, [name]: specifier };\n if (!sorted) return merged;\n return Object.fromEntries(Object.keys(merged).sort().map((key) => [key, merged[key]!]));\n}\n"]}
1
+ {"version":3,"file":"systems-of-record-library.service.js","sourceRoot":"","sources":["../../../../src/services/application/systems-of-record-library.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,mCAAmC,EAAwB,MAAM,+BAA+B,CAAC;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,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;AACvF,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,YAAoC,EAAE,IAAY,EAAE,SAAiB;IAC3F,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACxC,2HAA2H;IAC3H,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,CAAE,IAAI,OAAO,CAAC,CAAC;IAC5F,MAAM,MAAM,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC;IACtD,IAAI,CAAC,MAAM;QAAE,OAAO,MAAM,CAAC;IAC3B,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAE,CAAC,CAAC,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["/**\n * Declares the system-of-record facet library on an application that declares a system of record (#2013).\n *\n * Called by the provider-runtime artifact sync (`syncProviderRuntimeArtifactsForApp`) before discovery, so every door\n * that generates those artifacts — `wildo config sync`, `wildo dev start`, `wildo dev sync-csp`, `wildo frontend\n * publish`, `wildo local dev`'s missing-or-refused-module repair — declares it, not one of them. `wildo update` declares\n * and installs it itself, before it runs `dev sync-csp`, because there the sync would meet a manifest edited after\n * the last install (#2253 review).\n *\n * ## Why the CLI writes a dependency at all\n *\n * The vendor facets — Odoo, SAP S/4HANA, Dataverse, Business Central, NetSuite, Salesforce, generic OData — live in\n * `@wildo-ai/systems-of-record`, an OPT-IN framework package (`optInFrameworkPackages`, #1836): an application links it\n * only by declaring it in one of its own manifests. An application that declares `systemsOfRecord` in\n * `wildo.saas.config.ts` has already said everything that decides the answer, so asking it to also remember a package\n * name would be a second declaration of one fact, free to disagree with the first (`derive-before-you-ask.md`). The\n * alternative — refusing until someone adds it by hand — was rejected for that reason.\n *\n * ## What it writes, and where\n *\n * - the dependency, on every BACKEND service (a service with no `frontendType`): the backend is the process that reads\n * facets at boot, and `wildo secrets` resolves the facet module from the backend's own manifest;\n * - the root `pnpm.overrides` link, through {@link ProviderPackageLinksService} — the same reconciliation `wildo compose`\n * runs, which links every declared opt-in package (`file:` in framework development, the release version otherwise).\n *\n * It never REMOVES either. An application that stops declaring systems of record keeps the dependency until a person\n * removes it, like every other dependency it declares: removing a manifest entry silently is how a reconciler becomes\n * an outage (the same rule the link service states).\n *\n * The dependency takes effect after the package manager installs it. Until then discovery cannot record the library's\n * facet module and `wildo config sync` refuses, naming the remedy (`describeUndiscoveredSystemsOfRecordLibrary` in\n * `@wildo-ai/platform-config-lib`), because an artifact without it boots a backend that refuses every instance.\n */\nimport { existsSync, readFileSync, writeFileSync } from 'node:fs';\nimport { join, relative } from 'node:path';\nimport { FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE, type WildoSaasConfig } from '@wildo-ai/platform-config-lib';\nimport { ProviderPackageLinksService } from './provider-package-links.service';\n\n/** The dependency fields a declaration may already sit in; any of them means the backend declares the library. */\nconst DEPENDENCY_FIELDS = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'] as const;\n\n/**\n * The specifier written. `\"*\"` because every `@wildo-ai/*` dependency of an application's own packages is written that\n * way: the version comes from the root `pnpm.overrides` link, never from the importer.\n */\nconst LIBRARY_SPECIFIER = '*';\n\nexport interface SystemsOfRecordLibraryDeclaration {\n /** Backend manifests that gained the dependency, relative to the application root. Empty when nothing changed. */\n readonly declaredIn: string[];\n /** Root `pnpm.overrides` entries the link reconciliation wrote (or would write on a dry run). */\n readonly linksAdded: string[];\n}\n\nconst NOTHING_DECLARED: SystemsOfRecordLibraryDeclaration = { declaredIn: [], linksAdded: [] };\n\n/**\n * Add `@wildo-ai/systems-of-record` to every backend service's manifest, and link it, when the application declares at\n * least one system-of-record instance. Pure over the files it reads; `write: false` computes without writing.\n */\nexport function declareSystemsOfRecordLibrary(input: {\n readonly saasRoot: string;\n readonly saasConfig: Pick<WildoSaasConfig, 'services'> & Partial<Pick<WildoSaasConfig, 'systemsOfRecord'>>;\n readonly frameworkPath: string | null;\n readonly log: { info: (message: string) => void; warn: (message: string) => void };\n readonly write?: boolean;\n}): SystemsOfRecordLibraryDeclaration {\n const instances = Object.keys(input.saasConfig.systemsOfRecord ?? {});\n if (instances.length === 0) return NOTHING_DECLARED;\n const write = input.write !== false;\n\n const declaredIn: string[] = [];\n for (const [serviceKey, service] of Object.entries(input.saasConfig.services ?? {})) {\n if (service.frontendType !== undefined) continue;\n const manifestPath = join(input.saasRoot, service.path, 'package.json');\n if (!existsSync(manifestPath)) {\n input.log.warn(` ! service \"${serviceKey}\" has no package.json at ${relative(input.saasRoot, manifestPath)}, so ${FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE} was not declared on it.`);\n continue;\n }\n const text = readFileSync(manifestPath, 'utf8');\n const manifest = JSON.parse(text) as Record<string, unknown> & Partial<Record<(typeof DEPENDENCY_FIELDS)[number], Record<string, string>>>;\n if (DEPENDENCY_FIELDS.some((field) => manifest[field]?.[FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE] !== undefined)) continue;\n\n manifest.dependencies = withDependency(manifest.dependencies ?? {}, FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE, LIBRARY_SPECIFIER);\n if (write) writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}${text.endsWith('\\n') ? '\\n' : ''}`, 'utf8');\n declaredIn.push(relative(input.saasRoot, manifestPath));\n input.log.info(` ~ ${relative(input.saasRoot, manifestPath)} (dependencies ${FRAMEWORK_SYSTEMS_OF_RECORD_PACKAGE} — systemsOfRecord declares ${instances.join(', ')})`);\n }\n\n // Links every declared opt-in package, this one included; a no-op when the link is already there.\n const links = ProviderPackageLinksService.reconcileAndReport({\n applicationRoot: input.saasRoot,\n frameworkPath: input.frameworkPath,\n log: input.log,\n write,\n });\n if (declaredIn.length > 0 && links.added.length === 0) input.log.info(' → run `pnpm install` so the new dependency resolves.');\n return { declaredIn, linksAdded: links.added.map(({ packageName }) => packageName) };\n}\n\n/**\n * The dependency map with one entry added. Kept in alphabetical order when it already was, so an ordered manifest stays\n * ordered; appended otherwise, so an author's own grouping is never reshuffled.\n */\nfunction withDependency(dependencies: Record<string, string>, name: string, specifier: string): Record<string, string> {\n const names = Object.keys(dependencies);\n // Code-unit order, which is what `JSON`-sorting tools and pnpm write; `localeCompare` would weigh `@` and `/` differently.\n const sorted = names.every((current, index) => index === 0 || names[index - 1]! <= current);\n const merged = { ...dependencies, [name]: specifier };\n if (!sorted) return merged;\n return Object.fromEntries(Object.keys(merged).sort().map((key) => [key, merged[key]!]));\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"service-address-resolver.service.d.ts","sourceRoot":"","sources":["../../../../../../src/services/catalog/service-address-resolver.service.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,wBAAwB,EAE7B,oBAAoB,EAIpB,iBAAiB,EACjB,sBAAsB,EAEvB,MAAM,+BAA+B,CAAC;AAOvC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAM5G,oBAAY,kBAAkB;IAC5B,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;CAC1C;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,sBAAsB,CAAC;IAChC,YAAY,EAAE,iBAAiB,CAAC;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,oBAAoB,CAAC;IACrC;;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tC"}
1
+ {"version":3,"file":"service-address-resolver.service.d.ts","sourceRoot":"","sources":["../../../../src/services/catalog/service-address-resolver.service.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,wBAAwB,EAE7B,oBAAoB,EAIpB,iBAAiB,EACjB,sBAAsB,EAEvB,MAAM,+BAA+B,CAAC;AAOvC,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qDAAqD,CAAC;AAM5G,oBAAY,kBAAkB;IAC5B,WAAW,gBAAgB;IAC3B,kBAAkB,uBAAuB;CAC1C;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,sBAAsB,CAAC;IAChC,YAAY,EAAE,iBAAiB,CAAC;IAChC,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,oBAAoB,CAAC;IACrC;;;;;;;;;;;;;;;;OAgBG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;CAC5C;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACvC,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACxC,kBAAkB,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAClD,KAAK,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACrC,UAAU,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC1C;;;;OAIG;IACH,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;IACtC;;;;;OAKG;IACH,MAAM,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,yBAAyB;I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