@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":"capture.command.js","sourceRoot":"","sources":["../../../../../../src/commands/local-defaults/capture.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,wDAAwD,CAAC;AAEhE,4GAA4G;AAC5G,SAAS,wBAAwB,CAAC,IAAY,EAAE,OAAe;IAC7D,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;IACpE,gGAAgG;IAChG,iGAAiG;IACjG,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC;QAChE,IAAI;KACL,CAAC;IACF,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC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C;YAC5F,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * `wildo local-defaults capture` — record this machine's shared platform credentials and provider\n * API keys once, so every application created afterwards can ADOPT them instead of minting strangers.\n *\n * ## The failure this removes\n *\n * `wildo init` could only mint. On a machine already running a platform that is the wrong move:\n * those containers hold somebody else's credentials, so a freshly minted set authenticates to\n * nothing. Measured 2026-09-17 on a scratch application created beside a running Wonder Todos —\n * 16 of 25 shared secrets diverged, and the operator saw one line naming `PLATFORM_ADMIN_SECRET`,\n * which was one of the sixteen.\n *\n * The shape this restores was already visible in the dogfood pair: Wonder CRM shares 34 of 37\n * secrets with Wonder Todos and mints 3. This command makes that reachable without copying values\n * between JSON files by hand.\n *\n * ## Captured FROM an application, deliberately\n *\n * The source is an application that already works against the running platform, because that is the\n * only place the true values exist — inventing them here would produce a file that is internally\n * consistent and wrong, which is exactly the failure being fixed.\n */\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { isAbsolute, join, resolve } from 'path';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport {\n captureLocalDefaults,\n describeLocalDefaults,\n resolveLocalDefaultsPath,\n writeLocalDefaults,\n} from '~wildo-cli/services/credentials/local-defaults.service';\n\n/** Where an application keeps one environment's secrets, mirroring `EnvironmentPaths.resolveSecretsDir`. */\nfunction resolveSourceSecretsFile(from: string, envName: string): string | null {\n const base = isAbsolute(from) ? from : resolve(process.cwd(), from);\n // `--from` accepts an application ROOT (the common case) or the secrets file itself (the escape\n // hatch for a relocated `secretsPath`, which `wildo setup` step 1 allows an operator to choose).\n const candidates = [\n join(base, 'infrastructure', envName, 'secrets', 'secrets.json'),\n base,\n ];\n return candidates.find((candidate) => existsSync(candidate) && candidate.endsWith('.json')) ?? null;\n}\n\nexport default class LocalDefaultsCaptureCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'local-defaults capture',\n description: 'Record this machine\\'s shared platform credentials and provider keys so new apps adopt them at init',\n category: CommandCategory.Core,\n flags: {\n from: {\n type: 'string',\n description: 'Application root (or secrets.json path) already working against the running platform',\n },\n env: {\n type: 'string',\n description: 'Environment whose secrets are captured',\n default: 'local',\n },\n force: {\n type: 'boolean',\n description: 'Overwrite an existing ~/.wildo/local-defaults.json',\n default: false,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const from = ctx.flags.from as string | undefined;\n if (!from) {\n ctx.log.error('`--from` is required: name an application that already works against the running platform.');\n ctx.log.info(chalk.dim(' e.g. wildo local-defaults capture --from examples/wonder-todos'));\n return { success: false };\n }\n\n const envName = (ctx.flags.env as string | undefined) ?? 'local';\n const sourceFile = resolveSourceSecretsFile(from, envName);\n if (!sourceFile) {\n ctx.log.error(`No ${envName} secrets found for '${from}'.`);\n ctx.log.info(chalk.dim(` Looked for <app>/infrastructure/${envName}/secrets/secrets.json, and for the path itself.`));\n return { success: false };\n }\n\n const targetPath = resolveLocalDefaultsPath();\n if (existsSync(targetPath) && ctx.flags.force !== true) {\n /*\n * Refuse rather than merge. These values address RUNNING containers, so a half-updated file\n * would authenticate to some of them and not others — the same partial-credential state this\n * command exists to remove, arrived at from the other direction.\n */\n ctx.log.error(`${targetPath} already exists. Re-run with --force to replace it.`);\n return { success: false };\n }\n\n try {\n const secrets = JSON.parse(readFileSync(sourceFile, 'utf8')) as PlatformEnvSecretsJson;\n const defaults = captureLocalDefaults({ secrets, capturedFrom: sourceFile });\n\n if (Object.keys(defaults.shared).length === 0) {\n ctx.log.error(`'${sourceFile}' carries no shared-infrastructure material — nothing to capture.`);\n return { success: false };\n }\n\n const written = writeLocalDefaults(defaults);\n ctx.log.info('');\n ctx.log.info(chalk.green(` Captured: ${describeLocalDefaults(defaults)}`));\n ctx.log.info(chalk.dim(` Written: ${written} (0600)`));\n ctx.log.info('');\n ctx.log.info(chalk.dim(' New applications adopt these at `wildo init`. The shared platform credentials join this platform'));\n ctx.log.info(chalk.dim(' (`--local-defaults adopt` to skip the prompt, `skip` to mint a platform of their own); the provider'));\n ctx.log.info(chalk.dim(' keys are seeded either way (`--provider-key-defaults skip` to leave them out).'));\n ctx.log.info(chalk.dim(' NOT captured: the application operator secret and the administrator/approver identities.'));\n ctx.log.info(chalk.dim(' Each application mints its own, so this file never carries an operator door.'));\n ctx.log.info(chalk.dim(' Note what that does NOT mean: an environment has ONE platform administrator, seeded from'));\n ctx.log.info(chalk.dim(' the application that OWNS its platform. An application HOSTED on another\\'s platform signs'));\n ctx.log.info(chalk.dim(' in with the HOST\\'s administrator — its own minted password seeds nothing.'));\n ctx.log.info('');\n ctx.log.info(chalk.yellow(' This file is machine-local credentials in plain text. It lives outside every repository'));\n ctx.log.info(chalk.yellow(' and nothing backs it up, which is deliberate — losing it costs one re-run of this command.'));\n ctx.log.info('');\n return { success: true };\n } catch (error) {\n ctx.log.error(`Failed to capture local defaults: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n}\n"]}
1
+ {"version":3,"file":"capture.command.js","sourceRoot":"","sources":["../../../../src/commands/local-defaults/capture.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,UAAU,EAAE,MAAM,8C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C;YACxH,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,8EAA8E,CAAC,CAAC,CAAC;YACxG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,2FAA2F,CAAC,CAAC,CAAC;YACxH,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,8FAA8F,CAAC,CAAC,CAAC;YAC3H,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,qCAAqC,UAAU,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC5F,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF","sourcesContent":["/**\n * `wildo local-defaults capture` — record this machine's shared platform credentials and provider\n * API keys once, so every application created afterwards can ADOPT them instead of minting strangers.\n *\n * ## The failure this removes\n *\n * `wildo init` could only mint. On a machine already running a platform that is the wrong move:\n * those containers hold somebody else's credentials, so a freshly minted set authenticates to\n * nothing. Measured 2026-09-17 on a scratch application created beside a running Wonder Todos —\n * 16 of 25 shared secrets diverged, and the operator saw one line naming `PLATFORM_ADMIN_SECRET`,\n * which was one of the sixteen.\n *\n * The shape this restores was already visible in the dogfood pair: Wonder CRM shares 34 of 37\n * secrets with Wonder Todos and mints 3. This command makes that reachable without copying values\n * between JSON files by hand.\n *\n * ## Captured FROM an application, deliberately\n *\n * The source is an application that already works against the running platform, because that is the\n * only place the true values exist — inventing them here would produce a file that is internally\n * consistent and wrong, which is exactly the failure being fixed.\n */\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { isAbsolute, join, resolve } from 'path';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { PlatformEnvSecretsJson } from '~wildo-cli/services/credentials/credentials.schemas';\nimport {\n captureLocalDefaults,\n describeLocalDefaults,\n resolveLocalDefaultsPath,\n writeLocalDefaults,\n} from '~wildo-cli/services/credentials/local-defaults.service';\n\n/** Where an application keeps one environment's secrets, mirroring `EnvironmentPaths.resolveSecretsDir`. */\nfunction resolveSourceSecretsFile(from: string, envName: string): string | null {\n const base = isAbsolute(from) ? from : resolve(process.cwd(), from);\n // `--from` accepts an application ROOT (the common case) or the secrets file itself (the escape\n // hatch for a relocated `secretsPath`, which `wildo setup` step 1 allows an operator to choose).\n const candidates = [\n join(base, 'infrastructure', envName, 'secrets', 'secrets.json'),\n base,\n ];\n return candidates.find((candidate) => existsSync(candidate) && candidate.endsWith('.json')) ?? null;\n}\n\nexport default class LocalDefaultsCaptureCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'local-defaults capture',\n description: 'Record this machine\\'s shared platform credentials and provider keys so new apps adopt them at init',\n category: CommandCategory.Core,\n flags: {\n from: {\n type: 'string',\n description: 'Application root (or secrets.json path) already working against the running platform',\n },\n env: {\n type: 'string',\n description: 'Environment whose secrets are captured',\n default: 'local',\n },\n force: {\n type: 'boolean',\n description: 'Overwrite an existing ~/.wildo/local-defaults.json',\n default: false,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const from = ctx.flags.from as string | undefined;\n if (!from) {\n ctx.log.error('`--from` is required: name an application that already works against the running platform.');\n ctx.log.info(chalk.dim(' e.g. wildo local-defaults capture --from examples/wonder-todos'));\n return { success: false };\n }\n\n const envName = (ctx.flags.env as string | undefined) ?? 'local';\n const sourceFile = resolveSourceSecretsFile(from, envName);\n if (!sourceFile) {\n ctx.log.error(`No ${envName} secrets found for '${from}'.`);\n ctx.log.info(chalk.dim(` Looked for <app>/infrastructure/${envName}/secrets/secrets.json, and for the path itself.`));\n return { success: false };\n }\n\n const targetPath = resolveLocalDefaultsPath();\n if (existsSync(targetPath) && ctx.flags.force !== true) {\n /*\n * Refuse rather than merge. These values address RUNNING containers, so a half-updated file\n * would authenticate to some of them and not others — the same partial-credential state this\n * command exists to remove, arrived at from the other direction.\n */\n ctx.log.error(`${targetPath} already exists. Re-run with --force to replace it.`);\n return { success: false };\n }\n\n try {\n const secrets = JSON.parse(readFileSync(sourceFile, 'utf8')) as PlatformEnvSecretsJson;\n const defaults = captureLocalDefaults({ secrets, capturedFrom: sourceFile });\n\n if (Object.keys(defaults.shared).length === 0) {\n ctx.log.error(`'${sourceFile}' carries no shared-infrastructure material — nothing to capture.`);\n return { success: false };\n }\n\n const written = writeLocalDefaults(defaults);\n ctx.log.info('');\n ctx.log.info(chalk.green(` Captured: ${describeLocalDefaults(defaults)}`));\n ctx.log.info(chalk.dim(` Written: ${written} (0600)`));\n ctx.log.info('');\n ctx.log.info(chalk.dim(' New applications adopt these at `wildo init`. The shared platform credentials join this platform'));\n ctx.log.info(chalk.dim(' (`--local-defaults adopt` to skip the prompt, `skip` to mint a platform of their own); the provider'));\n ctx.log.info(chalk.dim(' keys are seeded either way (`--provider-key-defaults skip` to leave them out).'));\n ctx.log.info(chalk.dim(' NOT captured: the application operator secret and the administrator/approver identities.'));\n ctx.log.info(chalk.dim(' Each application mints its own, so this file never carries an operator door.'));\n ctx.log.info(chalk.dim(' Note what that does NOT mean: an environment has ONE platform administrator, seeded from'));\n ctx.log.info(chalk.dim(' the application that OWNS its platform. An application HOSTED on another\\'s platform signs'));\n ctx.log.info(chalk.dim(' in with the HOST\\'s administrator — its own minted password seeds nothing.'));\n ctx.log.info('');\n ctx.log.info(chalk.yellow(' This file is machine-local credentials in plain text. It lives outside every repository'));\n ctx.log.info(chalk.yellow(' and nothing backs it up, which is deliberate — losing it costs one re-run of this command.'));\n ctx.log.info('');\n return { success: true };\n } catch (error) {\n ctx.log.error(`Failed to capture local defaults: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"check.command.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/lock/check.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAIH,OAAO,EAOL,KAAK,oBAAoB,EAEzB,KAAK,yBAAyB,EAC/B,MAAM,+BAA+B,CAAC;AAUvC,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAM1F,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,WAAW;IACvD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAKxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAqEvD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,8BAA8B,CAAC,KAAK,EAAE;IAC1D,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB;;;yDAGqD;IACrD,gBAAgB,EAAE,yBAAyB,CAAC;CAC7C,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAiChC;AAsBD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,yBAAyB,EACjC,QAAQ,EAAE,yBAAyB,GAClC,MAAM,GAAG,IAAI,CAsBf"}
1
+ {"version":3,"file":"check.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/lock/check.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAIH,OA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C,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,2BAA2B,CAAC,QAAgB;IACnD,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,QAAQ,CACxE,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["/**\n * `wildo lock check` — verify that the **providers** and **infra**\n * sections of the on-disk\n * `<saasRoot>/.wildo-saas/wildo-saas.lock.json` are in sync with\n * what `wildo config sync` would produce against the current\n * authored config.\n *\n * Slice 2.5c-4 of `infra-provider-planner.md`. Read-only — never\n * writes the lockfile or any sync artifacts. Exit 0 on match; exit\n * non-zero with a sections-diff report on mismatch.\n *\n * Intended use: CI gate. Wire as a step in\n * `.github/workflows/engine-tests.yml` (or a dedicated lockfile\n * workflow) so a PR that forgot to commit a regenerated lockfile\n * fails loud at PR time instead of leaking through to the next dev\n * `wildo config sync`.\n *\n * **Scope of the check** (Slice 4.A.1 / H3 — important): this\n * command can only materialize `sections.providers` (via\n * `materializeSaasProviderRuntimeArtifacts`) and `sections.infra`\n * (via `materializeInfraSection`). Other lockfile sections (today:\n * `i18n`, `modules`, plus any future sections that other subsystems\n * add) are **NOT** verified — the comparison spreads them verbatim\n * from the on-disk lockfile, so they always match themselves. A PR\n * that mutates an i18n source file but forgets to commit a\n * regenerated lockfile will pass `wildo lock check` but be caught\n * by whichever sibling tool owns the i18n section's drift gate.\n *\n * Comparison policy: `sections.providers` and `sections.infra`\n * deep-equal. `generatedAt` and `schemaVersion` are NOT compared —\n * they're metadata, not pinned state. If two runs produce identical\n * `sections.{providers, infra}` content, those sections are \"in\n * sync\" regardless of when the lockfile was generated.\n *\n * Implementation note (Slice 2.5c-4 / 4.A.2 / M1): the\n * materialization compute (discovery + provider section + infra\n * section) is mostly duplicated from `provider-runtime-sync.service.ts`\n * rather than extracted into a shared helper. The duplication is\n * intentional for this slice — `lock check` runs the same primitives\n * via the same exported functions in `@wildo-ai/platform-config-lib`,\n * so behavior parity is structural. Future cleanup: extract a\n * `computeNextLockfileEnvelope` helper into\n * `provider-runtime-sync.service.ts` and have both\n * `syncProviderRuntimeArtifactsForApp` and this command consume it.\n */\n\nimport chalk from 'chalk';\nimport { join } from 'path';\nimport {\n loadWorkerConfigs,\n materializeInfraSection,\n materializeSaasProviderRuntimeArtifacts,\n loadSaasConfig,\n SaasLockfileEnvelopeSchema,\n stableJsonStringify,\n type SaasLockfileEnvelope,\n type SaasLockfileInfraSection,\n type SaasLockfileKnownSections,\n} from '@wildo-ai/platform-config-lib';\nimport { resolveAndRegisterSaasProviderContributions } from '../../services/credentials/composed-provider-catalogue';\n// Slice 6 of `infra-provider-planner.md`: the lock-check\n// materialization MUST use the same `moduleMap` as the writer in\n// `provider-runtime-sync.service.ts`. Without this, the writer\n// produces digests via `module.plan()` while the checker falls back\n// to authored-entry digests — guaranteed drift on every PR.\nimport { buildInfraProviderModuleMap, collectServableInfraProviders } from '@wildo-ai/platform-infra-providers';\nimport { existsSync, readFileSync } from 'fs';\nimport { loadAuthoredInfraEnvSelections } from '~wildo-cli/services/application/provider-runtime-sync.service';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { requireSaasRoot } from '~wildo-cli/services/registry/registry-command.utils';\n\nconst WILDO_SAAS_LOCK_RELATIVE_PATH = join('.wildo-saas', 'wildo-saas.lock.json');\n\nexport default class LockCheckCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'lock check',\n description: 'Verify wildo-saas.lock.json is in sync with authored config (CI gate).',\n category: CommandCategory.Config,\n flags: {},\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const saasRoot = requireSaasRoot(ctx, 'lock-check');\n if (!saasRoot) return { success: false };\n\n ctx.log.info(chalk.cyan(`\\n Lockfile drift check — ${saasRoot}\\n`));\n\n const lockPath = join(saasRoot, WILDO_SAAS_LOCK_RELATIVE_PATH);\n if (!existsSync(lockPath)) {\n ctx.log.error(`Lockfile not found at ${lockPath}. Run \\`wildo config sync\\` to generate it.`);\n return { success: false };\n }\n\n const onDiskRaw = readFileSync(lockPath, 'utf-8');\n let onDisk: SaasLockfileEnvelope;\n try {\n onDisk = SaasLockfileEnvelopeSchema.parse(JSON.parse(onDiskRaw));\n } catch (e) {\n ctx.log.error(\n `Lockfile at ${lockPath} fails schema validation — ` +\n `${ErrorUtils.extractErrorMessage(e)}. Run \\`wildo config sync\\` to regenerate.`,\n );\n return { success: false };\n }\n\n let computed: SaasLockfileEnvelope;\n try {\n // Slice 2.5c-4: compute the would-be next envelope using the\n // SAME `generatedAt` as the on-disk lockfile so the byte-level\n // diff (when we report it) doesn't include a timestamp delta.\n // The actual comparison ignores `generatedAt` regardless; this\n // just keeps the diff payload tidy.\n //\n // Slice 4.A.2 / M1: thread the already-parsed `previousSections`\n // from `run()` into the compute helper so the lockfile is read\n // exactly once. Eliminates a race window where the file could\n // change between the run() read and the compute helper's\n // re-read.\n computed = await computeWouldBeLockfileEnvelope({\n saasRoot,\n generatedAt: onDisk.generatedAt,\n previousSections: onDisk.sections,\n });\n } catch (e) {\n ctx.log.error(\n `Failed to materialize lockfile from authored config — ` +\n `${ErrorUtils.extractErrorMessage(e)}.`,\n );\n return { success: false };\n }\n\n const drift = describeSectionsDrift(onDisk.sections, computed.sections);\n if (!drift) {\n // Slice 4.A.1 / H3: scoped success message — the check only\n // covers providers + infra. i18n / modules / future sections\n // are NOT verified by this command (see command JSDoc).\n ctx.log.info(chalk.green(\n ' ✅ Providers + infra sections are in sync with authored config.\\n'\n + ' (Other lockfile sections are not verified by this command.)\\n',\n ));\n return { success: true };\n }\n\n ctx.log.error(chalk.red(' ❌ Lockfile drift detected.\\n'));\n ctx.log.error(chalk.yellow(drift));\n ctx.log.error(\n chalk.yellow('\\n Run `wildo config sync` and commit the updated lockfile.\\n'),\n );\n return { success: false };\n }\n}\n\n/**\n * Compute the lockfile envelope that `wildo config sync` would\n * write right now, using the same primitives the sync uses but\n * without any disk writes.\n *\n * Slice 4.A.2 / M1 fix: `previousSections` is now passed in from the\n * caller (which already parsed the on-disk lockfile in `run()`)\n * instead of re-read here. Eliminates the redundant read and the\n * race window where the file could change between the two reads.\n *\n * **Exported for the Slice 6 CI gate** (`infra-provider-planner.md`)\n * so a \"live contract\" test can re-materialize the lockfile against\n * `examples/wonder-todos/` and assert no drift, mirroring the\n * `framework-knowledge-audit.live.contract.test.ts` pattern. The\n * function is otherwise an internal helper of the `lock check`\n * command; the export contract is \"stable enough for the test, do\n * not consume from outside the lock-check pair\".\n */\nexport async function computeWouldBeLockfileEnvelope(input: {\n saasRoot: string;\n generatedAt: string;\n /** The on-disk lockfile's `sections`, already parsed by the\n * caller. Spread into the computed envelope so unknown / non-\n * materialized sections (i18n, modules, future) are preserved\n * verbatim — matches the sync writer's behavior. */\n previousSections: SaasLockfileKnownSections;\n}): Promise<SaasLockfileEnvelope> {\n const { saasRoot, generatedAt, previousSections } = input;\n const saasConfig = await loadSaasConfig(join(saasRoot, 'wildo.saas.config.ts'));\n const { contributions: discoveredProviderContributions, augmentations: discoveredProviderAugmentations, systemOfRecordFacetModules: discoveredSystemOfRecordFacetModules, admittedProviderPackages } = await resolveAndRegisterSaasProviderContributions({ saasRoot, saasConfig });\n const workerConfigs = await loadWorkerConfigs(saasRoot, saasConfig);\n const nodeWorkerKeys = workerConfigs\n .filter((entry) => isNodeWorkerRuntimeLanguage(entry.config.runtime.language))\n .map((entry) => entry.key);\n const { lockSection: providersSection } = materializeSaasProviderRuntimeArtifacts(\n saasConfig,\n {\n discoveredContributions: discoveredProviderContributions,\n // Passed exactly as `config sync` passes it: the lock records opted-in augmentations (#1672), so a check\n // that omitted them would report drift on every application that has one.\n discoveredAugmentations: discoveredProviderAugmentations,\n // The walk's facet modules (#1675): the only answer that sees a package shipping facets and no provider.\n discoveredSystemOfRecordFacetModules,\n // Recorded in the lock as `config sync` records them (#1676), or every application with a listing drifts.\n admittedProviderPackages,\n nodeWorkerKeys,\n },\n );\n const infraSection = await computeInfraSection(saasRoot, generatedAt, previousSections.infra);\n\n return SaasLockfileEnvelopeSchema.parse({\n schemaVersion: 2,\n generatedAt,\n sections: {\n ...previousSections,\n providers: providersSection,\n ...(infraSection ? { infra: infraSection } : {}),\n },\n });\n}\n\nasync function computeInfraSection(\n saasRoot: string,\n generatedAt: string,\n previousSection: SaasLockfileInfraSection | undefined,\n): Promise<SaasLockfileInfraSection | undefined> {\n // The same enumeration the `config sync` writer uses, so the two projections judge the same\n // population of environments (#1693).\n const envs = await loadAuthoredInfraEnvSelections(saasRoot);\n if (envs.length === 0) return undefined;\n // Slice 6: pass the canonical module catalog so `planContributionDigest`\n // is computed identically to `provider-runtime-sync.service.ts`'s\n // writer path. Only the catalogue's module-less exemptions fall through\n // to the authored-entry digest; every other module-less provider is\n // refused (#1693).\n const moduleMap = buildInfraProviderModuleMap();\n // #1693: the SAME servable set on both lockfile projections, so `config sync` and `lock check`\n // refuse the same unservable declarations (a declaration no provider module can serve).\n return materializeInfraSection({ envs, generatedAt, moduleMap, previousSection, servableProviders: collectServableInfraProviders() });\n}\n\n/**\n * Deep-compare `sections` ignoring `generatedAt` / `schemaVersion`.\n * Returns `null` on match, or a multi-line human-readable diff\n * otherwise. Diff format prioritizes section/key paths over raw JSON\n * dumps.\n *\n * Exported for testing (Slice 4.A.3 / T4) — the command's drift\n * detection is the load-bearing contract; pin its output format so a\n * future formatting refactor doesn't silently break CI gate\n * messaging.\n */\nexport function describeSectionsDrift(\n onDisk: SaasLockfileKnownSections,\n computed: SaasLockfileKnownSections,\n): string | null {\n const onDiskJson = stableJsonStringify(onDisk);\n const computedJson = stableJsonStringify(computed);\n if (onDiskJson === computedJson) return null;\n\n const lines: string[] = [];\n const allSectionKeys = new Set([...Object.keys(onDisk), ...Object.keys(computed)]);\n for (const sectionKey of Array.from(allSectionKeys).sort()) {\n const a = stableJsonStringify((onDisk as Record<string, unknown>)[sectionKey]);\n const b = stableJsonStringify((computed as Record<string, unknown>)[sectionKey]);\n if (a === b) continue;\n if (a === undefined) {\n lines.push(` + sections.${sectionKey} (added by sync — not in lockfile yet)`);\n } else if (b === undefined) {\n lines.push(` - sections.${sectionKey} (removed by sync — still in lockfile)`);\n } else {\n lines.push(` ~ sections.${sectionKey} (drift)`);\n lines.push(` on-disk: ${a.slice(0, 200)}${a.length > 200 ? '…' : ''}`);\n lines.push(` computed: ${b.slice(0, 200)}${b.length > 200 ? '…' : ''}`);\n }\n }\n return lines.join('\\n');\n}\n\nfunction isNodeWorkerRuntimeLanguage(language: string): boolean {\n return ['javascript', 'js', 'node', 'nodejs', 'ts', 'typescript'].includes(\n language.trim().toLowerCase(),\n );\n}\n"]}
1
+ {"version":3,"file":"check.command.js","sourceRoot":"","sources":["../../../../src/commands/lock/check.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,uCAAuC,EACvC,cAAc,EACd,0BAA0B,EAC1B,mBAAmB,GAIpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,2CAA2C,EAAE,MAAM,wDAAwD,CAAC;AACrH,yDAAyD;AACzD,iEAAiE;AACjE,+DAA+D;AAC/D,oEAAoE;AACpE,4DAA4D;AAC5D,OAAO,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAChH,OAAO,E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AO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,2BAA2B,CAAC,QAAgB;IACnD,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC,QAAQ,CACxE,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAC9B,CAAC;AACJ,CAAC","sourcesContent":["/**\n * `wildo lock check` — verify that the **providers** and **infra**\n * sections of the on-disk\n * `<saasRoot>/.wildo-saas/wildo-saas.lock.json` are in sync with\n * what `wildo config sync` would produce against the current\n * authored config.\n *\n * Slice 2.5c-4 of `infra-provider-planner.md`. Read-only — never\n * writes the lockfile or any sync artifacts. Exit 0 on match; exit\n * non-zero with a sections-diff report on mismatch.\n *\n * Intended use: CI gate. Wire as a step in\n * `.github/workflows/engine-tests.yml` (or a dedicated lockfile\n * workflow) so a PR that forgot to commit a regenerated lockfile\n * fails loud at PR time instead of leaking through to the next dev\n * `wildo config sync`.\n *\n * **Scope of the check** (Slice 4.A.1 / H3 — important): this\n * command can only materialize `sections.providers` (via\n * `materializeSaasProviderRuntimeArtifacts`) and `sections.infra`\n * (via `materializeInfraSection`). Other lockfile sections (today:\n * `i18n`, `modules`, plus any future sections that other subsystems\n * add) are **NOT** verified — the comparison spreads them verbatim\n * from the on-disk lockfile, so they always match themselves. A PR\n * that mutates an i18n source file but forgets to commit a\n * regenerated lockfile will pass `wildo lock check` but be caught\n * by whichever sibling tool owns the i18n section's drift gate.\n *\n * Comparison policy: `sections.providers` and `sections.infra`\n * deep-equal. `generatedAt` and `schemaVersion` are NOT compared —\n * they're metadata, not pinned state. If two runs produce identical\n * `sections.{providers, infra}` content, those sections are \"in\n * sync\" regardless of when the lockfile was generated.\n *\n * Implementation note (Slice 2.5c-4 / 4.A.2 / M1): the\n * materialization compute (discovery + provider section + infra\n * section) is mostly duplicated from `provider-runtime-sync.service.ts`\n * rather than extracted into a shared helper. The duplication is\n * intentional for this slice — `lock check` runs the same primitives\n * via the same exported functions in `@wildo-ai/platform-config-lib`,\n * so behavior parity is structural. Future cleanup: extract a\n * `computeNextLockfileEnvelope` helper into\n * `provider-runtime-sync.service.ts` and have both\n * `syncProviderRuntimeArtifactsForApp` and this command consume it.\n */\n\nimport chalk from 'chalk';\nimport { join } from 'path';\nimport {\n loadWorkerConfigs,\n materializeInfraSection,\n materializeSaasProviderRuntimeArtifacts,\n loadSaasConfig,\n SaasLockfileEnvelopeSchema,\n stableJsonStringify,\n type SaasLockfileEnvelope,\n type SaasLockfileInfraSection,\n type SaasLockfileKnownSections,\n} from '@wildo-ai/platform-config-lib';\nimport { resolveAndRegisterSaasProviderContributions } from '../../services/credentials/composed-provider-catalogue';\n// Slice 6 of `infra-provider-planner.md`: the lock-check\n// materialization MUST use the same `moduleMap` as the writer in\n// `provider-runtime-sync.service.ts`. Without this, the writer\n// produces digests via `module.plan()` while the checker falls back\n// to authored-entry digests — guaranteed drift on every PR.\nimport { buildInfraProviderModuleMap, collectServableInfraProviders } from '@wildo-ai/platform-infra-providers';\nimport { existsSync, readFileSync } from 'fs';\nimport { loadAuthoredInfraEnvSelections } from '~wildo-cli/services/application/provider-runtime-sync.service';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { requireSaasRoot } from '~wildo-cli/services/registry/registry-command.utils';\n\nconst WILDO_SAAS_LOCK_RELATIVE_PATH = join('.wildo-saas', 'wildo-saas.lock.json');\n\nexport default class LockCheckCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'lock check',\n description: 'Verify wildo-saas.lock.json is in sync with authored config (CI gate).',\n category: CommandCategory.Config,\n flags: {},\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const saasRoot = requireSaasRoot(ctx, 'lock-check');\n if (!saasRoot) return { success: false };\n\n ctx.log.info(chalk.cyan(`\\n Lockfile drift check — ${saasRoot}\\n`));\n\n const lockPath = join(saasRoot, WILDO_SAAS_LOCK_RELATIVE_PATH);\n if (!existsSync(lockPath)) {\n ctx.log.error(`Lockfile not found at ${lockPath}. Run \\`wildo config sync\\` to generate it.`);\n return { success: false };\n }\n\n const onDiskRaw = readFileSync(lockPath, 'utf-8');\n let onDisk: SaasLockfileEnvelope;\n try {\n onDisk = SaasLockfileEnvelopeSchema.parse(JSON.parse(onDiskRaw));\n } catch (e) {\n ctx.log.error(\n `Lockfile at ${lockPath} fails schema validation — ` +\n `${ErrorUtils.extractErrorMessage(e)}. Run \\`wildo config sync\\` to regenerate.`,\n );\n return { success: false };\n }\n\n let computed: SaasLockfileEnvelope;\n try {\n // Slice 2.5c-4: compute the would-be next envelope using the\n // SAME `generatedAt` as the on-disk lockfile so the byte-level\n // diff (when we report it) doesn't include a timestamp delta.\n // The actual comparison ignores `generatedAt` regardless; this\n // just keeps the diff payload tidy.\n //\n // Slice 4.A.2 / M1: thread the already-parsed `previousSections`\n // from `run()` into the compute helper so the lockfile is read\n // exactly once. Eliminates a race window where the file could\n // change between the run() read and the compute helper's\n // re-read.\n computed = await computeWouldBeLockfileEnvelope({\n saasRoot,\n generatedAt: onDisk.generatedAt,\n previousSections: onDisk.sections,\n });\n } catch (e) {\n ctx.log.error(\n `Failed to materialize lockfile from authored config — ` +\n `${ErrorUtils.extractErrorMessage(e)}.`,\n );\n return { success: false };\n }\n\n const drift = describeSectionsDrift(onDisk.sections, computed.sections);\n if (!drift) {\n // Slice 4.A.1 / H3: scoped success message — the check only\n // covers providers + infra. i18n / modules / future sections\n // are NOT verified by this command (see command JSDoc).\n ctx.log.info(chalk.green(\n ' ✅ Providers + infra sections are in sync with authored config.\\n'\n + ' (Other lockfile sections are not verified by this command.)\\n',\n ));\n return { success: true };\n }\n\n ctx.log.error(chalk.red(' ❌ Lockfile drift detected.\\n'));\n ctx.log.error(chalk.yellow(drift));\n ctx.log.error(\n chalk.yellow('\\n Run `wildo config sync` and commit the updated lockfile.\\n'),\n );\n return { success: false };\n }\n}\n\n/**\n * Compute the lockfile envelope that `wildo config sync` would\n * write right now, using the same primitives the sync uses but\n * without any disk writes.\n *\n * Slice 4.A.2 / M1 fix: `previousSections` is now passed in from the\n * caller (which already parsed the on-disk lockfile in `run()`)\n * instead of re-read here. Eliminates the redundant read and the\n * race window where the file could change between the two reads.\n *\n * **Exported for the Slice 6 CI gate** (`infra-provider-planner.md`)\n * so a \"live contract\" test can re-materialize the lockfile against\n * `examples/wonder-todos/` and assert no drift, mirroring the\n * `framework-knowledge-audit.live.contract.test.ts` pattern. The\n * function is otherwise an internal helper of the `lock check`\n * command; the export contract is \"stable enough for the test, do\n * not consume from outside the lock-check pair\".\n */\nexport async function computeWouldBeLockfileEnvelope(input: {\n saasRoot: string;\n generatedAt: string;\n /** The on-disk lockfile's `sections`, already parsed by the\n * caller. Spread into the computed envelope so unknown / non-\n * materialized sections (i18n, modules, future) are preserved\n * verbatim — matches the sync writer's behavior. */\n previousSections: SaasLockfileKnownSections;\n}): Promise<SaasLockfileEnvelope> {\n const { saasRoot, generatedAt, previousSections } = input;\n const saasConfig = await loadSaasConfig(join(saasRoot, 'wildo.saas.config.ts'));\n const { contributions: discoveredProviderContributions, augmentations: discoveredProviderAugmentations, systemOfRecordFacetModules: discoveredSystemOfRecordFacetModules, admittedProviderPackages } = await resolveAndRegisterSaasProviderContributions({ saasRoot, saasConfig });\n const workerConfigs = await loadWorkerConfigs(saasRoot, saasConfig);\n const nodeWorkerKeys = workerConfigs\n .filter((entry) => isNodeWorkerRuntimeLanguage(entry.config.runtime.language))\n .map((entry) => entry.key);\n const { lockSection: providersSection } = materializeSaasProviderRuntimeArtifacts(\n saasConfig,\n {\n discoveredContributions: discoveredProviderContributions,\n // Passed exactly as `config sync` passes it: the lock records opted-in augmentations (#1672), so a check\n // that omitted them would report drift on every application that has one.\n discoveredAugmentations: discoveredProviderAugmentations,\n // The walk's facet modules (#1675): the only answer that sees a package shipping facets and no provider.\n discoveredSystemOfRecordFacetModules,\n // Recorded in the lock as `config sync` records them (#1676), or every application with a listing drifts.\n admittedProviderPackages,\n nodeWorkerKeys,\n },\n );\n const infraSection = await computeInfraSection(saasRoot, generatedAt, previousSections.infra);\n\n return SaasLockfileEnvelopeSchema.parse({\n schemaVersion: 2,\n generatedAt,\n sections: {\n ...previousSections,\n providers: providersSection,\n ...(infraSection ? { infra: infraSection } : {}),\n },\n });\n}\n\nasync function computeInfraSection(\n saasRoot: string,\n generatedAt: string,\n previousSection: SaasLockfileInfraSection | undefined,\n): Promise<SaasLockfileInfraSection | undefined> {\n // The same enumeration the `config sync` writer uses, so the two projections judge the same\n // population of environments (#1693).\n const envs = await loadAuthoredInfraEnvSelections(saasRoot);\n if (envs.length === 0) return undefined;\n // Slice 6: pass the canonical module catalog so `planContributionDigest`\n // is computed identically to `provider-runtime-sync.service.ts`'s\n // writer path. Only the catalogue's module-less exemptions fall through\n // to the authored-entry digest; every other module-less provider is\n // refused (#1693).\n const moduleMap = buildInfraProviderModuleMap();\n // #1693: the SAME servable set on both lockfile projections, so `config sync` and `lock check`\n // refuse the same unservable declarations (a declaration no provider module can serve).\n return materializeInfraSection({ envs, generatedAt, moduleMap, previousSection, servableProviders: collectServableInfraProviders() });\n}\n\n/**\n * Deep-compare `sections` ignoring `generatedAt` / `schemaVersion`.\n * Returns `null` on match, or a multi-line human-readable diff\n * otherwise. Diff format prioritizes section/key paths over raw JSON\n * dumps.\n *\n * Exported for testing (Slice 4.A.3 / T4) — the command's drift\n * detection is the load-bearing contract; pin its output format so a\n * future formatting refactor doesn't silently break CI gate\n * messaging.\n */\nexport function describeSectionsDrift(\n onDisk: SaasLockfileKnownSections,\n computed: SaasLockfileKnownSections,\n): string | null {\n const onDiskJson = stableJsonStringify(onDisk);\n const computedJson = stableJsonStringify(computed);\n if (onDiskJson === computedJson) return null;\n\n const lines: string[] = [];\n const allSectionKeys = new Set([...Object.keys(onDisk), ...Object.keys(computed)]);\n for (const sectionKey of Array.from(allSectionKeys).sort()) {\n const a = stableJsonStringify((onDisk as Record<string, unknown>)[sectionKey]);\n const b = stableJsonStringify((computed as Record<string, unknown>)[sectionKey]);\n if (a === b) continue;\n if (a === undefined) {\n lines.push(` + sections.${sectionKey} (added by sync — not in lockfile yet)`);\n } else if (b === undefined) {\n lines.push(` - sections.${sectionKey} (removed by sync — still in lockfile)`);\n } else {\n lines.push(` ~ sections.${sectionKey} (drift)`);\n lines.push(` on-disk: ${a.slice(0, 200)}${a.length > 200 ? '…' : ''}`);\n lines.push(` computed: ${b.slice(0, 200)}${b.length > 200 ? '…' : ''}`);\n }\n }\n return lines.join('\\n');\n}\n\nfunction isNodeWorkerRuntimeLanguage(language: string): boolean {\n return ['javascript', 'js', 'node', 'nodejs', 'ts', 'typescript'].includes(\n language.trim().toLowerCase(),\n );\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"generate.command.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/market/generate.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA2B1F,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,WAAW;IAC5D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAqDxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAsFtD;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,oBAAoB;CAc7B;AAED,yDAAyD"}
1
+ {"version":3,"file":"generate.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/market/generate.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAIH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AA2B1F,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,WAAW;IAC5D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAqDxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAsFtD;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,oBAAoB;CAc7B;AAED,yDAAyD"}
@@ -1 +1 @@
1
- {"version":3,"file":"generate.command.js","sourceRoot":"","sources":["../../../../../../src/commands/market/generate.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAElG,OAAO,EACL,aAAa,EACb,kCAAkC,EAClC,kBAAkB,EAClB,iBAAiB,GAElB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;GAMG;AACH,MAAM,qBAAqB,GAA2B;IACpD,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,WAAW;IACnD,IAAI,GAAgB;QAC3B,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,gEAAgE;QAC7E,QAAQ,EAAE,eAAe,CAAC,M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":["/**\n * @wildo_source:part:start cli.market.generate-command\n *\n * `wildo market generate` — Market generation CLI surface (Phase 4.2).\n *\n * Renders one `MarketMessageTemplate` against the application's\n * authored `MarketSnapshot` and invokes the\n * `market.generation.agent` LLM agent to produce final\n * marketing copy. The CLI is a thin client over POST\n * `/api/companion/market/generate`; the dev-companion does the work.\n *\n * Flags:\n * - `--template` (required) — `MarketMessageTemplate.ref`\n * - `--icp`, `--feature`, `--benefit`, `--channel`, `--objection` —\n * ref of the corresponding entity. Each is optional at the CLI\n * layer, but the *template's* `requiredInputs` decides which ones\n * become mandatory: an under-specified call surfaces a precise\n * \"missing required input\" error from the subprocess instead of a\n * confusing LLM hallucination. Refs that the template does not\n * declare are silently ignored — the CLI surfaces a soft warning\n * so the operator can simplify the command line.\n * - `--language` — overrides `output_language` substitution\n * (default: English).\n * - `--explain` — prints the rendered prompt + trace alongside the\n * LLM output. Useful for debugging templates and context-block\n * ranking.\n * - `--timeout` — override the default 90 s companion-client\n * timeout (in seconds). Useful for long objection-response emails\n * on slow GPT-4O windows.\n */\n\nimport chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ensureSaasAppScope } from '~wildo-cli/kernel/command-scope-utils';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { companionFailureExitCode } from '~wildo-cli/services/companion/companion-client.service';\n\nimport {\n companionPost,\n MARKET_SAAS_SCOPE_REQUIRED_MESSAGE,\n optionalStringFlag,\n requireStringFlag,\n type MarketGenerateCliResult,\n} from './market-command.utils';\n\n/**\n * CLI flag → `MarketMessageRequiredInput`-equivalent kind name pairs.\n *\n * Used for the soft \"you passed --benefit but the template didn't\n * declare BENEFIT_REF, so it was ignored\" warning. Kept in sync with\n * the renderer's switch in `renderMarketPrompt(...)` (subprocess).\n */\nconst FLAG_TO_CONSUMED_KIND: Record<string, string> = {\n icp: 'icp',\n benefit: 'benefit',\n channel: 'channel',\n objection: 'objection',\n};\n\nexport default class MarketGenerateCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'market generate',\n description: 'Render a market message template + invoke the generation agent',\n category: CommandCategory.Market,\n flags: {\n template: {\n type: 'string',\n description: 'MarketMessageTemplate ref to render',\n required: true,\n },\n icp: {\n type: 'string',\n description: 'MarketICP ref (required when the template declares ICP_REF)',\n },\n feature: {\n type: 'string',\n description: 'AppFeature ref to anchor the context block (used for intent picking, not substitution)',\n },\n benefit: {\n type: 'string',\n description: 'FeatureBenefit ref (required when the template declares BENEFIT_REF)',\n },\n channel: {\n type: 'string',\n description: 'MarketChannel ref (required when the template declares CHANNEL_REF)',\n },\n objection: {\n type: 'string',\n description: 'MarketObjection ref (required when the template declares OBJECTION_REF)',\n },\n language: {\n type: 'string',\n description: 'Output language label substituted into {{output_language}} (default: English)',\n },\n explain: {\n type: 'boolean',\n description: 'Print the rendered prompt + trace alongside the LLM output',\n default: false,\n },\n timeout: {\n type: 'number',\n description: 'Override the default 90s companion-client timeout (in seconds)',\n },\n /*\n * The machine form (#1656). Without it the only way to consume the result programmatically was to\n * call the companion route yourself — which the shipped skill told agents to do, token and all.\n */\n json: {\n type: 'boolean',\n description: 'Print the typed MarketGenerationResponse as JSON instead of the operator summary',\n default: false,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n if (!ensureSaasAppScope(ctx, MARKET_SAAS_SCOPE_REQUIRED_MESSAGE)) {\n return { success: false };\n }\n\n const templateRef = requireStringFlag(ctx, 'template', 'MarketMessageTemplate ref');\n if (!templateRef) {\n return { success: false };\n }\n\n const json = ctx.flags.json === true;\n try {\n if (!json) ctx.log.info(chalk.cyan('\\n Generating market copy via dev companion...\\n'));\n\n const result = await companionPost<MarketGenerateCliResult>(\n ctx,\n '/api/companion/market/generate',\n {\n templateRef,\n icpRef: optionalStringFlag(ctx, 'icp'),\n featureRef: optionalStringFlag(ctx, 'feature'),\n benefitRef: optionalStringFlag(ctx, 'benefit'),\n channelRef: optionalStringFlag(ctx, 'channel'),\n objectionRef: optionalStringFlag(ctx, 'objection'),\n outputLanguage: optionalStringFlag(ctx, 'language'),\n },\n );\n\n if (json) {\n ctx.log.info(JSON.stringify(result));\n return { success: true };\n }\n\n this.warnAboutIgnoredRefs(ctx, result);\n\n ctx.log.success(' Market generation output ready.');\n ctx.log.info(chalk.dim(` Template: ${result.trace.template.ref} (${result.trace.template.name})`));\n ctx.log.info(chalk.dim(` Output kind: ${result.trace.template.outputKind}`));\n ctx.log.info(chalk.dim(` Language: ${result.trace.outputLanguage}`));\n ctx.log.info(chalk.dim(` Voice used: ${result.trace.contextVoiceUsed ?? '(none)'}`));\n ctx.log.info(chalk.dim(` Agent: ${result.trace.agentRef}`));\n\n if (result.trace.consumedInputs.length > 0) {\n ctx.log.info(chalk.dim(' Inputs consumed:'));\n for (const input of result.trace.consumedInputs) {\n ctx.log.info(chalk.dim(` - ${input.kind}: ${input.ref}`));\n }\n }\n\n if (result.trace.contextIcpsConsidered.length > 0) {\n ctx.log.info(chalk.dim(` ICPs in context: ${result.trace.contextIcpsConsidered.join(', ')}`));\n }\n if (result.trace.contextBenefitsConsidered.length > 0) {\n ctx.log.info(chalk.dim(` Benefits in context: ${result.trace.contextBenefitsConsidered.join(', ')}`));\n }\n\n const explain = Boolean(ctx.flags.explain);\n if (explain) {\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Market-context block'));\n for (const line of result.contextBlock.split('\\n')) {\n ctx.log.info(` ${line}`);\n }\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Rendered template body'));\n for (const line of result.renderedTemplate.split('\\n')) {\n ctx.log.info(` ${line}`);\n }\n }\n\n ctx.log.info('');\n ctx.log.info(chalk.bold(' LLM output'));\n for (const line of result.output.split('\\n')) {\n ctx.log.info(` ${line}`);\n }\n ctx.log.info('');\n\n return { success: true };\n } catch (error) {\n ctx.log.error(\n `Market generation failed: ${ErrorUtils.extractErrorMessage(error)}`,\n );\n return { success: false, exitCode: companionFailureExitCode(error) };\n }\n }\n\n /**\n * Surface a soft warning when the operator passed an entity ref\n * that the chosen template did not consume.\n *\n * The renderer (subprocess) is the source of truth for \"what the\n * template actually used\" — `result.trace.consumedInputs` lists\n * every ref the renderer consumed for substitution. If the\n * operator passed `--benefit X` but the template's\n * `requiredInputs` did not declare `BENEFIT_REF`, the ref is\n * silently ignored. Surfacing a warning lets the operator\n * simplify their command line without us hard-failing (templates\n * may legitimately accept optional contextual hints later).\n *\n * `--feature` is intentionally excluded: it currently anchors\n * the context-block intent picker, not template substitution, so\n * it never appears in `consumedInputs` even when used.\n */\n private warnAboutIgnoredRefs(ctx: CommandContext, result: MarketGenerateCliResult): void {\n const consumedKinds = new Set(result.trace.consumedInputs.map((entry) => entry.kind));\n const ignored: string[] = [];\n for (const [flag, kind] of Object.entries(FLAG_TO_CONSUMED_KIND)) {\n if (optionalStringFlag(ctx, flag) && !consumedKinds.has(kind)) {\n ignored.push(`--${flag}`);\n }\n }\n if (ignored.length > 0) {\n ctx.log.warn(\n `Template \"${result.trace.template.ref}\" did not consume: ${ignored.join(', ')} — these flags were ignored.`,\n );\n }\n }\n}\n\n/** @wildo_source:part:end cli.market.generate-command */\n"]}
1
+ {"version":3,"file":"generate.command.js","sourceRoot":"","sources":["../../../../src/commands/market/generate.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,wDAAwD,CAAC;AAElG,OAAO,EACL,a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AAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC9D,OAAO,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;QACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACvB,GAAG,CAAC,GAAG,CAAC,IAAI,CACV,aAAa,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,sBAAsB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,8BAA8B,CAC7G,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AAED,yDAAyD","sourcesContent":["/**\n * @wildo_source:part:start cli.market.generate-command\n *\n * `wildo market generate` — Market generation CLI surface (Phase 4.2).\n *\n * Renders one `MarketMessageTemplate` against the application's\n * authored `MarketSnapshot` and invokes the\n * `market.generation.agent` LLM agent to produce final\n * marketing copy. The CLI is a thin client over POST\n * `/api/companion/market/generate`; the dev-companion does the work.\n *\n * Flags:\n * - `--template` (required) — `MarketMessageTemplate.ref`\n * - `--icp`, `--feature`, `--benefit`, `--channel`, `--objection` —\n * ref of the corresponding entity. Each is optional at the CLI\n * layer, but the *template's* `requiredInputs` decides which ones\n * become mandatory: an under-specified call surfaces a precise\n * \"missing required input\" error from the subprocess instead of a\n * confusing LLM hallucination. Refs that the template does not\n * declare are silently ignored — the CLI surfaces a soft warning\n * so the operator can simplify the command line.\n * - `--language` — overrides `output_language` substitution\n * (default: English).\n * - `--explain` — prints the rendered prompt + trace alongside the\n * LLM output. Useful for debugging templates and context-block\n * ranking.\n * - `--timeout` — override the default 90 s companion-client\n * timeout (in seconds). Useful for long objection-response emails\n * on slow GPT-4O windows.\n */\n\nimport chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandMeta, CommandContext, CommandResult } from '~wildo-cli/kernel/types';\nimport { ensureSaasAppScope } from '~wildo-cli/kernel/command-scope-utils';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { companionFailureExitCode } from '~wildo-cli/services/companion/companion-client.service';\n\nimport {\n companionPost,\n MARKET_SAAS_SCOPE_REQUIRED_MESSAGE,\n optionalStringFlag,\n requireStringFlag,\n type MarketGenerateCliResult,\n} from './market-command.utils';\n\n/**\n * CLI flag → `MarketMessageRequiredInput`-equivalent kind name pairs.\n *\n * Used for the soft \"you passed --benefit but the template didn't\n * declare BENEFIT_REF, so it was ignored\" warning. Kept in sync with\n * the renderer's switch in `renderMarketPrompt(...)` (subprocess).\n */\nconst FLAG_TO_CONSUMED_KIND: Record<string, string> = {\n icp: 'icp',\n benefit: 'benefit',\n channel: 'channel',\n objection: 'objection',\n};\n\nexport default class MarketGenerateCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'market generate',\n description: 'Render a market message template + invoke the generation agent',\n category: CommandCategory.Market,\n flags: {\n template: {\n type: 'string',\n description: 'MarketMessageTemplate ref to render',\n required: true,\n },\n icp: {\n type: 'string',\n description: 'MarketICP ref (required when the template declares ICP_REF)',\n },\n feature: {\n type: 'string',\n description: 'AppFeature ref to anchor the context block (used for intent picking, not substitution)',\n },\n benefit: {\n type: 'string',\n description: 'FeatureBenefit ref (required when the template declares BENEFIT_REF)',\n },\n channel: {\n type: 'string',\n description: 'MarketChannel ref (required when the template declares CHANNEL_REF)',\n },\n objection: {\n type: 'string',\n description: 'MarketObjection ref (required when the template declares OBJECTION_REF)',\n },\n language: {\n type: 'string',\n description: 'Output language label substituted into {{output_language}} (default: English)',\n },\n explain: {\n type: 'boolean',\n description: 'Print the rendered prompt + trace alongside the LLM output',\n default: false,\n },\n timeout: {\n type: 'number',\n description: 'Override the default 90s companion-client timeout (in seconds)',\n },\n /*\n * The machine form (#1656). Without it the only way to consume the result programmatically was to\n * call the companion route yourself — which the shipped skill told agents to do, token and all.\n */\n json: {\n type: 'boolean',\n description: 'Print the typed MarketGenerationResponse as JSON instead of the operator summary',\n default: false,\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n if (!ensureSaasAppScope(ctx, MARKET_SAAS_SCOPE_REQUIRED_MESSAGE)) {\n return { success: false };\n }\n\n const templateRef = requireStringFlag(ctx, 'template', 'MarketMessageTemplate ref');\n if (!templateRef) {\n return { success: false };\n }\n\n const json = ctx.flags.json === true;\n try {\n if (!json) ctx.log.info(chalk.cyan('\\n Generating market copy via dev companion...\\n'));\n\n const result = await companionPost<MarketGenerateCliResult>(\n ctx,\n '/api/companion/market/generate',\n {\n templateRef,\n icpRef: optionalStringFlag(ctx, 'icp'),\n featureRef: optionalStringFlag(ctx, 'feature'),\n benefitRef: optionalStringFlag(ctx, 'benefit'),\n channelRef: optionalStringFlag(ctx, 'channel'),\n objectionRef: optionalStringFlag(ctx, 'objection'),\n outputLanguage: optionalStringFlag(ctx, 'language'),\n },\n );\n\n if (json) {\n ctx.log.info(JSON.stringify(result));\n return { success: true };\n }\n\n this.warnAboutIgnoredRefs(ctx, result);\n\n ctx.log.success(' Market generation output ready.');\n ctx.log.info(chalk.dim(` Template: ${result.trace.template.ref} (${result.trace.template.name})`));\n ctx.log.info(chalk.dim(` Output kind: ${result.trace.template.outputKind}`));\n ctx.log.info(chalk.dim(` Language: ${result.trace.outputLanguage}`));\n ctx.log.info(chalk.dim(` Voice used: ${result.trace.contextVoiceUsed ?? '(none)'}`));\n ctx.log.info(chalk.dim(` Agent: ${result.trace.agentRef}`));\n\n if (result.trace.consumedInputs.length > 0) {\n ctx.log.info(chalk.dim(' Inputs consumed:'));\n for (const input of result.trace.consumedInputs) {\n ctx.log.info(chalk.dim(` - ${input.kind}: ${input.ref}`));\n }\n }\n\n if (result.trace.contextIcpsConsidered.length > 0) {\n ctx.log.info(chalk.dim(` ICPs in context: ${result.trace.contextIcpsConsidered.join(', ')}`));\n }\n if (result.trace.contextBenefitsConsidered.length > 0) {\n ctx.log.info(chalk.dim(` Benefits in context: ${result.trace.contextBenefitsConsidered.join(', ')}`));\n }\n\n const explain = Boolean(ctx.flags.explain);\n if (explain) {\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Market-context block'));\n for (const line of result.contextBlock.split('\\n')) {\n ctx.log.info(` ${line}`);\n }\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Rendered template body'));\n for (const line of result.renderedTemplate.split('\\n')) {\n ctx.log.info(` ${line}`);\n }\n }\n\n ctx.log.info('');\n ctx.log.info(chalk.bold(' LLM output'));\n for (const line of result.output.split('\\n')) {\n ctx.log.info(` ${line}`);\n }\n ctx.log.info('');\n\n return { success: true };\n } catch (error) {\n ctx.log.error(\n `Market generation failed: ${ErrorUtils.extractErrorMessage(error)}`,\n );\n return { success: false, exitCode: companionFailureExitCode(error) };\n }\n }\n\n /**\n * Surface a soft warning when the operator passed an entity ref\n * that the chosen template did not consume.\n *\n * The renderer (subprocess) is the source of truth for \"what the\n * template actually used\" — `result.trace.consumedInputs` lists\n * every ref the renderer consumed for substitution. If the\n * operator passed `--benefit X` but the template's\n * `requiredInputs` did not declare `BENEFIT_REF`, the ref is\n * silently ignored. Surfacing a warning lets the operator\n * simplify their command line without us hard-failing (templates\n * may legitimately accept optional contextual hints later).\n *\n * `--feature` is intentionally excluded: it currently anchors\n * the context-block intent picker, not template substitution, so\n * it never appears in `consumedInputs` even when used.\n */\n private warnAboutIgnoredRefs(ctx: CommandContext, result: MarketGenerateCliResult): void {\n const consumedKinds = new Set(result.trace.consumedInputs.map((entry) => entry.kind));\n const ignored: string[] = [];\n for (const [flag, kind] of Object.entries(FLAG_TO_CONSUMED_KIND)) {\n if (optionalStringFlag(ctx, flag) && !consumedKinds.has(kind)) {\n ignored.push(`--${flag}`);\n }\n }\n if (ignored.length > 0) {\n ctx.log.warn(\n `Template \"${result.trace.template.ref}\" did not consume: ${ignored.join(', ')} — these flags were ignored.`,\n );\n }\n }\n}\n\n/** @wildo_source:part:end cli.market.generate-command */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"market-command.utils.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/market/market-command.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAK9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;;;;;;GASG;AACH,eAAO,MAAM,mCAAmC,QAAS,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,uBAAuB,GAAG,wBAAwB,CAAC;AAE/D;;;;;;;;;GASG;AACH,eAAO,MAAM,kCAAkC,6GAC6D,CAAC;AAE7G,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CAOf;AAED,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,GACf,MAAM,GAAG,SAAS,CAMpB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM,CAU5D;AAsBD,wBAAsB,aAAa,CAAC,CAAC,EACnC,GAAG,EAAE,cAAc,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAC/B,OAAO,CAAC,CAAC,CAAC,CAGZ;AAED,8CAA8C"}
1
+ {"version":3,"file":"market-command.utils.d.ts","sourceRo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_source:part:start cli.market.utils\n *\n * Market generation CLI shared utilities (Phase 4.2).\n *\n * Mirrors the shape of `commands/generate/email-command.utils.ts` —\n * each command surface gets its own small utils file so we don't\n * cross-couple the `generate` and `market` categories. The two\n * helpers we genuinely share (companion HTTP client + service-address\n * resolution) live in `~wildo-cli/services/companion/...` and are\n * imported here directly.\n */\n\nimport type { MarketGenerationResponse } from '@wildo-ai/saas-specifications';\n\nimport { CompanionClient } from '~wildo-cli/services/companion/companion-client.service';\nimport { loadAppLocalRuntimeServiceAddresses } from '~wildo-cli/services/application/app-local-runtime-addresses.service';\nimport type { CompanionClientOptions } from '~wildo-cli/services/companion/companion.schemas';\nimport type { CommandContext } from '~wildo-cli/kernel/types';\n\n/**\n * Default companion-client timeout for `wildo market generate`.\n *\n * 90 s matches `EMAIL_COMPANION_TIMEOUT_MS` plus headroom for the\n * two-step (introspection subprocess + LLM call) market generation\n * flow. The LLM call is the dominant cost; the renderer itself\n * completes in single-digit ms. Operators can override via\n * `--timeout <seconds>` on the CLI for long objection-response\n * emails or batch generations.\n */\nexport const MARKET_COMPANION_DEFAULT_TIMEOUT_MS = 90_000;\n\nexport interface MarketGenerateCliRequest {\n templateRef: string;\n icpRef?: string;\n featureRef?: string;\n benefitRef?: string;\n channelRef?: string;\n objectionRef?: string;\n outputLanguage?: string;\n}\n\n/**\n * CLI-side alias for `MarketGenerationResponse` (canonical shape\n * authored once in `@wildo-ai/saas-specifications`,\n * `market-generation.schemas.ts`). F-2 + F-6 from the Phase-4.2 audit\n * consolidated three formerly hand-authored definitions (CLI\n * interface, service interface, inline service Zod) into this one\n * shared schema.\n */\nexport type MarketGenerateCliResult = MarketGenerationResponse;\n\n/**\n * Operator-facing message for the saas-app scope gate on `market`\n * commands. More specific than the shared kernel default — it names\n * `wildo.saas.config.ts` so the operator knows exactly what marks a\n * SaaS application root. Passed to the shared `ensureSaasAppScope`\n * kernel helper (`~wildo-cli/kernel/command-scope-utils`) at the\n * command call site; kept here so the market surface owns its own\n * wording and the `market` command tree need not import the message\n * from another command category.\n */\nexport const MARKET_SAAS_SCOPE_REQUIRED_MESSAGE =\n 'Market commands require a SaaS application. Run from within a directory containing wildo.saas.config.ts.';\n\nexport function requireStringFlag(\n ctx: CommandContext,\n flagName: string,\n label: string,\n): string | null {\n const value = ctx.flags[flagName];\n if (typeof value === 'string' && value.trim().length > 0) {\n return value.trim();\n }\n ctx.log.error(`Missing required flag --${flagName} (${label}).`);\n return null;\n}\n\nexport function optionalStringFlag(\n ctx: CommandContext,\n flagName: string,\n): string | undefined {\n const value = ctx.flags[flagName];\n if (typeof value === 'string' && value.trim().length > 0) {\n return value.trim();\n }\n return undefined;\n}\n\n/**\n * Resolve a per-call `--timeout` flag (in seconds) into milliseconds.\n *\n * Returns `MARKET_COMPANION_DEFAULT_TIMEOUT_MS` when the flag is\n * absent, missing, or invalid. Negative or zero values fall back to\n * the default (the CLI never lets the operator disable the timeout\n * outright — that surface belongs to the companion service).\n */\nexport function resolveTimeoutMs(ctx: CommandContext): number {\n const raw = ctx.flags.timeout;\n if (raw === undefined || raw === null || raw === '') {\n return MARKET_COMPANION_DEFAULT_TIMEOUT_MS;\n }\n const seconds = typeof raw === 'number' ? raw : Number(raw);\n if (!Number.isFinite(seconds) || seconds <= 0) {\n return MARKET_COMPANION_DEFAULT_TIMEOUT_MS;\n }\n return Math.floor(seconds * 1000);\n}\n\nasync function resolveCompanionClientOptions(\n ctx: CommandContext,\n timeoutMs: number,\n): Promise<CompanionClientOptions> {\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n if (!saasRoot) {\n return { timeoutMs };\n }\n\n const serviceAddresses = await loadAppLocalRuntimeServiceAddresses(saasRoot);\n const devCompanion = serviceAddresses?.devCompanion;\n\n return {\n appRoot: saasRoot,\n baseUrl: devCompanion?.url,\n port: devCompanion?.port,\n timeoutMs,\n };\n}\n\nexport async function companionPost<T>(\n ctx: CommandContext,\n pathname: string,\n body?: unknown,\n options?: { timeoutMs?: number },\n): Promise<T> {\n const timeoutMs = options?.timeoutMs ?? resolveTimeoutMs(ctx);\n return CompanionClient.post<T>(pathname, body, await resolveCompanionClientOptions(ctx, timeoutMs));\n}\n\n/** @wildo_source:part:end cli.market.utils */\n"]}
1
+ {"version":3,"file":"market-command.utils.js","sourceRoot":"","sources":["../../../../src/commands/market/market-command.utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,EAAE,eAAe,EAAE,MAAM,wDAAwD,CAAC;AACzF,OAAO,EAAE,mCAAmC,EAAE,MAAM,qEAAqE,CAAC;AAI1H;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mCAAmC,GAAG,MAAM,CAAC;AAsB1D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAC7C,0GAA0G,CAAC;AAE7G,MAAM,UAAU,iBAAiB,CAC/B,GAAmB,EACnB,QAAgB,EAChB,KAAa;IAEb,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;IACD,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,2BAA2B,QAAQ,KAAK,KAAK,IAAI,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,kBAAkB,CAChC,GAAmB,EACnB,QAAgB;IAEhB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACzD,OAAO,KAAK,CAAC,IAAI,EAAE,CAAC;IACtB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;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,OAAO,eAAe,CAAC,IAAI,CAAI,QAAQ,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC,CAAC;AACtG,CAAC;AAED,8CAA8C","sourcesContent":["/**\n * @wildo_source:part:start cli.market.utils\n *\n * Market generation CLI shared utilities (Phase 4.2).\n *\n * Mirrors the shape of `commands/generate/email-command.utils.ts` —\n * each command surface gets its own small utils file so we don't\n * cross-couple the `generate` and `market` categories. The two\n * helpers we genuinely share (companion HTTP client + service-address\n * resolution) live in `~wildo-cli/services/companion/...` and are\n * imported here directly.\n */\n\nimport type { MarketGenerationResponse } from '@wildo-ai/saas-specifications';\n\nimport { CompanionClient } from '~wildo-cli/services/companion/companion-client.service';\nimport { loadAppLocalRuntimeServiceAddresses } from '~wildo-cli/services/application/app-local-runtime-addresses.service';\nimport type { CompanionClientOptions } from '~wildo-cli/services/companion/companion.schemas';\nimport type { CommandContext } from '~wildo-cli/kernel/types';\n\n/**\n * Default companion-client timeout for `wildo market generate`.\n *\n * 90 s matches `EMAIL_COMPANION_TIMEOUT_MS` plus headroom for the\n * two-step (introspection subprocess + LLM call) market generation\n * flow. The LLM call is the dominant cost; the renderer itself\n * completes in single-digit ms. Operators can override via\n * `--timeout <seconds>` on the CLI for long objection-response\n * emails or batch generations.\n */\nexport const MARKET_COMPANION_DEFAULT_TIMEOUT_MS = 90_000;\n\nexport interface MarketGenerateCliRequest {\n templateRef: string;\n icpRef?: string;\n featureRef?: string;\n benefitRef?: string;\n channelRef?: string;\n objectionRef?: string;\n outputLanguage?: string;\n}\n\n/**\n * CLI-side alias for `MarketGenerationResponse` (canonical shape\n * authored once in `@wildo-ai/saas-specifications`,\n * `market-generation.schemas.ts`). F-2 + F-6 from the Phase-4.2 audit\n * consolidated three formerly hand-authored definitions (CLI\n * interface, service interface, inline service Zod) into this one\n * shared schema.\n */\nexport type MarketGenerateCliResult = MarketGenerationResponse;\n\n/**\n * Operator-facing message for the saas-app scope gate on `market`\n * commands. More specific than the shared kernel default — it names\n * `wildo.saas.config.ts` so the operator knows exactly what marks a\n * SaaS application root. Passed to the shared `ensureSaasAppScope`\n * kernel helper (`~wildo-cli/kernel/command-scope-utils`) at the\n * command call site; kept here so the market surface owns its own\n * wording and the `market` command tree need not import the message\n * from another command category.\n */\nexport const MARKET_SAAS_SCOPE_REQUIRED_MESSAGE =\n 'Market commands require a SaaS application. Run from within a directory containing wildo.saas.config.ts.';\n\nexport function requireStringFlag(\n ctx: CommandContext,\n flagName: string,\n label: string,\n): string | null {\n const value = ctx.flags[flagName];\n if (typeof value === 'string' && value.trim().length > 0) {\n return value.trim();\n }\n ctx.log.error(`Missing required flag --${flagName} (${label}).`);\n return null;\n}\n\nexport function optionalStringFlag(\n ctx: CommandContext,\n flagName: string,\n): string | undefined {\n const value = ctx.flags[flagName];\n if (typeof value === 'string' && value.trim().length > 0) {\n return value.trim();\n }\n return undefined;\n}\n\n/**\n * Resolve a per-call `--timeout` flag (in seconds) into milliseconds.\n *\n * Returns `MARKET_COMPANION_DEFAULT_TIMEOUT_MS` when the flag is\n * absent, missing, or invalid. Negative or zero values fall back to\n * the default (the CLI never lets the operator disable the timeout\n * outright — that surface belongs to the companion service).\n */\nexport function resolveTimeoutMs(ctx: CommandContext): number {\n const raw = ctx.flags.timeout;\n if (raw === undefined || raw === null || raw === '') {\n return MARKET_COMPANION_DEFAULT_TIMEOUT_MS;\n }\n const seconds = typeof raw === 'number' ? raw : Number(raw);\n if (!Number.isFinite(seconds) || seconds <= 0) {\n return MARKET_COMPANION_DEFAULT_TIMEOUT_MS;\n }\n return Math.floor(seconds * 1000);\n}\n\nasync function resolveCompanionClientOptions(\n ctx: CommandContext,\n timeoutMs: number,\n): Promise<CompanionClientOptions> {\n const saasRoot = ctx.cliContext.resolvedHomes.app.declarationRoot;\n if (!saasRoot) {\n return { timeoutMs };\n }\n\n const serviceAddresses = await loadAppLocalRuntimeServiceAddresses(saasRoot);\n const devCompanion = serviceAddresses?.devCompanion;\n\n return {\n appRoot: saasRoot,\n baseUrl: devCompanion?.url,\n port: devCompanion?.port,\n timeoutMs,\n };\n}\n\nexport async function companionPost<T>(\n ctx: CommandContext,\n pathname: string,\n body?: unknown,\n options?: { timeoutMs?: number },\n): Promise<T> {\n const timeoutMs = options?.timeoutMs ?? resolveTimeoutMs(ctx);\n return CompanionClient.post<T>(pathname, body, await resolveCompanionClientOptions(ctx, timeoutMs));\n}\n\n/** @wildo_source:part:end cli.market.utils */\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"set.command.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/prefs/set.command.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAkC1F,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAiCxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAiDtD;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM;CA+Bf"}
1
+ {"version":3,"file":"set.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/prefs/set.command.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAkC1F,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,WAAW;IACtD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAiCxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;IAiDtD;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM;CA+Bf"}
@@ -1 +1 @@
1
- {"version":3,"file":"set.command.js","sourceR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CAAC;IAC3B,CAAC;CACF","sourcesContent":["/**\n * `wildo prefs set` — state once, on this machine, what every later command would otherwise ask.\n *\n * ## The problem this removes\n *\n * `wildo init` asked six questions whose answers never varied between two applications created on\n * the same machine an hour apart — the operator's own name and email, the store, the runtime, how to\n * treat the machine's shared platform credentials. So the command a creator actually ran was seven\n * lines long, and because it had to be re-runnable it had to be kept somewhere: a preferences file\n * with no reader, maintained by hand, in a shell history.\n *\n * What belongs here is exactly what `WildoMachineDefaults` documents: identity, posture, and a house\n * default. A per-application decision with real consequences — a port block, a name — deliberately\n * does not, because a stored answer would silently apply it to an application whose author never\n * considered it.\n *\n * ## Never a secret\n *\n * `preferences.json` is ordinary-permission machine configuration holding ANSWERS. Credential\n * MATERIAL lives in `local-defaults.json` beside it, which is written `0600` and holds values. So\n * this command takes the administrator's identity and refuses to take their password: an omitted\n * password is minted by the framework-managed materials, which is a better answer than storing one.\n */\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\n\nimport { DatabaseEngine, resolveMachinePreferencesPath, WildoDeploymentRuntime } from '@wildo-ai/platform-config-lib';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandContext, CommandMeta, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { ContextManager } from '~wildo-cli/services/context/context-manager.service';\nimport type { WildoMachineDefaults } from '~wildo-cli/services/context/context.schemas';\nimport { LocalDefaultsMode } from '~wildo-cli/services/credentials/local-defaults.service';\nimport { writeMachineDefaults } from '~wildo-cli/services/context/machine-preferences.writer';\nimport { listCodingAgents } from '~wildo-cli/services/coding-agents/coding-agent-login.service';\n\n/**\n * One settable member: the flag that carries it, the preferences key it writes, and — for a closed\n * vocabulary — the values it accepts.\n *\n * Declared as ONE table rather than as parallel flag/parse/write blocks, so a member added here\n * cannot reach the file without also being validated and reported. The vocabularies are read from\n * their named enums rather than restated, which is what keeps this table from drifting from the\n * contract it writes.\n */\nconst SETTABLE_MEMBERS = [\n { flag: 'admin-email', camel: 'adminEmail', key: 'adminEmail', vocabulary: null },\n { flag: 'admin-first-name', camel: 'adminFirstName', key: 'adminFirstName', vocabulary: null },\n { flag: 'admin-last-name', camel: 'adminLastName', key: 'adminLastName', vocabulary: null },\n { flag: 'database', camel: 'database', key: 'database', vocabulary: Object.values(DatabaseEngine) },\n { flag: 'runtime', camel: 'runtime', key: 'runtime', vocabulary: Object.values(WildoDeploymentRuntime) },\n { flag: 'local-defaults', camel: 'localDefaults', key: 'localDefaults', vocabulary: Object.values(LocalDefaultsMode) },\n { flag: 'provider-key-defaults', camel: 'providerKeyDefaults', key: 'providerKeyDefaults', vocabulary: Object.values(LocalDefaultsMode) },\n // Derived from the provider registry, so an agent the engine adds is settable without this line changing.\n { flag: 'coding-agent', camel: 'codingAgent', key: 'codingAgent', vocabulary: listCodingAgents().map((agent) => agent.providerRef) },\n] as const satisfies readonly {\n flag: string;\n camel: string;\n key: string;\n vocabulary: readonly string[] | null;\n}[];\n\nexport default class PrefsSetCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'prefs set',\n description: 'Record on this machine the answers wildo init would otherwise ask for',\n category: CommandCategory.Core,\n flags: {\n 'admin-email': { type: 'string', description: 'Platform-administrator email for newly created applications' },\n 'admin-first-name': { type: 'string', description: 'Platform-administrator first name' },\n 'admin-last-name': { type: 'string', description: 'Platform-administrator last name' },\n database: {\n type: 'string',\n description: `Default application store (${Object.values(DatabaseEngine).join(' | ')})`,\n },\n runtime: {\n type: 'string',\n description: `Default infrastructure runtime (${Object.values(WildoDeploymentRuntime).join(' | ')})`,\n },\n 'local-defaults': {\n type: 'string',\n description: `Default treatment of the shared platform credentials in ~/.wildo/local-defaults.json (${Object.values(LocalDefaultsMode).join(' | ')})`,\n },\n 'provider-key-defaults': {\n type: 'string',\n description: `Default treatment of the provider keys in ~/.wildo/local-defaults.json (${Object.values(LocalDefaultsMode).join(' | ')})`,\n },\n 'coding-agent': {\n type: 'string',\n description: 'The coding agent this machine builds applications with (a provider declaring an ACP agent, e.g. anthropic, openai, opencode)',\n },\n unset: {\n type: 'string',\n description: 'Remove one stored member by its preferences key (e.g. --unset database)',\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const path = resolveMachinePreferencesPath();\n\n const requested: { key: string; value: string }[] = [];\n for (const member of SETTABLE_MEMBERS) {\n const raw = (ctx.flags[member.camel] ?? ctx.flags[member.flag]) as string | undefined;\n if (typeof raw !== 'string') continue;\n const value = raw.trim();\n // A stray `--database=` must not install an empty answer that later reads as \"stated\".\n if (value === '') {\n ctx.log.error(`--${member.flag} was given no value. Use --unset ${member.key} to remove it.`);\n return { success: false };\n }\n if (member.vocabulary !== null && !member.vocabulary.includes(value)) {\n ctx.log.error(`Invalid --${member.flag} \"${value}\". Valid: ${member.vocabulary.join(', ')}.`);\n return { success: false };\n }\n requested.push({ key: member.key, value });\n }\n\n const unsetRaw = ctx.flags.unset as string | undefined;\n const unset = typeof unsetRaw === 'string' ? unsetRaw.trim() : undefined;\n if (unset !== undefined && !SETTABLE_MEMBERS.some((member) => member.key === unset)) {\n ctx.log.error(\n `Unknown preference \"${unset}\". Settable: ${SETTABLE_MEMBERS.map((member) => member.key).join(', ')}.`,\n );\n return { success: false };\n }\n\n if (requested.length === 0 && unset === undefined) {\n return this.report(ctx, path);\n }\n\n try {\n writeMachineDefaults({\n set: Object.fromEntries(requested.map(({ key, value }) => [key, value])),\n unset: unset === undefined ? [] : [unset],\n }, path);\n } catch (error) {\n ctx.log.error(`Could not write ${path}: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n\n for (const { key, value } of requested) ctx.log.info(chalk.green(` ${key} = ${value}`));\n if (unset !== undefined) ctx.log.info(chalk.dim(` ${unset} removed`));\n ctx.log.info('');\n return this.report(ctx, path);\n }\n\n /**\n * What this machine now answers, and what it still asks.\n *\n * Reads the FILE rather than `ctx.cliContext.preferences`, which was loaded at startup — before\n * this command wrote. Reporting the cached copy showed every member as \"asked\" immediately after\n * setting it, which is the one moment the report is read and the one answer it must not give.\n * The read goes through the loader's own validator, so the line about unrecognized values being\n * dropped is a description of what actually happens rather than a claim about it.\n */\n private report(ctx: CommandContext, path: string): CommandResult {\n let stored: WildoMachineDefaults | null = null;\n try {\n if (existsSync(path)) {\n stored = ContextManager.readMachineDefaults(\n (JSON.parse(readFileSync(path, 'utf8')) as { defaults?: unknown }).defaults,\n );\n }\n } catch {\n // An unreadable or malformed file is exactly what the loader treats as \"no preferences\", so\n // report the same thing rather than failing a command whose write already succeeded.\n stored = null;\n }\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Machine answers') + chalk.dim(` (${path})`));\n ctx.log.info('');\n for (const member of SETTABLE_MEMBERS) {\n const value = stored?.[member.key as keyof typeof stored];\n ctx.log.info(\n value === undefined\n ? chalk.dim(` ${member.key.padEnd(16)} — asked`)\n : ` ${member.key.padEnd(16)} ${chalk.green(String(value))}`,\n );\n }\n ctx.log.info('');\n ctx.log.info(chalk.dim(' A flag still overrides any of these for a single run.'));\n ctx.log.info(chalk.dim(' Values shown are what is LOADED — a member the file states with an'));\n ctx.log.info(chalk.dim(' unrecognized value is dropped on read and shows here as asked.'));\n ctx.log.info('');\n return { success: true };\n }\n}\n"]}
1
+ {"version":3,"file":"set.command.js","sourceRoot":"","sources":["../../../../src/commands/prefs/set.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,6BAA6B,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACtH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE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tC,MAAM,KAAK,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,GAA0B,CAAC,CAAC;YAC1D,GAAG,CAAC,GAAG,CAAC,IAAI,CACV,KAAK,KAAK,SAAS;gBACjB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,UAAU,CAAC;gBACnD,CAAC,CAAC,OAAO,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CACjE,CAAC;QACJ,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,yDAAyD,CAAC,CAAC,CAAC;QACnF,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,sEAAsE,CAAC,CAAC,CAAC;QAChG,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC,CAAC;QAC5F,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF","sourcesContent":["/**\n * `wildo prefs set` — state once, on this machine, what every later command would otherwise ask.\n *\n * ## The problem this removes\n *\n * `wildo init` asked six questions whose answers never varied between two applications created on\n * the same machine an hour apart — the operator's own name and email, the store, the runtime, how to\n * treat the machine's shared platform credentials. So the command a creator actually ran was seven\n * lines long, and because it had to be re-runnable it had to be kept somewhere: a preferences file\n * with no reader, maintained by hand, in a shell history.\n *\n * What belongs here is exactly what `WildoMachineDefaults` documents: identity, posture, and a house\n * default. A per-application decision with real consequences — a port block, a name — deliberately\n * does not, because a stored answer would silently apply it to an application whose author never\n * considered it.\n *\n * ## Never a secret\n *\n * `preferences.json` is ordinary-permission machine configuration holding ANSWERS. Credential\n * MATERIAL lives in `local-defaults.json` beside it, which is written `0600` and holds values. So\n * this command takes the administrator's identity and refuses to take their password: an omitted\n * password is minted by the framework-managed materials, which is a better answer than storing one.\n */\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\n\nimport { DatabaseEngine, resolveMachinePreferencesPath, WildoDeploymentRuntime } from '@wildo-ai/platform-config-lib';\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport type { CommandContext, CommandMeta, CommandResult } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport { ContextManager } from '~wildo-cli/services/context/context-manager.service';\nimport type { WildoMachineDefaults } from '~wildo-cli/services/context/context.schemas';\nimport { LocalDefaultsMode } from '~wildo-cli/services/credentials/local-defaults.service';\nimport { writeMachineDefaults } from '~wildo-cli/services/context/machine-preferences.writer';\nimport { listCodingAgents } from '~wildo-cli/services/coding-agents/coding-agent-login.service';\n\n/**\n * One settable member: the flag that carries it, the preferences key it writes, and — for a closed\n * vocabulary — the values it accepts.\n *\n * Declared as ONE table rather than as parallel flag/parse/write blocks, so a member added here\n * cannot reach the file without also being validated and reported. The vocabularies are read from\n * their named enums rather than restated, which is what keeps this table from drifting from the\n * contract it writes.\n */\nconst SETTABLE_MEMBERS = [\n { flag: 'admin-email', camel: 'adminEmail', key: 'adminEmail', vocabulary: null },\n { flag: 'admin-first-name', camel: 'adminFirstName', key: 'adminFirstName', vocabulary: null },\n { flag: 'admin-last-name', camel: 'adminLastName', key: 'adminLastName', vocabulary: null },\n { flag: 'database', camel: 'database', key: 'database', vocabulary: Object.values(DatabaseEngine) },\n { flag: 'runtime', camel: 'runtime', key: 'runtime', vocabulary: Object.values(WildoDeploymentRuntime) },\n { flag: 'local-defaults', camel: 'localDefaults', key: 'localDefaults', vocabulary: Object.values(LocalDefaultsMode) },\n { flag: 'provider-key-defaults', camel: 'providerKeyDefaults', key: 'providerKeyDefaults', vocabulary: Object.values(LocalDefaultsMode) },\n // Derived from the provider registry, so an agent the engine adds is settable without this line changing.\n { flag: 'coding-agent', camel: 'codingAgent', key: 'codingAgent', vocabulary: listCodingAgents().map((agent) => agent.providerRef) },\n] as const satisfies readonly {\n flag: string;\n camel: string;\n key: string;\n vocabulary: readonly string[] | null;\n}[];\n\nexport default class PrefsSetCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'prefs set',\n description: 'Record on this machine the answers wildo init would otherwise ask for',\n category: CommandCategory.Core,\n flags: {\n 'admin-email': { type: 'string', description: 'Platform-administrator email for newly created applications' },\n 'admin-first-name': { type: 'string', description: 'Platform-administrator first name' },\n 'admin-last-name': { type: 'string', description: 'Platform-administrator last name' },\n database: {\n type: 'string',\n description: `Default application store (${Object.values(DatabaseEngine).join(' | ')})`,\n },\n runtime: {\n type: 'string',\n description: `Default infrastructure runtime (${Object.values(WildoDeploymentRuntime).join(' | ')})`,\n },\n 'local-defaults': {\n type: 'string',\n description: `Default treatment of the shared platform credentials in ~/.wildo/local-defaults.json (${Object.values(LocalDefaultsMode).join(' | ')})`,\n },\n 'provider-key-defaults': {\n type: 'string',\n description: `Default treatment of the provider keys in ~/.wildo/local-defaults.json (${Object.values(LocalDefaultsMode).join(' | ')})`,\n },\n 'coding-agent': {\n type: 'string',\n description: 'The coding agent this machine builds applications with (a provider declaring an ACP agent, e.g. anthropic, openai, opencode)',\n },\n unset: {\n type: 'string',\n description: 'Remove one stored member by its preferences key (e.g. --unset database)',\n },\n },\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const path = resolveMachinePreferencesPath();\n\n const requested: { key: string; value: string }[] = [];\n for (const member of SETTABLE_MEMBERS) {\n const raw = (ctx.flags[member.camel] ?? ctx.flags[member.flag]) as string | undefined;\n if (typeof raw !== 'string') continue;\n const value = raw.trim();\n // A stray `--database=` must not install an empty answer that later reads as \"stated\".\n if (value === '') {\n ctx.log.error(`--${member.flag} was given no value. Use --unset ${member.key} to remove it.`);\n return { success: false };\n }\n if (member.vocabulary !== null && !member.vocabulary.includes(value)) {\n ctx.log.error(`Invalid --${member.flag} \"${value}\". Valid: ${member.vocabulary.join(', ')}.`);\n return { success: false };\n }\n requested.push({ key: member.key, value });\n }\n\n const unsetRaw = ctx.flags.unset as string | undefined;\n const unset = typeof unsetRaw === 'string' ? unsetRaw.trim() : undefined;\n if (unset !== undefined && !SETTABLE_MEMBERS.some((member) => member.key === unset)) {\n ctx.log.error(\n `Unknown preference \"${unset}\". Settable: ${SETTABLE_MEMBERS.map((member) => member.key).join(', ')}.`,\n );\n return { success: false };\n }\n\n if (requested.length === 0 && unset === undefined) {\n return this.report(ctx, path);\n }\n\n try {\n writeMachineDefaults({\n set: Object.fromEntries(requested.map(({ key, value }) => [key, value])),\n unset: unset === undefined ? [] : [unset],\n }, path);\n } catch (error) {\n ctx.log.error(`Could not write ${path}: ${ErrorUtils.extractErrorMessage(error)}`);\n return { success: false };\n }\n\n for (const { key, value } of requested) ctx.log.info(chalk.green(` ${key} = ${value}`));\n if (unset !== undefined) ctx.log.info(chalk.dim(` ${unset} removed`));\n ctx.log.info('');\n return this.report(ctx, path);\n }\n\n /**\n * What this machine now answers, and what it still asks.\n *\n * Reads the FILE rather than `ctx.cliContext.preferences`, which was loaded at startup — before\n * this command wrote. Reporting the cached copy showed every member as \"asked\" immediately after\n * setting it, which is the one moment the report is read and the one answer it must not give.\n * The read goes through the loader's own validator, so the line about unrecognized values being\n * dropped is a description of what actually happens rather than a claim about it.\n */\n private report(ctx: CommandContext, path: string): CommandResult {\n let stored: WildoMachineDefaults | null = null;\n try {\n if (existsSync(path)) {\n stored = ContextManager.readMachineDefaults(\n (JSON.parse(readFileSync(path, 'utf8')) as { defaults?: unknown }).defaults,\n );\n }\n } catch {\n // An unreadable or malformed file is exactly what the loader treats as \"no preferences\", so\n // report the same thing rather than failing a command whose write already succeeded.\n stored = null;\n }\n ctx.log.info('');\n ctx.log.info(chalk.bold(' Machine answers') + chalk.dim(` (${path})`));\n ctx.log.info('');\n for (const member of SETTABLE_MEMBERS) {\n const value = stored?.[member.key as keyof typeof stored];\n ctx.log.info(\n value === undefined\n ? chalk.dim(` ${member.key.padEnd(16)} — asked`)\n : ` ${member.key.padEnd(16)} ${chalk.green(String(value))}`,\n );\n }\n ctx.log.info('');\n ctx.log.info(chalk.dim(' A flag still overrides any of these for a single run.'));\n ctx.log.info(chalk.dim(' Values shown are what is LOADED — a member the file states with an'));\n ctx.log.info(chalk.dim(' unrecognized value is dropped on read and shows here as asked.'));\n ctx.log.info('');\n return { success: true };\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/providers/show.command.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAkB,MAAM,yBAAyB,CAAC;AAa1G;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;IAC3D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAQxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CA0EvD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK;gBAAE,OAAO,EAAE,OAAO,CAAA;aAAE,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;CAC/H;AAMD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAM1E"}
1
+ {"version":3,"file":"show.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/providers/show.command.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAI7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAkB,MAAM,yBAAyB,CAAC;AAa1G;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,WAAW;IAC3D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAQxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CA0EvD;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK;gBAAE,OAAO,EAAE,OAAO,CAAA;aAAE,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC;CAC/H;AAMD;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAM1E"}
@@ -1 +1 @@
1
- {"version":3,"file":"show.command.js","sourceRoot":"","sources":["../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OAAO,CAAC,SAAS,CAAC,CAAC;YAChE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;QAC5F,CAAC;QAAC,MAAM,CAAC;YACP,iGAAiG;QACnG,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC5C,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;aAC9C,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC;aACtG,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,GAAW;IACzB,OAAO,GAAG,CAAC,OAAO,CAAC,gCAAgC,EAAE,CAAC,MAAM,EAAE,UAAkB,EAAE,SAAiB,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;AACnI,CAAC","sourcesContent":["import { readdirSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { join, relative } from 'node:path';\n\nimport { ProviderModuleFacet } from '@wildo-ai/platform-config-lib';\n\nimport chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { providerFacetPackageName, readApplicationPackageScope } from '~wildo-cli/services/registry/provider-module-identity.service';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult, FlagDefinition } from '~wildo-cli/kernel/types';\n\nconst FLAG_GREP = 'grep';\n/** The facet subpath that carries a provider package's backend module (`<scope>/provider-<ref>/backend`). */\nconst BACKEND_FACET_SUBPATH = 'backend';\n\nconst FLAGS: Record<string, FlagDefinition> = {\n [FLAG_GREP]: {\n type: 'string',\n description: 'Show only operations whose id, path or summary contains this text (case-insensitive).',\n },\n};\n\n/**\n * What can I call on this provider?\n *\n * An author deciding which operation to use has no way to look inside a provider package short of\n * reading its source. Inside a service the typed client answers it — `createAsanaClient` gives\n * autocomplete with each operation's own summary — but the question this answers comes first: is\n * the operation I need in there at all, and what must I supply to call it?\n *\n * ## Which provider it reads\n *\n * A provider INSTALLED into this application from the module registry (`wildo registry add\n * wildo/providers/<ref>`, #2014), which is the application's own package, named after its scope:\n * `<scope>/provider-<ref>`, whose `./backend` export carries the module. Until #2019 this command\n * read the generated provider catalogue, one framework package with a subpath per vendor; that\n * catalogue was archived at the cut-over, and a provider now reaches an application only as its own\n * installed copy.\n *\n * ## Read from the RUNTIME artifact, never re-derived\n *\n * The operations are loaded through the provider's own lazy `operations()` — the same loader the\n * executor calls — so what this prints is what a call would find. Reading the source instead would\n * make the command a second implementation of the module's shape, and a second implementation is a\n * thing that disagrees.\n *\n * It resolves the package with `createRequire` from the application root and from each of its\n * runtime hosts, so it answers where the package is actually a dependency. A provider the\n * application has not installed fails as a resolution error naming the specifier, which is the true\n * answer to \"can I call this?\".\n */\nexport default class ProvidersShowCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'providers show',\n description:\n 'List the operations a provider installed in this application offers — id, method, path, and the inputs a caller must supply. '\n + 'Takes the provider ref (`wildo providers show asana`).',\n category: CommandCategory.Core,\n args: [{ name: 'ref', description: 'Provider ref, as installed under `providers/<ref>/` (`asana`).', required: true }],\n flags: FLAGS,\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const ref = ctx.args.ref;\n if (!ref) {\n ctx.log.error('Which provider? `wildo providers show <ref>` — for example `wildo providers show asana`.');\n return { success: false };\n }\n\n let scope: string;\n try {\n scope = await readApplicationPackageScope(process.cwd());\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n ctx.log.error('Run `wildo providers show` from the root of the application the provider is installed in.');\n return { success: false };\n }\n const specifier = `${providerFacetPackageName(scope, ref, ProviderModuleFacet.BACKEND)}/${BACKEND_FACET_SUBPATH}`;\n const resolved = resolveFromAnyRuntimeHost(specifier);\n if (resolved === undefined) {\n ctx.log.error(`Could not resolve '${specifier}' from ${process.cwd()} or any of its packages.`);\n ctx.log.error(\n `Either this application has not installed '${ref}' (\\`wildo registry add wildo/providers/${ref}\\`), `\n + 'or it is installed and not built yet, or no runtime of the application depends on it.',\n );\n return { success: false };\n }\n const namespace = (await import(resolved.modulePath)) as Record<string, unknown>;\n\n const fragment = namespace.backendProviderFragment as { modules?: ReadonlyMap<string, unknown> } | undefined;\n const providerModule = fragment?.modules === undefined ? undefined : [...fragment.modules.values()][0];\n const protocols = (providerModule as { protocols?: readonly { runtimeContract?: Record<string, unknown> }[] } | undefined)?.protocols ?? [];\n const contract = protocols\n .map((protocol) => protocol.runtimeContract)\n .find((runtimeContract) => typeof runtimeContract?.operations === 'function') as\n | { baseUrl?: string; baseUrlEnvVarName?: string; baseUrlHostEnvVarName?: string; operations: () => Promise<CatalogueShape> }\n | undefined;\n\n if (contract === undefined) {\n ctx.log.error(`'${specifier}' resolved but declares no REST runtime contract with an operation catalogue.`);\n return { success: false };\n }\n\n const catalogue = await contract.operations();\n const grep = (ctx.flags[FLAG_GREP] as string | undefined)?.toLowerCase();\n const operations = Object.values(catalogue.operations).filter((operation) =>\n grep === undefined\n || `${operation.operationId} ${operation.pathTemplate} ${operation.summary ?? ''}`.toLowerCase().includes(grep),\n );\n\n ctx.log.info('');\n // Naming the host is not decoration: a provider is installed per RUNTIME HOST, and \"can I call\n // this?\" has a different answer in a backend service and in a worker. Printing where it resolved\n // from is what stops this command answering about a package the caller's host does not have.\n ctx.log.info(chalk.dim(`resolved from ${resolved.host}`));\n ctx.log.info(\n chalk.bold(`${ref} — ${operations.length} operation(s)`)\n + (grep === undefined ? '' : chalk.dim(` matching '${grep}' of ${Object.keys(catalogue.operations).length}`)),\n );\n ctx.log.info(chalk.dim(` base URL: ${contract.baseUrl\n ?? (contract.baseUrlHostEnvVarName !== undefined ? `https://$${contract.baseUrlHostEnvVarName}` : `from $${contract.baseUrlEnvVarName ?? '(undeclared)'}`)}`));\n ctx.log.info('');\n\n for (const operation of operations.sort((left, right) => left.operationId.localeCompare(right.operationId))) {\n // The inputs a caller MUST supply, which is the question behind \"can I call this?\" — an\n // operation whose required set names something the caller cannot produce is one to skip.\n const required = requiredInputNames(operation);\n ctx.log.info(`${chalk.bold(operation.operationId)} ${chalk.cyan(`${operation.method} ${operation.pathTemplate}`)}`);\n if (operation.summary) ctx.log.info(chalk.dim(` ${operation.summary}`));\n ctx.log.info(chalk.dim(` requires: ${required.length === 0 ? '(nothing)' : required.join(', ')}`));\n }\n\n ctx.log.info('');\n ctx.log.info(chalk.dim(`Call one with the typed client: create${pascal(ref)}Client(executor.forExecution(ctx)) — each method carries the summary above.`));\n return { success: true };\n }\n}\n\nexport interface CatalogueOperation {\n readonly operationId: string;\n readonly method: string;\n readonly pathTemplate: string;\n readonly summary?: string;\n readonly inputSchema?: { readonly shape?: Record<string, { readonly safeParse?: (value: unknown) => { success: boolean } }> };\n}\n\ninterface CatalogueShape {\n readonly operations: Record<string, CatalogueOperation>;\n}\n\n/**\n * Which declared inputs are REQUIRED, asked of the schema rather than of a parallel list.\n *\n * A Zod object's optionality is only knowable by asking it, and the emitted schemas are the one\n * place that answer lives — the operation's `parameters` say where a value RIDES, not whether the\n * caller must supply it. `safeParse(undefined)` succeeding is exactly what optional means, and it\n * avoids reaching into Zod internals that differ between versions.\n */\nexport function requiredInputNames(operation: CatalogueOperation): string[] {\n const shape = operation.inputSchema?.shape;\n if (!shape) return [];\n return Object.entries(shape)\n .filter(([, field]) => field?.safeParse?.(undefined)?.success === false)\n .map(([name]) => name);\n}\n\n/**\n * Find the specifier from the working directory, or from any package inside it.\n *\n * A provider package is a dependency of a RUNTIME HOST — Wonder Todos declares `@wonder-todos/provider-asana`\n * on `backend-api`, not on the application root — so resolving only from the cwd answers \"no\" while the answer is \"yes, in\n * the backend\". Each candidate is probed by RESOLUTION rather than by reading manifests: a manifest\n * can declare a dependency that is not installed, and what this command reports on is what a running\n * host would actually load.\n *\n * One level deep, because that is where an application's runtime hosts live. Deeper would start\n * walking `node_modules` trees to answer a question about the application's own packages.\n */\nfunction resolveFromAnyRuntimeHost(specifier: string): { readonly modulePath: string; readonly host: string } | undefined {\n const roots = [process.cwd(), ...listImmediateDirectories(process.cwd())];\n for (const root of roots) {\n try {\n const modulePath = createRequire(`${root}/`).resolve(specifier);\n return { modulePath, host: root === process.cwd() ? '.' : relative(process.cwd(), root) };\n } catch {\n // Not installed for this host — the next one may have it, and none having it is the real answer.\n }\n }\n return undefined;\n}\n\nfunction listImmediateDirectories(root: string): string[] {\n try {\n return readdirSync(root, { withFileTypes: true })\n .filter((entry) => entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules')\n .map((entry) => join(root, entry.name));\n } catch {\n return [];\n }\n}\n\nfunction pascal(ref: string): string {\n return ref.replace(/(^|[^a-zA-Z0-9])([a-zA-Z0-9])/g, (_match, _separator: string, character: string) => character.toUpperCase());\n}\n"]}
1
+ {"version":3,"file":"show.command.js","sourceRoot":"","sources":["../../../../src/commands/providers/show.command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,mBAAmB,E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AAC;QAAC,MAAM,CAAC;YACP,iGAAiG;QACnG,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,wBAAwB,CAAC,IAAY;IAC5C,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;aAC9C,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC;aACtG,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,GAAW;IACzB,OAAO,GAAG,CAAC,OAAO,CAAC,gCAAgC,EAAE,CAAC,MAAM,EAAE,UAAkB,EAAE,SAAiB,EAAE,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;AACnI,CAAC","sourcesContent":["import { readdirSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { join, relative } from 'node:path';\n\nimport { ProviderModuleFacet } from '@wildo-ai/platform-config-lib';\n\nimport chalk from 'chalk';\n\nimport { BaseCommand } from '~wildo-cli/kernel/base-command';\nimport { providerFacetPackageName, readApplicationPackageScope } from '~wildo-cli/services/registry/provider-module-identity.service';\nimport { CommandCategory } from '~wildo-cli/kernel/types';\nimport { ErrorUtils } from '~wildo-cli/infrastructure/errors/error.utils';\nimport type { CommandMeta, CommandContext, CommandResult, FlagDefinition } from '~wildo-cli/kernel/types';\n\nconst FLAG_GREP = 'grep';\n/** The facet subpath that carries a provider package's backend module (`<scope>/provider-<ref>/backend`). */\nconst BACKEND_FACET_SUBPATH = 'backend';\n\nconst FLAGS: Record<string, FlagDefinition> = {\n [FLAG_GREP]: {\n type: 'string',\n description: 'Show only operations whose id, path or summary contains this text (case-insensitive).',\n },\n};\n\n/**\n * What can I call on this provider?\n *\n * An author deciding which operation to use has no way to look inside a provider package short of\n * reading its source. Inside a service the typed client answers it — `createAsanaClient` gives\n * autocomplete with each operation's own summary — but the question this answers comes first: is\n * the operation I need in there at all, and what must I supply to call it?\n *\n * ## Which provider it reads\n *\n * A provider INSTALLED into this application from the module registry (`wildo registry add\n * wildo/providers/<ref>`, #2014), which is the application's own package, named after its scope:\n * `<scope>/provider-<ref>`, whose `./backend` export carries the module. Until #2019 this command\n * read the generated provider catalogue, one framework package with a subpath per vendor; that\n * catalogue was archived at the cut-over, and a provider now reaches an application only as its own\n * installed copy.\n *\n * ## Read from the RUNTIME artifact, never re-derived\n *\n * The operations are loaded through the provider's own lazy `operations()` — the same loader the\n * executor calls — so what this prints is what a call would find. Reading the source instead would\n * make the command a second implementation of the module's shape, and a second implementation is a\n * thing that disagrees.\n *\n * It resolves the package with `createRequire` from the application root and from each of its\n * runtime hosts, so it answers where the package is actually a dependency. A provider the\n * application has not installed fails as a resolution error naming the specifier, which is the true\n * answer to \"can I call this?\".\n */\nexport default class ProvidersShowCommand extends BaseCommand {\n readonly meta: CommandMeta = {\n name: 'providers show',\n description:\n 'List the operations a provider installed in this application offers — id, method, path, and the inputs a caller must supply. '\n + 'Takes the provider ref (`wildo providers show asana`).',\n category: CommandCategory.Core,\n args: [{ name: 'ref', description: 'Provider ref, as installed under `providers/<ref>/` (`asana`).', required: true }],\n flags: FLAGS,\n };\n\n async run(ctx: CommandContext): Promise<CommandResult> {\n const ref = ctx.args.ref;\n if (!ref) {\n ctx.log.error('Which provider? `wildo providers show <ref>` — for example `wildo providers show asana`.');\n return { success: false };\n }\n\n let scope: string;\n try {\n scope = await readApplicationPackageScope(process.cwd());\n } catch (error) {\n ctx.log.error(ErrorUtils.extractErrorMessage(error));\n ctx.log.error('Run `wildo providers show` from the root of the application the provider is installed in.');\n return { success: false };\n }\n const specifier = `${providerFacetPackageName(scope, ref, ProviderModuleFacet.BACKEND)}/${BACKEND_FACET_SUBPATH}`;\n const resolved = resolveFromAnyRuntimeHost(specifier);\n if (resolved === undefined) {\n ctx.log.error(`Could not resolve '${specifier}' from ${process.cwd()} or any of its packages.`);\n ctx.log.error(\n `Either this application has not installed '${ref}' (\\`wildo registry add wildo/providers/${ref}\\`), `\n + 'or it is installed and not built yet, or no runtime of the application depends on it.',\n );\n return { success: false };\n }\n const namespace = (await import(resolved.modulePath)) as Record<string, unknown>;\n\n const fragment = namespace.backendProviderFragment as { modules?: ReadonlyMap<string, unknown> } | undefined;\n const providerModule = fragment?.modules === undefined ? undefined : [...fragment.modules.values()][0];\n const protocols = (providerModule as { protocols?: readonly { runtimeContract?: Record<string, unknown> }[] } | undefined)?.protocols ?? [];\n const contract = protocols\n .map((protocol) => protocol.runtimeContract)\n .find((runtimeContract) => typeof runtimeContract?.operations === 'function') as\n | { baseUrl?: string; baseUrlEnvVarName?: string; baseUrlHostEnvVarName?: string; operations: () => Promise<CatalogueShape> }\n | undefined;\n\n if (contract === undefined) {\n ctx.log.error(`'${specifier}' resolved but declares no REST runtime contract with an operation catalogue.`);\n return { success: false };\n }\n\n const catalogue = await contract.operations();\n const grep = (ctx.flags[FLAG_GREP] as string | undefined)?.toLowerCase();\n const operations = Object.values(catalogue.operations).filter((operation) =>\n grep === undefined\n || `${operation.operationId} ${operation.pathTemplate} ${operation.summary ?? ''}`.toLowerCase().includes(grep),\n );\n\n ctx.log.info('');\n // Naming the host is not decoration: a provider is installed per RUNTIME HOST, and \"can I call\n // this?\" has a different answer in a backend service and in a worker. Printing where it resolved\n // from is what stops this command answering about a package the caller's host does not have.\n ctx.log.info(chalk.dim(`resolved from ${resolved.host}`));\n ctx.log.info(\n chalk.bold(`${ref} — ${operations.length} operation(s)`)\n + (grep === undefined ? '' : chalk.dim(` matching '${grep}' of ${Object.keys(catalogue.operations).length}`)),\n );\n ctx.log.info(chalk.dim(` base URL: ${contract.baseUrl\n ?? (contract.baseUrlHostEnvVarName !== undefined ? `https://$${contract.baseUrlHostEnvVarName}` : `from $${contract.baseUrlEnvVarName ?? '(undeclared)'}`)}`));\n ctx.log.info('');\n\n for (const operation of operations.sort((left, right) => left.operationId.localeCompare(right.operationId))) {\n // The inputs a caller MUST supply, which is the question behind \"can I call this?\" — an\n // operation whose required set names something the caller cannot produce is one to skip.\n const required = requiredInputNames(operation);\n ctx.log.info(`${chalk.bold(operation.operationId)} ${chalk.cyan(`${operation.method} ${operation.pathTemplate}`)}`);\n if (operation.summary) ctx.log.info(chalk.dim(` ${operation.summary}`));\n ctx.log.info(chalk.dim(` requires: ${required.length === 0 ? '(nothing)' : required.join(', ')}`));\n }\n\n ctx.log.info('');\n ctx.log.info(chalk.dim(`Call one with the typed client: create${pascal(ref)}Client(executor.forExecution(ctx)) — each method carries the summary above.`));\n return { success: true };\n }\n}\n\nexport interface CatalogueOperation {\n readonly operationId: string;\n readonly method: string;\n readonly pathTemplate: string;\n readonly summary?: string;\n readonly inputSchema?: { readonly shape?: Record<string, { readonly safeParse?: (value: unknown) => { success: boolean } }> };\n}\n\ninterface CatalogueShape {\n readonly operations: Record<string, CatalogueOperation>;\n}\n\n/**\n * Which declared inputs are REQUIRED, asked of the schema rather than of a parallel list.\n *\n * A Zod object's optionality is only knowable by asking it, and the emitted schemas are the one\n * place that answer lives — the operation's `parameters` say where a value RIDES, not whether the\n * caller must supply it. `safeParse(undefined)` succeeding is exactly what optional means, and it\n * avoids reaching into Zod internals that differ between versions.\n */\nexport function requiredInputNames(operation: CatalogueOperation): string[] {\n const shape = operation.inputSchema?.shape;\n if (!shape) return [];\n return Object.entries(shape)\n .filter(([, field]) => field?.safeParse?.(undefined)?.success === false)\n .map(([name]) => name);\n}\n\n/**\n * Find the specifier from the working directory, or from any package inside it.\n *\n * A provider package is a dependency of a RUNTIME HOST — Wonder Todos declares `@wonder-todos/provider-asana`\n * on `backend-api`, not on the application root — so resolving only from the cwd answers \"no\" while the answer is \"yes, in\n * the backend\". Each candidate is probed by RESOLUTION rather than by reading manifests: a manifest\n * can declare a dependency that is not installed, and what this command reports on is what a running\n * host would actually load.\n *\n * One level deep, because that is where an application's runtime hosts live. Deeper would start\n * walking `node_modules` trees to answer a question about the application's own packages.\n */\nfunction resolveFromAnyRuntimeHost(specifier: string): { readonly modulePath: string; readonly host: string } | undefined {\n const roots = [process.cwd(), ...listImmediateDirectories(process.cwd())];\n for (const root of roots) {\n try {\n const modulePath = createRequire(`${root}/`).resolve(specifier);\n return { modulePath, host: root === process.cwd() ? '.' : relative(process.cwd(), root) };\n } catch {\n // Not installed for this host — the next one may have it, and none having it is the real answer.\n }\n }\n return undefined;\n}\n\nfunction listImmediateDirectories(root: string): string[] {\n try {\n return readdirSync(root, { withFileTypes: true })\n .filter((entry) => entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules')\n .map((entry) => join(root, entry.name));\n } catch {\n return [];\n }\n}\n\nfunction pascal(ref: string): string {\n return ref.replace(/(^|[^a-zA-Z0-9])([a-zA-Z0-9])/g, (_match, _separator: string, character: string) => character.toUpperCase());\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"add.command.d.ts","sourceRoot":"","sources":["../../../../../../src/commands/registry/add.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAmG1F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,WAAW;IACzD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAuBxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAsOvD"}
1
+ {"version":3,"file":"add.command.d.ts","sourceRoot":"","sources":["../../../../src/commands/registry/add.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7D,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAmG1F,MAAM,CAAC,OAAO,OAAO,kBAAmB,SAAQ,WAAW;IACzD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAuBxB;IAEI,GAAG,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CAsOvD"}