@aws/nx-plugin 1.0.0-rc.47 → 1.0.0-rc.49

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 (83) hide show
  1. package/LICENSE-THIRD-PARTY +15 -0
  2. package/generators.json +7 -0
  3. package/migrations.json +5 -0
  4. package/package.json +4 -4
  5. package/src/mcp-server/dev-server.d.ts +1 -0
  6. package/src/mcp-server/dev-server.js +18 -0
  7. package/src/mcp-server/dev-server.js.map +1 -0
  8. package/src/mcp-server/guide-pipeline.js +1 -1
  9. package/src/mcp-server/guide-pipeline.js.map +1 -1
  10. package/src/mcp-server/server.js +2 -0
  11. package/src/mcp-server/server.js.map +1 -1
  12. package/src/mcp-server/tools/general-guidance.d.ts +1 -1
  13. package/src/mcp-server/tools/general-guidance.js +1 -0
  14. package/src/mcp-server/tools/general-guidance.js.map +1 -1
  15. package/src/mcp-server/tools/upgrade-workspace.d.ts +11 -0
  16. package/src/mcp-server/tools/upgrade-workspace.js +32 -0
  17. package/src/mcp-server/tools/upgrade-workspace.js.map +1 -0
  18. package/src/preset/__snapshots__/generator.spec.ts.snap +6 -0
  19. package/src/sdk/ts.d.ts +4 -2
  20. package/src/sdk/ts.js +4 -2
  21. package/src/sdk/ts.js.map +1 -1
  22. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +9 -4
  23. package/src/ts/agent/a2a-connection/__snapshots__/generator.spec.ts.snap +1 -0
  24. package/src/ts/agent/files/ag-ui/index.ts.template +25 -9
  25. package/src/ts/agent/files/common/agent.ts.template +2 -1
  26. package/src/ts/agent/files/deploy/Dockerfile.template +7 -3
  27. package/src/ts/agent/gateway-connection/__snapshots__/generator.spec.ts.snap +1 -0
  28. package/src/ts/agent/generator.js +2 -2
  29. package/src/ts/agent/generator.js.map +1 -1
  30. package/src/ts/agent/mcp-connection/__snapshots__/generator.spec.ts.snap +1 -0
  31. package/src/ts/mcp-server/files/Dockerfile.template +7 -3
  32. package/src/ts/mcp-server/generator.js +2 -2
  33. package/src/ts/mcp-server/generator.js.map +1 -1
  34. package/src/ts/nx-migration/files/migration.spec.ts.template +26 -0
  35. package/src/ts/nx-migration/files/migration.ts.template +55 -0
  36. package/src/ts/nx-migration/files/prompt.md.template +46 -0
  37. package/src/ts/nx-migration/generator.d.ts +24 -0
  38. package/src/ts/nx-migration/generator.js +122 -0
  39. package/src/ts/nx-migration/generator.js.map +1 -0
  40. package/src/ts/nx-migration/schema.d.js +6 -0
  41. package/src/ts/nx-migration/schema.d.js.map +1 -0
  42. package/src/ts/nx-migration/schema.d.ts +13 -0
  43. package/src/ts/nx-migration/schema.json +63 -0
  44. package/src/ts/nx-plugin/utils.d.ts +21 -1
  45. package/src/ts/nx-plugin/utils.js +46 -35
  46. package/src/ts/nx-plugin/utils.js.map +1 -1
  47. package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +11 -3
  48. package/src/ts/rdb/files/Dockerfile.template +5 -1
  49. package/src/ts/rdb/files/src/migration-handler.ts.template +3 -1
  50. package/src/ts/rdb/generator.js +2 -2
  51. package/src/ts/rdb/generator.js.map +1 -1
  52. package/src/utils/agent-connection/agent-connection.js +4 -0
  53. package/src/utils/agent-connection/agent-connection.js.map +1 -1
  54. package/src/utils/agent-connection/files/core-strands/base/tool-errors-strands.ts.template +22 -0
  55. package/src/utils/agent-core-constructs/files/terraform/app/agentcore-gateway/__nameKebabCase__/__nameKebabCase__.tf.template +19 -1
  56. package/src/utils/commands.d.ts +4 -3
  57. package/src/utils/commands.js +6 -2
  58. package/src/utils/commands.js.map +1 -1
  59. package/src/utils/docker.d.ts +8 -0
  60. package/src/utils/docker.js +8 -1
  61. package/src/utils/docker.js.map +1 -1
  62. package/src/utils/format.js +54 -25
  63. package/src/utils/format.js.map +1 -1
  64. package/src/utils/init.js +7 -2
  65. package/src/utils/init.js.map +1 -1
  66. package/src/utils/mcp.d.ts +9 -0
  67. package/src/utils/mcp.js +9 -1
  68. package/src/utils/mcp.js.map +1 -1
  69. package/src/utils/migration-versions.d.ts +95 -0
  70. package/src/utils/migration-versions.js +128 -0
  71. package/src/utils/migration-versions.js.map +1 -0
  72. package/src/utils/nx.d.ts +18 -0
  73. package/src/utils/nx.js +24 -1
  74. package/src/utils/nx.js.map +1 -1
  75. package/src/utils/test-git.d.ts +39 -0
  76. package/src/utils/test-git.js +117 -0
  77. package/src/utils/test-git.js.map +1 -0
  78. package/src/utils/versions.d.ts +4 -1
  79. package/src/utils/versions.js +10 -2
  80. package/src/utils/versions.js.map +1 -1
  81. package/src/bin/aws-nx-mcp.d.ts +0 -2
  82. package/src/bin/aws-nx-mcp.js +0 -14
  83. package/src/bin/aws-nx-mcp.js.map +0 -1
package/src/utils/nx.d.ts CHANGED
@@ -16,6 +16,24 @@ export declare const listGenerators: (includeHidden?: boolean) => GeneratorInfo[
16
16
  */
17
17
  export declare const getGeneratorInfo: (generatorFileName: string) => GeneratorInfo;
18
18
  export declare const getPackageVersion: () => string;
19
+ /**
20
+ * True inside the plugin's own monorepo, where the plugin is the source rather
21
+ * than a dependency.
22
+ */
23
+ export declare const isNxPluginForAwsWorkspace: (tree: Tree) => boolean;
24
+ /**
25
+ * The `@aws/nx-plugin` devDependency entry for a workspace the plugin generates
26
+ * into, keyed to the version the running generators come from. Empty inside the
27
+ * plugin's own monorepo.
28
+ */
29
+ export declare const nxPluginSelfDependency: (tree: Tree) => Record<string, string>;
30
+ /**
31
+ * The `@aws/nx-plugin-mcp` devDependency entry, keyed to the running generators'
32
+ * version — the two packages are released in lockstep. Declaring it pins the MCP
33
+ * server the vended config runs in the workspace's lockfile, so upgrading it
34
+ * upgrades the server. Empty inside the plugin's own monorepo.
35
+ */
36
+ export declare const nxPluginMcpDependency: (tree: Tree) => Record<string, string>;
19
37
  /**
20
38
  * Read a project configuration where the project name may not be fully qualified (ie may omit the scope prefix)
21
39
  */
package/src/utils/nx.js CHANGED
@@ -1,11 +1,12 @@
1
1
  /**
2
2
  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  * SPDX-License-Identifier: Apache-2.0
4
- */ import { getProjects, readProjectConfiguration, updateProjectConfiguration } from "@nx/devkit";
4
+ */ import { getProjects, readJson, readProjectConfiguration, updateProjectConfiguration } from "@nx/devkit";
5
5
  import * as path from "path";
6
6
  import PackageJson from "../../package.json" with {
7
7
  type: 'json'
8
8
  };
9
+ import { NX_PLUGIN_MCP_PACKAGE_NAME } from "./mcp.js";
9
10
  import { toSnakeCase } from "./names.js";
10
11
  import { getNpmScope, getNpmScopePrefix } from "./npm-scope.js";
11
12
  export { buildGeneratorInfoList } from "./generators.js";
@@ -25,6 +26,28 @@ const GENERATORS = buildGeneratorInfoList(path.resolve(import.meta.dirname, '..'
25
26
  export const getPackageVersion = ()=>{
26
27
  return PackageJson.version;
27
28
  };
29
+ /**
30
+ * True inside the plugin's own monorepo, where the plugin is the source rather
31
+ * than a dependency.
32
+ */ export const isNxPluginForAwsWorkspace = (tree)=>{
33
+ const rootPackageJson = tree.exists('package.json') ? readJson(tree, 'package.json') : undefined;
34
+ return rootPackageJson?.name === '@aws/nx-plugin-source';
35
+ };
36
+ /**
37
+ * The `@aws/nx-plugin` devDependency entry for a workspace the plugin generates
38
+ * into, keyed to the version the running generators come from. Empty inside the
39
+ * plugin's own monorepo.
40
+ */ export const nxPluginSelfDependency = (tree)=>isNxPluginForAwsWorkspace(tree) ? {} : {
41
+ [PackageJson.name]: `^${PackageJson.version}`
42
+ };
43
+ /**
44
+ * The `@aws/nx-plugin-mcp` devDependency entry, keyed to the running generators'
45
+ * version — the two packages are released in lockstep. Declaring it pins the MCP
46
+ * server the vended config runs in the workspace's lockfile, so upgrading it
47
+ * upgrades the server. Empty inside the plugin's own monorepo.
48
+ */ export const nxPluginMcpDependency = (tree)=>isNxPluginForAwsWorkspace(tree) ? {} : {
49
+ [NX_PLUGIN_MCP_PACKAGE_NAME]: `^${PackageJson.version}`
50
+ };
28
51
  /**
29
52
  * Read a project configuration where the project name may not be fully qualified (ie may omit the scope prefix)
30
53
  */ export const readProjectConfigurationUnqualified = (tree, projectName)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/nx.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n type ProjectConfiguration,\n readProjectConfiguration,\n type TargetConfiguration,\n type TargetDefaultValue,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport * as path from 'path';\nimport PackageJson from '../../package.json' with { type: 'json' };\nimport { toSnakeCase } from './names';\nimport { getNpmScope, getNpmScopePrefix } from './npm-scope';\n\nexport type { GeneratorInfo, NxGeneratorInfo } from './generators';\nexport { buildGeneratorInfoList } from './generators';\n\nimport { buildGeneratorInfoList, type GeneratorInfo } from './generators';\n\nconst GENERATORS = buildGeneratorInfoList(\n path.resolve(import.meta.dirname, '..', '..'),\n);\n\n/**\n * List Nx Plugin for AWS generators\n * @param includeHidden include hidden generators (default false)\n */\nexport const listGenerators = (includeHidden = false) =>\n GENERATORS.filter((g) => includeHidden || !g.hidden);\n\n/**\n * Return generator information. Call this from a generator method with import.meta.filename\n */\nexport const getGeneratorInfo = (generatorFileName: string): GeneratorInfo => {\n const { dir, name } = path.parse(path.resolve(generatorFileName));\n const resolvedFactoryPath = path.join(dir, name);\n return GENERATORS.find(\n (generatorInfo) =>\n generatorInfo.resolvedFactoryPath === resolvedFactoryPath,\n );\n};\n\nexport const getPackageVersion = () => {\n return PackageJson.version;\n};\n\n/**\n * Read a project configuration where the project name may not be fully qualified (ie may omit the scope prefix)\n */\nexport const readProjectConfigurationUnqualified = (\n tree: Tree,\n projectName: string,\n) => {\n try {\n return readProjectConfiguration(tree, projectName);\n } catch (e) {\n // Attempt to find the project without the scope\n const project = [...getProjects(tree).values()].find(\n (p) =>\n p.name &&\n (p.name === `${getNpmScopePrefix(tree)}${projectName}` || // TypeScript fully-qualified name\n p.name === `${toSnakeCase(getNpmScope(tree))}.${projectName}`), // Python fully-qualified name\n );\n if (project) {\n return project;\n }\n throw e;\n }\n};\n\n/**\n * Returns whether a project with the given name already exists in the workspace.\n * The project name may be unqualified (ie may omit the scope prefix).\n */\nexport const projectExists = (tree: Tree, projectName: string): boolean => {\n try {\n readProjectConfigurationUnqualified(tree, projectName);\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Add metadata about the generator that generated the project to the project.json\n */\nexport const addGeneratorMetadata = (\n tree: Tree,\n projectName: string,\n info: { id: string },\n additionalMetadata?: { [key: string]: any },\n) => {\n const config = readProjectConfigurationUnqualified(tree, projectName);\n const metadata = {\n ...config?.metadata,\n generator: info.id,\n ...additionalMetadata,\n };\n // Skip the write when nothing changed so re-running doesn't reserialize\n // project.json. metadata is plain JSON built in a fixed key order, so a\n // stringify comparison is exact here.\n if (JSON.stringify(config?.metadata) === JSON.stringify(metadata)) {\n return;\n }\n // Place metadata immediately before targets so the serialized key order is\n // identical whether or not metadata already existed (matching the order Nx\n // normalizes a read config to), keeping the change a pure metadata insert.\n const { targets, ...rest } = config;\n updateProjectConfiguration(tree, config.name, {\n ...rest,\n metadata: metadata as any,\n ...(targets ? { targets } : {}),\n });\n};\n\n/**\n * Represents a component entry in project metadata\n */\nexport interface ComponentMetadata {\n readonly generator: string;\n readonly name?: string;\n readonly path?: string;\n [key: string]: any;\n}\n\n/**\n * Add metadata about the generator that generated the component to the project.json\n */\nexport const addComponentGeneratorMetadata = (\n tree: Tree,\n projectName: string,\n info: { id: string },\n componentPath: string,\n componentName?: string,\n additionalMetadata?: { [key: string]: any },\n) => {\n const config = readProjectConfigurationUnqualified(tree, projectName);\n\n const existingComponents = (config?.metadata as any)?.components ?? [];\n const alreadyAdded = existingComponents.filter(\n (c: any) => c.generator === info.id && c.name === componentName,\n );\n\n if (alreadyAdded.length === 0) {\n const componentMetadata: ComponentMetadata = {\n generator: info.id,\n path: componentPath,\n ...(componentName ? { name: componentName } : {}),\n ...additionalMetadata,\n };\n // Place metadata before targets for a stable serialized key order.\n const { targets, ...rest } = config;\n updateProjectConfiguration(tree, config.name, {\n ...rest,\n metadata: {\n ...config?.metadata,\n components: [...existingComponents, componentMetadata],\n } as any,\n ...(targets ? { targets } : {}),\n });\n }\n};\n\n/**\n * Merge a generator's own config into an `nx.json` `targetDefaults` value,\n * preserving whatever the workspace already had. `apply` receives the config to\n * layer onto and returns the merged config (e.g. `(base) => ({ cache: true,\n * ...base })`); it must be idempotent so re-running the generator is a no-op.\n *\n * Nx 23.1 widened each value to either a config object or an ordered array of\n * filtered entries. The plugin only contributes unfiltered (catch-all) config,\n * so the input's shape is preserved: an object (or unset) stays an object;\n * an array keeps the user's filtered entries and `apply` merges into its first\n * unfiltered entry, prepending one as the base if none exists (Nx layers later\n * matches on top, so our catch-all must stay first to not override a filter).\n */\nexport const mergeTargetDefault = (\n value: TargetDefaultValue | undefined,\n apply: (base: Partial<TargetConfiguration>) => Partial<TargetConfiguration>,\n): TargetDefaultValue => {\n if (!Array.isArray(value)) {\n return apply(value ?? {});\n }\n const catchAllIndex = value.findIndex((entry) => entry.filter === undefined);\n if (catchAllIndex === -1) {\n return [apply({}), ...value];\n }\n return value.map((entry, index) =>\n index === catchAllIndex ? apply(entry) : entry,\n );\n};\n\n/**\n * A single entry in an Nx `dependsOn` array.\n * Matches the shape accepted by Nx without requiring a devkit type import.\n */\nexport type TargetDependency =\n | string\n | {\n projects?: string | string[];\n target: string;\n params?: 'ignore' | 'forward';\n };\n\nconst targetDependencyEquals = (a: TargetDependency, b: TargetDependency) => {\n if (typeof a === 'string' || typeof b === 'string') {\n return a === b;\n }\n if (a.target !== b.target || a.params !== b.params) {\n return false;\n }\n const aProjects = Array.isArray(a.projects)\n ? a.projects\n : a.projects !== undefined\n ? [a.projects]\n : [];\n const bProjects = Array.isArray(b.projects)\n ? b.projects\n : b.projects !== undefined\n ? [b.projects]\n : [];\n if (aProjects.length !== bProjects.length) {\n return false;\n }\n return aProjects.every((p, i) => p === bProjects[i]);\n};\n\n// The order target properties are authored in. Nx preserves a target's\n// authored key order when it reads then rewrites an existing project.json,\n// except `options` and `configurations`, which it always moves to the end (in\n// that order). Keeping `options`/`configurations` last here therefore makes a\n// generator's first-run output byte-identical to subsequent runs (idempotency);\n// the remaining keys are ordered to read intuitively.\nconst NX_TARGET_KEY_ORDER = [\n 'executor',\n 'dependsOn',\n 'continuous',\n 'cache',\n 'inputs',\n 'outputs',\n 'metadata',\n 'defaultConfiguration',\n 'options',\n 'configurations',\n];\n\n/**\n * Reorder a target's keys to match Nx's own serialization order. Nx reorders\n * target properties when it rewrites an existing project.json, so applying the\n * same order when first authoring a target keeps generators idempotent.\n */\nexport const normalizeTargetKeyOrder = <T extends object>(target: T): T =>\n Object.fromEntries(\n Object.entries(target as Record<string, unknown>).sort(([a], [b]) => {\n const ai = NX_TARGET_KEY_ORDER.indexOf(a);\n const bi = NX_TARGET_KEY_ORDER.indexOf(b);\n return (\n (ai === -1 ? NX_TARGET_KEY_ORDER.length : ai) -\n (bi === -1 ? NX_TARGET_KEY_ORDER.length : bi)\n );\n }),\n ) as T;\n\n/**\n * Mutate the project to add the dependency to the target if not already present\n * Adds the target if not present.\n *\n * Accepts either a string target name (e.g. `'build'`) or a dependency config\n * object (e.g. `{ projects: ['foo'], target: 'dev' }`). Deduplicates\n * using deep equality so re-running a generator does not grow `dependsOn`.\n */\nexport const addDependencyToTargetIfNotPresent = (\n project: ProjectConfiguration,\n target: string,\n dependency: TargetDependency,\n) => {\n project.targets ??= {};\n project.targets[target] ??= {};\n project.targets[target].dependsOn ??= [];\n const dependsOn = project.targets[target].dependsOn;\n // Leave existing dependencies in place so re-running does not reorder them;\n // only append when the dependency is genuinely absent.\n if (!dependsOn.some((d) => targetDependencyEquals(d, dependency))) {\n dependsOn.push(dependency);\n }\n // Keep key order aligned with Nx's so first run matches subsequent runs.\n project.targets[target] = normalizeTargetKeyOrder(project.targets[target]);\n};\n\n/**\n * Register a component's `<name>-dev` target under the project-level `dev`\n * target, so `nx run <project>:dev` starts every component in the project.\n *\n * Component generators author their own continuous `<name>-dev` runner and call\n * this to aggregate it. Every component added to the project accumulates its\n * `<name>-dev` under `dev`. Nx keys tasks by `project:target`, so any\n * dependencies shared between components run exactly once.\n */\nexport const addComponentDevTarget = (\n targets: Record<string, ProjectConfiguration['targets'][string]>,\n componentDevTargetName: string,\n) => {\n targets['dev'] ??= { continuous: true, dependsOn: [] };\n const projectDev = targets['dev'];\n projectDev.continuous = true;\n projectDev.dependsOn ??= [];\n // Append in component-creation order; dedupe keeps re-runs idempotent.\n if (!projectDev.dependsOn.includes(componentDevTargetName)) {\n projectDev.dependsOn.push(componentDevTargetName);\n }\n targets['dev'] = normalizeTargetKeyOrder(projectDev);\n};\n"],"names":["getProjects","readProjectConfiguration","updateProjectConfiguration","path","PackageJson","type","toSnakeCase","getNpmScope","getNpmScopePrefix","buildGeneratorInfoList","GENERATORS","resolve","dirname","listGenerators","includeHidden","filter","g","hidden","getGeneratorInfo","generatorFileName","dir","name","parse","resolvedFactoryPath","join","find","generatorInfo","getPackageVersion","version","readProjectConfigurationUnqualified","tree","projectName","e","project","values","p","projectExists","addGeneratorMetadata","info","additionalMetadata","config","metadata","generator","id","JSON","stringify","targets","rest","addComponentGeneratorMetadata","componentPath","componentName","existingComponents","components","alreadyAdded","c","length","componentMetadata","mergeTargetDefault","value","apply","Array","isArray","catchAllIndex","findIndex","entry","undefined","map","index","targetDependencyEquals","a","b","target","params","aProjects","projects","bProjects","every","i","NX_TARGET_KEY_ORDER","normalizeTargetKeyOrder","Object","fromEntries","entries","sort","ai","indexOf","bi","addDependencyToTargetIfNotPresent","dependency","dependsOn","some","d","push","addComponentDevTarget","componentDevTargetName","continuous","projectDev","includes"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EAEXC,wBAAwB,EAIxBC,0BAA0B,QACrB,aAAa;AACpB,YAAYC,UAAU,OAAO;AAC7B,OAAOC,iBAAiB,0BAA0B;IAAEC,MAAM;AAAO,EAAE;AACnE,SAASC,WA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AK;QAAEiD,YAAY;QAAMN,WAAW,EAAE;IAAC;IACrD,MAAMO,aAAalD,OAAO,CAAC,MAAM;IACjCkD,WAAWD,UAAU,GAAG;IACxBC,WAAWP,SAAS,KAAK,EAAE;IAC3B,uEAAuE;IACvE,IAAI,CAACO,WAAWP,SAAS,CAACQ,QAAQ,CAACH,yBAAyB;QAC1DE,WAAWP,SAAS,CAACG,IAAI,CAACE;IAC5B;IACAhD,OAAO,CAAC,MAAM,GAAGiC,wBAAwBiB;AAC3C,EAAE"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/nx.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getProjects,\n type ProjectConfiguration,\n readJson,\n readProjectConfiguration,\n type TargetConfiguration,\n type TargetDefaultValue,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport * as path from 'path';\nimport PackageJson from '../../package.json' with { type: 'json' };\nimport { NX_PLUGIN_MCP_PACKAGE_NAME } from './mcp';\nimport { toSnakeCase } from './names';\nimport { getNpmScope, getNpmScopePrefix } from './npm-scope';\n\nexport type { GeneratorInfo, NxGeneratorInfo } from './generators';\nexport { buildGeneratorInfoList } from './generators';\n\nimport { buildGeneratorInfoList, type GeneratorInfo } from './generators';\n\nconst GENERATORS = buildGeneratorInfoList(\n path.resolve(import.meta.dirname, '..', '..'),\n);\n\n/**\n * List Nx Plugin for AWS generators\n * @param includeHidden include hidden generators (default false)\n */\nexport const listGenerators = (includeHidden = false) =>\n GENERATORS.filter((g) => includeHidden || !g.hidden);\n\n/**\n * Return generator information. Call this from a generator method with import.meta.filename\n */\nexport const getGeneratorInfo = (generatorFileName: string): GeneratorInfo => {\n const { dir, name } = path.parse(path.resolve(generatorFileName));\n const resolvedFactoryPath = path.join(dir, name);\n return GENERATORS.find(\n (generatorInfo) =>\n generatorInfo.resolvedFactoryPath === resolvedFactoryPath,\n );\n};\n\nexport const getPackageVersion = () => {\n return PackageJson.version;\n};\n\n/**\n * True inside the plugin's own monorepo, where the plugin is the source rather\n * than a dependency.\n */\nexport const isNxPluginForAwsWorkspace = (tree: Tree): boolean => {\n const rootPackageJson = tree.exists('package.json')\n ? readJson(tree, 'package.json')\n : undefined;\n return rootPackageJson?.name === '@aws/nx-plugin-source';\n};\n\n/**\n * The `@aws/nx-plugin` devDependency entry for a workspace the plugin generates\n * into, keyed to the version the running generators come from. Empty inside the\n * plugin's own monorepo.\n */\nexport const nxPluginSelfDependency = (tree: Tree): Record<string, string> =>\n isNxPluginForAwsWorkspace(tree)\n ? {}\n : { [PackageJson.name]: `^${PackageJson.version}` };\n\n/**\n * The `@aws/nx-plugin-mcp` devDependency entry, keyed to the running generators'\n * version — the two packages are released in lockstep. Declaring it pins the MCP\n * server the vended config runs in the workspace's lockfile, so upgrading it\n * upgrades the server. Empty inside the plugin's own monorepo.\n */\nexport const nxPluginMcpDependency = (tree: Tree): Record<string, string> =>\n isNxPluginForAwsWorkspace(tree)\n ? {}\n : { [NX_PLUGIN_MCP_PACKAGE_NAME]: `^${PackageJson.version}` };\n\n/**\n * Read a project configuration where the project name may not be fully qualified (ie may omit the scope prefix)\n */\nexport const readProjectConfigurationUnqualified = (\n tree: Tree,\n projectName: string,\n) => {\n try {\n return readProjectConfiguration(tree, projectName);\n } catch (e) {\n // Attempt to find the project without the scope\n const project = [...getProjects(tree).values()].find(\n (p) =>\n p.name &&\n (p.name === `${getNpmScopePrefix(tree)}${projectName}` || // TypeScript fully-qualified name\n p.name === `${toSnakeCase(getNpmScope(tree))}.${projectName}`), // Python fully-qualified name\n );\n if (project) {\n return project;\n }\n throw e;\n }\n};\n\n/**\n * Returns whether a project with the given name already exists in the workspace.\n * The project name may be unqualified (ie may omit the scope prefix).\n */\nexport const projectExists = (tree: Tree, projectName: string): boolean => {\n try {\n readProjectConfigurationUnqualified(tree, projectName);\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Add metadata about the generator that generated the project to the project.json\n */\nexport const addGeneratorMetadata = (\n tree: Tree,\n projectName: string,\n info: { id: string },\n additionalMetadata?: { [key: string]: any },\n) => {\n const config = readProjectConfigurationUnqualified(tree, projectName);\n const metadata = {\n ...config?.metadata,\n generator: info.id,\n ...additionalMetadata,\n };\n // Skip the write when nothing changed so re-running doesn't reserialize\n // project.json. metadata is plain JSON built in a fixed key order, so a\n // stringify comparison is exact here.\n if (JSON.stringify(config?.metadata) === JSON.stringify(metadata)) {\n return;\n }\n // Place metadata immediately before targets so the serialized key order is\n // identical whether or not metadata already existed (matching the order Nx\n // normalizes a read config to), keeping the change a pure metadata insert.\n const { targets, ...rest } = config;\n updateProjectConfiguration(tree, config.name, {\n ...rest,\n metadata: metadata as any,\n ...(targets ? { targets } : {}),\n });\n};\n\n/**\n * Represents a component entry in project metadata\n */\nexport interface ComponentMetadata {\n readonly generator: string;\n readonly name?: string;\n readonly path?: string;\n [key: string]: any;\n}\n\n/**\n * Add metadata about the generator that generated the component to the project.json\n */\nexport const addComponentGeneratorMetadata = (\n tree: Tree,\n projectName: string,\n info: { id: string },\n componentPath: string,\n componentName?: string,\n additionalMetadata?: { [key: string]: any },\n) => {\n const config = readProjectConfigurationUnqualified(tree, projectName);\n\n const existingComponents = (config?.metadata as any)?.components ?? [];\n const alreadyAdded = existingComponents.filter(\n (c: any) => c.generator === info.id && c.name === componentName,\n );\n\n if (alreadyAdded.length === 0) {\n const componentMetadata: ComponentMetadata = {\n generator: info.id,\n path: componentPath,\n ...(componentName ? { name: componentName } : {}),\n ...additionalMetadata,\n };\n // Place metadata before targets for a stable serialized key order.\n const { targets, ...rest } = config;\n updateProjectConfiguration(tree, config.name, {\n ...rest,\n metadata: {\n ...config?.metadata,\n components: [...existingComponents, componentMetadata],\n } as any,\n ...(targets ? { targets } : {}),\n });\n }\n};\n\n/**\n * Merge a generator's own config into an `nx.json` `targetDefaults` value,\n * preserving whatever the workspace already had. `apply` receives the config to\n * layer onto and returns the merged config (e.g. `(base) => ({ cache: true,\n * ...base })`); it must be idempotent so re-running the generator is a no-op.\n *\n * Nx 23.1 widened each value to either a config object or an ordered array of\n * filtered entries. The plugin only contributes unfiltered (catch-all) config,\n * so the input's shape is preserved: an object (or unset) stays an object;\n * an array keeps the user's filtered entries and `apply` merges into its first\n * unfiltered entry, prepending one as the base if none exists (Nx layers later\n * matches on top, so our catch-all must stay first to not override a filter).\n */\nexport const mergeTargetDefault = (\n value: TargetDefaultValue | undefined,\n apply: (base: Partial<TargetConfiguration>) => Partial<TargetConfiguration>,\n): TargetDefaultValue => {\n if (!Array.isArray(value)) {\n return apply(value ?? {});\n }\n const catchAllIndex = value.findIndex((entry) => entry.filter === undefined);\n if (catchAllIndex === -1) {\n return [apply({}), ...value];\n }\n return value.map((entry, index) =>\n index === catchAllIndex ? apply(entry) : entry,\n );\n};\n\n/**\n * A single entry in an Nx `dependsOn` array.\n * Matches the shape accepted by Nx without requiring a devkit type import.\n */\nexport type TargetDependency =\n | string\n | {\n projects?: string | string[];\n target: string;\n params?: 'ignore' | 'forward';\n };\n\nconst targetDependencyEquals = (a: TargetDependency, b: TargetDependency) => {\n if (typeof a === 'string' || typeof b === 'string') {\n return a === b;\n }\n if (a.target !== b.target || a.params !== b.params) {\n return false;\n }\n const aProjects = Array.isArray(a.projects)\n ? a.projects\n : a.projects !== undefined\n ? [a.projects]\n : [];\n const bProjects = Array.isArray(b.projects)\n ? b.projects\n : b.projects !== undefined\n ? [b.projects]\n : [];\n if (aProjects.length !== bProjects.length) {\n return false;\n }\n return aProjects.every((p, i) => p === bProjects[i]);\n};\n\n// The order target properties are authored in. Nx preserves a target's\n// authored key order when it reads then rewrites an existing project.json,\n// except `options` and `configurations`, which it always moves to the end (in\n// that order). Keeping `options`/`configurations` last here therefore makes a\n// generator's first-run output byte-identical to subsequent runs (idempotency);\n// the remaining keys are ordered to read intuitively.\nconst NX_TARGET_KEY_ORDER = [\n 'executor',\n 'dependsOn',\n 'continuous',\n 'cache',\n 'inputs',\n 'outputs',\n 'metadata',\n 'defaultConfiguration',\n 'options',\n 'configurations',\n];\n\n/**\n * Reorder a target's keys to match Nx's own serialization order. Nx reorders\n * target properties when it rewrites an existing project.json, so applying the\n * same order when first authoring a target keeps generators idempotent.\n */\nexport const normalizeTargetKeyOrder = <T extends object>(target: T): T =>\n Object.fromEntries(\n Object.entries(target as Record<string, unknown>).sort(([a], [b]) => {\n const ai = NX_TARGET_KEY_ORDER.indexOf(a);\n const bi = NX_TARGET_KEY_ORDER.indexOf(b);\n return (\n (ai === -1 ? NX_TARGET_KEY_ORDER.length : ai) -\n (bi === -1 ? NX_TARGET_KEY_ORDER.length : bi)\n );\n }),\n ) as T;\n\n/**\n * Mutate the project to add the dependency to the target if not already present\n * Adds the target if not present.\n *\n * Accepts either a string target name (e.g. `'build'`) or a dependency config\n * object (e.g. `{ projects: ['foo'], target: 'dev' }`). Deduplicates\n * using deep equality so re-running a generator does not grow `dependsOn`.\n */\nexport const addDependencyToTargetIfNotPresent = (\n project: ProjectConfiguration,\n target: string,\n dependency: TargetDependency,\n) => {\n project.targets ??= {};\n project.targets[target] ??= {};\n project.targets[target].dependsOn ??= [];\n const dependsOn = project.targets[target].dependsOn;\n // Leave existing dependencies in place so re-running does not reorder them;\n // only append when the dependency is genuinely absent.\n if (!dependsOn.some((d) => targetDependencyEquals(d, dependency))) {\n dependsOn.push(dependency);\n }\n // Keep key order aligned with Nx's so first run matches subsequent runs.\n project.targets[target] = normalizeTargetKeyOrder(project.targets[target]);\n};\n\n/**\n * Register a component's `<name>-dev` target under the project-level `dev`\n * target, so `nx run <project>:dev` starts every component in the project.\n *\n * Component generators author their own continuous `<name>-dev` runner and call\n * this to aggregate it. Every component added to the project accumulates its\n * `<name>-dev` under `dev`. Nx keys tasks by `project:target`, so any\n * dependencies shared between components run exactly once.\n */\nexport const addComponentDevTarget = (\n targets: Record<string, ProjectConfiguration['targets'][string]>,\n componentDevTargetName: string,\n) => {\n targets['dev'] ??= { continuous: true, dependsOn: [] };\n const projectDev = targets['dev'];\n projectDev.continuous = true;\n projectDev.dependsOn ??= [];\n // Append in component-creation order; dedupe keeps re-runs idempotent.\n if (!projectDev.dependsOn.includes(componentDevTargetName)) {\n projectDev.dependsOn.push(componentDevTargetName);\n }\n targets['dev'] = normalizeTargetKeyOrder(projectDev);\n};\n"],"names":["getProjects","readJson","readProjectConfiguration","updateProjectConfiguration","path","PackageJson","type","NX_PLUGIN_MCP_PACKAGE_NAME","toSnakeCase","getNpmScope","getNpmScopePrefix","buildGeneratorInfoList","GENERATORS","resolve","dirname","listGenerators","includeHidden","filter","g","hidden","getGeneratorInfo","generatorFileName","dir","name","parse","resolvedFactoryPath","join","find","generatorInfo","getPackageVersion","version","isNxPluginForAwsWorkspace","tree","rootPackageJson","exists","undefined","nxPluginSelfDependency","nxPluginMcpDependency","readProjectConfigurationUnqualified","projectName","e","project","values","p","projectExists","addGeneratorMetadata","info","additionalMetadata","config","metadata","generator","id","JSON","stringify","targets","rest","addComponentGeneratorMetadata","componentPath","componentName","existingComponents","components","alreadyAdded","c","length","componentMetadata","mergeTargetDefault","value","apply","Array","isArray","catchAllIndex","findIndex","entry","map","index","targetDependencyEquals","a","b","target","params","aProjects","projects","bProjects","every","i","NX_TARGET_KEY_ORDER","normalizeTargetKeyOrder","Object","fromEntries","entries","sort","ai","indexOf","bi","addDependencyToTargetIfNotPresent","dependency","dependsOn","some","d","push","addComponentDevTarget","componentDevTargetName","continuous","projectDev","includes"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EAEXC,QAAQ,EACRC,wBAAwB,EAIxBC,0BAA0B,QACrB,aAAa;AACpB,YAAYC,UAAU,OAAO;AAC7B,OAAOC,iBAAiB,0BAA0B;IAAEC,MAAM;AAAO,EAAE;AACnE,SAASC,0BAA0B,QAAQ,WAAQ;AACnD,SAASC,WAAW,QAAQ,aAAU;AACtC,SAASC,WAAW,EAAEC,iBAAiB,QAAQ,iBAAc;AAG7D,SAASC,sBAAsB,QAAQ,kBAAe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AS,KAAK,EAAE;IACxC,MAAMA,YAAYvD,QAAQa,OAAO,CAACwB,OAAO,CAACkB,SAAS;IACnD,4EAA4E;IAC5E,uDAAuD;IACvD,IAAI,CAACA,UAAUC,IAAI,CAAC,CAACC,IAAMvB,uBAAuBuB,GAAGH,cAAc;QACjEC,UAAUG,IAAI,CAACJ;IACjB;IACA,yEAAyE;IACzEtD,QAAQa,OAAO,CAACwB,OAAO,GAAGQ,wBAAwB7C,QAAQa,OAAO,CAACwB,OAAO;AAC3E,EAAE;AAEF;;;;;;;;CAQC,GACD,OAAO,MAAMsB,wBAAwB,CACnC9C,SACA+C;IAEA/C,OAAO,CAAC,MAAM,KAAK;QAAEgD,YAAY;QAAMN,WAAW,EAAE;IAAC;IACrD,MAAMO,aAAajD,OAAO,CAAC,MAAM;IACjCiD,WAAWD,UAAU,GAAG;IACxBC,WAAWP,SAAS,KAAK,EAAE;IAC3B,uEAAuE;IACvE,IAAI,CAACO,WAAWP,SAAS,CAACQ,QAAQ,CAACH,yBAAyB;QAC1DE,WAAWP,SAAS,CAACG,IAAI,CAACE;IAC5B;IACA/C,OAAO,CAAC,MAAM,GAAGgC,wBAAwBiB;AAC3C,EAAE"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ /**
6
+ * Isolate every git invocation in the surrounding tests from the machine's real
7
+ * git configuration, and point the test identity at a throwaway config file.
8
+ *
9
+ * Two leaks are prevented:
10
+ *
11
+ * 1. Inherited `GIT_*` variables. When the test suite runs from a git hook (the
12
+ * repo's `pre-commit` runs the unit tests), git exports `GIT_DIR` and
13
+ * `GIT_INDEX_FILE` pointing at the surrounding repository. Those take
14
+ * precedence over `cwd`, so `git init`/`git config`/`git commit` in a temp
15
+ * directory operate on the real repository instead — writing `user.*` into
16
+ * its `.git/config` and committing test fixtures.
17
+ * 2. Reads of, and writes to, the user's global and system config. Pointing
18
+ * `GIT_CONFIG_GLOBAL`/`GIT_CONFIG_SYSTEM` at files inside a temp directory
19
+ * means a stray `git config --global` lands there and is deleted with it,
20
+ * and the developer's real `user.email` can neither leak into assertions nor
21
+ * be overwritten.
22
+ *
23
+ * Both env vars are restored after each test.
24
+ */
25
+ export declare const useIsolatedGitEnv: () => void;
26
+ /**
27
+ * Run a git command in `cwd`, with the ambient `GIT_DIR`/`GIT_INDEX_FILE`
28
+ * cleared so it cannot escape to a surrounding repository even if
29
+ * `useIsolatedGitEnv` is not in effect. `execFileSync` (no shell) keeps
30
+ * arguments from being re-split.
31
+ */
32
+ export declare const runGit: (args: string[], cwd: string) => string;
33
+ /**
34
+ * Create a git repository in `dir` for a test to work in. The identity comes
35
+ * from the isolated global config set up by `useIsolatedGitEnv`, so nothing is
36
+ * written outside `dir`. Hooks are disabled — the repo under test has a
37
+ * `pre-commit` hook that runs the whole test suite.
38
+ */
39
+ export declare const initTestGitRepo: (dir: string) => void;
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { execFileSync } from "node:child_process";
5
+ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
6
+ import { tmpdir } from "node:os";
7
+ import { join } from "node:path";
8
+ import { afterEach, beforeEach } from "vitest";
9
+ /**
10
+ * Identity used by the temp repositories these helpers create. Only ever
11
+ * written to a throwaway `GIT_CONFIG_GLOBAL` file, never to the developer's
12
+ * real config.
13
+ */ const TEST_GIT_USER_NAME = 'nx-plugin-for-aws-test';
14
+ const TEST_GIT_USER_EMAIL = 'nx-plugin-for-aws-test@example.invalid';
15
+ /**
16
+ * Isolate every git invocation in the surrounding tests from the machine's real
17
+ * git configuration, and point the test identity at a throwaway config file.
18
+ *
19
+ * Two leaks are prevented:
20
+ *
21
+ * 1. Inherited `GIT_*` variables. When the test suite runs from a git hook (the
22
+ * repo's `pre-commit` runs the unit tests), git exports `GIT_DIR` and
23
+ * `GIT_INDEX_FILE` pointing at the surrounding repository. Those take
24
+ * precedence over `cwd`, so `git init`/`git config`/`git commit` in a temp
25
+ * directory operate on the real repository instead — writing `user.*` into
26
+ * its `.git/config` and committing test fixtures.
27
+ * 2. Reads of, and writes to, the user's global and system config. Pointing
28
+ * `GIT_CONFIG_GLOBAL`/`GIT_CONFIG_SYSTEM` at files inside a temp directory
29
+ * means a stray `git config --global` lands there and is deleted with it,
30
+ * and the developer's real `user.email` can neither leak into assertions nor
31
+ * be overwritten.
32
+ *
33
+ * Both env vars are restored after each test.
34
+ */ export const useIsolatedGitEnv = ()=>{
35
+ const savedEnv = {};
36
+ let configDir;
37
+ beforeEach(()=>{
38
+ for (const key of Object.keys(process.env)){
39
+ if (key.startsWith('GIT_')) {
40
+ savedEnv[key] = process.env[key];
41
+ delete process.env[key];
42
+ }
43
+ }
44
+ configDir = mkdtempSync(join(tmpdir(), 'nx-plugin-gitconfig-'));
45
+ // Seed the identity here rather than per-repo, so temp repos need no
46
+ // `git config` call at all and cannot write to a real repository.
47
+ writeFileSync(join(configDir, 'global'), `[user]\n\tname = ${TEST_GIT_USER_NAME}\n\temail = ${TEST_GIT_USER_EMAIL}\n`);
48
+ // Empty, so system config (which may set user.* or hook paths) cannot leak.
49
+ writeFileSync(join(configDir, 'system'), '');
50
+ for (const key of [
51
+ 'GIT_CONFIG_GLOBAL',
52
+ 'GIT_CONFIG_SYSTEM'
53
+ ]){
54
+ savedEnv[key] ??= process.env[key];
55
+ }
56
+ process.env.GIT_CONFIG_GLOBAL = join(configDir, 'global');
57
+ process.env.GIT_CONFIG_SYSTEM = join(configDir, 'system');
58
+ });
59
+ afterEach(()=>{
60
+ // Clear every GIT_* variable first, so any set *during* the test (and
61
+ // therefore absent from savedEnv) cannot leak into the next one.
62
+ for (const key of Object.keys(process.env)){
63
+ if (key.startsWith('GIT_')) {
64
+ delete process.env[key];
65
+ }
66
+ }
67
+ for (const [key, value] of Object.entries(savedEnv)){
68
+ if (value !== undefined) {
69
+ process.env[key] = value;
70
+ }
71
+ }
72
+ for (const key of Object.keys(savedEnv)){
73
+ delete savedEnv[key];
74
+ }
75
+ if (configDir) {
76
+ rmSync(configDir, {
77
+ force: true,
78
+ recursive: true
79
+ });
80
+ configDir = undefined;
81
+ }
82
+ });
83
+ };
84
+ /**
85
+ * Run a git command in `cwd`, with the ambient `GIT_DIR`/`GIT_INDEX_FILE`
86
+ * cleared so it cannot escape to a surrounding repository even if
87
+ * `useIsolatedGitEnv` is not in effect. `execFileSync` (no shell) keeps
88
+ * arguments from being re-split.
89
+ */ export const runGit = (args, cwd)=>execFileSync('git', args, {
90
+ cwd,
91
+ encoding: 'utf-8',
92
+ stdio: 'pipe',
93
+ env: {
94
+ ...process.env,
95
+ GIT_DIR: undefined,
96
+ GIT_WORK_TREE: undefined,
97
+ GIT_INDEX_FILE: undefined,
98
+ GIT_COMMON_DIR: undefined
99
+ }
100
+ });
101
+ /**
102
+ * Create a git repository in `dir` for a test to work in. The identity comes
103
+ * from the isolated global config set up by `useIsolatedGitEnv`, so nothing is
104
+ * written outside `dir`. Hooks are disabled — the repo under test has a
105
+ * `pre-commit` hook that runs the whole test suite.
106
+ */ export const initTestGitRepo = (dir)=>{
107
+ runGit([
108
+ 'init'
109
+ ], dir);
110
+ runGit([
111
+ 'config',
112
+ 'core.hooksPath',
113
+ '/dev/null'
114
+ ], dir);
115
+ };
116
+
117
+ //# sourceMappingURL=test-git.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/test-git.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { execFileSync } from 'node:child_process';\nimport { mkdtempSync, rmSync, writeFileSync } from 'node:fs';\nimport { tmpdir } from 'node:os';\nimport { join } from 'node:path';\nimport { afterEach, beforeEach } from 'vitest';\n\n/**\n * Identity used by the temp repositories these helpers create. Only ever\n * written to a throwaway `GIT_CONFIG_GLOBAL` file, never to the developer's\n * real config.\n */\nconst TEST_GIT_USER_NAME = 'nx-plugin-for-aws-test';\nconst TEST_GIT_USER_EMAIL = 'nx-plugin-for-aws-test@example.invalid';\n\n/**\n * Isolate every git invocation in the surrounding tests from the machine's real\n * git configuration, and point the test identity at a throwaway config file.\n *\n * Two leaks are prevented:\n *\n * 1. Inherited `GIT_*` variables. When the test suite runs from a git hook (the\n * repo's `pre-commit` runs the unit tests), git exports `GIT_DIR` and\n * `GIT_INDEX_FILE` pointing at the surrounding repository. Those take\n * precedence over `cwd`, so `git init`/`git config`/`git commit` in a temp\n * directory operate on the real repository instead — writing `user.*` into\n * its `.git/config` and committing test fixtures.\n * 2. Reads of, and writes to, the user's global and system config. Pointing\n * `GIT_CONFIG_GLOBAL`/`GIT_CONFIG_SYSTEM` at files inside a temp directory\n * means a stray `git config --global` lands there and is deleted with it,\n * and the developer's real `user.email` can neither leak into assertions nor\n * be overwritten.\n *\n * Both env vars are restored after each test.\n */\nexport const useIsolatedGitEnv = () => {\n const savedEnv: Record<string, string | undefined> = {};\n let configDir: string | undefined;\n\n beforeEach(() => {\n for (const key of Object.keys(process.env)) {\n if (key.startsWith('GIT_')) {\n savedEnv[key] = process.env[key];\n delete process.env[key];\n }\n }\n\n configDir = mkdtempSync(join(tmpdir(), 'nx-plugin-gitconfig-'));\n // Seed the identity here rather than per-repo, so temp repos need no\n // `git config` call at all and cannot write to a real repository.\n writeFileSync(\n join(configDir, 'global'),\n `[user]\\n\\tname = ${TEST_GIT_USER_NAME}\\n\\temail = ${TEST_GIT_USER_EMAIL}\\n`,\n );\n // Empty, so system config (which may set user.* or hook paths) cannot leak.\n writeFileSync(join(configDir, 'system'), '');\n\n for (const key of ['GIT_CONFIG_GLOBAL', 'GIT_CONFIG_SYSTEM'] as const) {\n savedEnv[key] ??= process.env[key];\n }\n process.env.GIT_CONFIG_GLOBAL = join(configDir, 'global');\n process.env.GIT_CONFIG_SYSTEM = join(configDir, 'system');\n });\n\n afterEach(() => {\n // Clear every GIT_* variable first, so any set *during* the test (and\n // therefore absent from savedEnv) cannot leak into the next one.\n for (const key of Object.keys(process.env)) {\n if (key.startsWith('GIT_')) {\n delete process.env[key];\n }\n }\n for (const [key, value] of Object.entries(savedEnv)) {\n if (value !== undefined) {\n process.env[key] = value;\n }\n }\n for (const key of Object.keys(savedEnv)) {\n delete savedEnv[key];\n }\n if (configDir) {\n rmSync(configDir, { force: true, recursive: true });\n configDir = undefined;\n }\n });\n};\n\n/**\n * Run a git command in `cwd`, with the ambient `GIT_DIR`/`GIT_INDEX_FILE`\n * cleared so it cannot escape to a surrounding repository even if\n * `useIsolatedGitEnv` is not in effect. `execFileSync` (no shell) keeps\n * arguments from being re-split.\n */\nexport const runGit = (args: string[], cwd: string): string =>\n execFileSync('git', args, {\n cwd,\n encoding: 'utf-8',\n stdio: 'pipe',\n env: {\n ...process.env,\n GIT_DIR: undefined,\n GIT_WORK_TREE: undefined,\n GIT_INDEX_FILE: undefined,\n GIT_COMMON_DIR: undefined,\n } as NodeJS.ProcessEnv,\n });\n\n/**\n * Create a git repository in `dir` for a test to work in. The identity comes\n * from the isolated global config set up by `useIsolatedGitEnv`, so nothing is\n * written outside `dir`. Hooks are disabled — the repo under test has a\n * `pre-commit` hook that runs the whole test suite.\n */\nexport const initTestGitRepo = (dir: string): void => {\n runGit(['init'], dir);\n runGit(['config', 'core.hooksPath', '/dev/null'], dir);\n};\n"],"names":["execFileSync","mkdtempSync","rmSync","writeFileSync","tmpdir","join","afterEach","beforeEach","TEST_GIT_USER_NAME","TEST_GIT_USER_EMAIL","useIsolatedGitEnv","savedEnv","configDir","key","Object","keys","process","env","startsWith","GIT_CONFIG_GLOBAL","GIT_CONFIG_SYSTEM","value","entries","undefined","force","recursive","runGit","args","cwd","encoding","stdio","GIT_DIR","GIT_WORK_TREE","GIT_INDEX_FILE","GIT_COMMON_DIR","initTestGitRepo","dir"],"mappings":"AAAA;;;CAGC,GAED,SAASA,YAA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AK,MAAM,CAACA,KAAKQ,MAAM,IAAIP,OAAOQ,OAAO,CAACX,UAAW;YACnD,IAAIU,UAAUE,WAAW;gBACvBP,QAAQC,GAAG,CAACJ,IAAI,GAAGQ;YACrB;QACF;QACA,KAAK,MAAMR,OAAOC,OAAOC,IAAI,CAACJ,UAAW;YACvC,OAAOA,QAAQ,CAACE,IAAI;QACtB;QACA,IAAID,WAAW;YACbV,OAAOU,WAAW;gBAAEY,OAAO;gBAAMC,WAAW;YAAK;YACjDb,YAAYW;QACd;IACF;AACF,EAAE;AAEF;;;;;CAKC,GACD,OAAO,MAAMG,SAAS,CAACC,MAAgBC,MACrC5B,aAAa,OAAO2B,MAAM;QACxBC;QACAC,UAAU;QACVC,OAAO;QACPb,KAAK;YACH,GAAGD,QAAQC,GAAG;YACdc,SAASR;YACTS,eAAeT;YACfU,gBAAgBV;YAChBW,gBAAgBX;QAClB;IACF,GAAG;AAEL;;;;;CAKC,GACD,OAAO,MAAMY,kBAAkB,CAACC;IAC9BV,OAAO;QAAC;KAAO,EAAEU;IACjBV,OAAO;QAAC;QAAU;QAAkB;KAAY,EAAEU;AACpD,EAAE"}
@@ -9,6 +9,7 @@ export declare const TS_VERSIONS: {
9
9
  readonly '@a2a-js/sdk': "0.3.14";
10
10
  readonly '@aws/aws-distro-opentelemetry-node-autoinstrumentation': "0.12.0";
11
11
  readonly '@opentelemetry/propagator-jaeger': "2.9.0";
12
+ readonly minimatch: "10.2.5";
12
13
  readonly '@aws-sdk/client-dynamodb': "3.1090.0";
13
14
  readonly '@aws-sdk/client-api-gateway': "3.1090.0";
14
15
  readonly '@aws-sdk/client-iam': "3.1090.0";
@@ -136,7 +137,7 @@ export type ITsDepVersion = keyof typeof TS_VERSIONS;
136
137
  * Add versions to the given dependencies
137
138
  */
138
139
  export declare const withVersions: (deps: ITsDepVersion[]) => {
139
- [k: string]: "0.3.14" | "0.12.0" | "2.9.0" | "3.1090.0" | "3.972.58" | "1.0.0-alpha.10" | "2.34.0" | "7.7.0" | "22.2.2" | "10.3.0" | "23.1.0" | "1.12.1" | "1.15.43" | "1.29.0" | "0.22.0" | "0.0.4" | "0.2.3" | "0.0.57" | "0.3.0" | "1.63.1" | "7.8.2" | "1.10.0" | "1.170.18" | "1.168.22" | "1.167.21" | "1.162.0" | "1.162.2" | "3.0.205" | "1.0.151" | "3.0.1330" | "1.0.62" | "5.101.2" | "11.18.0" | "26.1.1" | "8.10.162" | "2.8.19" | "8.20.0" | "8.18.1" | "5.0.6" | "4.6.10" | "4.5.10" | "4.9.7" | "4.16.1" | "4.1.10" | "6.0.1" | "0.41.3" | "7.1.1" | "1.0.20" | "2.1132.0" | "2.261.0" | "3.12.0" | "10.7.0" | "2.8.6" | "5.6.2" | "0.7.1" | "2.1.1" | "15.0.0" | "3.9.1" | "0.28.1" | "1.0.31" | "1.0.5" | "2.5.4" | "7.8.0" | "3.1.5" | "5.2.1" | "3.3.3" | "9.1.7" | "11.3.6" | "11.0.4" | "4.0.0" | "3.5.3" | "2.0.0" | "12.0.1" | "22.2.9" | "3.5.0" | "8.22.0" | "3.3.1" | "19.2.7" | "6.1.3" | "1.2.0" | "3.36.0" | "0.5.21" | "0.28.0" | "4.3.3" | "4.23.1" | "1.25.0" | "1.6.2" | "4.13.1" | "1.4.0" | "3.6.0" | "8.1.5" | "6.0.3" | "4.4.3" | "8.21.1";
140
+ [k: string]: "0.3.14" | "0.12.0" | "2.9.0" | "10.2.5" | "3.1090.0" | "3.972.58" | "1.0.0-alpha.10" | "2.34.0" | "7.7.0" | "22.2.2" | "10.3.0" | "23.1.0" | "1.12.1" | "1.15.43" | "1.29.0" | "0.22.0" | "0.0.4" | "0.2.3" | "0.0.57" | "0.3.0" | "1.63.1" | "7.8.2" | "1.10.0" | "1.170.18" | "1.168.22" | "1.167.21" | "1.162.0" | "1.162.2" | "3.0.205" | "1.0.151" | "3.0.1330" | "1.0.62" | "5.101.2" | "11.18.0" | "26.1.1" | "8.10.162" | "2.8.19" | "8.20.0" | "8.18.1" | "5.0.6" | "4.6.10" | "4.5.10" | "4.9.7" | "4.16.1" | "4.1.10" | "6.0.1" | "0.41.3" | "7.1.1" | "1.0.20" | "2.1132.0" | "2.261.0" | "3.12.0" | "10.7.0" | "2.8.6" | "5.6.2" | "0.7.1" | "2.1.1" | "15.0.0" | "3.9.1" | "0.28.1" | "1.0.31" | "1.0.5" | "2.5.4" | "7.8.0" | "3.1.5" | "5.2.1" | "3.3.3" | "9.1.7" | "11.3.6" | "11.0.4" | "4.0.0" | "3.5.3" | "2.0.0" | "12.0.1" | "22.2.9" | "3.5.0" | "8.22.0" | "3.3.1" | "19.2.7" | "6.1.3" | "1.2.0" | "3.36.0" | "0.5.21" | "0.28.0" | "4.3.3" | "4.23.1" | "1.25.0" | "1.6.2" | "4.13.1" | "1.4.0" | "3.6.0" | "8.1.5" | "6.0.3" | "4.4.3" | "8.21.1";
140
141
  };
141
142
  /**
142
143
  * Versions for Python dependencies added by generators
@@ -214,6 +215,7 @@ export declare const TERRAFORM_VERSIONS: {
214
215
  readonly archive: "2.8.0";
215
216
  readonly external: "2.4.0";
216
217
  readonly local: "2.9.0";
218
+ readonly time: "0.14.0";
217
219
  };
218
220
  export type ITerraformProviderVersion = keyof typeof TERRAFORM_VERSIONS;
219
221
  /**
@@ -227,4 +229,5 @@ export declare const terraformProviderVersions: () => {
227
229
  archiveProviderVersion: "2.8.0";
228
230
  externalProviderVersion: "2.4.0";
229
231
  localProviderVersion: "2.9.0";
232
+ timeProviderVersion: "0.14.0";
230
233
  };
@@ -9,6 +9,12 @@
9
9
  // Pinned above the version the ADOT autoinstrumentation package resolves
10
10
  // transitively (2.8.0) to clear CVE-2026-59892 (HIGH).
11
11
  '@opentelemetry/propagator-jaeger': '2.9.0',
12
+ // Overridden in the vended agent/MCP image builds to clear CVE-2026-14257
13
+ // (HIGH) in brace-expansion: minimatch 10 is the lowest major depending on
14
+ // brace-expansion 5.x, the only line Trivy's `< 5.0.8` advisory range treats
15
+ // as fixed. Overriding brace-expansion directly is not viable — 5.x drops the
16
+ // CommonJS default export that minimatch 9 calls.
17
+ minimatch: '10.2.5',
12
18
  '@aws-sdk/client-dynamodb': '3.1090.0',
13
19
  '@aws-sdk/client-api-gateway': '3.1090.0',
14
20
  '@aws-sdk/client-iam': '3.1090.0',
@@ -209,7 +215,8 @@
209
215
  null: '3.3.0',
210
216
  archive: '2.8.0',
211
217
  external: '2.4.0',
212
- local: '2.9.0'
218
+ local: '2.9.0',
219
+ time: '0.14.0'
213
220
  };
214
221
  /**
215
222
  * Substitution variables exposing Terraform provider version constraints to
@@ -220,7 +227,8 @@
220
227
  nullProviderVersion: TERRAFORM_VERSIONS.null,
221
228
  archiveProviderVersion: TERRAFORM_VERSIONS.archive,
222
229
  externalProviderVersion: TERRAFORM_VERSIONS.external,
223
- localProviderVersion: TERRAFORM_VERSIONS.local
230
+ localProviderVersion: TERRAFORM_VERSIONS.local,
231
+ timeProviderVersion: TERRAFORM_VERSIONS.time
224
232
  });
225
233
 
226
234
  //# sourceMappingURL=versions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/versions.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Versons for TypeScript dependencies added by generators\n */\nexport const TS_VERSIONS = {\n '@a2a-js/sdk': '0.3.14',\n '@aws/aws-distro-opentelemetry-node-autoinstrumentation': '0.12.0',\n // Pinned above the version the ADOT autoinstrumentation package resolves\n // transitively (2.8.0) to clear CVE-2026-59892 (HIGH).\n '@opentelemetry/propagator-jaeger': '2.9.0',\n '@aws-sdk/client-dynamodb': '3.1090.0',\n '@aws-sdk/client-api-gateway': '3.1090.0',\n '@aws-sdk/client-iam': '3.1090.0',\n '@aws-sdk/client-bedrock-agentcore': '3.1090.0',\n '@aws-sdk/client-bedrock-runtime': '3.1090.0',\n '@aws-sdk/client-s3': '3.1090.0',\n '@aws-sdk/client-sts': '3.1090.0',\n '@aws-sdk/credential-providers': '3.1090.0',\n '@aws-sdk/credential-provider-cognito-identity': '3.972.58',\n '@aws-sdk/client-secrets-manager': '3.1090.0',\n '@aws-sdk/rds-signer': '3.1090.0',\n '@aws-smithy/server-apigateway': '1.0.0-alpha.10',\n '@aws-smithy/server-node': '1.0.0-alpha.10',\n '@aws-lambda-powertools/logger': '2.34.0',\n '@aws-lambda-powertools/metrics': '2.34.0',\n '@aws-lambda-powertools/parameters': '2.34.0',\n '@aws-lambda-powertools/tracer': '2.34.0',\n '@aws-lambda-powertools/parser': '2.34.0',\n '@aws-sdk/client-appconfigdata': '3.1090.0',\n '@middy/core': '7.7.0',\n '@nxlv/python': '22.2.2',\n '@nx-extend/terraform': '10.3.0',\n '@nx/devkit': '23.1.0',\n '@nx/react': '23.1.0',\n 'create-nx-workspace': '23.1.0',\n '@swc-node/register': '1.12.1',\n '@swc/core': '1.15.43',\n '@modelcontextprotocol/sdk': '1.29.0',\n '@modelcontextprotocol/inspector': '0.22.0',\n '@ag-ui/a2ui-toolkit': '0.0.4',\n '@ag-ui/aws-strands': '0.2.3',\n '@ag-ui/client': '0.0.57',\n '@ag-ui/core': '0.0.57',\n '@ag-ui/encoder': '0.0.57',\n 'agent-chat-cli': '0.3.0',\n '@copilotkit/react-core': '1.63.1',\n rxjs: '7.8.2',\n '@strands-agents/sdk': '1.10.0',\n '@tanstack/react-router': '1.170.18',\n '@tanstack/router-plugin': '1.168.22',\n '@tanstack/router-generator': '1.167.21',\n '@tanstack/virtual-file-routes': '1.162.0',\n '@tanstack/router-utils': '1.162.2',\n '@cloudscape-design/board-components': '3.0.205',\n '@cloudscape-design/chat-components': '1.0.151',\n '@cloudscape-design/components': '3.0.1330',\n '@cloudscape-design/global-styles': '1.0.62',\n '@tanstack/react-query': '5.101.2',\n '@tanstack/react-query-devtools': '5.101.2',\n '@trpc/tanstack-react-query': '11.18.0',\n '@trpc/client': '11.18.0',\n '@trpc/server': '11.18.0',\n '@types/node': '26.1.1',\n '@types/aws-lambda': '8.10.162',\n '@types/cors': '2.8.19',\n '@types/pg': '8.20.0',\n '@types/ws': '8.18.1',\n '@types/express': '5.0.6',\n '@smithy/config-resolver': '4.6.10',\n '@smithy/node-config-provider': '4.5.10',\n '@smithy/node-http-handler': '4.9.7',\n '@smithy/types': '4.16.1',\n '@vitest/coverage-v8': '4.1.10',\n '@vitest/ui': '4.1.10',\n '@astrojs/react': '6.0.1',\n '@astrojs/starlight': '0.41.3',\n astro: '7.1.1',\n aws4fetch: '1.0.20',\n 'aws-cdk': '2.1132.0',\n 'aws-cdk-lib': '2.261.0',\n 'aws-xray-sdk-core': '3.12.0',\n constructs: '10.7.0',\n cors: '2.8.6',\n chalk: '5.6.2',\n 'class-variance-authority': '0.7.1',\n clsx: '2.1.1',\n commander: '15.0.0',\n electrodb: '3.9.1',\n esbuild: '0.28.1',\n 'event-source-polyfill': '1.0.31',\n '@types/event-source-polyfill': '1.0.5',\n '@biomejs/biome': '2.5.4',\n '@prisma/adapter-mariadb': '7.8.0',\n '@prisma/adapter-pg': '7.8.0',\n '@prisma/client': '7.8.0',\n ejs: '6.0.1',\n '@types/ejs': '3.1.5',\n express: '5.2.1',\n 'fast-glob': '3.3.3',\n husky: '9.1.7',\n 'fs-extra': '11.3.6',\n '@types/fs-extra': '11.0.4',\n 'make-dir-cli': '4.0.0',\n mariadb: '3.5.3',\n ncp: '2.0.0',\n npm: '12.0.1',\n 'npm-check-updates': '22.2.9',\n 'oidc-client-ts': '3.5.0',\n pg: '8.22.0',\n prisma: '7.8.0',\n 'react-oidc-context': '3.3.1',\n react: '19.2.7',\n 'react-dom': '19.2.7',\n rimraf: '6.1.3',\n rolldown: '1.2.0',\n 'simple-git': '3.36.0',\n 'source-map-support': '0.5.21',\n 'starlight-blog': '0.28.0',\n tailwindcss: '4.3.3',\n '@tailwindcss/vite': '4.3.3',\n tsx: '4.23.1',\n 'lucide-react': '1.25.0',\n 'radix-ui': '1.6.2',\n shadcn: '4.13.1',\n 'tw-animate-css': '1.4.0',\n 'tailwind-merge': '3.6.0',\n vite: '8.1.5',\n typescript: '6.0.3',\n vitest: '4.1.10',\n zod: '4.4.3',\n ws: '8.21.1',\n} as const;\nexport type ITsDepVersion = keyof typeof TS_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withVersions = (deps: ITsDepVersion[]) =>\n Object.fromEntries(deps.map((dep) => [dep, TS_VERSIONS[dep]]));\n\n/**\n * Versions for Python dependencies added by generators\n */\nexport const PY_VERSIONS = {\n 'a2a-sdk': '==0.3.26',\n 'ag-ui-langgraph': '==0.0.42',\n 'ag-ui-protocol': '==0.1.19',\n 'ag-ui-strands': '==0.2.2',\n 'aws-lambda-powertools': '==3.31.1',\n 'aws-lambda-powertools[tracer]': '==3.31.1',\n 'aws-lambda-powertools[parser]': '==3.31.1',\n 'aws-opentelemetry-distro': '==0.18.0',\n 'bedrock-agentcore': '==1.18.1',\n boto3: '==1.43.51',\n checkov: '==3.3.8',\n fastapi: '==0.139.2',\n 'fastapi[standard]': '==0.139.2',\n httpx: '==0.28.1',\n langchain: '==1.3.14',\n 'langchain-aws': '==1.6.2',\n 'langchain-mcp-adapters': '==0.3.0',\n langgraph: '==1.2.9',\n mcp: '==1.28.1',\n 'pip-check-updates': '==0.29.0',\n 'pip-licenses': '==5.5.5',\n ruff: '==0.15.22',\n 'strands-agents': '==1.48.0',\n 'strands-agents[a2a]': '==1.48.0',\n 'strands-agents-tools': '==0.8.4',\n ty: '==0.0.61',\n pynamodb: '==6.1.0',\n uvicorn: '==0.51.0',\n sqlmodel: '==0.0.39',\n alembic: '==1.18.5',\n aiomysql: '==0.3.2',\n asyncpg: '==0.31.0',\n // Pinned explicitly: SQLAlchemy's async engine pulls greenlet transitively,\n // and leaving it unpinned lets uv resolve to a just-released version whose\n // platform wheels may not all be published yet (breaking aarch64 installs).\n greenlet: '==3.5.4',\n} as const;\nexport type IPyDepVersion = keyof typeof PY_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withPyVersions = (deps: IPyDepVersion[]) =>\n deps.map((dep) => `${dep}${PY_VERSIONS[dep]}`);\n\n/**\n * Versions for vendored tools\n */\nexport const VENDORED_VERSIONS = {\n 'git-secrets': '1.3.0',\n} as const;\n\n/**\n * Base container images used by generated Dockerfiles. Pinned exactly so\n * generated images are reproducible, and chosen to be free of known\n * HIGH/CRITICAL vulnerabilities at time of generation.\n */\nexport const BASE_IMAGES = {\n node: 'public.ecr.aws/docker/library/node:lts-slim',\n python: 'public.ecr.aws/docker/library/python:3.14-slim',\n} as const;\n\n/**\n * Versions for container tooling used by generated image build/scan targets.\n * Pinned exactly so generated images are reproducible.\n */\nexport const CONTAINER_VERSIONS = {\n // ECR-hosted Trivy image used to scan built images during the build.\n trivy: '0.72.0',\n} as const;\n\n/**\n * Exact versions for Terraform providers used by generated `.tf` modules.\n * Pinned exactly (no range operator) so generated infrastructure is reproducible.\n */\nexport const TERRAFORM_VERSIONS = {\n aws: '6.55.0',\n random: '3.9.0',\n null: '3.3.0',\n archive: '2.8.0',\n external: '2.4.0',\n local: '2.9.0',\n} as const;\nexport type ITerraformProviderVersion = keyof typeof TERRAFORM_VERSIONS;\n\n/**\n * Substitution variables exposing Terraform provider version constraints to\n * generated `.tf` templates (e.g. `version = \"<%- awsProviderVersion %>\"`)\n */\nexport const terraformProviderVersions = () => ({\n awsProviderVersion: TERRAFORM_VERSIONS.aws,\n randomProviderVersion: TERRAFORM_VERSIONS.random,\n nullProviderVersion: TERRAFORM_VERSIONS.null,\n archiveProviderVersion: TERRAFORM_VERSIONS.archive,\n externalProviderVersion: TERRAFORM_VERSIONS.external,\n localProviderVersion: TERRAFORM_VERSIONS.local,\n});\n"],"names":["TS_VERSIONS","rxjs","astro","aws4fetch","constructs","cors","chalk","clsx","commander","electrodb","esbuild","ejs","express","husky","mariadb","ncp","npm","pg","prisma","react","rimraf","rolldown","tailwindcss","tsx","shadcn","vite","typescript","vitest","zod","ws","withVersions","deps","Object","fromEntries","map","dep","PY_VERSIONS","boto3","checkov","fastapi","httpx","langchain","langgraph","mcp","ruff","ty","pynamodb","uvicorn","sqlmodel","alembic","aiomysql","asyncpg","greenlet","withPyVersions","VENDORED_VERSIONS","BASE_IMAGES","node","python","CONTAINER_VERSIONS","trivy","TERRAFORM_VERSIONS","aws","random","null","archive","external","local","terraformProviderVersions","awsProviderVersion","randomProviderVersion","nullProviderVersion","archiveProviderVersion","externalProviderVersion","localProviderVersion"],"mappings":"AAAA;;;CAGC,GAED;;CAEC,GACD,OAAO,MAAMA,cAAc;IACzB,eAAe;IACf,0DAA0D;IAC1D,yEAAyE;IACzE,uDAAuD;IACvD,oCAAoC;IACpC,4BAA4B;IAC5B,+BAA+B;IAC/B,uBAAuB;IACvB,qCAAqC;IACrC,mCAAmC;IACnC,sBAAsB;IACtB,uBAAuB;IACvB,iCAAiC;IACjC,iDAAiD;IACjD,mCAAmC;IACnC,uBAAuB;IACvB,iCAAiC;IACjC,2BAA2B;IAC3B,iCAAiC;IACjC,kCAAkC;IAClC,qCAAqC;IACrC,iCAAiC;IACjC,iCAAiC;IACjC,iCAAiC;IACjC,eAAe;IACf,gBAAgB;IAChB,wBAAwB;IACxB,cAAc;IACd,aAAa;IACb,uBAAuB;IACvB,sBAAsB;IACtB,aAAa;IACb,6BAA6B;IAC7B,mCAAmC;IACnC,uBAAuB;IACvB,sBAAsB;IACtB,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1BC,MAAM;IACN,uBAAuB;IACvB,0BAA0B;IAC1B,2BAA2B;IAC3B,8BAA8B;IAC9B,iCAAiC;IACjC,0BAA0B;IAC1B,uCAAuC;IACvC,sCAAsC;IACtC,iCAAiC;IACjC,oCAAoC;IACpC,yBAAyB;IACzB,kCAAkC;IAClC,8BAA8B;IAC9B,gBAAgB;IAChB,gBAAgB;IAChB,eAAe;IACf,qBAAqB;IACrB,eAAe;IACf,aAAa;IACb,aAAa;IACb,kBAAkB;IAClB,2BA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,0BAA0B;IAC1BC,WAAW;IACXC,KAAK;IACL,qBAAqB;IACrB,gBAAgB;IAChBC,MAAM;IACN,kBAAkB;IAClB,uBAAuB;IACvB,wBAAwB;IACxBC,IAAI;IACJC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,SAAS;IACTC,UAAU;IACVC,SAAS;IACT,4EAA4E;IAC5E,2EAA2E;IAC3E,4EAA4E;IAC5EC,UAAU;AACZ,EAAW;AAGX;;CAEC,GACD,OAAO,MAAMC,iBAAiB,CAACtB,OAC7BA,KAAKG,GAAG,CAAC,CAACC,MAAQ,GAAGA,MAAMC,WAAW,CAACD,IAAI,EAAE,EAAE;AAEjD;;CAEC,GACD,OAAO,MAAMmB,oBAAoB;IAC/B,eAAe;AACjB,EAAW;AAEX;;;;CAIC,GACD,OAAO,MAAMC,cAAc;IACzBC,MAAM;IACNC,QAAQ;AACV,EAAW;AAEX;;;CAGC,GACD,OAAO,MAAMC,qBAAqB;IAChC,qEAAqE;IACrEC,OAAO;AACT,EAAW;AAEX;;;CAGC,GACD,OAAO,MAAMC,qBAAqB;IAChCC,KAAK;IACLC,QAAQ;IACRC,MAAM;IACNC,SAAS;IACTC,UAAU;IACVC,OAAO;AACT,EAAW;AAGX;;;CAGC,GACD,OAAO,MAAMC,4BAA4B,IAAO,CAAA;QAC9CC,oBAAoBR,mBAAmBC,GAAG;QAC1CQ,uBAAuBT,mBAAmBE,MAAM;QAChDQ,qBAAqBV,mBAAmBG,IAAI;QAC5CQ,wBAAwBX,mBAAmBI,OAAO;QAClDQ,yBAAyBZ,mBAAmBK,QAAQ;QACpDQ,sBAAsBb,mBAAmBM,KAAK;IAChD,CAAA,EAAG"}
1
+ {"version":3,"sources":["../../../../../packages/nx-plugin/src/utils/versions.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Versons for TypeScript dependencies added by generators\n */\nexport const TS_VERSIONS = {\n '@a2a-js/sdk': '0.3.14',\n '@aws/aws-distro-opentelemetry-node-autoinstrumentation': '0.12.0',\n // Pinned above the version the ADOT autoinstrumentation package resolves\n // transitively (2.8.0) to clear CVE-2026-59892 (HIGH).\n '@opentelemetry/propagator-jaeger': '2.9.0',\n // Overridden in the vended agent/MCP image builds to clear CVE-2026-14257\n // (HIGH) in brace-expansion: minimatch 10 is the lowest major depending on\n // brace-expansion 5.x, the only line Trivy's `< 5.0.8` advisory range treats\n // as fixed. Overriding brace-expansion directly is not viable — 5.x drops the\n // CommonJS default export that minimatch 9 calls.\n minimatch: '10.2.5',\n '@aws-sdk/client-dynamodb': '3.1090.0',\n '@aws-sdk/client-api-gateway': '3.1090.0',\n '@aws-sdk/client-iam': '3.1090.0',\n '@aws-sdk/client-bedrock-agentcore': '3.1090.0',\n '@aws-sdk/client-bedrock-runtime': '3.1090.0',\n '@aws-sdk/client-s3': '3.1090.0',\n '@aws-sdk/client-sts': '3.1090.0',\n '@aws-sdk/credential-providers': '3.1090.0',\n '@aws-sdk/credential-provider-cognito-identity': '3.972.58',\n '@aws-sdk/client-secrets-manager': '3.1090.0',\n '@aws-sdk/rds-signer': '3.1090.0',\n '@aws-smithy/server-apigateway': '1.0.0-alpha.10',\n '@aws-smithy/server-node': '1.0.0-alpha.10',\n '@aws-lambda-powertools/logger': '2.34.0',\n '@aws-lambda-powertools/metrics': '2.34.0',\n '@aws-lambda-powertools/parameters': '2.34.0',\n '@aws-lambda-powertools/tracer': '2.34.0',\n '@aws-lambda-powertools/parser': '2.34.0',\n '@aws-sdk/client-appconfigdata': '3.1090.0',\n '@middy/core': '7.7.0',\n '@nxlv/python': '22.2.2',\n '@nx-extend/terraform': '10.3.0',\n '@nx/devkit': '23.1.0',\n '@nx/react': '23.1.0',\n 'create-nx-workspace': '23.1.0',\n '@swc-node/register': '1.12.1',\n '@swc/core': '1.15.43',\n '@modelcontextprotocol/sdk': '1.29.0',\n '@modelcontextprotocol/inspector': '0.22.0',\n '@ag-ui/a2ui-toolkit': '0.0.4',\n '@ag-ui/aws-strands': '0.2.3',\n '@ag-ui/client': '0.0.57',\n '@ag-ui/core': '0.0.57',\n '@ag-ui/encoder': '0.0.57',\n 'agent-chat-cli': '0.3.0',\n '@copilotkit/react-core': '1.63.1',\n rxjs: '7.8.2',\n '@strands-agents/sdk': '1.10.0',\n '@tanstack/react-router': '1.170.18',\n '@tanstack/router-plugin': '1.168.22',\n '@tanstack/router-generator': '1.167.21',\n '@tanstack/virtual-file-routes': '1.162.0',\n '@tanstack/router-utils': '1.162.2',\n '@cloudscape-design/board-components': '3.0.205',\n '@cloudscape-design/chat-components': '1.0.151',\n '@cloudscape-design/components': '3.0.1330',\n '@cloudscape-design/global-styles': '1.0.62',\n '@tanstack/react-query': '5.101.2',\n '@tanstack/react-query-devtools': '5.101.2',\n '@trpc/tanstack-react-query': '11.18.0',\n '@trpc/client': '11.18.0',\n '@trpc/server': '11.18.0',\n '@types/node': '26.1.1',\n '@types/aws-lambda': '8.10.162',\n '@types/cors': '2.8.19',\n '@types/pg': '8.20.0',\n '@types/ws': '8.18.1',\n '@types/express': '5.0.6',\n '@smithy/config-resolver': '4.6.10',\n '@smithy/node-config-provider': '4.5.10',\n '@smithy/node-http-handler': '4.9.7',\n '@smithy/types': '4.16.1',\n '@vitest/coverage-v8': '4.1.10',\n '@vitest/ui': '4.1.10',\n '@astrojs/react': '6.0.1',\n '@astrojs/starlight': '0.41.3',\n astro: '7.1.1',\n aws4fetch: '1.0.20',\n 'aws-cdk': '2.1132.0',\n 'aws-cdk-lib': '2.261.0',\n 'aws-xray-sdk-core': '3.12.0',\n constructs: '10.7.0',\n cors: '2.8.6',\n chalk: '5.6.2',\n 'class-variance-authority': '0.7.1',\n clsx: '2.1.1',\n commander: '15.0.0',\n electrodb: '3.9.1',\n esbuild: '0.28.1',\n 'event-source-polyfill': '1.0.31',\n '@types/event-source-polyfill': '1.0.5',\n '@biomejs/biome': '2.5.4',\n '@prisma/adapter-mariadb': '7.8.0',\n '@prisma/adapter-pg': '7.8.0',\n '@prisma/client': '7.8.0',\n ejs: '6.0.1',\n '@types/ejs': '3.1.5',\n express: '5.2.1',\n 'fast-glob': '3.3.3',\n husky: '9.1.7',\n 'fs-extra': '11.3.6',\n '@types/fs-extra': '11.0.4',\n 'make-dir-cli': '4.0.0',\n mariadb: '3.5.3',\n ncp: '2.0.0',\n npm: '12.0.1',\n 'npm-check-updates': '22.2.9',\n 'oidc-client-ts': '3.5.0',\n pg: '8.22.0',\n prisma: '7.8.0',\n 'react-oidc-context': '3.3.1',\n react: '19.2.7',\n 'react-dom': '19.2.7',\n rimraf: '6.1.3',\n rolldown: '1.2.0',\n 'simple-git': '3.36.0',\n 'source-map-support': '0.5.21',\n 'starlight-blog': '0.28.0',\n tailwindcss: '4.3.3',\n '@tailwindcss/vite': '4.3.3',\n tsx: '4.23.1',\n 'lucide-react': '1.25.0',\n 'radix-ui': '1.6.2',\n shadcn: '4.13.1',\n 'tw-animate-css': '1.4.0',\n 'tailwind-merge': '3.6.0',\n vite: '8.1.5',\n typescript: '6.0.3',\n vitest: '4.1.10',\n zod: '4.4.3',\n ws: '8.21.1',\n} as const;\nexport type ITsDepVersion = keyof typeof TS_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withVersions = (deps: ITsDepVersion[]) =>\n Object.fromEntries(deps.map((dep) => [dep, TS_VERSIONS[dep]]));\n\n/**\n * Versions for Python dependencies added by generators\n */\nexport const PY_VERSIONS = {\n 'a2a-sdk': '==0.3.26',\n 'ag-ui-langgraph': '==0.0.42',\n 'ag-ui-protocol': '==0.1.19',\n 'ag-ui-strands': '==0.2.2',\n 'aws-lambda-powertools': '==3.31.1',\n 'aws-lambda-powertools[tracer]': '==3.31.1',\n 'aws-lambda-powertools[parser]': '==3.31.1',\n 'aws-opentelemetry-distro': '==0.18.0',\n 'bedrock-agentcore': '==1.18.1',\n boto3: '==1.43.51',\n checkov: '==3.3.8',\n fastapi: '==0.139.2',\n 'fastapi[standard]': '==0.139.2',\n httpx: '==0.28.1',\n langchain: '==1.3.14',\n 'langchain-aws': '==1.6.2',\n 'langchain-mcp-adapters': '==0.3.0',\n langgraph: '==1.2.9',\n mcp: '==1.28.1',\n 'pip-check-updates': '==0.29.0',\n 'pip-licenses': '==5.5.5',\n ruff: '==0.15.22',\n 'strands-agents': '==1.48.0',\n 'strands-agents[a2a]': '==1.48.0',\n 'strands-agents-tools': '==0.8.4',\n ty: '==0.0.61',\n pynamodb: '==6.1.0',\n uvicorn: '==0.51.0',\n sqlmodel: '==0.0.39',\n alembic: '==1.18.5',\n aiomysql: '==0.3.2',\n asyncpg: '==0.31.0',\n // Pinned explicitly: SQLAlchemy's async engine pulls greenlet transitively,\n // and leaving it unpinned lets uv resolve to a just-released version whose\n // platform wheels may not all be published yet (breaking aarch64 installs).\n greenlet: '==3.5.4',\n} as const;\nexport type IPyDepVersion = keyof typeof PY_VERSIONS;\n\n/**\n * Add versions to the given dependencies\n */\nexport const withPyVersions = (deps: IPyDepVersion[]) =>\n deps.map((dep) => `${dep}${PY_VERSIONS[dep]}`);\n\n/**\n * Versions for vendored tools\n */\nexport const VENDORED_VERSIONS = {\n 'git-secrets': '1.3.0',\n} as const;\n\n/**\n * Base container images used by generated Dockerfiles. Pinned exactly so\n * generated images are reproducible, and chosen to be free of known\n * HIGH/CRITICAL vulnerabilities at time of generation.\n */\nexport const BASE_IMAGES = {\n node: 'public.ecr.aws/docker/library/node:lts-slim',\n python: 'public.ecr.aws/docker/library/python:3.14-slim',\n} as const;\n\n/**\n * Versions for container tooling used by generated image build/scan targets.\n * Pinned exactly so generated images are reproducible.\n */\nexport const CONTAINER_VERSIONS = {\n // ECR-hosted Trivy image used to scan built images during the build.\n trivy: '0.72.0',\n} as const;\n\n/**\n * Exact versions for Terraform providers used by generated `.tf` modules.\n * Pinned exactly (no range operator) so generated infrastructure is reproducible.\n */\nexport const TERRAFORM_VERSIONS = {\n aws: '6.55.0',\n random: '3.9.0',\n null: '3.3.0',\n archive: '2.8.0',\n external: '2.4.0',\n local: '2.9.0',\n time: '0.14.0',\n} as const;\nexport type ITerraformProviderVersion = keyof typeof TERRAFORM_VERSIONS;\n\n/**\n * Substitution variables exposing Terraform provider version constraints to\n * generated `.tf` templates (e.g. `version = \"<%- awsProviderVersion %>\"`)\n */\nexport const terraformProviderVersions = () => ({\n awsProviderVersion: TERRAFORM_VERSIONS.aws,\n randomProviderVersion: TERRAFORM_VERSIONS.random,\n nullProviderVersion: TERRAFORM_VERSIONS.null,\n archiveProviderVersion: TERRAFORM_VERSIONS.archive,\n externalProviderVersion: TERRAFORM_VERSIONS.external,\n localProviderVersion: TERRAFORM_VERSIONS.local,\n timeProviderVersion: TERRAFORM_VERSIONS.time,\n});\n"],"names":["TS_VERSIONS","minimatch","rxjs","astro","aws4fetch","constructs","cors","chalk","clsx","commander","electrodb","esbuild","ejs","express","husky","mariadb","ncp","npm","pg","prisma","react","rimraf","rolldown","tailwindcss","tsx","shadcn","vite","typescript","vitest","zod","ws","withVersions","deps","Object","fromEntries","map","dep","PY_VERSIONS","boto3","checkov","fastapi","httpx","langchain","langgraph","mcp","ruff","ty","pynamodb","uvicorn","sqlmodel","alembic","aiomysql","asyncpg","greenlet","withPyVersions","VENDORED_VERSIONS","BASE_IMAGES","node","python","CONTAINER_VERSIONS","trivy","TERRAFORM_VERSIONS","aws","random","null","archive","external","local","time","terraformProviderVersions","awsProviderVersion","randomProviderVersion","nullProviderVersion","archiveProviderVersion","externalProviderVersion","localProviderVersion","timeProviderVersion"],"mappings":"AAAA;;;CAGC,GAED;;CAEC,GACD,OAAO,MAAMA,cAAc;IACzB,eAAe;IACf,0DAA0D;IAC1D,yEAAyE;IACzE,uDAAuD;IACvD,oCAAoC;IACpC,0EAA0E;IAC1E,2EAA2E;IAC3E,6EAA6E;IAC7E,8EAA8E;IAC9E,kDAAkD;IAClDC,WAAW;IACX,4BAA4B;IAC5B,+BAA+B;IAC/B,uBAAuB;IACvB,qCAAqC;IACrC,mCAAmC;IACn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AIC,GACD,OAAO,MAAMC,cAAc;IACzBC,MAAM;IACNC,QAAQ;AACV,EAAW;AAEX;;;CAGC,GACD,OAAO,MAAMC,qBAAqB;IAChC,qEAAqE;IACrEC,OAAO;AACT,EAAW;AAEX;;;CAGC,GACD,OAAO,MAAMC,qBAAqB;IAChCC,KAAK;IACLC,QAAQ;IACRC,MAAM;IACNC,SAAS;IACTC,UAAU;IACVC,OAAO;IACPC,MAAM;AACR,EAAW;AAGX;;;CAGC,GACD,OAAO,MAAMC,4BAA4B,IAAO,CAAA;QAC9CC,oBAAoBT,mBAAmBC,GAAG;QAC1CS,uBAAuBV,mBAAmBE,MAAM;QAChDS,qBAAqBX,mBAAmBG,IAAI;QAC5CS,wBAAwBZ,mBAAmBI,OAAO;QAClDS,yBAAyBb,mBAAmBK,QAAQ;QACpDS,sBAAsBd,mBAAmBM,KAAK;QAC9CS,qBAAqBf,mBAAmBO,IAAI;IAC9C,CAAA,EAAG"}
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
- * SPDX-License-Identifier: Apache-2.0
5
- */ import { startMcpServer } from "../mcp-server/index.js";
6
- void (async ()=>{
7
- try {
8
- await startMcpServer();
9
- } catch (e) {
10
- console.error(e);
11
- }
12
- })();
13
-
14
- //# sourceMappingURL=aws-nx-mcp.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../../../packages/nx-plugin/src/bin/aws-nx-mcp.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { startMcpServer } from '../mcp-server';\n\nvoid (async () => {\n try {\n await startMcpServer();\n } catch (e) {\n console.error(e);\n }\n})();\n"],"names":["startMcpServer","e","console","error"],"mappings":";AACA;;;CAGC,GACD,SAASA,cAAc,QAAQ,yBAAgB;AAE/C,KAAK,AAAC,CAAA;IACJ,IAAI;QACF,MAAMA;IACR,EAAE,OAAOC,GAAG;QACVC,QAAQC,KAAK,CAACF;IAChB;AACF,CAAA"}