@depup/nx 23.2.1-depup.7 → 23.3.0-depup.0

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 (350) hide show
  1. package/README.md +8 -19
  2. package/changes.json +10 -54
  3. package/dist/bin/init-local.js +7 -1
  4. package/dist/nx-cloud-internals.d.ts +1 -0
  5. package/dist/nx-cloud-internals.js +9 -0
  6. package/dist/plugins/package-json.js +1 -1
  7. package/dist/src/command-line/add/add.js +5 -1
  8. package/dist/src/command-line/affected/affected.js +70 -9
  9. package/dist/src/command-line/affected/command-object.js +1 -1
  10. package/dist/src/command-line/format/format.js +2 -18
  11. package/dist/src/command-line/graph/graph.d.ts +31 -0
  12. package/dist/src/command-line/graph/graph.js +113 -20
  13. package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +0 -3
  14. package/dist/src/command-line/init/implementation/add-nx-to-nest.js +0 -3
  15. package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +0 -3
  16. package/dist/src/command-line/init/implementation/angular/index.js +0 -3
  17. package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +0 -3
  18. package/dist/src/command-line/init/implementation/format.js +2 -3
  19. package/dist/src/command-line/init/implementation/utils.d.ts +0 -1
  20. package/dist/src/command-line/init/implementation/utils.js +6 -9
  21. package/dist/src/command-line/init/init-v2.js +0 -3
  22. package/dist/src/command-line/migrate/agentic/capture-generator-output.d.ts +25 -0
  23. package/dist/src/command-line/migrate/agentic/capture-generator-output.js +121 -5
  24. package/dist/src/command-line/migrate/agentic/close-agent-session.d.ts +21 -0
  25. package/dist/src/command-line/migrate/agentic/close-agent-session.js +126 -0
  26. package/dist/src/command-line/migrate/agentic/definitions.d.ts +24 -0
  27. package/dist/src/command-line/migrate/agentic/definitions.js +79 -20
  28. package/dist/src/command-line/migrate/agentic/format-command.d.ts +14 -0
  29. package/dist/src/command-line/migrate/agentic/format-command.js +44 -0
  30. package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +3 -3
  31. package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +3 -3
  32. package/dist/src/command-line/migrate/agentic/handoff.d.ts +50 -17
  33. package/dist/src/command-line/migrate/agentic/handoff.js +166 -24
  34. package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +23 -0
  35. package/dist/src/command-line/migrate/agentic/instruction-files.js +41 -0
  36. package/dist/src/command-line/migrate/agentic/master/invocations.d.ts +12 -0
  37. package/dist/src/command-line/migrate/agentic/master/invocations.js +54 -0
  38. package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +16 -0
  39. package/dist/src/command-line/migrate/agentic/master/run-master-session.js +175 -0
  40. package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +31 -0
  41. package/dist/src/command-line/migrate/agentic/master/spawn-master.js +222 -0
  42. package/dist/src/command-line/migrate/agentic/prompts/final-validation.d.ts +13 -0
  43. package/dist/src/command-line/migrate/agentic/prompts/final-validation.js +41 -0
  44. package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +17 -0
  45. package/dist/src/command-line/migrate/agentic/prompts/fragments.js +90 -0
  46. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +4 -3
  47. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +25 -1
  48. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +57 -34
  49. package/dist/src/command-line/migrate/agentic/run-step.js +28 -4
  50. package/dist/src/command-line/migrate/agentic/runner.d.ts +3 -15
  51. package/dist/src/command-line/migrate/agentic/runner.js +57 -239
  52. package/dist/src/command-line/migrate/agentic/terminal-repair.d.ts +1 -0
  53. package/dist/src/command-line/migrate/agentic/terminal-repair.js +27 -0
  54. package/dist/src/command-line/migrate/agentic/types.d.ts +23 -8
  55. package/dist/src/command-line/migrate/agentic/types.js +10 -7
  56. package/dist/src/command-line/migrate/agentic/windows-cmd.d.ts +33 -0
  57. package/dist/src/command-line/migrate/agentic/windows-cmd.js +88 -0
  58. package/dist/src/command-line/migrate/command-object.d.ts +2 -0
  59. package/dist/src/command-line/migrate/command-object.js +11 -1
  60. package/dist/src/command-line/migrate/deferred-output.d.ts +44 -0
  61. package/dist/src/command-line/migrate/deferred-output.js +92 -0
  62. package/dist/src/command-line/migrate/execute-migration.d.ts +9 -3
  63. package/dist/src/command-line/migrate/execute-migration.js +53 -16
  64. package/dist/src/command-line/migrate/migrate-analytics.d.ts +34 -9
  65. package/dist/src/command-line/migrate/migrate-analytics.js +71 -10
  66. package/dist/src/command-line/migrate/migrate-commits.d.ts +5 -4
  67. package/dist/src/command-line/migrate/migrate-commits.js +16 -6
  68. package/dist/src/command-line/migrate/migrate-config.d.ts +5 -2
  69. package/dist/src/command-line/migrate/migrate-config.js +19 -11
  70. package/dist/src/command-line/migrate/migrate-output.d.ts +3 -7
  71. package/dist/src/command-line/migrate/migrate-output.js +3 -7
  72. package/dist/src/command-line/migrate/migrate.d.ts +3 -0
  73. package/dist/src/command-line/migrate/migrate.js +183 -46
  74. package/dist/src/command-line/migrate/resolve-package-version.js +2 -19
  75. package/dist/src/command-line/migrate/run/agent-output.d.ts +11 -0
  76. package/dist/src/command-line/migrate/run/agent-output.js +21 -2
  77. package/dist/src/command-line/migrate/run/agent-work-payload.d.ts +37 -0
  78. package/dist/src/command-line/migrate/run/agent-work-payload.js +156 -0
  79. package/dist/src/command-line/migrate/run/atomic-write.d.ts +8 -0
  80. package/dist/src/command-line/migrate/run/atomic-write.js +17 -0
  81. package/dist/src/command-line/migrate/run/broker.d.ts +150 -0
  82. package/dist/src/command-line/migrate/run/broker.js +568 -0
  83. package/dist/src/command-line/migrate/run/clean-retry.d.ts +12 -0
  84. package/dist/src/command-line/migrate/run/clean-retry.js +99 -0
  85. package/dist/src/command-line/migrate/run/existing-run-report.d.ts +55 -0
  86. package/dist/src/command-line/migrate/run/existing-run-report.js +227 -0
  87. package/dist/src/command-line/migrate/run/give-up.d.ts +41 -0
  88. package/dist/src/command-line/migrate/run/give-up.js +148 -0
  89. package/dist/src/command-line/migrate/run/index.d.ts +9 -6
  90. package/dist/src/command-line/migrate/run/index.js +21 -2
  91. package/dist/src/command-line/migrate/run/issues.d.ts +127 -0
  92. package/dist/src/command-line/migrate/run/issues.js +1121 -0
  93. package/dist/src/command-line/migrate/run/orchestrator.d.ts +59 -1
  94. package/dist/src/command-line/migrate/run/orchestrator.js +1529 -457
  95. package/dist/src/command-line/migrate/run/run-id.d.ts +0 -8
  96. package/dist/src/command-line/migrate/run/run-id.js +0 -30
  97. package/dist/src/command-line/migrate/run/run-state.d.ts +77 -17
  98. package/dist/src/command-line/migrate/run/run-state.js +263 -32
  99. package/dist/src/command-line/migrate/run/runbook.d.ts +18 -0
  100. package/dist/src/command-line/migrate/run/runbook.js +118 -0
  101. package/dist/src/command-line/migrate/run/state-lock.d.ts +33 -2
  102. package/dist/src/command-line/migrate/run/state-lock.js +128 -2
  103. package/dist/src/command-line/migrate/run/state-machine.d.ts +50 -1
  104. package/dist/src/command-line/migrate/run/state-machine.js +339 -26
  105. package/dist/src/command-line/migrate/run/util.d.ts +3 -1
  106. package/dist/src/command-line/migrate/run/util.js +24 -3
  107. package/dist/src/command-line/migrate/run/worker.js +290 -129
  108. package/dist/src/command-line/migrate/step-actions.d.ts +1 -1
  109. package/dist/src/command-line/migrate/step-actions.js +7 -1
  110. package/dist/src/command-line/migrate/text.d.ts +6 -0
  111. package/dist/src/command-line/migrate/text.js +25 -0
  112. package/dist/src/command-line/migrate/version-skew-guard.js +2 -0
  113. package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +5 -11
  114. package/dist/src/command-line/release/publish.js +11 -8
  115. package/dist/src/command-line/release/utils/get-touched-projects-for-group.js +3 -3
  116. package/dist/src/command-line/release/utils/release-graph.js +1 -1
  117. package/dist/src/command-line/release/utils/remote-release-clients/github.js +5 -8
  118. package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +3 -3
  119. package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.d.ts +4 -2
  120. package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.js +37 -3
  121. package/dist/src/command-line/release/version/version-actions.d.ts +3 -0
  122. package/dist/src/command-line/reset/reset.js +10 -4
  123. package/dist/src/command-line/run/run-one.js +5 -1
  124. package/dist/src/command-line/run-many/run-many.js +6 -12
  125. package/dist/src/command-line/show/command-object.js +1 -1
  126. package/dist/src/command-line/show/projects.js +52 -1
  127. package/dist/src/command-line/yargs-utils/shared-options.d.ts +5 -1
  128. package/dist/src/command-line/yargs-utils/shared-options.js +38 -4
  129. package/dist/src/config/task-graph.d.ts +1 -1
  130. package/dist/src/config/workspace-json-project-json.d.ts +23 -1
  131. package/dist/src/core/graph/main.js +1 -1
  132. package/dist/src/core/graph/runtime.js +1 -1
  133. package/dist/src/core/graph/styles.js +1 -1
  134. package/dist/src/daemon/client/client.d.ts +14 -8
  135. package/dist/src/daemon/client/client.js +41 -12
  136. package/dist/src/daemon/message-types/get-plugin-capabilities.d.ts +5 -0
  137. package/dist/src/daemon/message-types/get-plugin-capabilities.js +11 -0
  138. package/dist/src/daemon/message-types/run-tasks-execution-hooks.d.ts +3 -2
  139. package/dist/src/daemon/message-types/select-affected-tasks.d.ts +21 -0
  140. package/dist/src/daemon/message-types/select-affected-tasks.js +11 -0
  141. package/dist/src/daemon/message-types/ultracache-configuration-version.d.ts +8 -0
  142. package/dist/src/daemon/message-types/ultracache-configuration-version.js +2 -0
  143. package/dist/src/daemon/server/dotenv-graph-changes.d.ts +1 -1
  144. package/dist/src/daemon/server/dotenv-graph-changes.js +2 -2
  145. package/dist/src/daemon/server/handle-get-plugin-capabilities.d.ts +2 -0
  146. package/dist/src/daemon/server/handle-get-plugin-capabilities.js +13 -0
  147. package/dist/src/daemon/server/handle-hash-tasks.d.ts +10 -2
  148. package/dist/src/daemon/server/handle-hash-tasks.js +18 -3
  149. package/dist/src/daemon/server/handle-select-affected-tasks.d.ts +3 -0
  150. package/dist/src/daemon/server/handle-select-affected-tasks.js +26 -0
  151. package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +3 -2
  152. package/dist/src/daemon/server/{handle-outputs-changes.d.ts → handle-watch-events.d.ts} +4 -4
  153. package/dist/src/daemon/server/{handle-outputs-changes.js → handle-watch-events.js} +36 -37
  154. package/dist/src/daemon/server/outputs-tracking.d.ts +7 -19
  155. package/dist/src/daemon/server/outputs-tracking.js +7 -107
  156. package/dist/src/daemon/server/planning-context.d.ts +8 -0
  157. package/dist/src/daemon/server/planning-context.js +18 -0
  158. package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +22 -7
  159. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +104 -74
  160. package/dist/src/daemon/server/restart-checks.d.ts +22 -0
  161. package/dist/src/daemon/server/restart-checks.js +77 -0
  162. package/dist/src/daemon/server/server.d.ts +1 -0
  163. package/dist/src/daemon/server/server.js +54 -30
  164. package/dist/src/daemon/server/shutdown-utils.d.ts +0 -5
  165. package/dist/src/daemon/server/shutdown-utils.js +3 -26
  166. package/dist/src/daemon/server/ultracache-configuration-state.d.ts +7 -0
  167. package/dist/src/daemon/server/ultracache-configuration-state.js +36 -0
  168. package/dist/src/devkit-internals.d.ts +3 -1
  169. package/dist/src/devkit-internals.js +8 -3
  170. package/dist/src/executors/run-commands/run-commands.impl.d.ts +2 -1
  171. package/dist/src/executors/run-commands/run-commands.impl.js +19 -5
  172. package/dist/src/executors/run-commands/running-tasks.d.ts +5 -4
  173. package/dist/src/executors/run-commands/running-tasks.js +13 -13
  174. package/dist/src/hasher/create-task-hasher.d.ts +8 -1
  175. package/dist/src/hasher/create-task-hasher.js +13 -3
  176. package/dist/src/hasher/hash-plan-inspector.js +2 -2
  177. package/dist/src/hasher/hash-task.d.ts +2 -2
  178. package/dist/src/hasher/hash-task.js +28 -17
  179. package/dist/src/hasher/native-task-hasher-impl.d.ts +20 -4
  180. package/dist/src/hasher/native-task-hasher-impl.js +75 -9
  181. package/dist/src/hasher/task-hasher.d.ts +24 -7
  182. package/dist/src/hasher/task-hasher.js +27 -8
  183. package/dist/src/hasher/task-planning-context.d.ts +13 -0
  184. package/dist/src/hasher/task-planning-context.js +12 -0
  185. package/dist/src/native/index.d.ts +582 -21
  186. package/dist/src/native/index.js +3 -3
  187. package/dist/src/native/native-bindings.js +13 -1
  188. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  189. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  190. package/dist/src/native/transform-objects.d.ts +11 -2
  191. package/dist/src/native/transform-objects.js +46 -0
  192. package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +15 -8
  193. package/dist/src/nx-cloud/update-manager.d.ts +3 -0
  194. package/dist/src/nx-cloud/update-manager.js +19 -13
  195. package/dist/src/nx-cloud/utilities/client.d.ts +1 -1
  196. package/dist/src/nx-cloud/utilities/client.js +1 -1
  197. package/dist/src/nx-cloud/utilities/is-workspace-claimed.js +2 -1
  198. package/dist/src/nx-cloud/utilities/nx-cloud-http-client.d.ts +5 -0
  199. package/dist/src/nx-cloud/utilities/nx-cloud-http-client.js +16 -0
  200. package/dist/src/nx-cloud/utilities/url-shorten.js +17 -10
  201. package/dist/src/plugins/js/index.js +45 -64
  202. package/dist/src/plugins/js/lock-file/lock-file.d.ts +4 -4
  203. package/dist/src/plugins/js/lock-file/lock-file.js +6 -7
  204. package/dist/src/plugins/js/lock-file/pnpm-parser.js +1 -1
  205. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +2 -0
  206. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +22 -0
  207. package/dist/src/plugins/js/project-graph/affected/lock-file-changes.d.ts +10 -2
  208. package/dist/src/plugins/js/project-graph/affected/lock-file-changes.js +51 -29
  209. package/dist/src/plugins/js/project-graph/affected/npm-packages.d.ts +10 -2
  210. package/dist/src/plugins/js/project-graph/affected/npm-packages.js +32 -11
  211. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +22 -18
  212. package/dist/src/plugins/js/utils/register.js +13 -4
  213. package/dist/src/plugins/package-json/create-nodes.d.ts +2 -2
  214. package/dist/src/plugins/package-json/create-nodes.js +13 -13
  215. package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +14 -0
  216. package/dist/src/project-graph/affected/affected-project-graph.js +5 -18
  217. package/dist/src/project-graph/affected/affected-projects.d.ts +7 -0
  218. package/dist/src/project-graph/affected/affected-projects.js +42 -0
  219. package/dist/src/project-graph/affected/affected-reasons.d.ts +116 -0
  220. package/dist/src/project-graph/affected/affected-reasons.js +459 -0
  221. package/dist/src/project-graph/affected/affected-tasks.d.ts +103 -0
  222. package/dist/src/project-graph/affected/affected-tasks.js +386 -0
  223. package/dist/src/project-graph/affected/print-explanation.d.ts +11 -0
  224. package/dist/src/project-graph/affected/print-explanation.js +44 -0
  225. package/dist/src/project-graph/error-types.d.ts +5 -0
  226. package/dist/src/project-graph/error-types.js +44 -5
  227. package/dist/src/project-graph/file-utils.d.ts +2 -0
  228. package/dist/src/project-graph/file-utils.js +12 -3
  229. package/dist/src/project-graph/nx-deps-cache.d.ts +5 -2
  230. package/dist/src/project-graph/nx-deps-cache.js +4 -4
  231. package/dist/src/project-graph/plugins/get-plugins.d.ts +3 -1
  232. package/dist/src/project-graph/plugins/get-plugins.js +60 -82
  233. package/dist/src/project-graph/plugins/in-process-loader.d.ts +1 -1
  234. package/dist/src/project-graph/plugins/in-process-loader.js +1 -4
  235. package/dist/src/project-graph/plugins/isolation/index.d.ts +1 -1
  236. package/dist/src/project-graph/plugins/isolation/index.js +3 -1
  237. package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +8 -0
  238. package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +42 -6
  239. package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.d.ts +10 -1
  240. package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.js +67 -17
  241. package/dist/src/project-graph/plugins/isolation/messaging.d.ts +3 -2
  242. package/dist/src/project-graph/plugins/isolation/plugin-worker.js +5 -1
  243. package/dist/src/project-graph/plugins/loaded-nx-plugin.d.ts +5 -2
  244. package/dist/src/project-graph/plugins/loaded-nx-plugin.js +14 -1
  245. package/dist/src/project-graph/plugins/nx-plugin-capabilities.d.ts +6 -0
  246. package/dist/src/project-graph/plugins/nx-plugin-capabilities.js +28 -0
  247. package/dist/src/project-graph/plugins/task-results-stub.d.ts +50 -0
  248. package/dist/src/project-graph/plugins/task-results-stub.js +111 -0
  249. package/dist/src/project-graph/plugins/tasks-execution-hooks.d.ts +3 -2
  250. package/dist/src/project-graph/plugins/tasks-execution-hooks.js +14 -1
  251. package/dist/src/project-graph/project-graph.js +43 -42
  252. package/dist/src/project-graph/utils/project-configuration/target-merging.js +67 -0
  253. package/dist/src/project-graph/utils/project-configuration/target-normalization.js +83 -0
  254. package/dist/src/project-graph/utils/project-configuration/utils.d.ts +1 -0
  255. package/dist/src/project-graph/utils/project-configuration/utils.js +1 -0
  256. package/dist/src/tasks-runner/batch/run-batch.js +15 -0
  257. package/dist/src/tasks-runner/cache.d.ts +37 -2
  258. package/dist/src/tasks-runner/cache.js +42 -1
  259. package/dist/src/tasks-runner/create-task-graph.d.ts +24 -1
  260. package/dist/src/tasks-runner/create-task-graph.js +57 -2
  261. package/dist/src/tasks-runner/default-tasks-runner.js +1 -1
  262. package/dist/src/tasks-runner/forked-process-task-runner.d.ts +1 -1
  263. package/dist/src/tasks-runner/forked-process-task-runner.js +11 -10
  264. package/dist/src/tasks-runner/init-tasks-runner.d.ts +7 -2
  265. package/dist/src/tasks-runner/init-tasks-runner.js +15 -7
  266. package/dist/src/tasks-runner/is-tui-enabled.js +4 -3
  267. package/dist/src/tasks-runner/life-cycle.d.ts +7 -0
  268. package/dist/src/tasks-runner/life-cycle.js +7 -0
  269. package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.d.ts +35 -0
  270. package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.js +146 -0
  271. package/dist/src/tasks-runner/prune-task-graph.d.ts +17 -0
  272. package/dist/src/tasks-runner/prune-task-graph.js +45 -0
  273. package/dist/src/tasks-runner/run-command.d.ts +41 -5
  274. package/dist/src/tasks-runner/run-command.js +98 -22
  275. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +93 -19
  276. package/dist/src/tasks-runner/running-tasks/batch-process.js +184 -88
  277. package/dist/src/tasks-runner/task-io-service.d.ts +11 -3
  278. package/dist/src/tasks-runner/task-io-service.js +14 -5
  279. package/dist/src/tasks-runner/task-orchestrator.d.ts +71 -4
  280. package/dist/src/tasks-runner/task-orchestrator.js +266 -66
  281. package/dist/src/tasks-runner/tasks-runner.d.ts +2 -0
  282. package/dist/src/tasks-runner/terminal-output-path.d.ts +11 -0
  283. package/dist/src/tasks-runner/terminal-output-path.js +18 -0
  284. package/dist/src/tasks-runner/utils.d.ts +5 -0
  285. package/dist/src/tasks-runner/utils.js +14 -2
  286. package/dist/src/ultracache/config.d.ts +21 -0
  287. package/dist/src/ultracache/config.js +29 -0
  288. package/dist/src/ultracache/fetch.d.ts +21 -0
  289. package/dist/src/ultracache/fetch.js +43 -0
  290. package/dist/src/ultracache/overrides.d.ts +17 -0
  291. package/dist/src/ultracache/overrides.js +61 -0
  292. package/dist/src/ultracache/report.d.ts +13 -0
  293. package/dist/src/ultracache/report.js +62 -0
  294. package/dist/src/ultracache/store.d.ts +41 -0
  295. package/dist/src/ultracache/store.js +158 -0
  296. package/dist/src/utils/ab-testing.d.ts +4 -1
  297. package/dist/src/utils/ab-testing.js +22 -19
  298. package/dist/src/utils/chunkify.d.ts +1 -7
  299. package/dist/src/utils/chunkify.js +2 -8
  300. package/dist/src/utils/command-line-utils.d.ts +20 -0
  301. package/dist/src/utils/command-line-utils.js +10 -3
  302. package/dist/src/utils/create-cli-options.d.ts +6 -0
  303. package/dist/src/utils/create-cli-options.js +29 -0
  304. package/dist/src/utils/db-connection.d.ts +2 -0
  305. package/dist/src/utils/db-connection.js +2 -0
  306. package/dist/src/utils/formatters/index.d.ts +6 -0
  307. package/dist/src/utils/formatters/index.js +5 -0
  308. package/dist/src/utils/formatters/prettier.d.ts +0 -8
  309. package/dist/src/utils/formatters/prettier.js +4 -26
  310. package/dist/src/utils/git-utils.d.ts +19 -0
  311. package/dist/src/utils/git-utils.js +97 -39
  312. package/dist/src/utils/handle-errors.js +5 -43
  313. package/dist/src/utils/http-client.d.ts +27 -0
  314. package/dist/src/utils/http-client.js +193 -0
  315. package/dist/src/utils/installed-nx-version.js +2 -48
  316. package/dist/src/utils/json-diff.d.ts +4 -2
  317. package/dist/src/utils/json-diff.js +6 -94
  318. package/dist/src/utils/min-release-age/packument.js +1 -1
  319. package/dist/src/utils/nx-cloud-utils.d.ts +2 -0
  320. package/dist/src/utils/nx-cloud-utils.js +6 -1
  321. package/dist/src/utils/output.d.ts +22 -3
  322. package/dist/src/utils/output.js +28 -5
  323. package/dist/src/utils/package-json.d.ts +25 -0
  324. package/dist/src/utils/package-json.js +49 -6
  325. package/dist/src/utils/package-manager.d.ts +6 -0
  326. package/dist/src/utils/package-manager.js +10 -0
  327. package/dist/src/utils/plugins/plugin-capabilities.js +7 -2
  328. package/dist/src/utils/project-graph-utils.d.ts +2 -0
  329. package/dist/src/utils/project-graph-utils.js +12 -0
  330. package/dist/src/utils/provenance.js +20 -4
  331. package/dist/src/utils/serialize-overrides-into-command-line.js +2 -4
  332. package/dist/src/utils/workspace-context.d.ts +51 -3
  333. package/dist/src/utils/workspace-context.js +174 -10
  334. package/package.json +38 -100
  335. package/schemas/nx-schema.json +38 -0
  336. package/schemas/project-schema.json +35 -0
  337. package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +0 -9
  338. package/dist/src/daemon/server/file-watching/route-workspace-changes.js +0 -76
  339. package/dist/src/daemon/server/watcher.d.ts +0 -18
  340. package/dist/src/daemon/server/watcher.js +0 -126
  341. package/dist/src/nx-cloud/utilities/axios.d.ts +0 -4
  342. package/dist/src/nx-cloud/utilities/axios.js +0 -17
  343. package/dist/src/project-graph/affected/locators/project-glob-changes.d.ts +0 -2
  344. package/dist/src/project-graph/affected/locators/project-glob-changes.js +0 -47
  345. package/dist/src/project-graph/affected/locators/workspace-json-changes.d.ts +0 -4
  346. package/dist/src/project-graph/affected/locators/workspace-json-changes.js +0 -47
  347. package/dist/src/project-graph/affected/locators/workspace-projects.d.ts +0 -3
  348. package/dist/src/project-graph/affected/locators/workspace-projects.js +0 -74
  349. package/dist/src/utils/collapse-expanded-outputs.d.ts +0 -10
  350. package/dist/src/utils/collapse-expanded-outputs.js +0 -72
@@ -0,0 +1,146 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SummaryTerminalOutputLifeCycle = void 0;
4
+ const output_1 = require("../../utils/output");
5
+ const terminal_output_path_1 = require("../terminal-output-path");
6
+ /**
7
+ * Prints a run as a handful of lines rather than a transcript: counts, then one
8
+ * line per failure naming the file that holds its output. Task output stops
9
+ * being a stream to read and becomes an artifact to address, so the size of this
10
+ * renderer's output depends on how many tasks failed, never on how loud they
11
+ * were.
12
+ *
13
+ * Selected by `--output-style=summary`, and by default when Nx is driven by an
14
+ * AI agent, which otherwise reads thousands of lines of passing output to find
15
+ * the one failure.
16
+ */
17
+ class SummaryTerminalOutputLifeCycle {
18
+ constructor(tasks) {
19
+ this.tasks = tasks;
20
+ this.failed = [];
21
+ this.stopped = [];
22
+ this.completed = new Set();
23
+ this.succeeded = 0;
24
+ this.cached = 0;
25
+ this.batchLogs = new Map();
26
+ }
27
+ setCloudLink(label, url) {
28
+ this.cloudLink = { label, url };
29
+ }
30
+ batchOutputAvailable(batchId, path) {
31
+ this.batchLogs.set(batchId, path);
32
+ }
33
+ /**
34
+ * Nothing is printed as tasks complete. A summary that interleaved with
35
+ * progress would be a transcript again.
36
+ */
37
+ printTaskTerminalOutput() { }
38
+ endTasks(taskResults) {
39
+ for (const { task, status, terminalOutput } of taskResults) {
40
+ this.completed.add(task.id);
41
+ switch (status) {
42
+ case 'failure':
43
+ // Whether a log file exists is decided here, not at render time.
44
+ // `persistTerminalOutputs` skips only an undefined `terminalOutput`,
45
+ // so an empty one still writes a 0-byte file - truthiness, not
46
+ // definedness, is what says a reader will find something there.
47
+ this.failed.push({
48
+ task,
49
+ hasOutput: !!terminalOutput,
50
+ });
51
+ break;
52
+ case 'stopped':
53
+ // Every task of a stopped batch carries `''`: the worker's partial
54
+ // log is announced as the batch's own artifact now, not folded into
55
+ // any task. So these address a file only when something else wrote
56
+ // one, and the batch log is addressed once below.
57
+ this.stopped.push({
58
+ task,
59
+ hasOutput: !!terminalOutput,
60
+ });
61
+ break;
62
+ case 'local-cache':
63
+ case 'local-cache-kept-existing':
64
+ case 'remote-cache':
65
+ this.cached++;
66
+ this.succeeded++;
67
+ break;
68
+ default:
69
+ this.succeeded++;
70
+ }
71
+ }
72
+ }
73
+ endCommand() {
74
+ const skipped = this.tasks.filter((t) => !this.completed.has(t.id)).length;
75
+ const bodyLines = [];
76
+ for (const { task, hasOutput } of this.failed) {
77
+ bodyLines.push('', ...this.failureBlock(task, hasOutput));
78
+ }
79
+ if (this.stopped.length > 0) {
80
+ bodyLines.push('', output_1.output.dim('Stopped before finishing:'), ...this.stopped.flatMap(({ task, hasOutput }) => {
81
+ const line = `${output_1.output.dim('-')} ${task.id}`;
82
+ return task.hash && hasOutput
83
+ ? [
84
+ line,
85
+ output_1.output.dim(` full log: ${(0, terminal_output_path_1.terminalOutputPathForHash)(task.hash)}`),
86
+ ]
87
+ : [line];
88
+ }));
89
+ }
90
+ if (this.batchLogs.size > 0) {
91
+ // One line per worker, not per task: a batch's log explains the whole
92
+ // batch, and no task's own output file contains it.
93
+ bodyLines.push('', output_1.output.dim('Batch worker logs:'));
94
+ for (const [batchId, path] of this.batchLogs) {
95
+ bodyLines.push(`${output_1.output.dim('-')} ${output_1.output.dim(`${batchId}: ${path}`)}`);
96
+ }
97
+ }
98
+ if (this.cloudLink) {
99
+ bodyLines.push('', `${this.cloudLink.label} ${this.cloudLink.url}`);
100
+ }
101
+ bodyLines.push('', output_1.output.dim('Re-run with --output-style=static to inline logs.'));
102
+ const title = this.countsLine(skipped);
103
+ if (this.failed.length > 0 || this.stopped.length > 0) {
104
+ output_1.output.error({ title, bodyLines });
105
+ }
106
+ else {
107
+ output_1.output.success({ title, bodyLines });
108
+ }
109
+ }
110
+ countsLine(skipped) {
111
+ const parts = [`${this.succeeded} succeeded`];
112
+ if (this.cached > 0) {
113
+ parts.push(`${this.cached} cached`);
114
+ }
115
+ if (this.failed.length > 0) {
116
+ parts.push(`${this.failed.length} failed`);
117
+ }
118
+ if (this.stopped.length > 0) {
119
+ parts.push(`${this.stopped.length} stopped`);
120
+ }
121
+ if (skipped > 0) {
122
+ parts.push(`${skipped} skipped`);
123
+ }
124
+ return `${this.tasks.length} ${this.tasks.length === 1 ? 'task' : 'tasks'}: ${parts.join(', ')}`;
125
+ }
126
+ failureBlock(task, hasOutput) {
127
+ // No exit code: `completeTasks` rebuilds `TaskResult.code` from the status,
128
+ // so every failure arrives as 1 and a task killed with 137 or a missing
129
+ // binary's 127 would all render `(exit 1)`. Printing a number that is
130
+ // always 1 to a reader whose job is to machine-read this line is worse than
131
+ // printing none. formatCommand is what every other renderer uses, so a task
132
+ // reads the same here as it does under --output-style=static.
133
+ const lines = [
134
+ `${output_1.output.colors.red('✖')} ${output_1.output.formatCommand(task.id)}`,
135
+ ];
136
+ // The log is addressed, not reproduced. `hash` is optional on the type but
137
+ // always set by the time a task has run — processTask hashes before it
138
+ // schedules — so that half only guards against printing a bogus path.
139
+ // `hasOutput` is the load-bearing half: no output, no file, no address.
140
+ if (task.hash && hasOutput) {
141
+ lines.push(output_1.output.dim(` full log: ${(0, terminal_output_path_1.terminalOutputPathForHash)(task.hash)}`));
142
+ }
143
+ return lines;
144
+ }
145
+ }
146
+ exports.SummaryTerminalOutputLifeCycle = SummaryTerminalOutputLifeCycle;
@@ -0,0 +1,17 @@
1
+ import type { TaskGraph } from '../config/task-graph';
2
+ /**
3
+ * Everything written onto a task as a run progresses: hashes and hash
4
+ * details by the hasher, timings by the orchestrator, terminal output by the
5
+ * Nx Cloud life cycle. Nothing that receives a task graph over a socket or
6
+ * a fork needs any of it. The daemon recomputes hashes, and a worker learns
7
+ * its own from `NX_TASK_HASH`; hash details are read only by Nx Cloud on the
8
+ * runner side.
9
+ */
10
+ export declare const TASK_RESULT_FIELDS: readonly ['hash', 'hashDetails', 'startTime', 'endTime', 'terminalOutput'];
11
+ /**
12
+ * A copy of the graph with `TASK_RESULT_FIELDS` removed from every task, made
13
+ * once per graph object. Structure and the remaining fields are fixed once a
14
+ * graph is built and only result fields change during a run, so the copy
15
+ * never goes stale, and the source graph is untouched.
16
+ */
17
+ export declare function pruneTaskGraph(taskGraph: TaskGraph): TaskGraph;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TASK_RESULT_FIELDS = void 0;
4
+ exports.pruneTaskGraph = pruneTaskGraph;
5
+ /**
6
+ * Everything written onto a task as a run progresses: hashes and hash
7
+ * details by the hasher, timings by the orchestrator, terminal output by the
8
+ * Nx Cloud life cycle. Nothing that receives a task graph over a socket or
9
+ * a fork needs any of it. The daemon recomputes hashes, and a worker learns
10
+ * its own from `NX_TASK_HASH`; hash details are read only by Nx Cloud on the
11
+ * runner side.
12
+ */
13
+ exports.TASK_RESULT_FIELDS = [
14
+ 'hash',
15
+ 'hashDetails',
16
+ 'startTime',
17
+ 'endTime',
18
+ 'terminalOutput',
19
+ ];
20
+ const prunedGraphs = new WeakMap();
21
+ /**
22
+ * A copy of the graph with `TASK_RESULT_FIELDS` removed from every task, made
23
+ * once per graph object. Structure and the remaining fields are fixed once a
24
+ * graph is built and only result fields change during a run, so the copy
25
+ * never goes stale, and the source graph is untouched.
26
+ */
27
+ function pruneTaskGraph(taskGraph) {
28
+ let pruned = prunedGraphs.get(taskGraph);
29
+ if (pruned)
30
+ return pruned;
31
+ const tasks = {};
32
+ for (const id in taskGraph.tasks) {
33
+ const task = taskGraph.tasks[id];
34
+ const copy = {};
35
+ for (const key in task) {
36
+ if (!exports.TASK_RESULT_FIELDS.includes(key)) {
37
+ copy[key] = task[key];
38
+ }
39
+ }
40
+ tasks[id] = copy;
41
+ }
42
+ pruned = { ...taskGraph, tasks };
43
+ prunedGraphs.set(taskGraph, pruned);
44
+ return pruned;
45
+ }
@@ -1,17 +1,42 @@
1
- import { NxJsonConfiguration } from '../config/nx-json';
2
- import { ProjectGraph, ProjectGraphProjectNode } from '../config/project-graph';
1
+ import { NxJsonConfiguration, TargetDependencies } from '../config/nx-json';
2
+ import { ProjectGraph } from '../config/project-graph';
3
3
  import { Task, TaskGraph } from '../config/task-graph';
4
4
  import { TargetDependencyConfig } from '../config/workspace-json-project-json';
5
5
  import { NxArgs } from '../utils/command-line-utils';
6
+ import { type UltracacheConfigurationOutcome } from '../ultracache/store';
7
+ import type { TaskPlanningContext } from '../hasher/task-planning-context';
8
+ /** What a command runs. */
9
+ export interface TaskSelection {
10
+ taskGraph: TaskGraph;
11
+ /**
12
+ * The tasks the command asked for, as opposed to ones pulled in as
13
+ * dependencies. A graph rebuilt after a sync is built from their projects.
14
+ */
15
+ initiatingTaskIds: string[];
16
+ /**
17
+ * What a rebuilt graph is pruned to: the selected tasks and everything they
18
+ * depend on. Unset keeps the whole rebuilt graph.
19
+ */
20
+ taskIds?: string[];
21
+ /** The planner selection used. It remembers those plans, so hashing the run reuses them. */
22
+ planningContext?: TaskPlanningContext;
23
+ /** The Ultracache configurations selection planned with; the run hashes with the same ones. */
24
+ ultracacheConfigurationOutcome?: UltracacheConfigurationOutcome | null;
25
+ }
6
26
  import { LifeCycle, TaskResult, TaskResults } from './life-cycle';
7
27
  import { TasksRunner } from './tasks-runner';
8
- export declare function runCommand(projectsToRun: ProjectGraphProjectNode[], currentProjectGraph: ProjectGraph, { nxJson }: {
28
+ /**
29
+ * `targets` on whole projects, as `run-many` runs them: every task of the
30
+ * projects' targets and what they depend on, with those tasks initiating.
31
+ */
32
+ export declare function selectTasksForProjects(projectGraph: ProjectGraph, projectNames: string[], nxArgs: NxArgs, overrides: any, extraTargetDependencies: TargetDependencies, excludeTaskDependencies: boolean): TaskSelection;
33
+ export declare function runCommand(taskSelection: TaskSelection, currentProjectGraph: ProjectGraph, { nxJson }: {
9
34
  nxJson: NxJsonConfiguration;
10
35
  }, nxArgs: NxArgs, overrides: any, initiatingProject: string | null, extraTargetDependencies: Record<string, (TargetDependencyConfig | string)[]>, extraOptions: {
11
36
  excludeTaskDependencies: boolean;
12
37
  loadDotEnvFiles: boolean;
13
38
  }): Promise<NodeJS.Process['exitCode']>;
14
- export declare function runCommandForTasks(projectsToRun: ProjectGraphProjectNode[], currentProjectGraph: ProjectGraph, { nxJson }: {
39
+ export declare function runTasksForCommand(taskSelection: TaskSelection, currentProjectGraph: ProjectGraph, { nxJson }: {
15
40
  nxJson: NxJsonConfiguration;
16
41
  }, nxArgs: NxArgs, overrides: any, initiatingProject: string | null, extraTargetDependencies: Record<string, (TargetDependencyConfig | string)[]>, extraOptions: {
17
42
  excludeTaskDependencies: boolean;
@@ -21,7 +46,7 @@ export declare function runCommandForTasks(projectsToRun: ProjectGraphProjectNod
21
46
  completed: boolean;
22
47
  }>;
23
48
  export declare function setEnvVarsBasedOnArgs(nxArgs: NxArgs, loadDotEnvFiles: boolean): void;
24
- export declare function invokeTasksRunner({ tasks, projectGraph, taskGraph, lifeCycle, nxJson, nxArgs, loadDotEnvFiles, initiatingProject, initiatingTasks, }: {
49
+ export declare function invokeTasksRunner({ tasks, projectGraph, taskGraph, lifeCycle, nxJson, nxArgs, loadDotEnvFiles, initiatingProject, initiatingTasks, planningContext, ultracacheConfigurationOutcome: loadedUltracacheConfigurationOutcome, }: {
25
50
  tasks: Task[];
26
51
  projectGraph: ProjectGraph;
27
52
  taskGraph: TaskGraph;
@@ -31,10 +56,21 @@ export declare function invokeTasksRunner({ tasks, projectGraph, taskGraph, life
31
56
  loadDotEnvFiles: boolean;
32
57
  initiatingProject: string | null;
33
58
  initiatingTasks: Task[];
59
+ planningContext?: TaskPlanningContext;
60
+ /** Already loaded for this command; `undefined` loads it here. */
61
+ ultracacheConfigurationOutcome?: UltracacheConfigurationOutcome | null;
34
62
  }): Promise<{
35
63
  [id: string]: TaskResult;
36
64
  }>;
37
65
  export declare function constructLifeCycles(lifeCycle: LifeCycle, taskGraph: TaskGraph, nxJson?: NxJsonConfiguration, skipNxCache?: boolean): LifeCycle[];
66
+ /**
67
+ * What affected task selection reads from the runner options, so it plans as
68
+ * the run hashes. The Ultracache configurations are loaded once, for selection and the run.
69
+ */
70
+ export declare function runnerInputsForSelection(nxArgs: NxArgs, nxJson: NxJsonConfiguration): Promise<{
71
+ ultracacheConfigurationOutcome: UltracacheConfigurationOutcome | null;
72
+ selectivelyHashTsConfig: boolean;
73
+ }>;
38
74
  export declare function getRunner(nxArgs: NxArgs, nxJson: NxJsonConfiguration): {
39
75
  tasksRunner: TasksRunner;
40
76
  runnerOptions: any;
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectTasksForProjects = selectTasksForProjects;
3
4
  exports.runCommand = runCommand;
4
- exports.runCommandForTasks = runCommandForTasks;
5
+ exports.runTasksForCommand = runTasksForCommand;
5
6
  exports.setEnvVarsBasedOnArgs = setEnvVarsBasedOnArgs;
6
7
  exports.invokeTasksRunner = invokeTasksRunner;
7
8
  exports.constructLifeCycles = constructLifeCycles;
9
+ exports.runnerInputsForSelection = runnerInputsForSelection;
8
10
  exports.getRunner = getRunner;
9
11
  exports.getRunnerOptions = getRunnerOptions;
10
12
  const tslib_1 = require("tslib");
@@ -23,6 +25,9 @@ const is_ci_1 = require("../utils/is-ci");
23
25
  const nx_cloud_utils_1 = require("../utils/nx-cloud-utils");
24
26
  const update_manager_1 = require("../nx-cloud/update-manager");
25
27
  const logger_1 = require("../utils/logger");
28
+ const overrides_1 = require("../ultracache/overrides");
29
+ const report_1 = require("../ultracache/report");
30
+ const store_1 = require("../ultracache/store");
26
31
  const nx_key_1 = require("../utils/nx-key");
27
32
  const output_1 = require("../utils/output");
28
33
  const configure_ai_agents_disclaimer_1 = require("../ai/configure-ai-agents-disclaimer");
@@ -35,6 +40,7 @@ const dynamic_run_many_terminal_output_life_cycle_1 = require("./life-cycles/dyn
35
40
  const dynamic_run_one_terminal_output_life_cycle_1 = require("./life-cycles/dynamic-run-one-terminal-output-life-cycle");
36
41
  const static_run_many_terminal_output_life_cycle_1 = require("./life-cycles/static-run-many-terminal-output-life-cycle");
37
42
  const static_run_one_terminal_output_life_cycle_1 = require("./life-cycles/static-run-one-terminal-output-life-cycle");
43
+ const summary_terminal_output_life_cycle_1 = require("./life-cycles/summary-terminal-output-life-cycle");
38
44
  const store_run_information_life_cycle_1 = require("./life-cycles/store-run-information-life-cycle");
39
45
  const task_history_life_cycle_1 = require("./life-cycles/task-history-life-cycle");
40
46
  const task_profiling_life_cycle_1 = require("./life-cycles/task-profiling-life-cycle");
@@ -82,7 +88,7 @@ async function getTerminalOutputLifeCycle(initiatingProject, initiatingTasks, pr
82
88
  process.env.NX_TUI = 'false';
83
89
  }
84
90
  // Kick off in the background so the URL is ready by the exit report. A brief
85
- // sync preamble (git remote + axios load) runs here; the network call does not.
91
+ // sync preamble (git remote lookup) runs here; the network call does not.
86
92
  (0, performance_report_1.prefetchRemoteCacheOnboardingUrl)(nxJson);
87
93
  if ((0, is_tui_enabled_1.isTuiEnabled)()) {
88
94
  const interceptedNxCloudLogs = [];
@@ -265,8 +271,14 @@ async function getTerminalOutputLifeCycle(initiatingProject, initiatingTasks, pr
265
271
  renderIsDone,
266
272
  };
267
273
  }
274
+ if (nxArgs.resolvedOutputStyle === 'summary') {
275
+ return {
276
+ lifeCycle: new summary_terminal_output_life_cycle_1.SummaryTerminalOutputLifeCycle(tasks),
277
+ renderIsDone: Promise.resolve(),
278
+ };
279
+ }
268
280
  const { runnerOptions } = getRunner(nxArgs, nxJson);
269
- const useDynamicOutput = shouldUseDynamicLifeCycle(tasks, runnerOptions, nxArgs.outputStyle);
281
+ const useDynamicOutput = shouldUseDynamicLifeCycle(tasks, runnerOptions, nxArgs.specifiedOutputStyle);
270
282
  if (isRunOne) {
271
283
  if (useDynamicOutput) {
272
284
  return await (0, dynamic_run_one_terminal_output_life_cycle_1.createRunOneDynamicOutputRenderer)({
@@ -298,8 +310,22 @@ async function getTerminalOutputLifeCycle(initiatingProject, initiatingTasks, pr
298
310
  }
299
311
  }
300
312
  }
301
- function createTaskGraphAndRunValidations(projectGraph, extraTargetDependencies, projectNames, nxArgs, overrides, extraOptions) {
302
- const taskGraph = (0, create_task_graph_1.createTaskGraph)(projectGraph, extraTargetDependencies, projectNames, nxArgs.targets, nxArgs.configuration, overrides, extraOptions.excludeTaskDependencies);
313
+ /**
314
+ * `targets` on whole projects, as `run-many` runs them: every task of the
315
+ * projects' targets and what they depend on, with those tasks initiating.
316
+ */
317
+ function selectTasksForProjects(projectGraph, projectNames, nxArgs, overrides, extraTargetDependencies, excludeTaskDependencies) {
318
+ const taskGraph = (0, create_task_graph_1.createTaskGraph)(projectGraph, extraTargetDependencies, projectNames, nxArgs.targets, nxArgs.configuration, overrides, excludeTaskDependencies);
319
+ const projects = new Set(projectNames);
320
+ return {
321
+ taskGraph,
322
+ initiatingTaskIds: Object.values(taskGraph.tasks)
323
+ .filter((t) => projects.has(t.target.project) &&
324
+ nxArgs.targets.includes(t.target.target))
325
+ .map((t) => t.id),
326
+ };
327
+ }
328
+ function runValidations(projectGraph, taskGraph, nxArgs) {
303
329
  (0, task_graph_utils_1.assertTaskGraphDoesNotContainInvalidTargets)(taskGraph);
304
330
  const cycle = (0, task_graph_utils_1.findCycle)(taskGraph);
305
331
  if (cycle) {
@@ -325,7 +351,7 @@ function createTaskGraphAndRunValidations(projectGraph, extraTargetDependencies,
325
351
  }
326
352
  return taskGraph;
327
353
  }
328
- async function runCommand(projectsToRun, currentProjectGraph, { nxJson }, nxArgs, overrides, initiatingProject, extraTargetDependencies, extraOptions) {
354
+ async function runCommand(taskSelection, currentProjectGraph, { nxJson }, nxArgs, overrides, initiatingProject, extraTargetDependencies, extraOptions) {
329
355
  const status = await (0, handle_errors_1.handleErrors)(process.env.NX_VERBOSE_LOGGING === 'true', async () => {
330
356
  const id = (0, native_1.hashArray)([...process.argv, Date.now().toString()]);
331
357
  await (0, tasks_execution_hooks_1.runPreTasksExecution)({
@@ -335,7 +361,7 @@ async function runCommand(projectsToRun, currentProjectGraph, { nxJson }, nxArgs
335
361
  argv: process.argv,
336
362
  });
337
363
  const startTime = Date.now();
338
- const { taskResults, completed } = await runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }, {
364
+ const { taskResults, completed } = await runTasksForCommand(taskSelection, currentProjectGraph, { nxJson }, {
339
365
  ...nxArgs,
340
366
  skipNxCache: nxArgs.skipNxCache ||
341
367
  process.env.NX_SKIP_NX_CACHE === 'true' ||
@@ -361,17 +387,20 @@ async function runCommand(projectsToRun, currentProjectGraph, { nxJson }, nxArgs
361
387
  });
362
388
  return status;
363
389
  }
364
- async function runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }, nxArgs, overrides, initiatingProject, extraTargetDependencies, extraOptions) {
390
+ async function runTasksForCommand(taskSelection, currentProjectGraph, { nxJson }, nxArgs, overrides, initiatingProject, extraTargetDependencies, extraOptions) {
365
391
  // Kick off the license lookup in the background so it overlaps with task
366
392
  // execution. The log itself is deferred to the print site below so it
367
393
  // never lands in the middle of task output.
368
394
  const nxKeyPromise = (0, nx_key_1.getNxKeyInformation)().catch(() => null);
369
- const projectNames = projectsToRun.map((t) => t.name);
370
- const projectNameSet = new Set(projectNames);
371
- const { projectGraph, taskGraph } = await ensureWorkspaceIsInSyncAndGetGraphs(currentProjectGraph, nxJson, projectNames, nxArgs, overrides, extraTargetDependencies, extraOptions);
395
+ const { projectGraph, taskGraph } = await ensureWorkspaceIsInSyncAndGetGraphs(currentProjectGraph, nxJson, nxArgs, overrides, extraTargetDependencies, extraOptions, taskSelection);
372
396
  const tasks = Object.values(taskGraph.tasks);
373
- const initiatingTasks = tasks.filter((t) => projectNameSet.has(t.target.project) &&
374
- nxArgs.targets.includes(t.target.target));
397
+ // A sync generator can remove a selected task, so absent ids are skipped.
398
+ const initiatingTasks = taskSelection.initiatingTaskIds
399
+ .map((id) => taskGraph.tasks[id])
400
+ .filter(Boolean);
401
+ const projectNames = [
402
+ ...new Set(initiatingTasks.map((t) => t.target.project)),
403
+ ];
375
404
  const { lifeCycle, renderIsDone, printSummary, restoreTerminal } = await getTerminalOutputLifeCycle(initiatingProject, initiatingTasks, projectNames, tasks, taskGraph, nxArgs, nxJson, overrides);
376
405
  try {
377
406
  const taskResults = await invokeTasksRunner({
@@ -384,6 +413,8 @@ async function runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }
384
413
  loadDotEnvFiles: extraOptions.loadDotEnvFiles,
385
414
  initiatingProject,
386
415
  initiatingTasks,
416
+ planningContext: taskSelection.planningContext,
417
+ ultracacheConfigurationOutcome: taskSelection.ultracacheConfigurationOutcome,
387
418
  });
388
419
  await renderIsDone.finally(() => restoreTerminal?.());
389
420
  if (printSummary) {
@@ -411,6 +442,9 @@ async function runCommandForTasks(projectsToRun, currentProjectGraph, { nxJson }
411
442
  }
412
443
  async function printConfigureAiAgentsDisclaimer() {
413
444
  try {
445
+ if ((0, is_ci_1.isCI)()) {
446
+ return;
447
+ }
414
448
  if (!client_1.daemonClient.enabled() || !(await client_1.daemonClient.isServerAvailable())) {
415
449
  return;
416
450
  }
@@ -437,8 +471,8 @@ function didCommandComplete(tasks, taskResults) {
437
471
  // Any stopped task means the run was interrupted
438
472
  return !Object.values(taskResults).some((r) => r.status === 'stopped');
439
473
  }
440
- async function ensureWorkspaceIsInSyncAndGetGraphs(projectGraph, nxJson, projectNames, nxArgs, overrides, extraTargetDependencies, extraOptions) {
441
- let taskGraph = createTaskGraphAndRunValidations(projectGraph, extraTargetDependencies ?? {}, projectNames, nxArgs, overrides, extraOptions);
474
+ async function ensureWorkspaceIsInSyncAndGetGraphs(projectGraph, nxJson, nxArgs, overrides, extraTargetDependencies, extraOptions, taskSelection) {
475
+ let taskGraph = runValidations(projectGraph, taskSelection.taskGraph, nxArgs);
442
476
  if (nxArgs.skipSync || (0, is_ci_1.isCI)()) {
443
477
  return { projectGraph, taskGraph };
444
478
  }
@@ -553,9 +587,21 @@ async function ensureWorkspaceIsInSyncAndGetGraphs(projectGraph, nxJson, project
553
587
  });
554
588
  await confirmRunningTasksWithSyncFailures();
555
589
  }
556
- // Re-create project graph and task graph
590
+ // Rebuild rather than carry: a sync generator may remove tasks or move inferred
591
+ // outputs, so the old graph and planning context are stale.
592
+ taskSelection.planningContext = undefined;
593
+ const projectNames = [
594
+ ...new Set(taskSelection.initiatingTaskIds
595
+ .filter((id) => taskGraph.tasks[id])
596
+ .map((id) => taskGraph.tasks[id].target.project)),
597
+ ];
557
598
  projectGraph = await (0, project_graph_1.createProjectGraphAsync)();
558
- taskGraph = createTaskGraphAndRunValidations(projectGraph, extraTargetDependencies ?? {}, projectNames, nxArgs, overrides, extraOptions);
599
+ const rebuilt = selectTasksForProjects(projectGraph, projectNames, nxArgs, overrides, extraTargetDependencies ?? {}, extraOptions.excludeTaskDependencies).taskGraph;
600
+ taskGraph = runValidations(projectGraph,
601
+ // Before validation, so a cycle or atomizer error names what will actually run.
602
+ taskSelection.taskIds
603
+ ? (0, utils_1.pruneToSelectedTasks)(rebuilt, taskSelection.taskIds)
604
+ : rebuilt, nxArgs);
559
605
  const successTitle = anySyncGeneratorsFailed
560
606
  ? // the identified changes were synced successfully, but the workspace
561
607
  // is still not up to date, which we'll mention next
@@ -641,12 +687,12 @@ function setEnvVarsBasedOnArgs(nxArgs, loadDotEnvFiles) {
641
687
  // grouping applies, let it win over the implicit request; an output style the
642
688
  // user asked for explicitly still wins over grouping.
643
689
  const batchMode = process.env.NX_BATCH_MODE === 'true' || nxArgs.batch;
644
- if (nxArgs.outputStyle == 'stream' ||
690
+ if (nxArgs.specifiedOutputStyle == 'stream' ||
645
691
  (batchMode && !(0, output_1.isLogGroupingEnabled)())) {
646
692
  process.env.NX_STREAM_OUTPUT = 'true';
647
693
  process.env.NX_PREFIX_OUTPUT = 'true';
648
694
  }
649
- if (nxArgs.outputStyle == 'stream-without-prefixes') {
695
+ if (nxArgs.specifiedOutputStyle == 'stream-without-prefixes') {
650
696
  process.env.NX_STREAM_OUTPUT = 'true';
651
697
  process.env.NX_PREFIX_OUTPUT = 'false';
652
698
  }
@@ -659,16 +705,22 @@ function setEnvVarsBasedOnArgs(nxArgs, loadDotEnvFiles) {
659
705
  process.env.NX_LOAD_DOT_ENV_FILES = 'true';
660
706
  }
661
707
  }
662
- async function invokeTasksRunner({ tasks, projectGraph, taskGraph, lifeCycle, nxJson, nxArgs, loadDotEnvFiles, initiatingProject, initiatingTasks, }) {
708
+ async function invokeTasksRunner({ tasks, projectGraph, taskGraph, lifeCycle, nxJson, nxArgs, loadDotEnvFiles, initiatingProject, initiatingTasks, planningContext, ultracacheConfigurationOutcome: loadedUltracacheConfigurationOutcome, }) {
663
709
  setEnvVarsBasedOnArgs(nxArgs, loadDotEnvFiles);
664
710
  // this needs to be done before we start to run the tasks
665
711
  const taskDetails = (0, hash_task_1.getTaskDetails)();
666
712
  const { tasksRunner, runnerOptions } = getRunner(nxArgs, nxJson);
667
- let hasher = (0, create_task_hasher_1.createTaskHasher)(projectGraph, nxJson, runnerOptions);
713
+ // Must precede hashing: the Ultracache configurations are a source for task hashes.
714
+ const ultracacheConfigurationOutcome = loadedUltracacheConfigurationOutcome !== undefined
715
+ ? loadedUltracacheConfigurationOutcome
716
+ : await (0, store_1.loadUltracacheConfigurationsForRun)(nxJson, runnerOptions);
717
+ const ultracacheConfigurations = (0, store_1.configurationsOf)(ultracacheConfigurationOutcome);
718
+ let hasher = (0, create_task_hasher_1.createTaskHasher)(projectGraph, nxJson, runnerOptions, ultracacheConfigurations, planningContext);
668
719
  // this is used for two reasons: to fetch all remote cache hits AND
669
720
  // to submit everything that is known in advance to Nx Cloud to run in
670
721
  // a distributed fashion
671
- await (0, hash_task_1.hashTasksThatDoNotDependOnOutputsOfOtherTasks)(hasher, projectGraph, taskGraph, nxJson, taskDetails);
722
+ const deferredTaskIds = await (0, hash_task_1.hashTasksThatDoNotDependOnOutputsOfOtherTasks)(hasher, projectGraph, taskGraph, nxJson, taskDetails, ultracacheConfigurations);
723
+ reportUltracacheConfigurations(ultracacheConfigurationOutcome, projectGraph, taskGraph, nxArgs);
672
724
  const taskResultsLifecycle = new task_results_life_cycle_1.TaskResultsLifeCycle();
673
725
  const compositedLifeCycle = new life_cycle_1.CompositeLifeCycle([
674
726
  ...constructLifeCycles(lifeCycle, taskGraph, nxJson, nxArgs.skipNxCache),
@@ -733,8 +785,12 @@ async function invokeTasksRunner({ tasks, projectGraph, taskGraph, lifeCycle, nx
733
785
  // per-task-env shape and normalizes internally.
734
786
  return hasher.hashTasks(tasks, taskGraph_, envOrPerTaskEnvs);
735
787
  },
788
+ hashTasksUpfront(tasks, taskGraph_, perTaskEnvs) {
789
+ return hasher.hashTasksUpfront(tasks, taskGraph_, perTaskEnvs);
790
+ },
736
791
  },
737
792
  daemon: client_1.daemonClient,
793
+ deferredTaskIds,
738
794
  });
739
795
  if (promiseOrObservable.subscribe) {
740
796
  promiseOrObservable = convertObservableToPromise(promiseOrObservable);
@@ -789,6 +845,7 @@ function shouldUseDynamicLifeCycle(tasks, options, outputStyle) {
789
845
  if ((0, is_ci_1.isCI)())
790
846
  return false;
791
847
  if ((0, output_1.isStaticOutputStyle)(outputStyle) ||
848
+ outputStyle === 'summary' ||
792
849
  outputStyle === 'stream' ||
793
850
  outputStyle === 'stream-without-prefixes')
794
851
  return false;
@@ -811,6 +868,25 @@ function loadTasksRunner(modulePath) {
811
868
  throw e;
812
869
  }
813
870
  }
871
+ function reportUltracacheConfigurations(outcome, projectGraph, taskGraph, nxArgs) {
872
+ if (!outcome || outcome.status === 'skipped')
873
+ return;
874
+ if (!nxArgs.verbose && process.env.NX_VERBOSE_LOGGING !== 'true')
875
+ return;
876
+ const summary = (0, report_1.formatUltracacheSummary)((0, overrides_1.buildUltracacheOverrides)(projectGraph, taskGraph, outcome.configurations), outcome.status);
877
+ output_1.output.note({ title: summary.line, bodyLines: summary.bodyLines });
878
+ }
879
+ /**
880
+ * What affected task selection reads from the runner options, so it plans as
881
+ * the run hashes. The Ultracache configurations are loaded once, for selection and the run.
882
+ */
883
+ async function runnerInputsForSelection(nxArgs, nxJson) {
884
+ const { runnerOptions } = getRunner(nxArgs, nxJson);
885
+ return {
886
+ ultracacheConfigurationOutcome: await (0, store_1.loadUltracacheConfigurationsForRun)(nxJson, runnerOptions),
887
+ selectivelyHashTsConfig: runnerOptions?.selectivelyHashTsConfig ?? false,
888
+ };
889
+ }
814
890
  function getRunner(nxArgs, nxJson) {
815
891
  let runner = nxArgs.runner;
816
892
  runner = runner ?? 'default';