@depup/angular__cli 21.2.1-depup.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 (364) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/bin/bootstrap.js +33 -0
  4. package/bin/ng.js +71 -0
  5. package/bin/package.json +3 -0
  6. package/changes.json +30 -0
  7. package/lib/cli/index.d.ts +11 -0
  8. package/lib/cli/index.js +109 -0
  9. package/lib/cli/index.js.map +1 -0
  10. package/lib/code-examples.db +0 -0
  11. package/lib/config/schema.json +6150 -0
  12. package/lib/config/workspace-schema.d.ts +1025 -0
  13. package/lib/config/workspace-schema.js +133 -0
  14. package/lib/config/workspace-schema.js.map +1 -0
  15. package/lib/init.d.ts +8 -0
  16. package/lib/init.js +162 -0
  17. package/lib/init.js.map +1 -0
  18. package/package.json +103 -0
  19. package/src/analytics/analytics-collector.d.ts +35 -0
  20. package/src/analytics/analytics-collector.js +195 -0
  21. package/src/analytics/analytics-collector.js.map +1 -0
  22. package/src/analytics/analytics-parameters.d.ts +101 -0
  23. package/src/analytics/analytics-parameters.js +107 -0
  24. package/src/analytics/analytics-parameters.js.map +1 -0
  25. package/src/analytics/analytics.d.ts +27 -0
  26. package/src/analytics/analytics.js +183 -0
  27. package/src/analytics/analytics.js.map +1 -0
  28. package/src/command-builder/architect-base-command-module.d.ts +30 -0
  29. package/src/command-builder/architect-base-command-module.js +244 -0
  30. package/src/command-builder/architect-base-command-module.js.map +1 -0
  31. package/src/command-builder/architect-command-module.d.ts +28 -0
  32. package/src/command-builder/architect-command-module.js +218 -0
  33. package/src/command-builder/architect-command-module.js.map +1 -0
  34. package/src/command-builder/command-module.d.ts +73 -0
  35. package/src/command-builder/command-module.js +245 -0
  36. package/src/command-builder/command-module.js.map +1 -0
  37. package/src/command-builder/command-runner.d.ts +9 -0
  38. package/src/command-builder/command-runner.js +195 -0
  39. package/src/command-builder/command-runner.js.map +1 -0
  40. package/src/command-builder/definitions.d.ts +41 -0
  41. package/src/command-builder/definitions.js +20 -0
  42. package/src/command-builder/definitions.js.map +1 -0
  43. package/src/command-builder/schematics-command-module.d.ts +41 -0
  44. package/src/command-builder/schematics-command-module.js +408 -0
  45. package/src/command-builder/schematics-command-module.js.map +1 -0
  46. package/src/command-builder/utilities/command.d.ts +13 -0
  47. package/src/command-builder/utilities/command.js +39 -0
  48. package/src/command-builder/utilities/command.js.map +1 -0
  49. package/src/command-builder/utilities/json-help.d.ts +37 -0
  50. package/src/command-builder/utilities/json-help.js +92 -0
  51. package/src/command-builder/utilities/json-help.js.map +1 -0
  52. package/src/command-builder/utilities/json-schema.d.ts +64 -0
  53. package/src/command-builder/utilities/json-schema.js +349 -0
  54. package/src/command-builder/utilities/json-schema.js.map +1 -0
  55. package/src/command-builder/utilities/normalize-options-middleware.d.ts +18 -0
  56. package/src/command-builder/utilities/normalize-options-middleware.js +37 -0
  57. package/src/command-builder/utilities/normalize-options-middleware.js.map +1 -0
  58. package/src/command-builder/utilities/schematic-engine-host.d.ts +15 -0
  59. package/src/command-builder/utilities/schematic-engine-host.js +179 -0
  60. package/src/command-builder/utilities/schematic-engine-host.js.map +1 -0
  61. package/src/command-builder/utilities/schematic-workflow.d.ts +14 -0
  62. package/src/command-builder/utilities/schematic-workflow.js +70 -0
  63. package/src/command-builder/utilities/schematic-workflow.js.map +1 -0
  64. package/src/commands/add/cli.d.ts +38 -0
  65. package/src/commands/add/cli.js +623 -0
  66. package/src/commands/add/cli.js.map +1 -0
  67. package/src/commands/add/long-description.md +7 -0
  68. package/src/commands/analytics/cli.d.ts +16 -0
  69. package/src/commands/analytics/cli.js +34 -0
  70. package/src/commands/analytics/cli.js.map +1 -0
  71. package/src/commands/analytics/info/cli.d.ts +16 -0
  72. package/src/commands/analytics/info/cli.js +25 -0
  73. package/src/commands/analytics/info/cli.js.map +1 -0
  74. package/src/commands/analytics/long-description.md +20 -0
  75. package/src/commands/analytics/settings/cli.d.ts +35 -0
  76. package/src/commands/analytics/settings/cli.js +54 -0
  77. package/src/commands/analytics/settings/cli.js.map +1 -0
  78. package/src/commands/build/cli.d.ts +16 -0
  79. package/src/commands/build/cli.js +21 -0
  80. package/src/commands/build/cli.js.map +1 -0
  81. package/src/commands/build/long-description.md +18 -0
  82. package/src/commands/cache/clean/cli.d.ts +17 -0
  83. package/src/commands/cache/clean/cli.js +32 -0
  84. package/src/commands/cache/clean/cli.js.map +1 -0
  85. package/src/commands/cache/cli.d.ts +17 -0
  86. package/src/commands/cache/cli.js +36 -0
  87. package/src/commands/cache/cli.js.map +1 -0
  88. package/src/commands/cache/info/cli.d.ts +20 -0
  89. package/src/commands/cache/info/cli.js +139 -0
  90. package/src/commands/cache/info/cli.js.map +1 -0
  91. package/src/commands/cache/long-description.md +53 -0
  92. package/src/commands/cache/settings/cli.d.ts +27 -0
  93. package/src/commands/cache/settings/cli.js +41 -0
  94. package/src/commands/cache/settings/cli.js.map +1 -0
  95. package/src/commands/cache/utilities.d.ts +11 -0
  96. package/src/commands/cache/utilities.js +47 -0
  97. package/src/commands/cache/utilities.js.map +1 -0
  98. package/src/commands/command-config.d.ts +17 -0
  99. package/src/commands/command-config.js +116 -0
  100. package/src/commands/command-config.js.map +1 -0
  101. package/src/commands/completion/cli.d.ts +16 -0
  102. package/src/commands/completion/cli.js +61 -0
  103. package/src/commands/completion/cli.js.map +1 -0
  104. package/src/commands/completion/long-description.md +67 -0
  105. package/src/commands/config/cli.d.ts +24 -0
  106. package/src/commands/config/cli.js +150 -0
  107. package/src/commands/config/cli.js.map +1 -0
  108. package/src/commands/config/long-description.md +13 -0
  109. package/src/commands/deploy/cli.d.ts +17 -0
  110. package/src/commands/deploy/cli.js +38 -0
  111. package/src/commands/deploy/cli.js.map +1 -0
  112. package/src/commands/deploy/long-description.md +22 -0
  113. package/src/commands/e2e/cli.d.ts +18 -0
  114. package/src/commands/e2e/cli.js +42 -0
  115. package/src/commands/e2e/cli.js.map +1 -0
  116. package/src/commands/extract-i18n/cli.d.ts +17 -0
  117. package/src/commands/extract-i18n/cli.js +48 -0
  118. package/src/commands/extract-i18n/cli.js.map +1 -0
  119. package/src/commands/generate/cli.d.ts +47 -0
  120. package/src/commands/generate/cli.js +189 -0
  121. package/src/commands/generate/cli.js.map +1 -0
  122. package/src/commands/lint/cli.d.ts +17 -0
  123. package/src/commands/lint/cli.js +25 -0
  124. package/src/commands/lint/cli.js.map +1 -0
  125. package/src/commands/lint/long-description.md +20 -0
  126. package/src/commands/make-this-awesome/cli.d.ts +17 -0
  127. package/src/commands/make-this-awesome/cli.js +36 -0
  128. package/src/commands/make-this-awesome/cli.js.map +1 -0
  129. package/src/commands/mcp/cli.d.ts +20 -0
  130. package/src/commands/mcp/cli.js +74 -0
  131. package/src/commands/mcp/cli.js.map +1 -0
  132. package/src/commands/mcp/constants.d.ts +10 -0
  133. package/src/commands/mcp/constants.js +16 -0
  134. package/src/commands/mcp/constants.js.map +1 -0
  135. package/src/commands/mcp/devserver.d.ts +85 -0
  136. package/src/commands/mcp/devserver.js +112 -0
  137. package/src/commands/mcp/devserver.js.map +1 -0
  138. package/src/commands/mcp/host.d.ts +97 -0
  139. package/src/commands/mcp/host.js +118 -0
  140. package/src/commands/mcp/host.js.map +1 -0
  141. package/src/commands/mcp/mcp-server.d.ts +192 -0
  142. package/src/commands/mcp/mcp-server.js +155 -0
  143. package/src/commands/mcp/mcp-server.js.map +1 -0
  144. package/src/commands/mcp/resources/ai-tutor.md +824 -0
  145. package/src/commands/mcp/resources/best-practices.md +54 -0
  146. package/src/commands/mcp/resources/instructions.d.ts +9 -0
  147. package/src/commands/mcp/resources/instructions.js +26 -0
  148. package/src/commands/mcp/resources/instructions.js.map +1 -0
  149. package/src/commands/mcp/shared-options.d.ts +12 -0
  150. package/src/commands/mcp/shared-options.js +22 -0
  151. package/src/commands/mcp/shared-options.js.map +1 -0
  152. package/src/commands/mcp/tools/ai-tutor.d.ts +12 -0
  153. package/src/commands/mcp/tools/ai-tutor.js +59 -0
  154. package/src/commands/mcp/tools/ai-tutor.js.map +1 -0
  155. package/src/commands/mcp/tools/best-practices.d.ts +13 -0
  156. package/src/commands/mcp/tools/best-practices.js +187 -0
  157. package/src/commands/mcp/tools/best-practices.js.map +1 -0
  158. package/src/commands/mcp/tools/build.d.ts +37 -0
  159. package/src/commands/mcp/tools/build.js +89 -0
  160. package/src/commands/mcp/tools/build.js.map +1 -0
  161. package/src/commands/mcp/tools/devserver/devserver-start.d.ts +31 -0
  162. package/src/commands/mcp/tools/devserver/devserver-start.js +91 -0
  163. package/src/commands/mcp/tools/devserver/devserver-start.js.map +1 -0
  164. package/src/commands/mcp/tools/devserver/devserver-stop.d.ts +31 -0
  165. package/src/commands/mcp/tools/devserver/devserver-stop.js +68 -0
  166. package/src/commands/mcp/tools/devserver/devserver-stop.js.map +1 -0
  167. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.d.ts +41 -0
  168. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js +104 -0
  169. package/src/commands/mcp/tools/devserver/devserver-wait-for-build.js.map +1 -0
  170. package/src/commands/mcp/tools/doc-search.d.ts +21 -0
  171. package/src/commands/mcp/tools/doc-search.js +324 -0
  172. package/src/commands/mcp/tools/doc-search.js.map +1 -0
  173. package/src/commands/mcp/tools/e2e.d.ts +44 -0
  174. package/src/commands/mcp/tools/e2e.js +87 -0
  175. package/src/commands/mcp/tools/e2e.js.map +1 -0
  176. package/src/commands/mcp/tools/examples/database-discovery.d.ts +34 -0
  177. package/src/commands/mcp/tools/examples/database-discovery.js +87 -0
  178. package/src/commands/mcp/tools/examples/database-discovery.js.map +1 -0
  179. package/src/commands/mcp/tools/examples/database.d.ts +35 -0
  180. package/src/commands/mcp/tools/examples/database.js +125 -0
  181. package/src/commands/mcp/tools/examples/database.js.map +1 -0
  182. package/src/commands/mcp/tools/examples/index.d.ts +26 -0
  183. package/src/commands/mcp/tools/examples/index.js +149 -0
  184. package/src/commands/mcp/tools/examples/index.js.map +1 -0
  185. package/src/commands/mcp/tools/examples/query-escaper.d.ts +20 -0
  186. package/src/commands/mcp/tools/examples/query-escaper.js +68 -0
  187. package/src/commands/mcp/tools/examples/query-escaper.js.map +1 -0
  188. package/src/commands/mcp/tools/examples/runtime-database.d.ts +10 -0
  189. package/src/commands/mcp/tools/examples/runtime-database.js +192 -0
  190. package/src/commands/mcp/tools/examples/runtime-database.js.map +1 -0
  191. package/src/commands/mcp/tools/examples/schemas.d.ts +29 -0
  192. package/src/commands/mcp/tools/examples/schemas.js +101 -0
  193. package/src/commands/mcp/tools/examples/schemas.js.map +1 -0
  194. package/src/commands/mcp/tools/examples/utils.d.ts +14 -0
  195. package/src/commands/mcp/tools/examples/utils.js +31 -0
  196. package/src/commands/mcp/tools/examples/utils.js.map +1 -0
  197. package/src/commands/mcp/tools/modernize.d.ts +43 -0
  198. package/src/commands/mcp/tools/modernize.js +165 -0
  199. package/src/commands/mcp/tools/modernize.js.map +1 -0
  200. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.d.ts +17 -0
  201. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.js +62 -0
  202. package/src/commands/mcp/tools/onpush-zoneless-migration/analyze-for-unsupported-zone-uses.js.map +1 -0
  203. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.d.ts +12 -0
  204. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.js +73 -0
  205. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-single-file.js.map +1 -0
  206. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.d.ts +11 -0
  207. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js +60 -0
  208. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js.map +1 -0
  209. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +15 -0
  210. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +238 -0
  211. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js.map +1 -0
  212. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.d.ts +10 -0
  213. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.js +20 -0
  214. package/src/commands/mcp/tools/onpush-zoneless-migration/send-debug-message.js.map +1 -0
  215. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.d.ts +35 -0
  216. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.js +136 -0
  217. package/src/commands/mcp/tools/onpush-zoneless-migration/ts-utils.js.map +1 -0
  218. package/src/commands/mcp/tools/onpush-zoneless-migration/types.d.ts +13 -0
  219. package/src/commands/mcp/tools/onpush-zoneless-migration/types.js +10 -0
  220. package/src/commands/mcp/tools/onpush-zoneless-migration/types.js.map +1 -0
  221. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +16 -0
  222. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +224 -0
  223. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js.map +1 -0
  224. package/src/commands/mcp/tools/projects.d.ts +47 -0
  225. package/src/commands/mcp/tools/projects.js +523 -0
  226. package/src/commands/mcp/tools/projects.js.map +1 -0
  227. package/src/commands/mcp/tools/test.d.ts +35 -0
  228. package/src/commands/mcp/tools/test.js +79 -0
  229. package/src/commands/mcp/tools/test.js.map +1 -0
  230. package/src/commands/mcp/tools/tool-registry.d.ts +39 -0
  231. package/src/commands/mcp/tools/tool-registry.js +35 -0
  232. package/src/commands/mcp/tools/tool-registry.js.map +1 -0
  233. package/src/commands/mcp/utils.d.ts +25 -0
  234. package/src/commands/mcp/utils.js +44 -0
  235. package/src/commands/mcp/utils.js.map +1 -0
  236. package/src/commands/mcp/workspace-utils.d.ts +53 -0
  237. package/src/commands/mcp/workspace-utils.js +138 -0
  238. package/src/commands/mcp/workspace-utils.js.map +1 -0
  239. package/src/commands/new/cli.d.ts +27 -0
  240. package/src/commands/new/cli.js +76 -0
  241. package/src/commands/new/cli.js.map +1 -0
  242. package/src/commands/new/long-description.md +15 -0
  243. package/src/commands/run/cli.d.ts +25 -0
  244. package/src/commands/run/cli.js +89 -0
  245. package/src/commands/run/cli.js.map +1 -0
  246. package/src/commands/run/long-description.md +10 -0
  247. package/src/commands/serve/cli.d.ts +16 -0
  248. package/src/commands/serve/cli.js +20 -0
  249. package/src/commands/serve/cli.js.map +1 -0
  250. package/src/commands/test/cli.d.ts +16 -0
  251. package/src/commands/test/cli.js +21 -0
  252. package/src/commands/test/cli.js.map +1 -0
  253. package/src/commands/test/long-description.md +2 -0
  254. package/src/commands/update/cli.d.ts +34 -0
  255. package/src/commands/update/cli.js +531 -0
  256. package/src/commands/update/cli.js.map +1 -0
  257. package/src/commands/update/long-description.md +22 -0
  258. package/src/commands/update/schematic/collection.json +9 -0
  259. package/src/commands/update/schematic/index.d.ts +11 -0
  260. package/src/commands/update/schematic/index.js +715 -0
  261. package/src/commands/update/schematic/index.js.map +1 -0
  262. package/src/commands/update/schematic/schema.d.ts +51 -0
  263. package/src/commands/update/schematic/schema.js +16 -0
  264. package/src/commands/update/schematic/schema.js.map +1 -0
  265. package/src/commands/update/schematic/schema.json +64 -0
  266. package/src/commands/update/utilities/cli-version.d.ts +48 -0
  267. package/src/commands/update/utilities/cli-version.js +196 -0
  268. package/src/commands/update/utilities/cli-version.js.map +1 -0
  269. package/src/commands/update/utilities/constants.d.ts +12 -0
  270. package/src/commands/update/utilities/constants.js +16 -0
  271. package/src/commands/update/utilities/constants.js.map +1 -0
  272. package/src/commands/update/utilities/git.d.ts +36 -0
  273. package/src/commands/update/utilities/git.js +148 -0
  274. package/src/commands/update/utilities/git.js.map +1 -0
  275. package/src/commands/update/utilities/migration.d.ts +32 -0
  276. package/src/commands/update/utilities/migration.js +267 -0
  277. package/src/commands/update/utilities/migration.js.map +1 -0
  278. package/src/commands/version/cli.d.ts +36 -0
  279. package/src/commands/version/cli.js +117 -0
  280. package/src/commands/version/cli.js.map +1 -0
  281. package/src/commands/version/version-info.d.ts +46 -0
  282. package/src/commands/version/version-info.js +107 -0
  283. package/src/commands/version/version-info.js.map +1 -0
  284. package/src/package-managers/discovery.d.ts +23 -0
  285. package/src/package-managers/discovery.js +104 -0
  286. package/src/package-managers/discovery.js.map +1 -0
  287. package/src/package-managers/error.d.ts +43 -0
  288. package/src/package-managers/error.js +41 -0
  289. package/src/package-managers/error.js.map +1 -0
  290. package/src/package-managers/factory.d.ts +30 -0
  291. package/src/package-managers/factory.js +137 -0
  292. package/src/package-managers/factory.js.map +1 -0
  293. package/src/package-managers/host.d.ts +86 -0
  294. package/src/package-managers/host.js +80 -0
  295. package/src/package-managers/host.js.map +1 -0
  296. package/src/package-managers/index.d.ts +13 -0
  297. package/src/package-managers/index.js +17 -0
  298. package/src/package-managers/index.js.map +1 -0
  299. package/src/package-managers/logger.d.ts +27 -0
  300. package/src/package-managers/logger.js +10 -0
  301. package/src/package-managers/logger.js.map +1 -0
  302. package/src/package-managers/package-manager-descriptor.d.ts +245 -0
  303. package/src/package-managers/package-manager-descriptor.js +175 -0
  304. package/src/package-managers/package-manager-descriptor.js.map +1 -0
  305. package/src/package-managers/package-manager.d.ts +191 -0
  306. package/src/package-managers/package-manager.js +496 -0
  307. package/src/package-managers/package-manager.js.map +1 -0
  308. package/src/package-managers/package-metadata.d.ts +91 -0
  309. package/src/package-managers/package-metadata.js +10 -0
  310. package/src/package-managers/package-metadata.js.map +1 -0
  311. package/src/package-managers/package-tree.d.ts +23 -0
  312. package/src/package-managers/package-tree.js +10 -0
  313. package/src/package-managers/package-tree.js.map +1 -0
  314. package/src/package-managers/parsers.d.ts +170 -0
  315. package/src/package-managers/parsers.js +467 -0
  316. package/src/package-managers/parsers.js.map +1 -0
  317. package/src/utilities/color.d.ts +9 -0
  318. package/src/utilities/color.js +28 -0
  319. package/src/utilities/color.js.map +1 -0
  320. package/src/utilities/completion.d.ts +30 -0
  321. package/src/utilities/completion.js +270 -0
  322. package/src/utilities/completion.js.map +1 -0
  323. package/src/utilities/config.d.ts +38 -0
  324. package/src/utilities/config.js +369 -0
  325. package/src/utilities/config.js.map +1 -0
  326. package/src/utilities/environment-options.d.ts +25 -0
  327. package/src/utilities/environment-options.js +60 -0
  328. package/src/utilities/environment-options.js.map +1 -0
  329. package/src/utilities/eol.d.ts +20 -0
  330. package/src/utilities/eol.js +35 -0
  331. package/src/utilities/eol.js.map +1 -0
  332. package/src/utilities/error.d.ts +18 -0
  333. package/src/utilities/error.js +41 -0
  334. package/src/utilities/error.js.map +1 -0
  335. package/src/utilities/find-up.d.ts +21 -0
  336. package/src/utilities/find-up.js +67 -0
  337. package/src/utilities/find-up.js.map +1 -0
  338. package/src/utilities/json-file.d.ts +24 -0
  339. package/src/utilities/json-file.js +179 -0
  340. package/src/utilities/json-file.js.map +1 -0
  341. package/src/utilities/log-file.d.ts +13 -0
  342. package/src/utilities/log-file.js +28 -0
  343. package/src/utilities/log-file.js.map +1 -0
  344. package/src/utilities/memoize.d.ts +15 -0
  345. package/src/utilities/memoize.js +64 -0
  346. package/src/utilities/memoize.js.map +1 -0
  347. package/src/utilities/package-metadata.d.ts +58 -0
  348. package/src/utilities/package-metadata.js +265 -0
  349. package/src/utilities/package-metadata.js.map +1 -0
  350. package/src/utilities/prettier.d.ts +13 -0
  351. package/src/utilities/prettier.js +46 -0
  352. package/src/utilities/prettier.js.map +1 -0
  353. package/src/utilities/project.d.ts +8 -0
  354. package/src/utilities/project.js +81 -0
  355. package/src/utilities/project.js.map +1 -0
  356. package/src/utilities/prompt.d.ts +17 -0
  357. package/src/utilities/prompt.js +90 -0
  358. package/src/utilities/prompt.js.map +1 -0
  359. package/src/utilities/tty.d.ts +16 -0
  360. package/src/utilities/tty.js +23 -0
  361. package/src/utilities/tty.js.map +1 -0
  362. package/src/utilities/version.d.ts +16 -0
  363. package/src/utilities/version.js +26 -0
  364. package/src/utilities/version.js.map +1 -0
@@ -0,0 +1,54 @@
1
+ You are an expert in TypeScript, Angular, and scalable web application development. You write functional, maintainable, performant, and accessible code following Angular and TypeScript best practices.
2
+
3
+ ## TypeScript Best Practices
4
+
5
+ - Use strict type checking
6
+ - Prefer type inference when the type is obvious
7
+ - Avoid the `any` type; use `unknown` when type is uncertain
8
+
9
+ ## Angular Best Practices
10
+
11
+ - Always use standalone components over NgModules
12
+ - Must NOT set `standalone: true` inside Angular decorators. It's the default in Angular v20+.
13
+ - Use signals for state management
14
+ - Implement lazy loading for feature routes
15
+ - Do NOT use the `@HostBinding` and `@HostListener` decorators. Put host bindings inside the `host` object of the `@Component` or `@Directive` decorator instead
16
+ - Use `NgOptimizedImage` for all static images.
17
+ - `NgOptimizedImage` does not work for inline base64 images.
18
+
19
+ ## Accessibility Requirements
20
+
21
+ - It MUST pass all AXE checks.
22
+ - It MUST follow all WCAG AA minimums, including focus management, color contrast, and ARIA attributes.
23
+
24
+ ### Components
25
+
26
+ - Keep components small and focused on a single responsibility
27
+ - Use `input()` and `output()` functions instead of decorators
28
+ - Use `computed()` for derived state
29
+ - Set `changeDetection: ChangeDetectionStrategy.OnPush` in `@Component` decorator
30
+ - Prefer inline templates for small components
31
+ - Prefer Reactive forms instead of Template-driven ones
32
+ - Do NOT use `ngClass`, use `class` bindings instead
33
+ - Do NOT use `ngStyle`, use `style` bindings instead
34
+ - When using external templates/styles, use paths relative to the component TS file.
35
+
36
+ ## State Management
37
+
38
+ - Use signals for local component state
39
+ - Use `computed()` for derived state
40
+ - Keep state transformations pure and predictable
41
+ - Do NOT use `mutate` on signals, use `update` or `set` instead
42
+
43
+ ## Templates
44
+
45
+ - Keep templates simple and avoid complex logic
46
+ - Use native control flow (`@if`, `@for`, `@switch`) instead of `*ngIf`, `*ngFor`, `*ngSwitch`
47
+ - Use the async pipe to handle observables
48
+ - Do not assume globals like (`new Date()`) are available.
49
+
50
+ ## Services
51
+
52
+ - Design services around a single responsibility
53
+ - Use the `providedIn: 'root'` option for singleton services
54
+ - Use the `inject()` function instead of constructor injection
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
9
+ export declare function registerInstructionsResource(server: McpServer): void;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.registerInstructionsResource = registerInstructionsResource;
11
+ const promises_1 = require("node:fs/promises");
12
+ const node_path_1 = require("node:path");
13
+ function registerInstructionsResource(server) {
14
+ server.registerResource('instructions', 'instructions://best-practices', {
15
+ title: 'Angular Best Practices and Code Generation Guide',
16
+ description: "A comprehensive guide detailing Angular's best practices for code generation and development." +
17
+ ' This guide should be used as a reference by an LLM to ensure any generated code' +
18
+ ' adheres to modern Angular standards, including the use of standalone components,' +
19
+ ' typed forms, modern control flow syntax, and other current conventions.',
20
+ mimeType: 'text/markdown',
21
+ }, async () => {
22
+ const text = await (0, promises_1.readFile)((0, node_path_1.join)(__dirname, 'best-practices.md'), 'utf-8');
23
+ return { contents: [{ uri: 'instructions://best-practices', text }] };
24
+ });
25
+ }
26
+ //# sourceMappingURL=instructions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instructions.js","sourceRoot":"","sources":["instructions.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAMH,oEAmBC;AAtBD,+CAA4C;AAC5C,yCAAiC;AAEjC,SAAgB,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,CAAC,gBAAgB,CACrB,cAAc,EACd,+BAA+B,EAC/B;QACE,KAAK,EAAE,kDAAkD;QACzD,WAAW,EACT,+FAA+F;YAC/F,kFAAkF;YAClF,mFAAmF;YACnF,0EAA0E;QAC5E,QAAQ,EAAE,eAAe;KAC1B,EACD,KAAK,IAAI,EAAE;QACT,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAA,gBAAI,EAAC,SAAS,EAAE,mBAAmB,CAAC,EAAE,OAAO,CAAC,CAAC;QAE3E,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,+BAA+B,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IACxE,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { z } from 'zod';
9
+ export declare const workspaceAndProjectOptions: {
10
+ workspace: z.ZodOptional<z.ZodString>;
11
+ project: z.ZodOptional<z.ZodString>;
12
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.workspaceAndProjectOptions = void 0;
11
+ const zod_1 = require("zod");
12
+ exports.workspaceAndProjectOptions = {
13
+ workspace: zod_1.z
14
+ .string()
15
+ .optional()
16
+ .describe('The path to the workspace directory (containing angular.json). If not provided, uses the current directory.'),
17
+ project: zod_1.z
18
+ .string()
19
+ .optional()
20
+ .describe('Which project to target in a monorepo context. If not provided, targets the default project.'),
21
+ };
22
+ //# sourceMappingURL=shared-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared-options.js","sourceRoot":"","sources":["shared-options.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,6BAAwB;AAEX,QAAA,0BAA0B,GAAG;IACxC,SAAS,EAAE,OAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,6GAA6G,CAC9G;IACH,OAAO,EAAE,OAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,8FAA8F,CAC/F;CACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ export declare const AI_TUTOR_TOOL: import("./tool-registry").McpToolDeclaration<Readonly<{
9
+ [k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
10
+ }>, Readonly<{
11
+ [k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
12
+ }>>;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.AI_TUTOR_TOOL = void 0;
11
+ const promises_1 = require("node:fs/promises");
12
+ const node_path_1 = require("node:path");
13
+ const tool_registry_1 = require("./tool-registry");
14
+ exports.AI_TUTOR_TOOL = (0, tool_registry_1.declareTool)({
15
+ name: 'ai_tutor',
16
+ title: 'Start Angular AI Tutor',
17
+ description: `
18
+ <Purpose>
19
+ Loads the core instructions, curriculum, and persona for the Angular AI Tutor.
20
+ This tool acts as a RAG (Retrieval-Augmented Generation) source, effectively
21
+ reprogramming the assistant to become a specialized Angular tutor by providing it
22
+ with a new core identity and knowledge base.
23
+ </Purpose>
24
+ <Use Cases>
25
+ * The user asks to start a guided, step-by-step tutorial for learning Angular (e.g., "teach me Angular," "start the tutorial").
26
+ * The user asks to resume a previous tutoring session.
27
+ </Use Cases>
28
+ <Operational Notes>
29
+ * The text returned by this tool is a new set of instructions and rules for you, the LLM. It is NOT meant to be displayed to the user.
30
+ * After invoking this tool, you MUST adopt the persona of the Angular AI Tutor and follow the curriculum provided in the text.
31
+ * Be aware that the tutor persona supports special user commands, such as "skip this section," "show the table of contents,"
32
+ or "set my experience level to beginner." The curriculum text will provide the full details on how to handle these.
33
+ * Your subsequent responses should be governed by these new instructions, leading the user through the "Smart Recipe Box"
34
+ application tutorial.
35
+ * As the tutor, you will use your other tools to access the user's project files to verify their solutions as instructed by the curriculum.
36
+ </Operational Notes>
37
+ `,
38
+ isReadOnly: true,
39
+ isLocalOnly: true,
40
+ factory: () => {
41
+ let aiTutorText;
42
+ return async () => {
43
+ aiTutorText ??= await (0, promises_1.readFile)((0, node_path_1.join)(__dirname, '../resources/ai-tutor.md'), 'utf-8');
44
+ return {
45
+ content: [
46
+ {
47
+ type: 'text',
48
+ text: aiTutorText,
49
+ annotations: {
50
+ audience: ['assistant'],
51
+ priority: 1.0,
52
+ },
53
+ },
54
+ ],
55
+ };
56
+ };
57
+ },
58
+ });
59
+ //# sourceMappingURL=ai-tutor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-tutor.js","sourceRoot":"","sources":["ai-tutor.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,+CAA4C;AAC5C,yCAAiC;AACjC,mDAA8C;AAEjC,QAAA,aAAa,GAAG,IAAA,2BAAW,EAAC;IACvC,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;CAoBd;IACC,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,GAAG,EAAE;QACZ,IAAI,WAAmB,CAAC;QAExB,OAAO,KAAK,IAAI,EAAE;YAChB,WAAW,KAAK,MAAM,IAAA,mBAAQ,EAAC,IAAA,gBAAI,EAAC,SAAS,EAAE,0BAA0B,CAAC,EAAE,OAAO,CAAC,CAAC;YAErF,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,WAAW;wBACjB,WAAW,EAAE;4BACX,QAAQ,EAAE,CAAC,WAAW,CAAC;4BACvB,QAAQ,EAAE,GAAG;yBACd;qBACF;iBACF;aACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { z } from 'zod';
9
+ export declare const BEST_PRACTICES_TOOL: import("./tool-registry").McpToolDeclaration<{
10
+ workspacePath: z.ZodOptional<z.ZodString>;
11
+ }, Readonly<{
12
+ [k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
13
+ }>>;
@@ -0,0 +1,187 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.BEST_PRACTICES_TOOL = void 0;
11
+ /**
12
+ * @fileoverview
13
+ * This file defines the `get_best_practices` MCP tool. The tool is designed to be version-aware,
14
+ * dynamically resolving the best practices guide from the user's installed version of
15
+ * `@angular/core`. It achieves this by reading a custom `angular` metadata block in the
16
+ * framework's `package.json`. If this resolution fails, it gracefully falls back to a generic
17
+ * guide bundled with the Angular CLI.
18
+ */
19
+ const promises_1 = require("node:fs/promises");
20
+ const node_module_1 = require("node:module");
21
+ const node_path_1 = require("node:path");
22
+ const zod_1 = require("zod");
23
+ const version_1 = require("../../../utilities/version");
24
+ const tool_registry_1 = require("./tool-registry");
25
+ const bestPracticesInputSchema = zod_1.z.object({
26
+ workspacePath: zod_1.z
27
+ .string()
28
+ .optional()
29
+ .describe('The absolute path to the `angular.json` file for the workspace. This is used to find the ' +
30
+ 'version-specific best practices guide that corresponds to the installed version of the ' +
31
+ 'Angular framework. You **MUST** get this path from the `list_projects` tool. If omitted, ' +
32
+ 'the tool will return the generic best practices guide bundled with the CLI.'),
33
+ });
34
+ exports.BEST_PRACTICES_TOOL = (0, tool_registry_1.declareTool)({
35
+ name: 'get_best_practices',
36
+ title: 'Get Angular Coding Best Practices Guide',
37
+ description: `
38
+ <Purpose>
39
+ Retrieves the official Angular Best Practices Guide. This guide contains the essential rules and conventions
40
+ that **MUST** be followed for any task involving the creation, analysis, or modification of Angular code.
41
+ </Purpose>
42
+ <Use Cases>
43
+ * As a mandatory first step before writing or modifying any Angular code to ensure adherence to modern standards.
44
+ * To learn about key concepts like standalone components, typed forms, and modern control flow syntax (@if, @for, @switch).
45
+ * To verify that existing code aligns with current Angular conventions before making changes.
46
+ </Use Cases>
47
+ <Operational Notes>
48
+ * **Project-Specific Use (Recommended):** For tasks inside a user's project, you **MUST** provide the
49
+ \`workspacePath\` argument to get the guide that matches the project's Angular version. Get this
50
+ path from \`list_projects\`.
51
+ * **General Use:** If no project context is available (e.g., for general questions or learning),
52
+ you can call the tool without the \`workspacePath\` argument. It will return the latest
53
+ generic best practices guide.
54
+ * The content of this guide is non-negotiable and reflects the official, up-to-date standards for Angular development.
55
+ * You **MUST** internalize and apply the principles from this guide in all subsequent Angular-related tasks.
56
+ * Failure to adhere to these best practices will result in suboptimal and outdated code.
57
+ </Operational Notes>`,
58
+ inputSchema: bestPracticesInputSchema.shape,
59
+ isReadOnly: true,
60
+ isLocalOnly: true,
61
+ factory: createBestPracticesHandler,
62
+ });
63
+ /**
64
+ * Retrieves the content of the generic best practices guide that is bundled with the CLI.
65
+ * This serves as a fallback when a version-specific guide cannot be found.
66
+ * @returns A promise that resolves to the string content of the bundled markdown file.
67
+ */
68
+ async function getBundledBestPractices() {
69
+ return (0, promises_1.readFile)((0, node_path_1.join)(__dirname, '../resources/best-practices.md'), 'utf-8');
70
+ }
71
+ /**
72
+ * Attempts to find and read a version-specific best practices guide from the user's installed
73
+ * version of `@angular/core`. It looks for a custom `angular` metadata property in the
74
+ * framework's `package.json` to locate the guide.
75
+ *
76
+ * @example A sample `package.json` `angular` field:
77
+ * ```json
78
+ * {
79
+ * "angular": {
80
+ * "bestPractices": {
81
+ * "format": "markdown",
82
+ * "path": "./resources/best-practices.md"
83
+ * }
84
+ * }
85
+ * }
86
+ * ```
87
+ *
88
+ * @param workspacePath The absolute path to the user's `angular.json` file.
89
+ * @param logger The MCP tool context logger for reporting warnings.
90
+ * @returns A promise that resolves to an object containing the guide's content and source,
91
+ * or `undefined` if the guide could not be resolved.
92
+ */
93
+ async function getVersionSpecificBestPractices(workspacePath, logger) {
94
+ // 1. Resolve the path to package.json
95
+ let pkgJsonPath;
96
+ try {
97
+ const workspaceRequire = (0, node_module_1.createRequire)(workspacePath);
98
+ pkgJsonPath = workspaceRequire.resolve('@angular/core/package.json');
99
+ }
100
+ catch (e) {
101
+ logger.warn(`Could not resolve '@angular/core/package.json' from '${workspacePath}'. ` +
102
+ 'Is Angular installed in this project? Falling back to the bundled guide.');
103
+ return undefined;
104
+ }
105
+ // 2. Read and parse package.json, then find and read the guide.
106
+ try {
107
+ const pkgJsonContent = await (0, promises_1.readFile)(pkgJsonPath, 'utf-8');
108
+ const pkgJson = JSON.parse(pkgJsonContent);
109
+ const bestPracticesInfo = pkgJson['angular']?.bestPractices;
110
+ if (bestPracticesInfo &&
111
+ bestPracticesInfo.format === 'markdown' &&
112
+ typeof bestPracticesInfo.path === 'string') {
113
+ const packageDirectory = (0, node_path_1.dirname)(pkgJsonPath);
114
+ const guidePath = (0, node_path_1.resolve)(packageDirectory, bestPracticesInfo.path);
115
+ // Ensure the resolved guide path is within the package boundary.
116
+ // Uses path.relative to create a cross-platform, case-insensitive check.
117
+ // If the relative path starts with '..' or is absolute, it is a traversal attempt.
118
+ const relativePath = (0, node_path_1.relative)(packageDirectory, guidePath);
119
+ if (relativePath.startsWith('..') || (0, node_path_1.isAbsolute)(relativePath)) {
120
+ logger.warn(`Detected a potential path traversal attempt in '${pkgJsonPath}'. ` +
121
+ `The path '${bestPracticesInfo.path}' escapes the package boundary. ` +
122
+ 'Falling back to the bundled guide.');
123
+ return undefined;
124
+ }
125
+ // Check the file size to prevent reading a very large file.
126
+ const stats = await (0, promises_1.stat)(guidePath);
127
+ if (stats.size > 1024 * 1024) {
128
+ // 1MB
129
+ logger.warn(`The best practices guide at '${guidePath}' is larger than 1MB (${stats.size} bytes). ` +
130
+ 'This is unexpected and the file will not be read. Falling back to the bundled guide.');
131
+ return undefined;
132
+ }
133
+ const content = await (0, promises_1.readFile)(guidePath, 'utf-8');
134
+ const source = `framework version ${pkgJson.version}`;
135
+ return { content, source };
136
+ }
137
+ else {
138
+ logger.warn(`Did not find valid 'angular.bestPractices' metadata in '${pkgJsonPath}'. ` +
139
+ 'Falling back to the bundled guide.');
140
+ }
141
+ }
142
+ catch (e) {
143
+ logger.warn(`Failed to read or parse version-specific best practices referenced in '${pkgJsonPath}': ${e instanceof Error ? e.message : e}. Falling back to the bundled guide.`);
144
+ }
145
+ return undefined;
146
+ }
147
+ /**
148
+ * Creates the handler function for the `get_best_practices` tool.
149
+ * The handler orchestrates the process of first attempting to get a version-specific guide
150
+ * and then falling back to the bundled guide if necessary.
151
+ * @param context The MCP tool context, containing the logger.
152
+ * @returns An async function that serves as the tool's executor.
153
+ */
154
+ function createBestPracticesHandler({ logger }) {
155
+ let bundledBestPractices;
156
+ return async (input) => {
157
+ let content;
158
+ let source;
159
+ // First, try to get the version-specific guide.
160
+ if (input.workspacePath) {
161
+ const versionSpecific = await getVersionSpecificBestPractices(input.workspacePath, logger);
162
+ if (versionSpecific) {
163
+ content = versionSpecific.content;
164
+ source = versionSpecific.source;
165
+ }
166
+ }
167
+ // If the version-specific guide was not found for any reason, fall back to the bundled version.
168
+ if (content === undefined) {
169
+ content = await (bundledBestPractices ??= getBundledBestPractices());
170
+ source = `bundled (CLI v${version_1.VERSION.full})`;
171
+ }
172
+ return {
173
+ content: [
174
+ {
175
+ type: 'text',
176
+ text: content,
177
+ annotations: {
178
+ audience: ['assistant'],
179
+ priority: 0.9,
180
+ source,
181
+ },
182
+ },
183
+ ],
184
+ };
185
+ };
186
+ }
187
+ //# sourceMappingURL=best-practices.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"best-practices.js","sourceRoot":"","sources":["best-practices.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH;;;;;;;GAOG;AAEH,+CAAkD;AAClD,6CAA4C;AAC5C,yCAAyE;AACzE,6BAAwB;AACxB,wDAAqD;AACrD,mDAAmE;AAEnE,MAAM,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,aAAa,EAAE,OAAC;SACb,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,2FAA2F;QACzF,yFAAyF;QACzF,2FAA2F;QAC3F,6EAA6E,CAChF;CACJ,CAAC,CAAC;AAIU,QAAA,mBAAmB,GAAG,IAAA,2BAAW,EAAC;IAC7C,IAAI,EAAE,oBAAoB;IAC1B,KAAK,EAAE,yCAAyC;IAChD,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;qBAoBM;IACnB,WAAW,EAAE,wBAAwB,CAAC,KAAK;IAC3C,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;IACjB,OAAO,EAAE,0BAA0B;CACpC,CAAC,CAAC;AAEH;;;;GAIG;AACH,KAAK,UAAU,uBAAuB;IACpC,OAAO,IAAA,mBAAQ,EAAC,IAAA,gBAAI,EAAC,SAAS,EAAE,gCAAgC,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,KAAK,UAAU,+BAA+B,CAC5C,aAAqB,EACrB,MAAgC;IAEhC,sCAAsC;IACtC,IAAI,WAAmB,CAAC;IACxB,IAAI,CAAC;QACH,MAAM,gBAAgB,GAAG,IAAA,2BA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AgG;QAChG,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC1B,OAAO,GAAG,MAAM,CAAC,oBAAoB,KAAK,uBAAuB,EAAE,CAAC,CAAC;YACrE,MAAM,GAAG,iBAAiB,iBAAO,CAAC,IAAI,GAAG,CAAC;QAC5C,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE;wBACX,QAAQ,EAAE,CAAC,WAAoB,CAAC;wBAChC,QAAQ,EAAE,GAAG;wBACb,MAAM;qBACP;iBACF;aACF;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { z } from 'zod';
9
+ import { type McpToolContext, type McpToolDeclaration } from './tool-registry';
10
+ declare const buildToolInputSchema: z.ZodObject<{
11
+ configuration: z.ZodOptional<z.ZodString>;
12
+ workspace: z.ZodOptional<z.ZodString>;
13
+ project: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>;
15
+ export type BuildToolInput = z.infer<typeof buildToolInputSchema>;
16
+ declare const buildToolOutputSchema: z.ZodObject<{
17
+ status: z.ZodEnum<{
18
+ success: "success";
19
+ failure: "failure";
20
+ }>;
21
+ logs: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ path: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strip>;
24
+ export type BuildToolOutput = z.infer<typeof buildToolOutputSchema>;
25
+ export declare function runBuild(input: BuildToolInput, context: McpToolContext): Promise<{
26
+ content: {
27
+ type: "text";
28
+ text: string;
29
+ }[];
30
+ structuredContent: {
31
+ status: "success" | "failure";
32
+ logs?: string[] | undefined;
33
+ path?: string | undefined;
34
+ };
35
+ }>;
36
+ export declare const BUILD_TOOL: McpToolDeclaration<typeof buildToolInputSchema.shape, typeof buildToolOutputSchema.shape>;
37
+ export {};
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.BUILD_TOOL = void 0;
11
+ exports.runBuild = runBuild;
12
+ const zod_1 = require("zod");
13
+ const shared_options_1 = require("../shared-options");
14
+ const utils_1 = require("../utils");
15
+ const workspace_utils_1 = require("../workspace-utils");
16
+ const tool_registry_1 = require("./tool-registry");
17
+ const DEFAULT_CONFIGURATION = 'development';
18
+ const buildStatusSchema = zod_1.z.enum(['success', 'failure']);
19
+ const buildToolInputSchema = zod_1.z.object({
20
+ ...shared_options_1.workspaceAndProjectOptions,
21
+ configuration: zod_1.z
22
+ .string()
23
+ .optional()
24
+ .describe('Which build configuration to use. Defaults to "development".'),
25
+ });
26
+ const buildToolOutputSchema = zod_1.z.object({
27
+ status: buildStatusSchema.describe('Build status.'),
28
+ logs: zod_1.z.array(zod_1.z.string()).optional().describe('Output logs from `ng build`.'),
29
+ path: zod_1.z.string().optional().describe('The output location for the build, if successful.'),
30
+ });
31
+ async function runBuild(input, context) {
32
+ const { workspacePath, projectName } = await (0, workspace_utils_1.resolveWorkspaceAndProject)({
33
+ host: context.host,
34
+ workspacePathInput: input.workspace,
35
+ projectNameInput: input.project,
36
+ mcpWorkspace: context.workspace,
37
+ });
38
+ // Build "ng"'s command line.
39
+ const args = ['build', projectName, '-c', input.configuration ?? DEFAULT_CONFIGURATION];
40
+ let status = 'success';
41
+ let logs = [];
42
+ let outputPath;
43
+ try {
44
+ logs = (await context.host.runCommand('ng', args, { cwd: workspacePath })).logs;
45
+ }
46
+ catch (e) {
47
+ status = 'failure';
48
+ logs = (0, utils_1.getCommandErrorLogs)(e);
49
+ }
50
+ for (const line of logs) {
51
+ const match = line.match(/Output location: (.*)/);
52
+ if (match) {
53
+ outputPath = match[1].trim();
54
+ break;
55
+ }
56
+ }
57
+ const structuredContent = {
58
+ status,
59
+ logs,
60
+ path: outputPath,
61
+ };
62
+ return (0, utils_1.createStructuredContentOutput)(structuredContent);
63
+ }
64
+ exports.BUILD_TOOL = (0, tool_registry_1.declareTool)({
65
+ name: 'build',
66
+ title: 'Build Tool',
67
+ description: `
68
+ <Purpose>
69
+ Perform a one-off, non-watched build using "ng build". Use this tool whenever the user wants to build an Angular project; this is similar to
70
+ "ng build", but the tool is smarter about using the right configuration and collecting the output logs.
71
+ </Purpose>
72
+ <Use Cases>
73
+ * Building an Angular project and getting build logs back.
74
+ </Use Cases>
75
+ <Operational Notes>
76
+ * This tool runs "ng build" so it expects to run within an Angular workspace.
77
+ * If you want a watched build which updates as files are changed, use "devserver.start" instead, which also serves the app.
78
+ * You can provide a project instead of building the root one. The "list_projects" MCP tool could be used to obtain the list of projects.
79
+ * This tool defaults to a development environment while a regular "ng build" defaults to a production environment. An unexpected build
80
+ failure might suggest the project is not configured for the requested environment.
81
+ </Operational Notes>
82
+ `,
83
+ isReadOnly: false,
84
+ isLocalOnly: true,
85
+ inputSchema: buildToolInputSchema.shape,
86
+ outputSchema: buildToolOutputSchema.shape,
87
+ factory: (context) => (input) => runBuild(input, context),
88
+ });
89
+ //# sourceMappingURL=build.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["build.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA+BH,4BAqCC;AAlED,6BAAwB;AACxB,sDAA+D;AAC/D,oCAA8E;AAC9E,wDAAgE;AAChE,mDAA4F;AAE5F,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAE5C,MAAM,iBAAiB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAGzD,MAAM,oBAAoB,GAAG,OAAC,CAAC,MAAM,CA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SAAS,CAAC;QACnB,IAAI,GAAG,IAAA,2BAAmB,EAAC,CAAC,CAAC,CAAC;IAChC,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QACxB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAClD,IAAI,KAAK,EAAE,CAAC;YACV,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAC7B,MAAM;QACR,CAAC;IACH,CAAC;IAED,MAAM,iBAAiB,GAAoB;QACzC,MAAM;QACN,IAAI;QACJ,IAAI,EAAE,UAAU;KACjB,CAAC;IAEF,OAAO,IAAA,qCAA6B,EAAC,iBAAiB,CAAC,CAAC;AAC1D,CAAC;AAEY,QAAA,UAAU,GAGnB,IAAA,2BAAW,EAAC;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE;;;;;;;;;;;;;;;CAed;IACC,UAAU,EAAE,KAAK;IACjB,WAAW,EAAE,IAAI;IACjB,WAAW,EAAE,oBAAoB,CAAC,KAAK;IACvC,YAAY,EAAE,qBAAqB,CAAC,KAAK;IACzC,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CAC1D,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import { z } from 'zod';
9
+ import { type McpToolContext, type McpToolDeclaration } from '../tool-registry';
10
+ declare const devserverStartToolInputSchema: z.ZodObject<{
11
+ workspace: z.ZodOptional<z.ZodString>;
12
+ project: z.ZodOptional<z.ZodString>;
13
+ }, z.core.$strip>;
14
+ export type DevserverStartToolInput = z.infer<typeof devserverStartToolInputSchema>;
15
+ declare const devserverStartToolOutputSchema: z.ZodObject<{
16
+ message: z.ZodString;
17
+ address: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type DevserverStartToolOutput = z.infer<typeof devserverStartToolOutputSchema>;
20
+ export declare function startDevserver(input: DevserverStartToolInput, context: McpToolContext): Promise<{
21
+ content: {
22
+ type: "text";
23
+ text: string;
24
+ }[];
25
+ structuredContent: {
26
+ message: string;
27
+ address: string;
28
+ };
29
+ }>;
30
+ export declare const DEVSERVER_START_TOOL: McpToolDeclaration<typeof devserverStartToolInputSchema.shape, typeof devserverStartToolOutputSchema.shape>;
31
+ export {};