@ohos-npm-ports/nx 23.1.1-beta.1 → 24.0.3-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (706) hide show
  1. package/README.md +6 -9
  2. package/dist/bin/init-local.js +10 -6
  3. package/dist/bin/nx-cloud.js +9 -0
  4. package/dist/bin/nx.js +1 -0
  5. package/dist/bin/post-install.js +5 -3
  6. package/dist/nx-cloud-internals.d.ts +2 -0
  7. package/dist/nx-cloud-internals.js +15 -0
  8. package/dist/plugins/package-json.js +1 -1
  9. package/dist/release/changelog-renderer/index.d.ts +4 -0
  10. package/dist/release/changelog-renderer/index.js +21 -6
  11. package/dist/release/index.d.ts +1 -1
  12. package/dist/src/adapter/ngcli-adapter.js +62 -3
  13. package/dist/src/ai/clone-ai-config-repo.js +49 -12
  14. package/dist/src/ai/constants.d.ts +15 -0
  15. package/dist/src/ai/constants.js +17 -1
  16. package/dist/src/ai/set-up-ai-agents/set-up-ai-agents.js +69 -10
  17. package/dist/src/ai/utils.d.ts +13 -0
  18. package/dist/src/ai/utils.js +29 -0
  19. package/dist/src/analytics/analytics.js +2 -4
  20. package/dist/src/command-line/add/add.d.ts +2 -0
  21. package/dist/src/command-line/add/add.js +30 -3
  22. package/dist/src/command-line/affected/affected.js +71 -9
  23. package/dist/src/command-line/affected/command-object.js +1 -1
  24. package/dist/src/command-line/completion/command-object.js +7 -12
  25. package/dist/src/command-line/configure-ai-agents/configure-ai-agents.js +40 -41
  26. package/dist/src/command-line/format/format.js +67 -100
  27. package/dist/src/command-line/generate/generate.js +35 -35
  28. package/dist/src/command-line/graph/graph.d.ts +31 -0
  29. package/dist/src/command-line/graph/graph.js +150 -29
  30. package/dist/src/command-line/import/import.js +30 -40
  31. package/dist/src/command-line/init/ai-agent-prompts.js +5 -11
  32. package/dist/src/command-line/init/command-object.js +0 -10
  33. package/dist/src/command-line/init/configure-plugins.js +4 -1
  34. package/dist/src/command-line/init/implementation/add-nx-to-monorepo.js +12 -35
  35. package/dist/src/command-line/init/implementation/add-nx-to-nest.js +38 -86
  36. package/dist/src/command-line/init/implementation/add-nx-to-npm-repo.js +8 -24
  37. package/dist/src/command-line/init/implementation/add-nx-to-turborepo.js +3 -17
  38. package/dist/src/command-line/init/implementation/angular/index.js +10 -18
  39. package/dist/src/command-line/init/implementation/angular/legacy-angular-versions.js +2 -3
  40. package/dist/src/command-line/init/implementation/angular/standalone-workspace.js +8 -2
  41. package/dist/src/command-line/init/implementation/check-compatible-with-plugins.js +2 -0
  42. package/dist/src/command-line/init/implementation/dot-nx/add-nx-scripts.js +5 -0
  43. package/dist/src/command-line/init/implementation/format.d.ts +18 -0
  44. package/dist/src/command-line/init/implementation/format.js +113 -0
  45. package/dist/src/command-line/init/implementation/utils.d.ts +0 -1
  46. package/dist/src/command-line/init/implementation/utils.js +13 -16
  47. package/dist/src/command-line/init/init-v1.js +15 -18
  48. package/dist/src/command-line/init/init-v2.js +81 -76
  49. package/dist/src/command-line/migrate/agentic/capture-generator-output.d.ts +25 -0
  50. package/dist/src/command-line/migrate/agentic/capture-generator-output.js +121 -5
  51. package/dist/src/command-line/migrate/agentic/close-agent-session.d.ts +21 -0
  52. package/dist/src/command-line/migrate/agentic/close-agent-session.js +127 -0
  53. package/dist/src/command-line/migrate/agentic/definitions.d.ts +25 -3
  54. package/dist/src/command-line/migrate/agentic/definitions.js +56 -62
  55. package/dist/src/command-line/migrate/agentic/format-command.d.ts +14 -0
  56. package/dist/src/command-line/migrate/agentic/format-command.js +44 -0
  57. package/dist/src/command-line/migrate/agentic/handoff-gitignore.d.ts +7 -30
  58. package/dist/src/command-line/migrate/agentic/handoff-gitignore.js +11 -62
  59. package/dist/src/command-line/migrate/agentic/handoff.d.ts +38 -47
  60. package/dist/src/command-line/migrate/agentic/handoff.js +133 -104
  61. package/dist/src/command-line/migrate/agentic/instruction-files.d.ts +2 -0
  62. package/dist/src/command-line/migrate/agentic/instruction-files.js +20 -0
  63. package/dist/src/command-line/migrate/agentic/master/invocations.d.ts +12 -0
  64. package/dist/src/command-line/migrate/agentic/master/invocations.js +54 -0
  65. package/dist/src/command-line/migrate/agentic/master/run-master-session.d.ts +34 -0
  66. package/dist/src/command-line/migrate/agentic/master/run-master-session.js +214 -0
  67. package/dist/src/command-line/migrate/agentic/master/spawn-master.d.ts +32 -0
  68. package/dist/src/command-line/migrate/agentic/master/spawn-master.js +284 -0
  69. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.d.ts +7 -12
  70. package/dist/src/command-line/migrate/agentic/print-dropped-agent-context.js +7 -0
  71. package/dist/src/command-line/migrate/agentic/prompts/final-validation.d.ts +13 -0
  72. package/dist/src/command-line/migrate/agentic/prompts/final-validation.js +41 -0
  73. package/dist/src/command-line/migrate/agentic/prompts/fragments.d.ts +6 -0
  74. package/dist/src/command-line/migrate/agentic/prompts/fragments.js +81 -0
  75. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.d.ts +0 -15
  76. package/dist/src/command-line/migrate/agentic/prompts/shared-rendering.js +3 -100
  77. package/dist/src/command-line/migrate/agentic/select.d.ts +16 -2
  78. package/dist/src/command-line/migrate/agentic/select.js +63 -35
  79. package/dist/src/command-line/migrate/agentic/terminal-repair.d.ts +1 -0
  80. package/dist/src/command-line/migrate/agentic/terminal-repair.js +27 -0
  81. package/dist/src/command-line/migrate/agentic/types.d.ts +33 -47
  82. package/dist/src/command-line/migrate/agentic/types.js +36 -0
  83. package/dist/src/command-line/migrate/agentic/windows-cmd.d.ts +33 -0
  84. package/dist/src/command-line/migrate/agentic/windows-cmd.js +88 -0
  85. package/dist/src/command-line/migrate/command-object.d.ts +8 -0
  86. package/dist/src/command-line/migrate/command-object.js +27 -3
  87. package/dist/src/command-line/migrate/deferred-output.d.ts +44 -0
  88. package/dist/src/command-line/migrate/deferred-output.js +92 -0
  89. package/dist/src/command-line/migrate/execute-migration.d.ts +34 -9
  90. package/dist/src/command-line/migrate/execute-migration.js +176 -44
  91. package/dist/src/command-line/migrate/migrate-analytics.d.ts +78 -1
  92. package/dist/src/command-line/migrate/migrate-analytics.js +165 -2
  93. package/dist/src/command-line/migrate/migrate-commits.d.ts +61 -18
  94. package/dist/src/command-line/migrate/migrate-commits.js +204 -25
  95. package/dist/src/command-line/migrate/migrate-config.d.ts +16 -12
  96. package/dist/src/command-line/migrate/migrate-config.js +40 -18
  97. package/dist/src/command-line/migrate/migrate-output.d.ts +39 -10
  98. package/dist/src/command-line/migrate/migrate-output.js +45 -14
  99. package/dist/src/command-line/migrate/migrate-ui-api.d.ts +2 -1
  100. package/dist/src/command-line/migrate/migrate-ui-api.js +16 -7
  101. package/dist/src/command-line/migrate/migrate.d.ts +39 -84
  102. package/dist/src/command-line/migrate/migrate.js +1012 -464
  103. package/dist/src/command-line/migrate/migration-shape.d.ts +8 -0
  104. package/dist/src/command-line/migrate/multi-major.js +7 -10
  105. package/dist/src/command-line/migrate/prompt-files.js +2 -9
  106. package/dist/src/command-line/migrate/resolve-package-version.d.ts +2 -4
  107. package/dist/src/command-line/migrate/resolve-package-version.js +8 -62
  108. package/dist/src/command-line/migrate/run/agent-output.d.ts +33 -0
  109. package/dist/src/command-line/migrate/run/agent-output.js +93 -0
  110. package/dist/src/command-line/migrate/run/agent-work-payload.d.ts +37 -0
  111. package/dist/src/command-line/migrate/run/agent-work-payload.js +156 -0
  112. package/dist/src/command-line/migrate/run/atomic-write.d.ts +8 -0
  113. package/dist/src/command-line/migrate/run/atomic-write.js +17 -0
  114. package/dist/src/command-line/migrate/run/broker.d.ts +159 -0
  115. package/dist/src/command-line/migrate/run/broker.js +616 -0
  116. package/dist/src/command-line/migrate/run/clean-retry.d.ts +12 -0
  117. package/dist/src/command-line/migrate/run/clean-retry.js +101 -0
  118. package/dist/src/command-line/migrate/run/existing-run-report.d.ts +55 -0
  119. package/dist/src/command-line/migrate/run/existing-run-report.js +229 -0
  120. package/dist/src/command-line/migrate/run/give-up.d.ts +42 -0
  121. package/dist/src/command-line/migrate/run/give-up.js +151 -0
  122. package/dist/src/command-line/migrate/run/index.d.ts +14 -0
  123. package/dist/src/command-line/migrate/run/index.js +57 -0
  124. package/dist/src/command-line/migrate/run/issues.d.ts +127 -0
  125. package/dist/src/command-line/migrate/run/issues.js +1126 -0
  126. package/dist/src/command-line/migrate/run/orchestrator.d.ts +135 -0
  127. package/dist/src/command-line/migrate/run/orchestrator.js +2536 -0
  128. package/dist/src/command-line/migrate/run/run-id.d.ts +8 -0
  129. package/dist/src/command-line/migrate/run/run-id.js +26 -0
  130. package/dist/src/command-line/migrate/run/run-state.d.ts +233 -0
  131. package/dist/src/command-line/migrate/run/run-state.js +708 -0
  132. package/dist/src/command-line/migrate/run/runbook.d.ts +19 -0
  133. package/dist/src/command-line/migrate/run/runbook.js +215 -0
  134. package/dist/src/command-line/migrate/run/state-lock.d.ts +81 -0
  135. package/dist/src/command-line/migrate/run/state-lock.js +294 -0
  136. package/dist/src/command-line/migrate/run/state-machine.d.ts +133 -0
  137. package/dist/src/command-line/migrate/run/state-machine.js +631 -0
  138. package/dist/src/command-line/migrate/run/util.d.ts +66 -0
  139. package/dist/src/command-line/migrate/run/util.js +196 -0
  140. package/dist/src/command-line/migrate/run/worker.d.ts +16 -0
  141. package/dist/src/command-line/migrate/run/worker.js +845 -0
  142. package/dist/src/command-line/migrate/run-migration-process.js +6 -5
  143. package/dist/src/command-line/migrate/safe-prompt.d.ts +14 -26
  144. package/dist/src/command-line/migrate/safe-prompt.js +32 -43
  145. package/dist/src/command-line/migrate/sort-migrations.d.ts +10 -0
  146. package/dist/src/command-line/migrate/sort-migrations.js +21 -0
  147. package/dist/src/command-line/migrate/step-actions.d.ts +5 -0
  148. package/dist/src/command-line/migrate/step-actions.js +18 -0
  149. package/dist/src/command-line/migrate/text.d.ts +24 -0
  150. package/dist/src/command-line/migrate/text.js +51 -0
  151. package/dist/src/command-line/migrate/version-skew-guard.d.ts +60 -0
  152. package/dist/src/command-line/migrate/version-skew-guard.js +177 -0
  153. package/dist/src/command-line/migrate/workspace-installation.d.ts +15 -0
  154. package/dist/src/command-line/migrate/workspace-installation.js +73 -0
  155. package/dist/src/command-line/nx-cloud/complete-run/command-object.js +1 -1
  156. package/dist/src/command-line/nx-cloud/connect/connect-to-nx-cloud.js +37 -42
  157. package/dist/src/command-line/nx-cloud/fix-ci/command-object.js +1 -1
  158. package/dist/src/command-line/nx-cloud/logout/command-object.js +11 -2
  159. package/dist/src/command-line/nx-cloud/record/command-object.js +1 -1
  160. package/dist/src/command-line/nx-cloud/start-ci-run/command-object.js +1 -1
  161. package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.d.ts +2 -0
  162. package/dist/src/command-line/nx-cloud/start-nx-agents/command-object.js +16 -0
  163. package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.d.ts +4 -0
  164. package/dist/src/command-line/nx-cloud/start-nx-agents/start-nx-agents.js +13 -0
  165. package/dist/src/command-line/nx-commands.js +26 -24
  166. package/dist/src/command-line/release/changelog.js +29 -26
  167. package/dist/src/command-line/release/config/config.d.ts +1 -0
  168. package/dist/src/command-line/release/config/config.js +48 -9
  169. package/dist/src/command-line/release/index.d.ts +1 -1
  170. package/dist/src/command-line/release/plan.js +15 -28
  171. package/dist/src/command-line/release/publish.js +11 -3
  172. package/dist/src/command-line/release/release.js +8 -19
  173. package/dist/src/command-line/release/utils/get-touched-projects-for-group.js +3 -3
  174. package/dist/src/command-line/release/utils/git.js +9 -8
  175. package/dist/src/command-line/release/utils/interpolate-release-config.d.ts +6 -0
  176. package/dist/src/command-line/release/utils/interpolate-release-config.js +39 -0
  177. package/dist/src/command-line/release/utils/release-graph.d.ts +23 -0
  178. package/dist/src/command-line/release/utils/release-graph.js +82 -21
  179. package/dist/src/command-line/release/utils/remote-release-clients/github.js +26 -36
  180. package/dist/src/command-line/release/utils/remote-release-clients/gitlab.js +21 -31
  181. package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.d.ts +4 -2
  182. package/dist/src/command-line/release/utils/remote-release-clients/remote-release-client.js +37 -3
  183. package/dist/src/command-line/release/utils/resolve-changelog-renderer.js +2 -2
  184. package/dist/src/command-line/release/utils/resolve-semver-specifier.js +19 -41
  185. package/dist/src/command-line/release/utils/shared.js +10 -10
  186. package/dist/src/command-line/release/utils/version-plan-utils.d.ts +3 -12
  187. package/dist/src/command-line/release/utils/version-plan-utils.js +33 -55
  188. package/dist/src/command-line/release/version/release-group-processor.d.ts +24 -0
  189. package/dist/src/command-line/release/version/release-group-processor.js +80 -6
  190. package/dist/src/command-line/release/version/resolve-current-version.js +7 -10
  191. package/dist/src/command-line/release/version/version-actions.d.ts +30 -2
  192. package/dist/src/command-line/release/version/version-actions.js +13 -3
  193. package/dist/src/command-line/release/version.js +15 -8
  194. package/dist/src/command-line/report/report.d.ts +2 -0
  195. package/dist/src/command-line/report/report.js +28 -1
  196. package/dist/src/command-line/reset/reset.js +87 -80
  197. package/dist/src/command-line/run/executor-utils.js +1 -0
  198. package/dist/src/command-line/run/run-one.d.ts +20 -1
  199. package/dist/src/command-line/run/run-one.js +159 -6
  200. package/dist/src/command-line/run/run.js +2 -1
  201. package/dist/src/command-line/run-many/run-many.js +7 -12
  202. package/dist/src/command-line/show/command-object.js +1 -1
  203. package/dist/src/command-line/show/projects.js +54 -1
  204. package/dist/src/command-line/show/show-target/info.d.ts +11 -2
  205. package/dist/src/command-line/show/show-target/info.js +100 -15
  206. package/dist/src/command-line/show/show-target/inputs.js +10 -2
  207. package/dist/src/command-line/show/show-target/utils.js +1 -0
  208. package/dist/src/command-line/watch/command-object.js +3 -22
  209. package/dist/src/command-line/watch/watch.d.ts +0 -7
  210. package/dist/src/command-line/watch/watch.js +14 -1
  211. package/dist/src/command-line/yargs-utils/shared-options.d.ts +5 -1
  212. package/dist/src/command-line/yargs-utils/shared-options.js +40 -4
  213. package/dist/src/config/misc-interfaces.d.ts +37 -7
  214. package/dist/src/config/nx-json.d.ts +22 -11
  215. package/dist/src/config/task-graph.d.ts +1 -1
  216. package/dist/src/config/workspace-json-project-json.d.ts +111 -1
  217. package/dist/src/core/graph/favicon.ico +0 -0
  218. package/dist/src/core/graph/main.js +1 -1
  219. package/dist/src/core/graph/runtime.js +1 -1
  220. package/dist/src/core/graph/styles.css +1 -1
  221. package/dist/src/core/graph/styles.js +1 -1
  222. package/dist/src/daemon/client/client.d.ts +76 -9
  223. package/dist/src/daemon/client/client.js +455 -107
  224. package/dist/src/daemon/client/daemon-environment.d.ts +62 -0
  225. package/dist/src/daemon/client/daemon-environment.js +257 -5
  226. package/dist/src/daemon/client/daemon-socket-messenger.d.ts +2 -2
  227. package/dist/src/daemon/client/daemon-socket-messenger.js +14 -5
  228. package/dist/src/daemon/is-v8-serializer-enabled.d.ts +2 -2
  229. package/dist/src/daemon/is-v8-serializer-enabled.js +2 -2
  230. package/dist/src/daemon/message-types/daemon-message.d.ts +33 -0
  231. package/dist/src/daemon/message-types/daemon-message.js +48 -0
  232. package/dist/src/daemon/message-types/get-plugin-capabilities.d.ts +5 -0
  233. package/dist/src/daemon/message-types/get-plugin-capabilities.js +11 -0
  234. package/dist/src/daemon/message-types/run-tasks-execution-hooks.d.ts +3 -2
  235. package/dist/src/daemon/message-types/select-affected-tasks.d.ts +21 -0
  236. package/dist/src/daemon/message-types/select-affected-tasks.js +11 -0
  237. package/dist/src/daemon/message-types/ultracache-configuration-version.d.ts +8 -0
  238. package/dist/src/daemon/message-types/ultracache-configuration-version.js +2 -0
  239. package/dist/src/daemon/sandbox-socket-hint.d.ts +27 -0
  240. package/dist/src/daemon/sandbox-socket-hint.js +136 -0
  241. package/dist/src/daemon/server/client-socket-context.d.ts +1 -1
  242. package/dist/src/daemon/server/client-socket-context.js +2 -3
  243. package/dist/src/daemon/server/dotenv-graph-changes.d.ts +97 -0
  244. package/dist/src/daemon/server/dotenv-graph-changes.js +284 -0
  245. package/dist/src/daemon/server/file-watching/file-watcher-sockets.d.ts +5 -0
  246. package/dist/src/daemon/server/file-watching/file-watcher-sockets.js +16 -0
  247. package/dist/src/daemon/server/handle-client-env.d.ts +8 -0
  248. package/dist/src/daemon/server/handle-client-env.js +113 -0
  249. package/dist/src/daemon/server/handle-get-plugin-capabilities.d.ts +2 -0
  250. package/dist/src/daemon/server/handle-get-plugin-capabilities.js +13 -0
  251. package/dist/src/daemon/server/handle-hash-tasks.d.ts +10 -2
  252. package/dist/src/daemon/server/handle-hash-tasks.js +18 -3
  253. package/dist/src/daemon/server/handle-process-in-background.js +21 -9
  254. package/dist/src/daemon/server/handle-select-affected-tasks.d.ts +4 -0
  255. package/dist/src/daemon/server/handle-select-affected-tasks.js +34 -0
  256. package/dist/src/daemon/server/handle-tasks-execution-hooks.d.ts +3 -2
  257. package/dist/src/daemon/server/handle-watch-events.d.ts +10 -0
  258. package/dist/src/daemon/server/handle-watch-events.js +85 -0
  259. package/dist/src/daemon/server/latest-nx.js +5 -2
  260. package/dist/src/daemon/server/native-js-loader.d.ts +1 -0
  261. package/dist/src/daemon/server/native-js-loader.js +21 -0
  262. package/dist/src/daemon/server/outputs-tracking.d.ts +7 -19
  263. package/dist/src/daemon/server/outputs-tracking.js +7 -107
  264. package/dist/src/daemon/server/planning-context.d.ts +8 -0
  265. package/dist/src/daemon/server/planning-context.js +18 -0
  266. package/dist/src/daemon/server/project-graph-incremental-recomputation.d.ts +36 -0
  267. package/dist/src/daemon/server/project-graph-incremental-recomputation.js +231 -50
  268. package/dist/src/daemon/server/restart-checks.d.ts +22 -0
  269. package/dist/src/daemon/server/restart-checks.js +77 -0
  270. package/dist/src/daemon/server/server.d.ts +3 -1
  271. package/dist/src/daemon/server/server.js +125 -100
  272. package/dist/src/daemon/server/shutdown-utils.d.ts +6 -6
  273. package/dist/src/daemon/server/shutdown-utils.js +13 -32
  274. package/dist/src/daemon/server/start.d.ts +1 -0
  275. package/dist/src/daemon/server/start.js +2 -0
  276. package/dist/src/daemon/server/ultracache-configuration-state.d.ts +7 -0
  277. package/dist/src/daemon/server/ultracache-configuration-state.js +36 -0
  278. package/dist/src/daemon/socket-utils.d.ts +32 -10
  279. package/dist/src/daemon/socket-utils.js +61 -56
  280. package/dist/src/daemon/tmp-dir.d.ts +59 -4
  281. package/dist/src/daemon/tmp-dir.js +223 -29
  282. package/dist/src/devkit-exports.d.ts +9 -1
  283. package/dist/src/devkit-exports.js +12 -1
  284. package/dist/src/devkit-internals.d.ts +114 -10
  285. package/dist/src/devkit-internals.js +251 -7
  286. package/dist/src/executors/run-commands/run-commands.impl.d.ts +5 -2
  287. package/dist/src/executors/run-commands/run-commands.impl.js +61 -21
  288. package/dist/src/executors/run-commands/running-tasks.d.ts +15 -5
  289. package/dist/src/executors/run-commands/running-tasks.js +206 -129
  290. package/dist/src/executors/run-commands/schema.json +2 -2
  291. package/dist/src/generators/internal-utils/format-changed-files.d.ts +24 -0
  292. package/dist/src/generators/internal-utils/format-changed-files.js +163 -0
  293. package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.d.ts +15 -0
  294. package/dist/src/generators/testing-utils/create-tree-with-empty-workspace.js +21 -3
  295. package/dist/src/generators/tree.d.ts +4 -2
  296. package/dist/src/hasher/check-task-files.js +5 -8
  297. package/dist/src/hasher/create-task-hasher.d.ts +8 -1
  298. package/dist/src/hasher/create-task-hasher.js +13 -3
  299. package/dist/src/hasher/file-hasher.js +9 -7
  300. package/dist/src/hasher/hash-plan-inspector.js +2 -2
  301. package/dist/src/hasher/hash-task.d.ts +2 -2
  302. package/dist/src/hasher/hash-task.js +32 -17
  303. package/dist/src/hasher/native-task-hasher-impl.d.ts +20 -4
  304. package/dist/src/hasher/native-task-hasher-impl.js +77 -9
  305. package/dist/src/hasher/task-hasher.d.ts +26 -7
  306. package/dist/src/hasher/task-hasher.js +31 -9
  307. package/dist/src/hasher/task-planning-context.d.ts +13 -0
  308. package/dist/src/hasher/task-planning-context.js +12 -0
  309. package/dist/src/migrations/update-15-0-0/prefix-outputs.js +2 -2
  310. package/dist/src/migrations/update-16-0-0/remove-nrwl-cli.js +2 -2
  311. package/dist/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +2 -2
  312. package/dist/src/migrations/update-16-0-0/update-nx-cloud-runner.js +2 -2
  313. package/dist/src/migrations/update-16-2-0/remove-run-commands-output-path.js +2 -2
  314. package/dist/src/migrations/update-17-0-0/rm-default-collection-npm-scope.js +2 -2
  315. package/dist/src/migrations/update-17-0-0/use-minimal-config-for-tasks-runner-options.js +2 -2
  316. package/dist/src/migrations/update-17-2-0/move-default-base.js +2 -2
  317. package/dist/src/migrations/update-18-0-0/disable-crystal-for-existing-workspaces.js +2 -2
  318. package/dist/src/migrations/update-19-2-4/set-project-name.js +2 -2
  319. package/dist/src/migrations/update-20-0-0/move-use-daemon-process.js +2 -2
  320. package/dist/src/migrations/update-20-0-1/use-legacy-cache.js +2 -2
  321. package/dist/src/migrations/update-21-0-0/release-changelog-config-changes.js +2 -2
  322. package/dist/src/migrations/update-21-0-0/release-version-config-changes.js +2 -2
  323. package/dist/src/migrations/update-21-0-0/remove-custom-tasks-runner.js +2 -2
  324. package/dist/src/migrations/update-21-0-0/remove-legacy-cache.js +2 -2
  325. package/dist/src/migrations/update-22-0-0/consolidate-release-tag-config.js +2 -2
  326. package/dist/src/migrations/update-22-0-0/release-version-config-changes.js +2 -2
  327. package/dist/src/migrations/update-22-2-0/add-self-healing-to-gitignore.js +2 -2
  328. package/dist/src/migrations/update-22-6-0/add-claude-settings-local-to-git-ignore.js +2 -2
  329. package/dist/src/migrations/update-22-6-0/add-claude-worktrees-to-git-ignore.js +2 -2
  330. package/dist/src/migrations/update-22-7-0/add-polygraph-to-git-ignore.js +2 -2
  331. package/dist/src/migrations/update-23-0-0/add-migrate-runs-to-git-ignore.js +2 -2
  332. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.d.ts +11 -0
  333. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.js +245 -0
  334. package/dist/src/migrations/update-23-2-0/set-cache-on-executor-target-defaults.md +50 -0
  335. package/dist/src/migrations/update-24-0-0/enable-legacy-affected.d.ts +4 -0
  336. package/dist/src/migrations/update-24-0-0/enable-legacy-affected.js +15 -0
  337. package/dist/src/migrations/update-24-0-0/enable-legacy-affected.md +30 -0
  338. package/dist/src/migrations/update-24-0-0/find-custom-hashers.d.ts +3 -0
  339. package/dist/src/migrations/update-24-0-0/find-custom-hashers.js +100 -0
  340. package/dist/src/migrations/update-24-0-0/find-custom-hashers.md +63 -0
  341. package/dist/src/migrations/update-24-0-0/move-custom-hashers-to-inputs.md +146 -0
  342. package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.d.ts +3 -0
  343. package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.js +130 -0
  344. package/dist/src/migrations/update-24-0-0/rename-ultracache-ignore-options.md +62 -0
  345. package/dist/src/native/index.d.ts +831 -36
  346. package/dist/src/native/index.js +85 -42
  347. package/dist/src/native/native-bindings.js +23 -1
  348. package/dist/src/native/native-file-cache-location.d.ts +17 -1
  349. package/dist/src/native/native-file-cache-location.js +86 -12
  350. package/dist/src/native/nx.openharmony-arm64.node +0 -0
  351. package/dist/src/native/nx.wasi-browser.js +1 -0
  352. package/dist/src/native/nx.wasi.cjs +1 -0
  353. package/dist/src/native/nx.wasm32-wasi.debug.wasm +0 -0
  354. package/dist/src/native/nx.wasm32-wasi.wasm +0 -0
  355. package/dist/src/native/transform-objects.d.ts +11 -2
  356. package/dist/src/native/transform-objects.js +46 -0
  357. package/dist/src/nx-cloud/generators/connect-to-nx-cloud/connect-to-nx-cloud.js +18 -11
  358. package/dist/src/nx-cloud/update-manager.d.ts +19 -0
  359. package/dist/src/nx-cloud/update-manager.js +250 -56
  360. package/dist/src/nx-cloud/utilities/client.d.ts +2 -1
  361. package/dist/src/nx-cloud/utilities/client.js +6 -1
  362. package/dist/src/nx-cloud/utilities/get-cloud-options.js +5 -2
  363. package/dist/src/nx-cloud/utilities/is-workspace-claimed.js +2 -1
  364. package/dist/src/nx-cloud/utilities/nx-cloud-http-client.d.ts +5 -0
  365. package/dist/src/nx-cloud/utilities/nx-cloud-http-client.js +16 -0
  366. package/dist/src/nx-cloud/utilities/onboarding.js +5 -2
  367. package/dist/src/nx-cloud/utilities/url-shorten.d.ts +1 -4
  368. package/dist/src/nx-cloud/utilities/url-shorten.js +22 -14
  369. package/dist/src/plugins/js/index.js +45 -64
  370. package/dist/src/plugins/js/lock-file/bun-parser.js +43 -10
  371. package/dist/src/plugins/js/lock-file/lock-file.d.ts +50 -8
  372. package/dist/src/plugins/js/lock-file/lock-file.js +198 -22
  373. package/dist/src/plugins/js/lock-file/npm-parser.js +10 -3
  374. package/dist/src/plugins/js/lock-file/pnpm-parser.js +417 -64
  375. package/dist/src/plugins/js/lock-file/project-graph-pruning.d.ts +25 -1
  376. package/dist/src/plugins/js/lock-file/project-graph-pruning.js +92 -12
  377. package/dist/src/plugins/js/lock-file/pruned-output.d.ts +331 -0
  378. package/dist/src/plugins/js/lock-file/pruned-output.js +1465 -0
  379. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.d.ts +3 -0
  380. package/dist/src/plugins/js/lock-file/utils/pnpm-normalizer.js +28 -5
  381. package/dist/src/plugins/js/project-graph/affected/lock-file-changes.d.ts +10 -2
  382. package/dist/src/plugins/js/project-graph/affected/lock-file-changes.js +51 -29
  383. package/dist/src/plugins/js/project-graph/affected/npm-packages.d.ts +10 -2
  384. package/dist/src/plugins/js/project-graph/affected/npm-packages.js +79 -27
  385. package/dist/src/plugins/js/project-graph/build-dependencies/build-dependencies.js +2 -1
  386. package/dist/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +24 -18
  387. package/dist/src/plugins/js/utils/register.d.ts +11 -0
  388. package/dist/src/plugins/js/utils/register.js +65 -16
  389. package/dist/src/plugins/js/utils/typescript.js +3 -2
  390. package/dist/src/plugins/package-json/create-nodes.d.ts +2 -2
  391. package/dist/src/plugins/package-json/create-nodes.js +13 -13
  392. package/dist/src/project-graph/affected/affected-project-graph-models.d.ts +15 -1
  393. package/dist/src/project-graph/affected/affected-project-graph.d.ts +1 -1
  394. package/dist/src/project-graph/affected/affected-project-graph.js +6 -19
  395. package/dist/src/project-graph/affected/affected-projects.d.ts +7 -0
  396. package/dist/src/project-graph/affected/affected-projects.js +42 -0
  397. package/dist/src/project-graph/affected/affected-reasons.d.ts +116 -0
  398. package/dist/src/project-graph/affected/affected-reasons.js +459 -0
  399. package/dist/src/project-graph/affected/affected-tasks.d.ts +106 -0
  400. package/dist/src/project-graph/affected/affected-tasks.js +410 -0
  401. package/dist/src/project-graph/affected/print-explanation.d.ts +11 -0
  402. package/dist/src/project-graph/affected/print-explanation.js +44 -0
  403. package/dist/src/project-graph/error-types.d.ts +17 -1
  404. package/dist/src/project-graph/error-types.js +71 -7
  405. package/dist/src/project-graph/file-utils.d.ts +2 -0
  406. package/dist/src/project-graph/file-utils.js +12 -3
  407. package/dist/src/project-graph/nx-deps-cache.d.ts +5 -2
  408. package/dist/src/project-graph/nx-deps-cache.js +4 -4
  409. package/dist/src/project-graph/plugins/get-plugins.d.ts +29 -1
  410. package/dist/src/project-graph/plugins/get-plugins.js +165 -82
  411. package/dist/src/project-graph/plugins/in-process-loader.d.ts +1 -1
  412. package/dist/src/project-graph/plugins/in-process-loader.js +1 -4
  413. package/dist/src/project-graph/plugins/isolation/enabled.js +1 -4
  414. package/dist/src/project-graph/plugins/isolation/index.d.ts +1 -1
  415. package/dist/src/project-graph/plugins/isolation/index.js +3 -1
  416. package/dist/src/project-graph/plugins/isolation/isolated-plugin.d.ts +41 -0
  417. package/dist/src/project-graph/plugins/isolation/isolated-plugin.js +189 -34
  418. package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.d.ts +10 -1
  419. package/dist/src/project-graph/plugins/isolation/load-isolated-plugin.js +67 -17
  420. package/dist/src/project-graph/plugins/isolation/messaging.d.ts +19 -5
  421. package/dist/src/project-graph/plugins/isolation/messaging.js +4 -3
  422. package/dist/src/project-graph/plugins/isolation/plugin-worker.js +85 -10
  423. package/dist/src/project-graph/plugins/loaded-nx-plugin.d.ts +5 -2
  424. package/dist/src/project-graph/plugins/loaded-nx-plugin.js +63 -7
  425. package/dist/src/project-graph/plugins/nx-plugin-capabilities.d.ts +6 -0
  426. package/dist/src/project-graph/plugins/nx-plugin-capabilities.js +28 -0
  427. package/dist/src/project-graph/plugins/task-results-stub.d.ts +50 -0
  428. package/dist/src/project-graph/plugins/task-results-stub.js +111 -0
  429. package/dist/src/project-graph/plugins/tasks-execution-hooks.d.ts +3 -2
  430. package/dist/src/project-graph/plugins/tasks-execution-hooks.js +14 -1
  431. package/dist/src/project-graph/project-graph.js +90 -44
  432. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.d.ts +7 -0
  433. package/dist/src/project-graph/utils/project-configuration/project-nodes-manager.js +19 -7
  434. package/dist/src/project-graph/utils/project-configuration/target-defaults.js +47 -21
  435. package/dist/src/project-graph/utils/project-configuration/target-merging.js +67 -0
  436. package/dist/src/project-graph/utils/project-configuration/target-normalization.js +95 -3
  437. package/dist/src/project-graph/utils/project-configuration/utils.d.ts +1 -0
  438. package/dist/src/project-graph/utils/project-configuration/utils.js +1 -0
  439. package/dist/src/project-graph/utils/project-configuration-utils.js +2 -2
  440. package/dist/src/project-graph/utils/retrieve-workspace-files.js +29 -8
  441. package/dist/src/tasks-runner/batch/run-batch.js +15 -0
  442. package/dist/src/tasks-runner/cache.d.ts +37 -2
  443. package/dist/src/tasks-runner/cache.js +42 -1
  444. package/dist/src/tasks-runner/create-task-graph.d.ts +32 -8
  445. package/dist/src/tasks-runner/create-task-graph.js +106 -28
  446. package/dist/src/tasks-runner/default-tasks-runner.js +1 -1
  447. package/dist/src/tasks-runner/forked-process-task-runner.d.ts +4 -1
  448. package/dist/src/tasks-runner/forked-process-task-runner.js +26 -16
  449. package/dist/src/tasks-runner/init-tasks-runner.d.ts +7 -2
  450. package/dist/src/tasks-runner/init-tasks-runner.js +133 -38
  451. package/dist/src/tasks-runner/is-tui-enabled.js +5 -2
  452. package/dist/src/tasks-runner/life-cycle.d.ts +13 -3
  453. package/dist/src/tasks-runner/life-cycle.js +16 -2
  454. package/dist/src/tasks-runner/life-cycles/dynamic-run-many-terminal-output-life-cycle.js +34 -13
  455. package/dist/src/tasks-runner/life-cycles/dynamic-run-one-terminal-output-life-cycle.js +26 -5
  456. package/dist/src/tasks-runner/life-cycles/performance-analysis.d.ts +5 -2
  457. package/dist/src/tasks-runner/life-cycles/performance-analysis.js +13 -7
  458. package/dist/src/tasks-runner/life-cycles/performance-life-cycle.d.ts +4 -3
  459. package/dist/src/tasks-runner/life-cycles/performance-life-cycle.js +9 -2
  460. package/dist/src/tasks-runner/life-cycles/performance-report.d.ts +12 -0
  461. package/dist/src/tasks-runner/life-cycles/performance-report.js +62 -3
  462. package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.d.ts +26 -1
  463. package/dist/src/tasks-runner/life-cycles/static-run-many-terminal-output-life-cycle.js +103 -6
  464. package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.d.ts +26 -0
  465. package/dist/src/tasks-runner/life-cycles/static-run-one-terminal-output-life-cycle.js +116 -17
  466. package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.d.ts +35 -0
  467. package/dist/src/tasks-runner/life-cycles/summary-terminal-output-life-cycle.js +150 -0
  468. package/dist/src/tasks-runner/life-cycles/task-history-life-cycle.js +16 -11
  469. package/dist/src/tasks-runner/life-cycles/tui-summary-life-cycle.js +76 -39
  470. package/dist/src/tasks-runner/prune-task-graph.d.ts +17 -0
  471. package/dist/src/tasks-runner/prune-task-graph.js +45 -0
  472. package/dist/src/tasks-runner/pseudo-ipc.d.ts +1 -0
  473. package/dist/src/tasks-runner/pseudo-ipc.js +18 -13
  474. package/dist/src/tasks-runner/pseudo-terminal.d.ts +18 -4
  475. package/dist/src/tasks-runner/pseudo-terminal.js +22 -10
  476. package/dist/src/tasks-runner/readiness/executor-ready-signal.d.ts +7 -0
  477. package/dist/src/tasks-runner/readiness/executor-ready-signal.js +43 -0
  478. package/dist/src/tasks-runner/readiness/probes.d.ts +14 -0
  479. package/dist/src/tasks-runner/readiness/probes.js +101 -0
  480. package/dist/src/tasks-runner/readiness/ready-signal-server.d.ts +18 -0
  481. package/dist/src/tasks-runner/readiness/ready-signal-server.js +72 -0
  482. package/dist/src/tasks-runner/readiness/ready-signal.d.ts +33 -0
  483. package/dist/src/tasks-runner/readiness/ready-signal.js +92 -0
  484. package/dist/src/tasks-runner/readiness/ready-when.d.ts +84 -0
  485. package/dist/src/tasks-runner/readiness/ready-when.js +371 -0
  486. package/dist/src/tasks-runner/readiness/startup-host.d.ts +1 -0
  487. package/dist/src/tasks-runner/readiness/startup-host.js +32 -0
  488. package/dist/src/tasks-runner/run-command.d.ts +47 -7
  489. package/dist/src/tasks-runner/run-command.js +146 -87
  490. package/dist/src/tasks-runner/run-outcome.d.ts +16 -0
  491. package/dist/src/tasks-runner/run-outcome.js +39 -0
  492. package/dist/src/tasks-runner/running-tasks/batch-process.d.ts +130 -1
  493. package/dist/src/tasks-runner/running-tasks/batch-process.js +267 -9
  494. package/dist/src/tasks-runner/running-tasks/node-child-process.js +5 -4
  495. package/dist/src/tasks-runner/running-tasks/running-task.d.ts +1 -1
  496. package/dist/src/tasks-runner/running-tasks/shared-running-task.d.ts +1 -0
  497. package/dist/src/tasks-runner/running-tasks/shared-running-task.js +12 -1
  498. package/dist/src/tasks-runner/task-env.d.ts +35 -0
  499. package/dist/src/tasks-runner/task-env.js +81 -7
  500. package/dist/src/tasks-runner/task-graph-utils.d.ts +9 -6
  501. package/dist/src/tasks-runner/task-graph-utils.js +17 -12
  502. package/dist/src/tasks-runner/task-io-service.d.ts +11 -3
  503. package/dist/src/tasks-runner/task-io-service.js +14 -5
  504. package/dist/src/tasks-runner/task-orchestrator.d.ts +201 -16
  505. package/dist/src/tasks-runner/task-orchestrator.js +1216 -205
  506. package/dist/src/tasks-runner/tasks-runner.d.ts +2 -0
  507. package/dist/src/tasks-runner/tasks-schedule.d.ts +18 -1
  508. package/dist/src/tasks-runner/tasks-schedule.js +63 -6
  509. package/dist/src/tasks-runner/terminal-output-path.d.ts +11 -0
  510. package/dist/src/tasks-runner/terminal-output-path.js +18 -0
  511. package/dist/src/tasks-runner/tokens.d.ts +54 -0
  512. package/dist/src/tasks-runner/tokens.js +161 -0
  513. package/dist/src/tasks-runner/utils.d.ts +40 -6
  514. package/dist/src/tasks-runner/utils.js +160 -71
  515. package/dist/src/ultracache/ci-status.d.ts +24 -0
  516. package/dist/src/ultracache/ci-status.js +87 -0
  517. package/dist/src/ultracache/config.d.ts +21 -0
  518. package/dist/src/ultracache/config.js +29 -0
  519. package/dist/src/ultracache/fetch.d.ts +23 -0
  520. package/dist/src/ultracache/fetch.js +44 -0
  521. package/dist/src/ultracache/overrides.d.ts +17 -0
  522. package/dist/src/ultracache/overrides.js +65 -0
  523. package/dist/src/ultracache/report.d.ts +13 -0
  524. package/dist/src/ultracache/report.js +62 -0
  525. package/dist/src/ultracache/store.d.ts +41 -0
  526. package/dist/src/ultracache/store.js +158 -0
  527. package/dist/src/utils/ab-testing.d.ts +4 -1
  528. package/dist/src/utils/ab-testing.js +22 -19
  529. package/dist/src/utils/acknowledge-build-scripts.d.ts +34 -1
  530. package/dist/src/utils/acknowledge-build-scripts.js +171 -32
  531. package/dist/src/utils/analytics-enabled.d.ts +7 -0
  532. package/dist/src/utils/analytics-enabled.js +11 -0
  533. package/dist/src/utils/analytics-prompt.js +4 -7
  534. package/dist/src/utils/assert-workspace-validity.js +7 -2
  535. package/dist/src/utils/cache-directory.d.ts +62 -3
  536. package/dist/src/utils/cache-directory.js +276 -25
  537. package/dist/src/utils/catalog/bun-manager-utils.d.ts +8 -0
  538. package/dist/src/utils/catalog/bun-manager-utils.js +174 -0
  539. package/dist/src/utils/catalog/bun-manager.d.ts +28 -0
  540. package/dist/src/utils/catalog/bun-manager.js +130 -0
  541. package/dist/src/utils/catalog/index.d.ts +1 -1
  542. package/dist/src/utils/catalog/index.js +1 -1
  543. package/dist/src/utils/catalog/manager-factory.js +3 -0
  544. package/dist/src/utils/catalog/manager-utils.d.ts +8 -1
  545. package/dist/src/utils/catalog/manager-utils.js +9 -4
  546. package/dist/src/utils/catalog/manager.d.ts +13 -1
  547. package/dist/src/utils/catalog/manager.js +30 -0
  548. package/dist/src/utils/catalog/pnpm-manager.d.ts +2 -1
  549. package/dist/src/utils/catalog/pnpm-manager.js +3 -0
  550. package/dist/src/utils/catalog/types.d.ts +4 -0
  551. package/dist/src/utils/catalog/yarn-manager.d.ts +6 -2
  552. package/dist/src/utils/catalog/yarn-manager.js +23 -32
  553. package/dist/src/utils/child-process.d.ts +31 -1
  554. package/dist/src/utils/child-process.js +105 -1
  555. package/dist/src/utils/chunkify.d.ts +1 -1
  556. package/dist/src/utils/chunkify.js +3 -2
  557. package/dist/src/utils/command-line-utils.d.ts +20 -0
  558. package/dist/src/utils/command-line-utils.js +10 -3
  559. package/dist/src/utils/consume-messages-from-socket.d.ts +42 -7
  560. package/dist/src/utils/consume-messages-from-socket.js +273 -38
  561. package/dist/src/utils/create-cli-options.d.ts +6 -0
  562. package/dist/src/utils/create-cli-options.js +29 -0
  563. package/dist/src/utils/db-connection.d.ts +2 -0
  564. package/dist/src/utils/db-connection.js +10 -16
  565. package/dist/src/utils/exit-codes.d.ts +9 -0
  566. package/dist/src/utils/exit-codes.js +19 -0
  567. package/dist/src/utils/fileutils.d.ts +5 -0
  568. package/dist/src/utils/fileutils.js +7 -2
  569. package/dist/src/utils/find-matching-projects.js +9 -6
  570. package/dist/src/utils/formatters/index.d.ts +19 -0
  571. package/dist/src/utils/formatters/index.js +79 -0
  572. package/dist/src/utils/formatters/oxfmt.d.ts +32 -0
  573. package/dist/src/utils/formatters/oxfmt.js +764 -0
  574. package/dist/src/utils/formatters/prettier.d.ts +18 -0
  575. package/dist/src/utils/formatters/prettier.js +179 -0
  576. package/dist/src/utils/formatters/shared.d.ts +5 -0
  577. package/dist/src/utils/formatters/shared.js +8 -0
  578. package/dist/src/utils/git-utils.d.ts +64 -2
  579. package/dist/src/utils/git-utils.js +560 -41
  580. package/dist/src/utils/git-worktrees.d.ts +30 -0
  581. package/dist/src/utils/git-worktrees.js +212 -0
  582. package/dist/src/utils/handle-errors.js +5 -43
  583. package/dist/src/utils/has-nx-js-plugin.d.ts +1 -1
  584. package/dist/src/utils/has-nx-js-plugin.js +1 -1
  585. package/dist/src/utils/http-client.d.ts +27 -0
  586. package/dist/src/utils/http-client.js +193 -0
  587. package/dist/src/utils/ignore.d.ts +170 -1
  588. package/dist/src/utils/ignore.js +263 -11
  589. package/dist/src/utils/installation-directory.d.ts +8 -0
  590. package/dist/src/utils/installation-directory.js +13 -0
  591. package/dist/src/utils/installed-nx-version.js +2 -48
  592. package/dist/src/utils/json-diff.d.ts +4 -2
  593. package/dist/src/utils/json-diff.js +6 -94
  594. package/dist/src/utils/kill-child-on-host-exit.d.ts +7 -0
  595. package/dist/src/utils/kill-child-on-host-exit.js +42 -0
  596. package/dist/src/utils/long-running-target.d.ts +8 -0
  597. package/dist/src/utils/long-running-target.js +17 -0
  598. package/dist/src/utils/min-release-age/behavior/bun.js +7 -11
  599. package/dist/src/utils/min-release-age/behavior/npm.js +5 -2
  600. package/dist/src/utils/min-release-age/behavior/pnpm.js +17 -9
  601. package/dist/src/utils/min-release-age/packument.js +2 -2
  602. package/dist/src/utils/nx-cloud-utils.d.ts +2 -0
  603. package/dist/src/utils/nx-cloud-utils.js +6 -1
  604. package/dist/src/utils/nx-console-prompt.js +3 -6
  605. package/dist/src/utils/nx-tmp-dir.d.ts +23 -0
  606. package/dist/src/utils/nx-tmp-dir.js +45 -0
  607. package/dist/src/utils/output.d.ts +173 -0
  608. package/dist/src/utils/output.js +313 -5
  609. package/dist/src/utils/owned-private-dir.d.ts +129 -0
  610. package/dist/src/utils/owned-private-dir.js +310 -0
  611. package/dist/src/utils/package-json.d.ts +27 -0
  612. package/dist/src/utils/package-json.js +62 -8
  613. package/dist/src/utils/package-manager-config/bunfig.d.ts +14 -0
  614. package/dist/src/utils/package-manager-config/bunfig.js +49 -0
  615. package/dist/src/utils/package-manager-config/npmrc.d.ts +23 -0
  616. package/dist/src/utils/package-manager-config/npmrc.js +124 -0
  617. package/dist/src/utils/package-manager-config/pnpm-config.d.ts +17 -0
  618. package/dist/src/utils/package-manager-config/pnpm-config.js +60 -0
  619. package/dist/src/utils/package-manager.d.ts +37 -3
  620. package/dist/src/utils/package-manager.js +373 -69
  621. package/dist/src/utils/params.d.ts +7 -1
  622. package/dist/src/utils/params.js +65 -7
  623. package/dist/src/utils/path.d.ts +6 -0
  624. package/dist/src/utils/path.js +15 -0
  625. package/dist/src/utils/perf-hooks.d.ts +1 -0
  626. package/dist/src/utils/permission-errors.d.ts +11 -0
  627. package/dist/src/utils/permission-errors.js +17 -0
  628. package/dist/src/utils/plugins/core-plugins.js +9 -1
  629. package/dist/src/utils/plugins/plugin-capabilities.js +7 -2
  630. package/dist/src/utils/progress-topics.d.ts +1 -0
  631. package/dist/src/utils/progress-topics.js +1 -0
  632. package/dist/src/utils/project-graph-utils.d.ts +2 -0
  633. package/dist/src/utils/project-graph-utils.js +12 -0
  634. package/dist/src/utils/prompt-helpers.d.ts +53 -0
  635. package/dist/src/utils/prompt-helpers.js +111 -0
  636. package/dist/src/utils/provenance.js +26 -18
  637. package/dist/src/utils/registry-config/bun.d.ts +2 -0
  638. package/dist/src/utils/registry-config/bun.js +257 -0
  639. package/dist/src/utils/registry-config/index.d.ts +13 -0
  640. package/dist/src/utils/registry-config/index.js +102 -0
  641. package/dist/src/utils/registry-config/pnpm.d.ts +2 -0
  642. package/dist/src/utils/registry-config/pnpm.js +1551 -0
  643. package/dist/src/utils/registry-config/utils.d.ts +195 -0
  644. package/dist/src/utils/registry-config/utils.js +496 -0
  645. package/dist/src/utils/registry-config/yarn-berry.d.ts +2 -0
  646. package/dist/src/utils/registry-config/yarn-berry.js +612 -0
  647. package/dist/src/utils/registry-config/yarn-classic.d.ts +2 -0
  648. package/dist/src/utils/registry-config/yarn-classic.js +1001 -0
  649. package/dist/src/utils/safe-spawn.d.ts +24 -0
  650. package/dist/src/utils/safe-spawn.js +100 -0
  651. package/dist/src/utils/serialize-overrides-into-command-line.js +2 -4
  652. package/dist/src/utils/shell-quoting.d.ts +22 -0
  653. package/dist/src/utils/shell-quoting.js +46 -0
  654. package/dist/src/utils/socket-refused-exit-code.d.ts +15 -0
  655. package/dist/src/utils/socket-refused-exit-code.js +18 -0
  656. package/dist/src/utils/spawn-without-terminal.d.ts +27 -0
  657. package/dist/src/utils/spawn-without-terminal.js +110 -0
  658. package/dist/src/utils/string-similarity.d.ts +38 -0
  659. package/dist/src/utils/string-similarity.js +108 -0
  660. package/dist/src/utils/wait-for-socket-connection.d.ts +11 -0
  661. package/dist/src/utils/wait-for-socket-connection.js +14 -8
  662. package/dist/src/utils/workspace-context.d.ts +51 -3
  663. package/dist/src/utils/workspace-context.js +174 -10
  664. package/dist/src/utils/write-formatted-json-file.d.ts +3 -2
  665. package/dist/src/utils/write-formatted-json-file.js +5 -4
  666. package/migrations.json +25 -5
  667. package/package.json +36 -57
  668. package/schemas/migrations-schema.json +11 -0
  669. package/schemas/nx-schema.json +169 -9
  670. package/schemas/project-schema.json +147 -2
  671. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.d.ts +0 -56
  672. package/dist/src/command-line/migrate/agentic/prompts/generic-validation.js +0 -66
  673. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.d.ts +0 -49
  674. package/dist/src/command-line/migrate/agentic/prompts/hybrid-prompt-migration.js +0 -53
  675. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.d.ts +0 -26
  676. package/dist/src/command-line/migrate/agentic/prompts/prompt-migration.js +0 -27
  677. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.d.ts +0 -46
  678. package/dist/src/command-line/migrate/agentic/prompts/system-prompt.js +0 -90
  679. package/dist/src/command-line/migrate/agentic/run-step.d.ts +0 -58
  680. package/dist/src/command-line/migrate/agentic/run-step.js +0 -123
  681. package/dist/src/command-line/migrate/agentic/runner.d.ts +0 -33
  682. package/dist/src/command-line/migrate/agentic/runner.js +0 -444
  683. package/dist/src/daemon/server/file-watching/route-workspace-changes.d.ts +0 -9
  684. package/dist/src/daemon/server/file-watching/route-workspace-changes.js +0 -76
  685. package/dist/src/daemon/server/watcher.d.ts +0 -18
  686. package/dist/src/daemon/server/watcher.js +0 -126
  687. package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.d.ts +0 -19
  688. package/dist/src/generators/internal-utils/format-changed-files-with-prettier-if-available.js +0 -81
  689. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.d.ts +0 -9
  690. package/dist/src/migrations/update-23-0-0/consolidate-release-tag-config.js +0 -18
  691. package/dist/src/nx-cloud/utilities/axios.d.ts +0 -4
  692. package/dist/src/nx-cloud/utilities/axios.js +0 -17
  693. package/dist/src/project-graph/affected/locators/project-glob-changes.d.ts +0 -2
  694. package/dist/src/project-graph/affected/locators/project-glob-changes.js +0 -44
  695. package/dist/src/project-graph/affected/locators/workspace-json-changes.d.ts +0 -4
  696. package/dist/src/project-graph/affected/locators/workspace-json-changes.js +0 -47
  697. package/dist/src/project-graph/affected/locators/workspace-projects.d.ts +0 -3
  698. package/dist/src/project-graph/affected/locators/workspace-projects.js +0 -74
  699. package/dist/src/tasks-runner/legacy-depends-on-warning.d.ts +0 -18
  700. package/dist/src/tasks-runner/legacy-depends-on-warning.js +0 -109
  701. package/dist/src/utils/collapse-expanded-outputs.d.ts +0 -10
  702. package/dist/src/utils/collapse-expanded-outputs.js +0 -72
  703. package/dist/src/utils/is-using-prettier.d.ts +0 -3
  704. package/dist/src/utils/is-using-prettier.js +0 -62
  705. package/dist/src/utils/min-release-age/npmrc.d.ts +0 -15
  706. package/dist/src/utils/min-release-age/npmrc.js +0 -45
package/README.md CHANGED
@@ -1,18 +1,18 @@
1
- <p style="text-align: center;">
1
+ <p align="center">
2
2
  <picture>
3
- <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
4
- <img alt="Nx - Smart Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
3
+ <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo-light.svg">
4
+ <img alt="Nx Logo" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-logo.svg" width="140">
5
5
  </picture>
6
6
  </p>
7
7
 
8
8
  <div style="text-align: center;">
9
9
 
10
- [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)]()
10
+ [![License](https://img.shields.io/npm/l/@nx/workspace.svg?style=flat-square)](<>)
11
11
  [![NPM Version](https://badge.fury.io/js/nx.svg)](https://www.npmjs.com/package/nx)
12
- [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)]()
12
+ [![Semantic Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](<>)
13
13
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
14
14
  [![Join us on the Official Nx Discord Server](https://img.shields.io/discord/1143497901675401286?label=discord)](https://go.nx.dev/community)
15
- [![Nx Sandboxing](https://staging.nx.app/workspaces/62d013ea0852fe0a2df74438/sandbox-badge.svg)](https://nx.dev/docs/features/ci-features/sandboxing)
15
+ [![Hours saved](https://img.shields.io/endpoint?url=https%3A%2F%2Fstaging.nx.app%2Fnx-cloud%2Fbadge%2F62d013ea0852fe0a2df74438%2Fhours-saved.json)](https://nx.dev/nx-cloud)
16
16
 
17
17
  </div>
18
18
 
@@ -60,6 +60,3 @@ npx nx@latest init
60
60
  - [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
61
61
  - [Blog Posts About Nx](https://nx.dev/blog)
62
62
 
63
- <p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
64
- width="100%" alt="Nx - Smart Monorepos · Fast Builds"></a></p>
65
-
@@ -6,9 +6,10 @@ const perf_hooks_1 = require("perf_hooks");
6
6
  const nx_commands_1 = require("../src/command-line/nx-commands");
7
7
  const strip_indents_1 = require("../src/utils/strip-indents");
8
8
  const client_1 = require("../src/daemon/client/client");
9
- const enquirer_1 = require("enquirer");
9
+ const prompt_helpers_1 = require("../src/utils/prompt-helpers");
10
10
  const output_1 = require("../src/utils/output");
11
11
  const analytics_1 = require("../src/analytics");
12
+ const is_ci_1 = require("../src/utils/is-ci");
12
13
  /**
13
14
  * Nx is being run inside a workspace.
14
15
  *
@@ -119,6 +120,11 @@ function shouldDelegateToAngularCLI() {
119
120
  return commands.indexOf(command) > -1;
120
121
  }
121
122
  async function ensureNxConsoleInstalledViaDaemon() {
123
+ // Asking the daemon makes a fresh daemon install nx@latest in the background,
124
+ // so skip it whenever the prompt could not be shown anyway.
125
+ if (!process.stdout.isTTY || (0, is_ci_1.isCI)()) {
126
+ return;
127
+ }
122
128
  // Only proceed if daemon is available
123
129
  if (!client_1.daemonClient.enabled() || !(await client_1.daemonClient.isServerAvailable())) {
124
130
  return;
@@ -126,7 +132,7 @@ async function ensureNxConsoleInstalledViaDaemon() {
126
132
  // Get status from daemon
127
133
  const status = await client_1.daemonClient.getNxConsoleStatus();
128
134
  // If we should prompt the user
129
- if (status.shouldPrompt && process.stdout.isTTY) {
135
+ if (status.shouldPrompt) {
130
136
  output_1.output.log({
131
137
  title: "Install Nx's official editor extension to:",
132
138
  bodyLines: [
@@ -136,11 +142,9 @@ async function ensureNxConsoleInstalledViaDaemon() {
136
142
  ],
137
143
  });
138
144
  try {
139
- const { shouldInstallNxConsole } = await (0, enquirer_1.prompt)({
140
- type: 'confirm',
141
- name: 'shouldInstallNxConsole',
145
+ const shouldInstallNxConsole = await (0, prompt_helpers_1.confirmationPrompt)({
142
146
  message: 'Install Nx Console? (you can uninstall anytime)',
143
- initial: true,
147
+ onCancel: () => false,
144
148
  });
145
149
  // Set preference and install if user said yes
146
150
  const result = await client_1.daemonClient.setNxConsolePreferenceAndInstall(shouldInstallNxConsole);
@@ -12,6 +12,15 @@ Promise.resolve().then(async () => invokeCommandWithNxCloudClient(options));
12
12
  async function invokeCommandWithNxCloudClient(options) {
13
13
  try {
14
14
  const client = await (0, client_1.getCloudClient)(options);
15
+ if (client.runCLI) {
16
+ return client
17
+ .runCLI(process.argv.slice(2))
18
+ .then((exitCode) => process.exit(typeof exitCode === 'number' ? exitCode : 0))
19
+ .catch((e) => {
20
+ console.error(e);
21
+ process.exit(1);
22
+ });
23
+ }
15
24
  client.invoke(command);
16
25
  }
17
26
  catch (e) {
package/dist/bin/nx.js CHANGED
@@ -209,6 +209,7 @@ function resolveNx(workspace) {
209
209
  function isNxCloudCommand(command) {
210
210
  const nxCloudCommands = [
211
211
  'start-ci-run',
212
+ 'start-nx-agents',
212
213
  'start-agent',
213
214
  'stop-all-agents',
214
215
  'complete-ci-run',
@@ -9,6 +9,8 @@ const get_cloud_options_1 = require("../src/nx-cloud/utilities/get-cloud-options
9
9
  const nx_cloud_utils_1 = require("../src/utils/nx-cloud-utils");
10
10
  const nx_json_1 = require("../src/config/nx-json");
11
11
  const logger_1 = require("../src/utils/logger");
12
+ const package_json_1 = require("../src/utils/package-json");
13
+ const installation_directory_1 = require("../src/utils/installation-directory");
12
14
  // The post install is not critical, to avoid any chance that it may hang
13
15
  // we will kill this process after 30 seconds.
14
16
  const postinstallTimeout = setTimeout(() => {
@@ -36,9 +38,9 @@ const postinstallTimeout = setTimeout(() => {
36
38
  }
37
39
  })();
38
40
  function isMainNxPackage() {
39
- const mainNxPath = require.resolve('nx', {
40
- paths: [workspace_root_1.workspaceRoot],
41
- });
41
+ // A plain `require.resolve('nx', { paths })` self-references this package,
42
+ // so every installed nx copy would pass.
43
+ const mainNxPath = (0, package_json_1.resolveWithoutCachePollution)('nx', (0, installation_directory_1.getNxRequirePaths)(workspace_root_1.workspaceRoot));
42
44
  const thisNxPath = require.resolve('nx');
43
45
  return mainNxPath === thisNxPath;
44
46
  }
@@ -0,0 +1,2 @@
1
+ export { importUltracacheConfigurations, openUltracacheConfigurations, } from './src/ultracache/store';
2
+ export declare const TASK_GRAPH_FORMAT = 2;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ // Nx internals for the Nx Cloud client, loaded as `nx/nx-cloud-internals`; not
3
+ // a public API. The client probes these exports to tell what this nx supports,
4
+ // so keep them stable.
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TASK_GRAPH_FORMAT = exports.openUltracacheConfigurations = exports.importUltracacheConfigurations = void 0;
7
+ var store_1 = require("./src/ultracache/store");
8
+ Object.defineProperty(exports, "importUltracacheConfigurations", { enumerable: true, get: function () { return store_1.importUltracacheConfigurations; } });
9
+ Object.defineProperty(exports, "openUltracacheConfigurations", { enumerable: true, get: function () { return store_1.openUltracacheConfigurations; } });
10
+ // Nx Cloud reads it to pick the task-graph shape it hands this nx. Bump it when
11
+ // the shape changes in a way Cloud must handle.
12
+ // 1: `dependencies` and `continuousDependencies` edges are task ids (implied
13
+ // when the export is absent)
14
+ // 2: edges are objects (`{ id, waitFor?, inputs? }`)
15
+ exports.TASK_GRAPH_FORMAT = 2;
@@ -29,7 +29,7 @@ const plugin = {
29
29
  const patterns = (0, package_json_1.buildPackageJsonPatterns)(context.workspaceRoot, (f) => (0, fileutils_1.readJsonFile)((0, path_1.join)(context.workspaceRoot, f)));
30
30
  const isInPackageJsonWorkspaces = (0, package_json_1.buildPackageJsonWorkspacesMatcher)(patterns);
31
31
  const packageManagerCommand = (0, package_manager_1.getPackageManagerCommand)((0, package_manager_1.detectPackageManager)(context.workspaceRoot), context.workspaceRoot);
32
- const result = (0, plugins_1.createNodesFromFiles)((packageJsonPath) => (0, package_json_1.createNodeFromPackageJson)(packageJsonPath, workspace_root_1.workspaceRoot, cache, isInPackageJsonWorkspaces(packageJsonPath), packageManagerCommand), configFiles, options, context);
32
+ const result = (0, plugins_1.createNodesFromFiles)((packageJsonPath) => (0, package_json_1.createNodeFromPackageJson)(packageJsonPath, workspace_root_1.workspaceRoot, cache, isInPackageJsonWorkspaces(packageJsonPath), packageManagerCommand, context.nxJsonConfiguration), configFiles, options, context);
33
33
  writeCache();
34
34
  return result;
35
35
  },
@@ -106,5 +106,9 @@ export default class DefaultChangelogRenderer {
106
106
  protected groupChangesByScope(changes: ChangelogChange[]): Record<string, ChangelogChange[]>;
107
107
  protected extractBreakingChangeExplanation(message: string): string | null;
108
108
  private isBreakingChangeBoundary;
109
+ protected isAiAgentAuthor(author: {
110
+ name: string;
111
+ email: string;
112
+ }): boolean;
109
113
  protected formatName(name?: string): string;
110
114
  }
@@ -3,6 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const semver_1 = require("semver");
4
4
  // Stripped from breaking change explanations (e.g. bot/session markers).
5
5
  const HtmlCommentRegex = /<!--[\s\S]*?-->/g;
6
+ // Keyed on email: agent display names track model versions (e.g. "Claude Opus
7
+ // 5 (1M context)"), and a human contributor can share a name with an agent.
8
+ const AiAgentAuthorEmails = new Set([
9
+ 'noreply@anthropic.com',
10
+ 'claude@anthropic.com',
11
+ 'amp@ampcode.com',
12
+ 'cursoragent@cursor.com',
13
+ 'openhands@all-hands.dev',
14
+ 'opendevin@all-hands.dev',
15
+ ]);
16
+ // The Copilot coding agent's trailer is not always [bot]-suffixed.
17
+ const CopilotAuthorEmailRegex = /^(?:\d+\+)?copilot@users\.noreply\.github\.com$/;
6
18
  class DefaultChangelogRenderer {
7
19
  /**
8
20
  * A ChangelogRenderer class takes in the determined changes and other relevant metadata
@@ -212,15 +224,14 @@ class DefaultChangelogRenderer {
212
224
  }
213
225
  for (const author of change.authors) {
214
226
  const name = this.formatName(author.name);
215
- if (!name || name.includes('[bot]')) {
227
+ if (!name || name.includes('[bot]') || this.isAiAgentAuthor(author)) {
216
228
  continue;
217
229
  }
218
- if (_authors.has(name)) {
219
- const entry = _authors.get(name);
220
- entry.email.add(author.email);
230
+ if (!_authors.has(name)) {
231
+ _authors.set(name, { email: new Set() });
221
232
  }
222
- else {
223
- _authors.set(name, { email: new Set([author.email]) });
233
+ if (author.email) {
234
+ _authors.get(name).email.add(author.email);
224
235
  }
225
236
  }
226
237
  }
@@ -372,6 +383,10 @@ class DefaultChangelogRenderer {
372
383
  // Git metadata delimiter following the body
373
384
  trimmed === '"');
374
385
  }
386
+ isAiAgentAuthor(author) {
387
+ const email = (author.email || '').trim().toLowerCase();
388
+ return (AiAgentAuthorEmails.has(email) || CopilotAuthorEmailRegex.test(email));
389
+ }
375
390
  formatName(name = '') {
376
391
  return name
377
392
  .split(' ')
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * @public Programmatic API for nx release
3
3
  */
4
- export { ReleaseClient, release, releaseChangelog, releasePublish, releaseVersion, VersionActions, AfterAllProjectsVersioned, } from '../src/command-line/release';
4
+ export { ReleaseClient, release, releaseChangelog, releasePublish, releaseVersion, VersionActions, AfterAllProjectsVersioned, ResolveVersionForDependency, } from '../src/command-line/release';
@@ -31,6 +31,7 @@ const executor_utils_1 = require("../command-line/run/executor-utils");
31
31
  const plugins_1 = require("../project-graph/plugins");
32
32
  const schema_utils_1 = require("../config/schema-utils");
33
33
  const handle_import_1 = require("../utils/handle-import");
34
+ const prompt_helpers_1 = require("../utils/prompt-helpers");
34
35
  const target_merging_1 = require("../project-graph/utils/project-configuration/target-merging");
35
36
  function getProjectGraph() {
36
37
  try {
@@ -252,8 +253,7 @@ async function createRecorder(host, record, logger) {
252
253
  else if (event.kind === 'rename') {
253
254
  record.loggingQueue.push(`${pc.blue('RENAME')} ${eventPath} => ${event.to}`);
254
255
  // Surface as DELETE source + CREATE destination so downstream consumers
255
- // (e.g. the agentic validation prompt's `<files_changed>` block) see
256
- // both endpoints.
256
+ // see both endpoints.
257
257
  const toPath = event.to.startsWith('/') ? event.to.slice(1) : event.to;
258
258
  record.changes?.push({ type: 'DELETE', path: eventPath, content: null });
259
259
  record.changes?.push(emptyFileChange('CREATE', toPath));
@@ -653,8 +653,66 @@ function createPromptProvider() {
653
653
  return { ...question, type: definition.type };
654
654
  }
655
655
  });
656
- return require('enquirer').prompt(questions);
656
+ // Angular hands over a whole form at once; clack asks one question at a
657
+ // time, so they are run in order and the answers reassembled.
658
+ return (async () => {
659
+ const answers = {};
660
+ for (const question of questions) {
661
+ answers[question.name] = await askSchematicQuestion(question);
662
+ }
663
+ return answers;
664
+ })();
657
665
  };
666
+ async function askSchematicQuestion(question) {
667
+ const validate = question.validate
668
+ ? (value) => {
669
+ const result = question.validate(value);
670
+ if (result === true)
671
+ return undefined;
672
+ return typeof result === 'string' ? result : 'Invalid value';
673
+ }
674
+ : undefined;
675
+ const choices = (question.choices ?? []).map((c) => typeof c === 'string' ? { value: c } : { value: c.name, label: c.message });
676
+ switch (question.type) {
677
+ case 'confirm':
678
+ return (0, prompt_helpers_1.confirmationPrompt)({
679
+ message: question.message,
680
+ initial: question.initial !== false,
681
+ });
682
+ case 'select':
683
+ return (0, prompt_helpers_1.selectPrompt)({
684
+ message: question.message,
685
+ choices,
686
+ initial: question.initial,
687
+ });
688
+ case 'multiselect':
689
+ return (0, prompt_helpers_1.multiselectPrompt)({
690
+ message: question.message,
691
+ choices,
692
+ initialValues: question.initial,
693
+ });
694
+ case 'numeral': {
695
+ // No numeric prompt; the answer is parsed back so callers still get a
696
+ // number rather than the typed string.
697
+ const answer = await (0, prompt_helpers_1.textPrompt)({
698
+ message: question.message,
699
+ initialValue: question.initial === undefined
700
+ ? undefined
701
+ : String(question.initial),
702
+ validate: (value) => value !== '' && !Number.isNaN(Number(value))
703
+ ? validate?.(value)
704
+ : 'Please enter a number',
705
+ });
706
+ return Number(answer);
707
+ }
708
+ default:
709
+ return (0, prompt_helpers_1.textPrompt)({
710
+ message: question.message,
711
+ initialValue: question.initial,
712
+ validate,
713
+ });
714
+ }
715
+ }
658
716
  }
659
717
  async function runMigration(root, packageName, migrationName, projects, isVerbose, projectGraph) {
660
718
  const logger = (0, exports.getLogger)(isVerbose);
@@ -932,6 +990,7 @@ async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, proj
932
990
  const batchImplementationFactory = executorConfig.batchImplementation
933
991
  ? this.getImplementationFactory(executorConfig.batchImplementation, executorsDir, nodeModule)
934
992
  : null;
993
+ // TODO(v25): remove custom hasher support.
935
994
  const hasherFactory = executorConfig.hasher
936
995
  ? this.getImplementationFactory(executorConfig.hasher, executorsDir, nodeModule)
937
996
  : null;
@@ -7,18 +7,59 @@ const os_1 = require("os");
7
7
  const path_1 = require("path");
8
8
  const REPO_URL = 'https://github.com/nrwl/nx-ai-agents-config';
9
9
  const CACHE_DIR = (0, path_1.join)((0, os_1.tmpdir)(), 'nx-ai-agents-config');
10
+ // `git rev-parse --local-env-vars`, plus GIT_NAMESPACE and the indexed
11
+ // GIT_CONFIG_KEY_<n> / GIT_CONFIG_VALUE_<n> pairs. Hooks export GIT_INDEX_FILE;
12
+ // inheriting it makes `git clone` rewrite the caller's index.
13
+ const GIT_LOCAL_REPO_ENV_VARS = new Set([
14
+ 'GIT_ALTERNATE_OBJECT_DIRECTORIES',
15
+ 'GIT_COMMON_DIR',
16
+ 'GIT_CONFIG',
17
+ 'GIT_CONFIG_COUNT',
18
+ 'GIT_CONFIG_PARAMETERS',
19
+ 'GIT_DIR',
20
+ 'GIT_GRAFT_FILE',
21
+ 'GIT_IMPLICIT_WORK_TREE',
22
+ 'GIT_INDEX_FILE',
23
+ 'GIT_NAMESPACE',
24
+ 'GIT_NO_REPLACE_OBJECTS',
25
+ 'GIT_OBJECT_DIRECTORY',
26
+ 'GIT_PREFIX',
27
+ 'GIT_REPLACE_REF_BASE',
28
+ 'GIT_SHALLOW_FILE',
29
+ 'GIT_WORK_TREE',
30
+ ]);
31
+ function isGitLocalRepoEnvVar(key) {
32
+ const upper = key.toUpperCase();
33
+ return (GIT_LOCAL_REPO_ENV_VARS.has(upper) ||
34
+ upper.startsWith('GIT_CONFIG_KEY_') ||
35
+ upper.startsWith('GIT_CONFIG_VALUE_'));
36
+ }
37
+ function environmentWithoutGitLocalRepoVars() {
38
+ const env = { ...process.env };
39
+ for (const key of Object.keys(env)) {
40
+ if (isGitLocalRepoEnvVar(key)) {
41
+ delete env[key];
42
+ }
43
+ }
44
+ return env;
45
+ }
46
+ function execGitWithoutLocalRepoEnv(command, timeout) {
47
+ return (0, child_process_1.execSync)(command, {
48
+ encoding: 'utf-8',
49
+ env: environmentWithoutGitLocalRepoVars(),
50
+ stdio: ['pipe', 'pipe', 'pipe'],
51
+ timeout,
52
+ windowsHide: true,
53
+ });
54
+ }
10
55
  /**
11
56
  * Get the latest commit hash from the remote repository.
12
57
  * Uses `git ls-remote` to fetch the HEAD commit hash without cloning.
13
58
  */
14
59
  function getLatestCommitHash() {
15
60
  try {
16
- const output = (0, child_process_1.execSync)(`git ls-remote ${REPO_URL} HEAD`, {
17
- encoding: 'utf-8',
18
- stdio: ['pipe', 'pipe', 'pipe'],
19
- timeout: 30000, // 30 second timeout
20
- windowsHide: true,
21
- });
61
+ const output = execGitWithoutLocalRepoEnv(`git ls-remote ${REPO_URL} HEAD`, 30000 // 30 second timeout
62
+ );
22
63
  const hash = output.split('\t')[0];
23
64
  if (!hash || hash.length < 10) {
24
65
  throw new Error('Invalid commit hash received');
@@ -43,12 +84,8 @@ function cloneRepo(targetPath) {
43
84
  if ((0, fs_1.existsSync)(tempPath)) {
44
85
  (0, fs_1.rmSync)(tempPath, { recursive: true, force: true });
45
86
  }
46
- (0, child_process_1.execSync)(`git clone --depth 1 ${REPO_URL} "${tempPath}"`, {
47
- encoding: 'utf-8',
48
- stdio: ['pipe', 'pipe', 'pipe'],
49
- timeout: 120000, // 2 minute timeout for clone
50
- windowsHide: true,
51
- });
87
+ execGitWithoutLocalRepoEnv(`git clone --depth 1 ${REPO_URL} "${tempPath}"`, 120000 // 2 minute timeout for clone
88
+ );
52
89
  // Remove .git directory after clone
53
90
  const gitDir = (0, path_1.join)(tempPath, '.git');
54
91
  if ((0, fs_1.existsSync)(gitDir)) {
@@ -29,3 +29,18 @@ export declare const nxMcpTomlHeader = "[mcp_servers.\"nx-mcp\"]";
29
29
  * For Nx < 22, uses 'nx-mcp'
30
30
  */
31
31
  export declare function getNxMcpTomlConfig(nxVersion: string): string;
32
+ /**
33
+ * The Nx runtime roots as they belong in a *committed* sandbox allowlist.
34
+ *
35
+ * `~/.nx` is the literal tilde rather than an expanded `NX_HOME_TMP_DIR`: the
36
+ * sandbox expands it per user, which is the property that makes the entry worth
37
+ * committing at all. An absolute home would pin the file to whoever ran the
38
+ * generator.
39
+ *
40
+ * Both are listed because socket resolution walks a chain — `/tmp/.nx` first,
41
+ * `~/.nx` when a peer already owns the shared container. Allowing only the first
42
+ * leaves every user on a machine where someone else got there first silently
43
+ * uncovered. Windows resolves `NX_TMP_DIR` to a machine-specific `%TMP%` and has
44
+ * no sandbox to configure, so the POSIX root is the one that belongs here.
45
+ */
46
+ export declare const NX_ALLOWLIST_ROOTS: readonly ["/tmp/.nx", "~/.nx"];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nxMcpTomlHeader = exports.analyticsDomain = exports.getAgentRulesWrapped = exports.rulesRegex = exports.nxRulesMarkerCommentEnd = exports.nxRulesMarkerCommentDescription = exports.nxRulesMarkerCommentStart = void 0;
3
+ exports.NX_ALLOWLIST_ROOTS = exports.nxMcpTomlHeader = exports.analyticsDomain = exports.getAgentRulesWrapped = exports.rulesRegex = exports.nxRulesMarkerCommentEnd = exports.nxRulesMarkerCommentDescription = exports.nxRulesMarkerCommentStart = void 0;
4
4
  exports.agentsMdPath = agentsMdPath;
5
5
  exports.geminiMdPath = geminiMdPath;
6
6
  exports.parseGeminiSettings = parseGeminiSettings;
@@ -13,6 +13,7 @@ exports.getNxMcpTomlConfig = getNxMcpTomlConfig;
13
13
  const path_1 = require("path");
14
14
  const semver_1 = require("semver");
15
15
  const fileutils_1 = require("../utils/fileutils");
16
+ const nx_tmp_dir_1 = require("../utils/nx-tmp-dir");
16
17
  const get_agent_rules_1 = require("./set-up-ai-agents/get-agent-rules");
17
18
  function agentsMdPath(root) {
18
19
  return (0, path_1.join)(root, 'AGENTS.md');
@@ -74,3 +75,18 @@ command = "npx"
74
75
  args = ${args}
75
76
  `;
76
77
  }
78
+ /**
79
+ * The Nx runtime roots as they belong in a *committed* sandbox allowlist.
80
+ *
81
+ * `~/.nx` is the literal tilde rather than an expanded `NX_HOME_TMP_DIR`: the
82
+ * sandbox expands it per user, which is the property that makes the entry worth
83
+ * committing at all. An absolute home would pin the file to whoever ran the
84
+ * generator.
85
+ *
86
+ * Both are listed because socket resolution walks a chain — `/tmp/.nx` first,
87
+ * `~/.nx` when a peer already owns the shared container. Allowing only the first
88
+ * leaves every user on a machine where someone else got there first silently
89
+ * uncovered. Windows resolves `NX_TMP_DIR` to a machine-specific `%TMP%` and has
90
+ * no sandbox to configure, so the POSIX root is the one that belongs here.
91
+ */
92
+ exports.NX_ALLOWLIST_ROOTS = [nx_tmp_dir_1.NX_TMP_DIR_POSIX, '~/.nx'];
@@ -7,9 +7,11 @@ const fs_1 = require("fs");
7
7
  const path_1 = require("path");
8
8
  const semver_1 = require("semver");
9
9
  const smol_toml_1 = tslib_1.__importDefault(require("smol-toml"));
10
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
10
+ const format_changed_files_1 = require("../../generators/internal-utils/format-changed-files");
11
11
  const generate_files_1 = require("../../generators/utils/generate-files");
12
12
  const json_1 = require("../../generators/utils/json");
13
+ const nx_json_1 = require("../../generators/utils/nx-json");
14
+ const analytics_enabled_1 = require("../../utils/analytics-enabled");
13
15
  const native_1 = require("../../native");
14
16
  const package_json_1 = require("../../utils/package-json");
15
17
  const package_manager_1 = require("../../utils/package-manager");
@@ -71,6 +73,8 @@ function normalizeOptions(options) {
71
73
  async function setupAiAgentsGeneratorImpl(tree, options) {
72
74
  const hasAgent = (agent) => options.agents.includes(agent);
73
75
  const nxVersion = (0, installed_nx_version_1.getInstalledNxVersion)() ?? getDeclaredNxVersionOrDefault();
76
+ const analyticsEnabled = (0, analytics_enabled_1.isAnalyticsEnabled)((0, nx_json_1.readNxJson)(tree));
77
+ let addedAnalyticsDomain = false;
74
78
  const agentsMd = (0, constants_1.agentsMdPath)(options.directory);
75
79
  // write AGENTS.md for most agents
76
80
  if (hasAgent('cursor') ||
@@ -81,12 +85,15 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
81
85
  }
82
86
  if (hasAgent('claude')) {
83
87
  const claudePath = (0, path_1.join)(options.directory, 'CLAUDE.md');
84
- writeAgentRules(tree, claudePath, options.writeNxCloudRules);
88
+ writeAgentRules(tree, importsAgentsMd(tree, claudePath) ? agentsMd : claudePath, options.writeNxCloudRules);
85
89
  // Configure Claude plugin via marketplace (plugin includes MCP server)
86
90
  const claudeSettingsPath = (0, path_1.join)(options.directory, '.claude', 'settings.json');
87
91
  if (!tree.exists(claudeSettingsPath)) {
88
92
  (0, json_1.writeJson)(tree, claudeSettingsPath, {});
89
93
  }
94
+ const allowedDomains = (0, json_1.readJson)(tree, claudeSettingsPath).sandbox?.network?.allowedDomains;
95
+ addedAnalyticsDomain =
96
+ analyticsEnabled && !allowedDomains?.includes(constants_1.analyticsDomain);
90
97
  (0, json_1.updateJson)(tree, claudeSettingsPath, (json) => ({
91
98
  ...json,
92
99
  extraKnownMarketplaces: {
@@ -103,17 +110,41 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
103
110
  ...json.enabledPlugins,
104
111
  'nx@nx-claude-plugins': true,
105
112
  },
106
- // Allow Nx analytics requests through Claude Code's sandbox network filter
113
+ // Allow Nx unix socket usage (daemon, plugin workers, forked processes)
114
+ // through Claude Code's sandbox, and analytics requests when the
115
+ // workspace has them on. Nx also copies its native binary into a cache
116
+ // under the same fixed tmp root before loading it, so the read/write
117
+ // grants cover that too. The root is a fixed /tmp path on macOS and
118
+ // Linux, so these entries are machine-independent and safe to commit.
107
119
  sandbox: {
108
120
  ...json.sandbox,
121
+ filesystem: {
122
+ ...json.sandbox?.filesystem,
123
+ allowRead: withEntries(json.sandbox?.filesystem?.allowRead, ...constants_1.NX_ALLOWLIST_ROOTS),
124
+ // Covers the whole tmp root, not just the socket dir: the native
125
+ // binary cache lives under it too, and without the cache a running
126
+ // daemon keeps an open handle on the binding inside node_modules,
127
+ // which blocks reinstalling or rebuilding dependencies. What keeps
128
+ // users apart is not this allowlist but the 0700 per-uid directories
129
+ // Nx verifies on every use (see ensureOwnedPrivateDir).
130
+ allowWrite: withEntries(json.sandbox?.filesystem?.allowWrite, ...constants_1.NX_ALLOWLIST_ROOTS),
131
+ },
109
132
  network: {
110
133
  ...json.sandbox?.network,
111
- allowedDomains: json.sandbox?.network?.allowedDomains?.includes(constants_1.analyticsDomain)
112
- ? json.sandbox.network.allowedDomains
113
- : [
114
- ...(json.sandbox?.network?.allowedDomains ?? []),
115
- constants_1.analyticsDomain,
116
- ],
134
+ // Egress follows the workspace's analytics opt-in (#36663). The
135
+ // socket grant does not: Nx needs its sockets either way.
136
+ ...(analyticsEnabled
137
+ ? {
138
+ allowedDomains: withEntries(json.sandbox?.network?.allowedDomains, constants_1.analyticsDomain),
139
+ }
140
+ : {}),
141
+ // Covers binding as well as connecting, so a fresh daemon, a plugin
142
+ // worker and a forked task can each create their own socket under
143
+ // these roots. Deliberately scoped rather than `allowAllUnixSockets`,
144
+ // which grants connect access to every socket on the machine —
145
+ // including the Docker and SSH-agent sockets — and grants nothing
146
+ // extra for creating Nx's own.
147
+ allowUnixSockets: withEntries(json.sandbox?.network?.allowUnixSockets, ...constants_1.NX_ALLOWLIST_ROOTS),
117
148
  },
118
149
  },
119
150
  }));
@@ -234,11 +265,20 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
234
265
  (0, ignore_1.addEntryToGitIgnore)(tree, (0, path_1.join)(options.directory, '.gitignore'), '.nx/polygraph');
235
266
  (0, ignore_1.addEntryToGitIgnore)(tree, (0, path_1.join)(options.directory, '.gitignore'), '.claude/worktrees');
236
267
  (0, ignore_1.addEntryToGitIgnore)(tree, (0, path_1.join)(options.directory, '.gitignore'), '.claude/settings.local.json');
237
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
268
+ await (0, format_changed_files_1.formatChangedFiles)(tree);
238
269
  // we use the check variable to determine if we should actually make changes or just report what would be changed
239
270
  return async (check = false) => {
240
271
  const messages = [];
241
272
  const errors = [];
273
+ if (addedAnalyticsDomain) {
274
+ messages.push({
275
+ title: `Allowed ${constants_1.analyticsDomain} through Claude Code's sandbox network filter`,
276
+ bodyLines: [
277
+ `Nx sends analytics there because this workspace sets "analytics": true in nx.json.`,
278
+ `Set it to false to opt out, then remove the domain from .claude/settings.json.`,
279
+ ],
280
+ });
281
+ }
242
282
  if (hasAgent('copilot')) {
243
283
  try {
244
284
  if ((await (0, native_1.isEditorInstalled)(0 /* SupportedEditor.VSCode */)) &&
@@ -300,6 +340,25 @@ async function setupAiAgentsGeneratorImpl(tree, options) {
300
340
  };
301
341
  };
302
342
  }
343
+ /**
344
+ * The user's existing entries in their original order, plus any of `values`
345
+ * they do not already have. A Set does the deduping, so re-running the
346
+ * generator is a no-op rather than a growing list.
347
+ */
348
+ function withEntries(existing, ...values) {
349
+ return [...new Set([...(existing ?? []), ...values])];
350
+ }
351
+ function importsAgentsMd(tree, claudePath) {
352
+ if (!tree.exists(claudePath)) {
353
+ return false;
354
+ }
355
+ const nxBlock = tree.read(claudePath, 'utf-8').match(constants_1.rulesRegex)?.[0];
356
+ return (nxBlock
357
+ ?.replace(constants_1.nxRulesMarkerCommentStart, '')
358
+ .replace(constants_1.nxRulesMarkerCommentEnd, '')
359
+ .replace(constants_1.nxRulesMarkerCommentDescription, '')
360
+ .trim() === '@AGENTS.md');
361
+ }
303
362
  function writeAgentRules(tree, path, writeNxCloudRules) {
304
363
  if (!tree.exists(path)) {
305
364
  // File doesn't exist - create with h1 header (standalone content)
@@ -18,3 +18,16 @@ export declare function getAgentConfigurations(agentsToConsider: Agent[], worksp
18
18
  disabledAgents: AgentConfiguration[];
19
19
  }>;
20
20
  export declare function configureAgents(agents: Agent[], workspaceRoot: string, useLatest?: boolean): Promise<void>;
21
+ /**
22
+ * Explains a permission error thrown while writing agent configuration files.
23
+ *
24
+ * The errno alone does not identify the cause. Agent harnesses (e.g. Claude
25
+ * Code) deny writes to their own settings files from sandboxed shell commands,
26
+ * so `nx configure-ai-agents` run through an agent's bash tool fails with EPERM
27
+ * where the same command succeeds in a terminal — but a root-owned
28
+ * `.claude/settings.json` left by an earlier `sudo nx`, or a read-only
29
+ * checkout, produces the same errno with an unrelated remedy. The sandbox
30
+ * explanation is therefore only offered where a sandbox or an agent is
31
+ * actually detected, and the underlying message is kept either way.
32
+ */
33
+ export declare function agentConfigWriteBlockedLines(error: unknown): string[];