@aws/nx-plugin 1.3.0 → 1.3.2

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 (70) hide show
  1. package/LICENSE-THIRD-PARTY +107 -259
  2. package/migrations.json +57 -14
  3. package/package.json +14 -14
  4. package/src/agentcore-gateway/__snapshots__/generator.spec.ts.snap +1 -1
  5. package/src/greengrass/component/python/__snapshots__/generator.spec.ts.snap +8 -8
  6. package/src/infra/app/__snapshots__/generator.spec.ts.snap +3 -3
  7. package/src/migrations/latest/biome-markdown-yaml-formatter-off/metadata.json +3 -0
  8. package/src/migrations/latest/biome-markdown-yaml-formatter-off/migration.js +113 -0
  9. package/src/migrations/latest/biome-markdown-yaml-formatter-off/migration.js.map +1 -0
  10. package/src/migrations/latest/py-agentcore-launcher/metadata.json +3 -0
  11. package/src/migrations/latest/py-agentcore-launcher/migration.d.ts +7 -0
  12. package/src/migrations/latest/py-agentcore-launcher/migration.js +100 -0
  13. package/src/migrations/latest/py-agentcore-launcher/migration.js.map +1 -0
  14. package/src/migrations/v1.0.15/0001-py-agent-pillow-override/migration.js.map +1 -0
  15. package/src/migrations/v1.1.1/0001-ts-agent-guardrails-synth-input/migration.js.map +1 -0
  16. package/src/migrations/v1.3.0/0001-ts-agent-guardrails-terraform-version-retention/migration.d.ts +6 -0
  17. package/src/migrations/v1.3.0/0001-ts-agent-guardrails-terraform-version-retention/migration.js.map +1 -0
  18. package/src/preset/__snapshots__/generator.spec.ts.snap +15 -5
  19. package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +7 -7
  20. package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +7 -7
  21. package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +4 -4
  22. package/src/py/agent/generator.js +2 -2
  23. package/src/py/agent/generator.js.map +1 -1
  24. package/src/py/agent/guardrails/__snapshots__/generator.spec.ts.snap +6 -6
  25. package/src/py/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
  26. package/src/py/fast-api/__snapshots__/generator.terraform.spec.ts.snap +12 -12
  27. package/src/py/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  28. package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +4 -4
  29. package/src/py/mcp-server/generator.js +2 -2
  30. package/src/py/mcp-server/generator.js.map +1 -1
  31. package/src/py/rdb/__snapshots__/generator.spec.ts.snap +4 -4
  32. package/src/smithy/project/__snapshots__/generator.spec.ts.snap +5 -5
  33. package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +8 -8
  34. package/src/trpc/backend/__snapshots__/generator.spec.ts.snap +12 -12
  35. package/src/ts/agent/__snapshots__/generator.spec.ts.snap +3 -3
  36. package/src/ts/agent/guardrails/__snapshots__/generator.spec.ts.snap +3 -3
  37. package/src/ts/dcr-proxy/__snapshots__/generator.spec.ts.snap +1 -1
  38. package/src/ts/dynamodb/__snapshots__/generator.spec.ts.snap +2 -2
  39. package/src/ts/lambda-function/__snapshots__/generator.spec.ts.snap +2 -2
  40. package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
  41. package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +4 -4
  42. package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +53 -33
  43. package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +2 -2
  44. package/src/utils/agent-core-constructs/files/cdk/app/agent-core/__nameKebabCase__/__nameKebabCase__.ts.template +1 -1
  45. package/src/utils/agent-core-constructs/files/terraform/core/agent-core-code/runtime.tf.template +1 -1
  46. package/src/utils/agent-core-packaging.d.ts +7 -4
  47. package/src/utils/agent-core-packaging.js +28 -6
  48. package/src/utils/agent-core-packaging.js.map +1 -1
  49. package/src/utils/format.d.ts +10 -0
  50. package/src/utils/format.js +11 -0
  51. package/src/utils/format.js.map +1 -1
  52. package/src/utils/test/fake-aws/fake_aws.py +8 -2
  53. package/src/utils/version-upgrade-migration/sync-vended-versions.d.ts +8 -0
  54. package/src/utils/version-upgrade-migration/sync-vended-versions.js +11 -2
  55. package/src/utils/version-upgrade-migration/sync-vended-versions.js.map +1 -1
  56. package/src/utils/versions.d.ts +71 -71
  57. package/src/utils/versions.js +68 -68
  58. package/src/utils/versions.js.map +1 -1
  59. package/src/migrations/latest/py-agent-pillow-override/migration.js.map +0 -1
  60. package/src/migrations/latest/ts-agent-guardrails-synth-input/migration.js.map +0 -1
  61. package/src/migrations/latest/ts-agent-guardrails-terraform-version-retention/migration.js.map +0 -1
  62. /package/src/migrations/latest/{ts-agent-guardrails-terraform-version-retention → biome-markdown-yaml-formatter-off}/migration.d.ts +0 -0
  63. /package/src/migrations/{latest/py-agent-pillow-override → v1.0.15/0001-py-agent-pillow-override}/metadata.json +0 -0
  64. /package/src/migrations/{latest/py-agent-pillow-override → v1.0.15/0001-py-agent-pillow-override}/migration.d.ts +0 -0
  65. /package/src/migrations/{latest/py-agent-pillow-override → v1.0.15/0001-py-agent-pillow-override}/migration.js +0 -0
  66. /package/src/migrations/{latest/ts-agent-guardrails-synth-input → v1.1.1/0001-ts-agent-guardrails-synth-input}/metadata.json +0 -0
  67. /package/src/migrations/{latest/ts-agent-guardrails-synth-input → v1.1.1/0001-ts-agent-guardrails-synth-input}/migration.d.ts +0 -0
  68. /package/src/migrations/{latest/ts-agent-guardrails-synth-input → v1.1.1/0001-ts-agent-guardrails-synth-input}/migration.js +0 -0
  69. /package/src/migrations/{latest/ts-agent-guardrails-terraform-version-retention → v1.3.0/0001-ts-agent-guardrails-terraform-version-retention}/metadata.json +0 -0
  70. /package/src/migrations/{latest/ts-agent-guardrails-terraform-version-retention → v1.3.0/0001-ts-agent-guardrails-terraform-version-retention}/migration.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws/nx-plugin",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/awslabs/nx-plugin-for-aws.git",
@@ -36,21 +36,21 @@
36
36
  "node": "^22.13.0 || ^24.0.0 || >=26.0.0"
37
37
  },
38
38
  "peerDependencies": {
39
- "nx": "23.3.0"
39
+ "nx": "23.3.1"
40
40
  },
41
41
  "dependencies": {
42
42
  "@apidevtools/swagger-parser": "12.1.0",
43
- "@astral-sh/ruff-wasm-nodejs": "0.17.1",
44
- "@biomejs/js-api": "6.0.0",
45
- "@biomejs/wasm-nodejs": "2.5.15",
43
+ "@astral-sh/ruff-wasm-nodejs": "0.17.2",
44
+ "@biomejs/js-api": "6.1.0",
45
+ "@biomejs/wasm-nodejs": "2.6.3",
46
46
  "@getgrit/gritql": "0.0.3",
47
47
  "@iarna/toml": "2.2.5",
48
- "@modelcontextprotocol/sdk": "1.32.1",
49
- "@nx/devkit": "23.3.0",
50
- "@nx/js": "23.3.0",
51
- "@nx/react": "23.3.0",
52
- "@nx/vite": "23.3.0",
53
- "@nxlv/python": "23.2.1",
48
+ "@modelcontextprotocol/sdk": "1.32.2",
49
+ "@nx/devkit": "23.3.1",
50
+ "@nx/js": "23.3.1",
51
+ "@nx/react": "23.3.1",
52
+ "@nx/vite": "23.3.1",
53
+ "@nxlv/python": "23.3.1",
54
54
  "@phenomnomnominal/tsquery": "6.2.0",
55
55
  "@types/estree": "1.0.9",
56
56
  "@types/js-yaml": "4.0.9",
@@ -78,9 +78,9 @@
78
78
  "spdx-satisfies": "6.0.0",
79
79
  "typescript": "6.0.3",
80
80
  "unified": "11.0.5",
81
- "unist-util-visit": "5.1.0",
82
- "vite": "8.3.4",
83
- "vitest": "5.0.4",
81
+ "unist-util-visit": "5.2.0",
82
+ "vite": "8.3.5",
83
+ "vitest": "5.0.5",
84
84
  "zod": "4.6.7"
85
85
  },
86
86
  "devDependencies": {
@@ -7,7 +7,7 @@ exports[`agentcore-gateway generator > protocol: http > omits protocol_type from
7
7
  required_providers {
8
8
  aws = {
9
9
  source = "hashicorp/aws"
10
- version = "6.69.1"
10
+ version = "6.70.0"
11
11
  }
12
12
  time = {
13
13
  source = "hashicorp/time"
@@ -217,11 +217,11 @@ def test_run_once_does_not_raise():
217
217
  - packages/common/*
218
218
  catalog:
219
219
  '@types/node': 26.6.5
220
- vite: 8.3.4
221
- vitest: 5.0.4
222
- '@vitest/coverage-v8': 5.0.4
220
+ vite: 8.3.5
221
+ vitest: 5.0.5
222
+ '@vitest/coverage-v8': 5.0.5
223
223
  jsdom: 29.1.1
224
- '@nx/vitest': 23.3.0
224
+ '@nx/vitest': 23.3.1
225
225
  js-yaml: 4.3.2
226
226
  '@types/js-yaml': 4.0.9
227
227
  tsx: 4.23.15
@@ -436,11 +436,11 @@ def test_run_once_does_not_raise():
436
436
  - packages/common/*
437
437
  catalog:
438
438
  '@types/node': 26.6.5
439
- vite: 8.3.4
440
- vitest: 5.0.4
441
- '@vitest/coverage-v8': 5.0.4
439
+ vite: 8.3.5
440
+ vitest: 5.0.5
441
+ '@vitest/coverage-v8': 5.0.5
442
442
  jsdom: 29.1.1
443
- '@nx/vitest': 23.3.0
443
+ '@nx/vitest': 23.3.1
444
444
  js-yaml: 4.3.2
445
445
  '@types/js-yaml': 4.0.9
446
446
  tsx: 4.23.15
@@ -50,7 +50,7 @@ exports[`infra generator > should configure Checkov target correctly > checkov-t
50
50
  "default",
51
51
  ],
52
52
  "options": {
53
- "command": "uvx --from checkov==3.3.29 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
53
+ "command": "uvx --from checkov==3.3.30 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
54
54
  },
55
55
  "outputs": [
56
56
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -150,7 +150,7 @@ exports[`infra generator > should configure project.json with correct targets >
150
150
  "default",
151
151
  ],
152
152
  "options": {
153
- "command": "uvx --from checkov==3.3.29 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
153
+ "command": "uvx --from checkov==3.3.30 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
154
154
  },
155
155
  "outputs": [
156
156
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -767,7 +767,7 @@ exports[`infra generator > should handle custom project names correctly > custom
767
767
  "default",
768
768
  ],
769
769
  "options": {
770
- "command": "uvx --from checkov==3.3.29 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
770
+ "command": "uvx --from checkov==3.3.30 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
771
771
  },
772
772
  "outputs": [
773
773
  "{workspaceRoot}/dist/{projectRoot}/checkov",
@@ -0,0 +1,3 @@
1
+ {
2
+ "description": "Turn off Biome 2.6's Markdown and YAML formatting in biome.json, which formats them by default"
3
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { getDependencyVersionFromPackageJson, readJson, writeJson } from "@nx/devkit";
5
+ import { gte, minVersion, validRange } from "semver";
6
+ import { formatFilesInSubtree } from "../../../utils/format.js";
7
+ import { ownedDependencies } from "../../../utils/version-upgrade-migration/owned-dependencies.js";
8
+ import { syncedTsVersion } from "../../../utils/version-upgrade-migration/sync-vended-versions.js";
9
+ /**
10
+ * Turn off Biome's Markdown and YAML formatting in `biome.json`.
11
+ *
12
+ * Biome 2.6 formats Markdown and YAML by default. The vended `format` target
13
+ * runs `biome format {projectRoot}`, so after the upgrade it fails on generated
14
+ * README.md files and the TypeScript Greengrass component's `recipe.yaml`, and
15
+ * `lint` and `build` stop with it.
16
+ *
17
+ * Guardrails:
18
+ * - A workspace without `biome.json` is left alone.
19
+ * - A top-level `markdown` or `yaml` key that is already present is the user's
20
+ * own setting and is kept as it is. Biome 2.5 rejects both keys, so one is
21
+ * only present when the user configured Biome 2.6 themselves.
22
+ * - Missing keys go right after `css`, where the generators place them, or at
23
+ * the end when there is no `css` section.
24
+ * - Idempotent: a second run finds both keys present and changes nothing.
25
+ * - Biome 2.5 rejects both keys and then fails every `format` and `lint`
26
+ * target, so they are added only when the workspace runs Biome 2.6 or later
27
+ * once `nx migrate` finishes. Otherwise `biome.json` is left as it is and a
28
+ * next step says what to add after moving to Biome 2.6.
29
+ */ const BIOME_CONFIG = 'biome.json';
30
+ const LANGUAGES = [
31
+ 'markdown',
32
+ 'yaml'
33
+ ];
34
+ const FORMATTER_OFF = {
35
+ formatter: {
36
+ enabled: false
37
+ }
38
+ };
39
+ const BIOME = '@biomejs/biome';
40
+ /** First Biome release that accepts the `markdown` and `yaml` keys. */ const MIN_BIOME_VERSION = '2.6.0';
41
+ /** Whether every version a semver range allows is Biome 2.6 or later. */ const allowsOnlyBiome26 = (specifier)=>{
42
+ if (typeof specifier !== 'string' || validRange(specifier) === null) {
43
+ return false;
44
+ }
45
+ const lowest = minVersion(specifier);
46
+ return lowest !== null && gte(lowest, MIN_BIOME_VERSION);
47
+ };
48
+ /**
49
+ * Whether the workspace runs Biome 2.6 or later once `nx migrate` finishes.
50
+ *
51
+ * The version sync runs after this migration in the same `nx migrate`, so the
52
+ * root `package.json` still holds the old Biome here. The check takes the lowest
53
+ * version the declared range (or the catalog entry it references) allows, then
54
+ * the version the sync will move Biome to. A tag, alias or missing declaration
55
+ * counts only when the sync moves it.
56
+ */ const runsBiome26AfterMigrate = async (tree)=>{
57
+ if (!tree.exists('package.json')) {
58
+ return false;
59
+ }
60
+ const { dependencies, devDependencies } = readJson(tree, 'package.json');
61
+ const declared = devDependencies?.[BIOME] ?? dependencies?.[BIOME];
62
+ if (declared === undefined) {
63
+ return false;
64
+ }
65
+ const resolved = getDependencyVersionFromPackageJson(tree, BIOME, 'package.json', [
66
+ 'devDependencies',
67
+ 'dependencies'
68
+ ]);
69
+ if (allowsOnlyBiome26(resolved)) {
70
+ return true;
71
+ }
72
+ return allowsOnlyBiome26(syncedTsVersion(tree, await ownedDependencies(tree), BIOME, declared));
73
+ };
74
+ const SKIPPED_NEXT_STEP = 'Biome stays below 2.6 in this workspace, and Biome 2.5 rejects the `markdown` and `yaml` keys, so biome.json was left as it is. ' + 'Biome 2.6 formats Markdown and YAML files by default. After you move `@biomejs/biome` to 2.6 or later, add ' + '`"markdown": { "formatter": { "enabled": false } }` and `"yaml": { "formatter": { "enabled": false } }` to biome.json, ' + 'or the `format` target fails on generated README.md and YAML files.';
75
+ export default async function migration(tree) {
76
+ if (!tree.exists(BIOME_CONFIG)) {
77
+ return {
78
+ nextSteps: []
79
+ };
80
+ }
81
+ const biome = readJson(tree, BIOME_CONFIG);
82
+ const missing = LANGUAGES.filter((language)=>biome[language] === undefined);
83
+ if (missing.length === 0) {
84
+ return {
85
+ nextSteps: []
86
+ };
87
+ }
88
+ if (!await runsBiome26AfterMigrate(tree)) {
89
+ return {
90
+ nextSteps: [
91
+ SKIPPED_NEXT_STEP
92
+ ]
93
+ };
94
+ }
95
+ const additions = Object.fromEntries(missing.map((language)=>[
96
+ language,
97
+ FORMATTER_OFF
98
+ ]));
99
+ const entries = Object.entries(biome);
100
+ const cssIndex = entries.findIndex(([key])=>key === 'css');
101
+ const insertAt = cssIndex === -1 ? entries.length : cssIndex + 1;
102
+ writeJson(tree, BIOME_CONFIG, Object.fromEntries([
103
+ ...entries.slice(0, insertAt),
104
+ ...Object.entries(additions),
105
+ ...entries.slice(insertAt)
106
+ ]));
107
+ await formatFilesInSubtree(tree);
108
+ return {
109
+ nextSteps: []
110
+ };
111
+ }
112
+
113
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/biome-markdown-yaml-formatter-off/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport {\n getDependencyVersionFromPackageJson,\n type MigrationReturnObject,\n readJson,\n type Tree,\n writeJson,\n} from '@nx/devkit';\nimport { gte, minVersion, validRange } from 'semver';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { ownedDependencies } from '../../../utils/version-upgrade-migration/owned-dependencies.js';\nimport { syncedTsVersion } from '../../../utils/version-upgrade-migration/sync-vended-versions.js';\n\n/**\n * Turn off Biome's Markdown and YAML formatting in `biome.json`.\n *\n * Biome 2.6 formats Markdown and YAML by default. The vended `format` target\n * runs `biome format {projectRoot}`, so after the upgrade it fails on generated\n * README.md files and the TypeScript Greengrass component's `recipe.yaml`, and\n * `lint` and `build` stop with it.\n *\n * Guardrails:\n * - A workspace without `biome.json` is left alone.\n * - A top-level `markdown` or `yaml` key that is already present is the user's\n * own setting and is kept as it is. Biome 2.5 rejects both keys, so one is\n * only present when the user configured Biome 2.6 themselves.\n * - Missing keys go right after `css`, where the generators place them, or at\n * the end when there is no `css` section.\n * - Idempotent: a second run finds both keys present and changes nothing.\n * - Biome 2.5 rejects both keys and then fails every `format` and `lint`\n * target, so they are added only when the workspace runs Biome 2.6 or later\n * once `nx migrate` finishes. Otherwise `biome.json` is left as it is and a\n * next step says what to add after moving to Biome 2.6.\n */\n\nconst BIOME_CONFIG = 'biome.json';\n\nconst LANGUAGES = ['markdown', 'yaml'] as const;\n\nconst FORMATTER_OFF = { formatter: { enabled: false } };\n\nconst BIOME = '@biomejs/biome';\n\n/** First Biome release that accepts the `markdown` and `yaml` keys. */\nconst MIN_BIOME_VERSION = '2.6.0';\n\n/** Whether every version a semver range allows is Biome 2.6 or later. */\nconst allowsOnlyBiome26 = (specifier: unknown): boolean => {\n if (typeof specifier !== 'string' || validRange(specifier) === null) {\n return false;\n }\n const lowest = minVersion(specifier);\n return lowest !== null && gte(lowest, MIN_BIOME_VERSION);\n};\n\n/**\n * Whether the workspace runs Biome 2.6 or later once `nx migrate` finishes.\n *\n * The version sync runs after this migration in the same `nx migrate`, so the\n * root `package.json` still holds the old Biome here. The check takes the lowest\n * version the declared range (or the catalog entry it references) allows, then\n * the version the sync will move Biome to. A tag, alias or missing declaration\n * counts only when the sync moves it.\n */\nconst runsBiome26AfterMigrate = async (tree: Tree): Promise<boolean> => {\n if (!tree.exists('package.json')) {\n return false;\n }\n const { dependencies, devDependencies } = readJson(tree, 'package.json');\n const declared: unknown = devDependencies?.[BIOME] ?? dependencies?.[BIOME];\n if (declared === undefined) {\n return false;\n }\n const resolved = getDependencyVersionFromPackageJson(\n tree,\n BIOME,\n 'package.json',\n ['devDependencies', 'dependencies'],\n );\n if (allowsOnlyBiome26(resolved)) {\n return true;\n }\n return allowsOnlyBiome26(\n syncedTsVersion(tree, await ownedDependencies(tree), BIOME, declared),\n );\n};\n\nconst SKIPPED_NEXT_STEP =\n 'Biome stays below 2.6 in this workspace, and Biome 2.5 rejects the `markdown` and `yaml` keys, so biome.json was left as it is. ' +\n 'Biome 2.6 formats Markdown and YAML files by default. After you move `@biomejs/biome` to 2.6 or later, add ' +\n '`\"markdown\": { \"formatter\": { \"enabled\": false } }` and `\"yaml\": { \"formatter\": { \"enabled\": false } }` to biome.json, ' +\n 'or the `format` target fails on generated README.md and YAML files.';\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n if (!tree.exists(BIOME_CONFIG)) {\n return { nextSteps: [] };\n }\n\n const biome: Record<string, unknown> = readJson(tree, BIOME_CONFIG);\n const missing = LANGUAGES.filter((language) => biome[language] === undefined);\n if (missing.length === 0) {\n return { nextSteps: [] };\n }\n if (!(await runsBiome26AfterMigrate(tree))) {\n return { nextSteps: [SKIPPED_NEXT_STEP] };\n }\n\n const additions = Object.fromEntries(\n missing.map((language) => [language, FORMATTER_OFF]),\n );\n const entries = Object.entries(biome);\n const cssIndex = entries.findIndex(([key]) => key === 'css');\n const insertAt = cssIndex === -1 ? entries.length : cssIndex + 1;\n writeJson(\n tree,\n BIOME_CONFIG,\n Object.fromEntries([\n ...entries.slice(0, insertAt),\n ...Object.entries(additions),\n ...entries.slice(insertAt),\n ]),\n );\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps: [] };\n}\n"],"names":["getDependencyVersionFromPackageJson","readJson","writeJson","gte","minVersion","validRange","formatFilesInSubtree","ownedDependencies","syncedTsVersion","BIOME_CONFIG","LANGUAGES","FORMATTER_OFF","formatter","enabled","BIOME","MIN_BIOME_VERSION","allowsOnlyBiome26","specifier","lowest","runsBiome26AfterMigrate","tree","exists","dependencies","devDependencies","declared","undefined","resolved","SKIPPED_NEXT_STEP","migration","nextSteps","biome","missing","filter","language","length","additions","Object","fromEntries","map","entries","cssIndex","findIndex","key","insertAt","slice"],"mappings":"AAAA;;;CAGC,GACD,SACEA,mCAAmC,EAEnCC,QAAQ,EAERC,SAAS,QACJ,aAAa;AACpB,SAASC,GAAG,EAAEC,UAAU,EAAEC,UAAU,QAAQ,SAAS;AACrD,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,iBAAiB,QAAQ,iEAAiE;AACnG,SAASC,eAAe,QAAQ,mEAAmE;AAEnG;;;;;;;;;;;;;;;;;;;;CAoBC,GAED,MAAMC,eAAe;AAErB,MAAMC,YAAY;IAAC;IAAY;CAAO;AAEtC,MAAMC,gBAAgB;IAAEC,WAAW;QAAEC,SAAS;IAAM;AAAE;AAEtD,MAAMC,QAAQ;AAEd,qEAAqE,GACrE,MAAMC,oBAAoB;AAE1B,uEAAuE,GACvE,MAAMC,oBAAoB,CAACC;IACzB,IAAI,OAAOA,cAAc,YAAYZ,WAAWY,eAAe,MAAM;QACnE,OAAO;IACT;IACA,MAAMC,SAASd,WAAWa;IAC1B,OAAOC,WAAW,QAAQf,IAAIe,QAAQH;AACxC;AAEA;;;;;;;;CAQC,GACD,MAAMI,0BAA0B,OAAOC;IACrC,IAAI,CAACA,KAAKC,MAAM,CAAC,iBAAiB;QAChC,OAAO;IACT;IACA,MAAM,EAAEC,YAAY,EAAEC,eAAe,EAAE,GAAGtB,SAASmB,MAAM;IACzD,MAAMI,WAAoBD,iBAAiB,CAACT,MAAM,IAAIQ,cAAc,CAACR,MAAM;IAC3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}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { type MigrationReturnObject, type Tree } from '@nx/devkit';
6
+ /** Add the interpreter-safe launcher without changing the user's main.py or application. */
7
+ export default function migration(tree: Tree): Promise<MigrationReturnObject>;
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */ import { basename } from "node:path";
5
+ import { getProjects, joinPathFragments, updateProjectConfiguration } from "@nx/devkit";
6
+ import { PY_AGENT_GENERATOR_INFO } from "../../../py/agent/generator.js";
7
+ import { PY_MCP_SERVER_GENERATOR_INFO } from "../../../py/mcp-server/generator.js";
8
+ import { applyGritQL, matchGritQL } from "../../../utils/ast.js";
9
+ import { formatFilesInSubtree } from "../../../utils/format.js";
10
+ import { kebabCase } from "../../../utils/names.js";
11
+ const TERRAFORM_RUNTIME = 'packages/common/terraform/src/core/agent-core-code/runtime.tf';
12
+ const PYTHON_AGENT_CORE_LAUNCHER = 'agentcore_launcher.py';
13
+ const launcher = `\
14
+ import sys
15
+ from pathlib import Path
16
+
17
+ from opentelemetry.instrumentation.auto_instrumentation import run
18
+
19
+ if __name__ == "__main__":
20
+ sys.argv = [
21
+ "opentelemetry-instrument",
22
+ sys.executable,
23
+ str(Path(__file__).with_name("main.py")),
24
+ *sys.argv[1:],
25
+ ]
26
+ run()
27
+ `;
28
+ const terraformEntry = 'entry_point = var.code_entry_point == "agentcore_launcher.py" ? [var.code_entry_point] : ["opentelemetry-instrument", var.code_entry_point]';
29
+ const oldTerraformEntry = 'entry_point = ["opentelemetry-instrument", var.code_entry_point]';
30
+ const hcl = (pattern)=>`language hcl\n${pattern}`;
31
+ const terraformInput = (entryPoint)=>`\`module "agent_core_runtime" { $body }\` where { $body <: contains \`code_runtime = $runtime\`, $runtime <: r".*PYTHON_.*", $body <: contains \`code_entry_point = "${entryPoint}"\` }`;
32
+ const cdkInput = (entryPoint)=>`\`AgentRuntimeArtifact.fromCodeAsset({ $props })\` where { $props <: contains \`runtime: AgentCoreRuntime.$runtime\`, $runtime <: r"PYTHON_.*", $props <: contains \`entrypoint: ${entryPoint}\` }`;
33
+ /** Add the interpreter-safe launcher without changing the user's main.py or application. */ export default async function migration(tree) {
34
+ const nextSteps = [];
35
+ if (tree.exists(TERRAFORM_RUNTIME) && await matchGritQL(tree, TERRAFORM_RUNTIME, hcl(`\`${oldTerraformEntry}\``))) {
36
+ await applyGritQL(tree, TERRAFORM_RUNTIME, hcl(`\`${oldTerraformEntry}\` => \`${terraformEntry}\``));
37
+ }
38
+ const coreMigrated = tree.exists(TERRAFORM_RUNTIME) && await matchGritQL(tree, TERRAFORM_RUNTIME, hcl(`\`${terraformEntry}\``));
39
+ for (const project of getProjects(tree).values()){
40
+ const components = project.metadata?.components ?? [];
41
+ let changed = false;
42
+ for (const component of components){
43
+ const agent = component.generator === PY_AGENT_GENERATOR_INFO.id;
44
+ if (!agent && component.generator !== PY_MCP_SERVER_GENERATOR_INFO.id || component.infra !== 'agentcore') {
45
+ continue;
46
+ }
47
+ const terraform = component.iac === 'terraform';
48
+ const targetName = `${component.name}-package`;
49
+ const target = project.targets?.[targetName];
50
+ const name = kebabCase(component.rc ?? '');
51
+ const packageDir = joinPathFragments(project.root, 'package', basename(component.path ?? ''));
52
+ const outputDir = joinPathFragments('dist', project.root, 'package', name);
53
+ const launcherPath = joinPathFragments(packageDir, PYTHON_AGENT_CORE_LAUNCHER);
54
+ const copyLauncher = `shx cp ${launcherPath} ${outputDir}/${PYTHON_AGENT_CORE_LAUNCHER}`;
55
+ const commands = target?.options?.commands;
56
+ const expectedCommands = [
57
+ `shx rm -rf ${outputDir}`,
58
+ `shx mkdir -p ${outputDir}`,
59
+ `shx cp -R dist/${project.root}/bundle-arm/. ${outputDir}`,
60
+ `shx cp -R ${project.sourceRoot}/. ${outputDir}/${basename(project.sourceRoot ?? '')}`,
61
+ `shx cp ${packageDir}/main.py ${outputDir}/main.py`
62
+ ];
63
+ const category = agent ? 'agents' : 'mcp-servers';
64
+ const infraPath = terraform ? `packages/common/terraform/src/app/${category}/${name}/${name}.tf` : `packages/common/constructs/src/app/${category}/${name}/${name}.ts`;
65
+ const report = ()=>nextSteps.push(`${project.name}/${component.name}: review customized packaging or ${infraPath}; add ${PYTHON_AGENT_CORE_LAUNCHER} calling OpenTelemetry run() with sys.executable and main.py, copy it to the package root, and select it as this Python runtime's code entrypoint.`);
66
+ if (!component.path || !component.rc || ![
67
+ 'cdk',
68
+ 'terraform'
69
+ ].includes(component.iac) || target?.executor !== 'nx:run-commands' || target.options?.parallel !== false || !Array.isArray(commands) || ![
70
+ 5,
71
+ 6
72
+ ].includes(commands.length) || expectedCommands.some((command, index)=>commands[index] !== command) || commands.length === 6 && commands[5] !== copyLauncher || !tree.exists(`${packageDir}/main.py`) || !tree.exists(infraPath) || tree.exists(launcherPath) && tree.read(launcherPath, 'utf-8') !== launcher || terraform && !tree.exists(TERRAFORM_RUNTIME)) {
73
+ report();
74
+ continue;
75
+ }
76
+ const oldEntry = terraform ? hcl(terraformInput('main.py')) : cdkInput("['opentelemetry-instrument', 'main.py']");
77
+ const newEntry = terraform ? hcl(terraformInput(PYTHON_AGENT_CORE_LAUNCHER)) : cdkInput("['agentcore_launcher.py']");
78
+ const alreadyMigrated = await matchGritQL(tree, infraPath, newEntry);
79
+ if (!alreadyMigrated && !await matchGritQL(tree, infraPath, oldEntry) || terraform && !coreMigrated) {
80
+ report();
81
+ continue;
82
+ }
83
+ if (!tree.exists(launcherPath)) tree.write(launcherPath, launcher);
84
+ if (commands.length === 5) {
85
+ commands.push(copyLauncher);
86
+ changed = true;
87
+ }
88
+ if (!alreadyMigrated) {
89
+ await applyGritQL(tree, infraPath, terraform ? hcl('`module "agent_core_runtime" { $body }` where { $body <: contains `code_runtime = $runtime`, $runtime <: r".*PYTHON_.*", $body <: contains bubble `code_entry_point = "main.py"` => `code_entry_point = "agentcore_launcher.py"` }') : "`AgentRuntimeArtifact.fromCodeAsset({ $props })` where { $props <: contains `runtime: AgentCoreRuntime.$runtime`, $runtime <: r\"PYTHON_.*\", $props <: contains bubble `entrypoint: ['opentelemetry-instrument', 'main.py']` => `entrypoint: ['agentcore_launcher.py']` }");
90
+ }
91
+ }
92
+ if (changed) updateProjectConfiguration(tree, project.name, project);
93
+ }
94
+ await formatFilesInSubtree(tree);
95
+ return {
96
+ nextSteps
97
+ };
98
+ }
99
+
100
+ //# sourceMappingURL=migration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/latest/py-agentcore-launcher/migration.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { basename } from 'node:path';\nimport {\n getProjects,\n joinPathFragments,\n type MigrationReturnObject,\n type Tree,\n updateProjectConfiguration,\n} from '@nx/devkit';\nimport { PY_AGENT_GENERATOR_INFO } from '../../../py/agent/generator.js';\nimport { PY_MCP_SERVER_GENERATOR_INFO } from '../../../py/mcp-server/generator.js';\nimport { applyGritQL, matchGritQL } from '../../../utils/ast.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { kebabCase } from '../../../utils/names.js';\nimport type { ComponentMetadata } from '../../../utils/nx.js';\n\nconst TERRAFORM_RUNTIME =\n 'packages/common/terraform/src/core/agent-core-code/runtime.tf';\nconst PYTHON_AGENT_CORE_LAUNCHER = 'agentcore_launcher.py';\nconst launcher = `\\\nimport sys\nfrom pathlib import Path\n\nfrom opentelemetry.instrumentation.auto_instrumentation import run\n\nif __name__ == \"__main__\":\n sys.argv = [\n \"opentelemetry-instrument\",\n sys.executable,\n str(Path(__file__).with_name(\"main.py\")),\n *sys.argv[1:],\n ]\n run()\n`;\nconst terraformEntry =\n 'entry_point = var.code_entry_point == \"agentcore_launcher.py\" ? [var.code_entry_point] : [\"opentelemetry-instrument\", var.code_entry_point]';\nconst oldTerraformEntry =\n 'entry_point = [\"opentelemetry-instrument\", var.code_entry_point]';\nconst hcl = (pattern: string) => `language hcl\\n${pattern}`;\nconst terraformInput = (entryPoint: string) =>\n `\\`module \"agent_core_runtime\" { $body }\\` where { $body <: contains \\`code_runtime = $runtime\\`, $runtime <: r\".*PYTHON_.*\", $body <: contains \\`code_entry_point = \"${entryPoint}\"\\` }`;\nconst cdkInput = (entryPoint: string) =>\n `\\`AgentRuntimeArtifact.fromCodeAsset({ $props })\\` where { $props <: contains \\`runtime: AgentCoreRuntime.$runtime\\`, $runtime <: r\"PYTHON_.*\", $props <: contains \\`entrypoint: ${entryPoint}\\` }`;\n\n/** Add the interpreter-safe launcher without changing the user's main.py or application. */\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n if (\n tree.exists(TERRAFORM_RUNTIME) &&\n (await matchGritQL(\n tree,\n TERRAFORM_RUNTIME,\n hcl(`\\`${oldTerraformEntry}\\``),\n ))\n ) {\n await applyGritQL(\n tree,\n TERRAFORM_RUNTIME,\n hcl(`\\`${oldTerraformEntry}\\` => \\`${terraformEntry}\\``),\n );\n }\n const coreMigrated =\n tree.exists(TERRAFORM_RUNTIME) &&\n (await matchGritQL(tree, TERRAFORM_RUNTIME, hcl(`\\`${terraformEntry}\\``)));\n for (const project of getProjects(tree).values()) {\n const components: ComponentMetadata[] = project.metadata?.components ?? [];\n let changed = false;\n for (const component of components) {\n const agent = component.generator === PY_AGENT_GENERATOR_INFO.id;\n if (\n (!agent && component.generator !== PY_MCP_SERVER_GENERATOR_INFO.id) ||\n component.infra !== 'agentcore'\n ) {\n continue;\n }\n const terraform = component.iac === 'terraform';\n const targetName = `${component.name}-package`;\n const target = project.targets?.[targetName];\n const name = kebabCase(component.rc ?? '');\n const packageDir = joinPathFragments(\n project.root,\n 'package',\n basename(component.path ?? ''),\n );\n const outputDir = joinPathFragments(\n 'dist',\n project.root,\n 'package',\n name,\n );\n const launcherPath = joinPathFragments(\n packageDir,\n PYTHON_AGENT_CORE_LAUNCHER,\n );\n const copyLauncher = `shx cp ${launcherPath} ${outputDir}/${PYTHON_AGENT_CORE_LAUNCHER}`;\n const commands = target?.options?.commands;\n const expectedCommands = [\n `shx rm -rf ${outputDir}`,\n `shx mkdir -p ${outputDir}`,\n `shx cp -R dist/${project.root}/bundle-arm/. ${outputDir}`,\n `shx cp -R ${project.sourceRoot}/. ${outputDir}/${basename(project.sourceRoot ?? '')}`,\n `shx cp ${packageDir}/main.py ${outputDir}/main.py`,\n ];\n const category = agent ? 'agents' : 'mcp-servers';\n const infraPath = terraform\n ? `packages/common/terraform/src/app/${category}/${name}/${name}.tf`\n : `packages/common/constructs/src/app/${category}/${name}/${name}.ts`;\n const report = () =>\n nextSteps.push(\n `${project.name}/${component.name}: review customized packaging or ${infraPath}; add ${PYTHON_AGENT_CORE_LAUNCHER} calling OpenTelemetry run() with sys.executable and main.py, copy it to the package root, and select it as this Python runtime's code entrypoint.`,\n );\n if (\n !component.path ||\n !component.rc ||\n !['cdk', 'terraform'].includes(component.iac) ||\n target?.executor !== 'nx:run-commands' ||\n target.options?.parallel !== false ||\n !Array.isArray(commands) ||\n ![5, 6].includes(commands.length) ||\n expectedCommands.some(\n (command, index) => commands[index] !== command,\n ) ||\n (commands.length === 6 && commands[5] !== copyLauncher) ||\n !tree.exists(`${packageDir}/main.py`) ||\n !tree.exists(infraPath) ||\n (tree.exists(launcherPath) &&\n tree.read(launcherPath, 'utf-8') !== launcher) ||\n (terraform && !tree.exists(TERRAFORM_RUNTIME))\n ) {\n report();\n continue;\n }\n const oldEntry = terraform\n ? hcl(terraformInput('main.py'))\n : cdkInput(\"['opentelemetry-instrument', 'main.py']\");\n const newEntry = terraform\n ? hcl(terraformInput(PYTHON_AGENT_CORE_LAUNCHER))\n : cdkInput(\"['agentcore_launcher.py']\");\n const alreadyMigrated = await matchGritQL(tree, infraPath, newEntry);\n if (\n (!alreadyMigrated && !(await matchGritQL(tree, infraPath, oldEntry))) ||\n (terraform && !coreMigrated)\n ) {\n report();\n continue;\n }\n if (!tree.exists(launcherPath)) tree.write(launcherPath, launcher);\n if (commands.length === 5) {\n commands.push(copyLauncher);\n changed = true;\n }\n if (!alreadyMigrated) {\n await applyGritQL(\n tree,\n infraPath,\n terraform\n ? hcl(\n '`module \"agent_core_runtime\" { $body }` where { $body <: contains `code_runtime = $runtime`, $runtime <: r\".*PYTHON_.*\", $body <: contains bubble `code_entry_point = \"main.py\"` => `code_entry_point = \"agentcore_launcher.py\"` }',\n )\n : \"`AgentRuntimeArtifact.fromCodeAsset({ $props })` where { $props <: contains `runtime: AgentCoreRuntime.$runtime`, $runtime <: r\\\"PYTHON_.*\\\", $props <: contains bubble `entrypoint: ['opentelemetry-instrument', 'main.py']` => `entrypoint: ['agentcore_launcher.py']` }\",\n );\n }\n }\n if (changed) updateProjectConfiguration(tree, project.name, project);\n }\n await formatFilesInSubtree(tree);\n return { nextSteps };\n}\n"],"names":["basename","getProjects","joinPathFragments","updateProjectConfiguration","PY_AGENT_GENERATOR_INFO","PY_MCP_SERVER_GENERATOR_INFO","applyGritQL","matchGritQL","formatFilesInSubtree","kebabCase","TERRAFORM_RUNTIME","PYTHON_AGENT_CORE_LAUNCHER","launcher","terraformEntry","oldTerraformEntry","hcl","pattern","terraformInput","entryPoint","cdkInput","migration","tree","nextSteps","exists","coreMigrated","project","values","components","metadata","changed","component","agent","generator","id","infra","terraform","iac","targetName","name","target","targets","rc","packageDir","root","path","outputDir","launcherPath","copyLauncher","commands","options","expectedCommands","sourceRoot","category","infraPath","report","push","includes","executor","parallel","Array","isArray","length","some","command","index","read","oldEntry","newEntry","alreadyMigrated","write"],"mappings":"AAAA;;;CAGC,GAED,SAASA,QAAQ,QAAQ,YAAY;AACrC,SACEC,WAAW,EACXC,iBAAiB,EAGjBC,0BAA0B,QACrB,aAAa;AACpB,SAASC,uBAAuB,QAAQ,iCAAiC;AAC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AMI,QAAQa,IAAI,EAAEb;IAC9D;IACA,MAAMjB,qBAAqBa;IAC3B,OAAO;QAAEC;IAAU;AACrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/v1.0.15/0001-py-agent-pillow-override/migration.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 joinPathFragments,\n type MigrationReturnObject,\n type Tree,\n} from '@nx/devkit';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport type { UVPyprojectToml } from '../../../utils/nxlv-python.js';\nimport { addUvOverrideDependencies } from '../../../utils/py.js';\nimport { tryReadToml } from '../../../utils/toml.js';\n\n/**\n * Add the strands-agents-tools pillow override to the workspace root\n * pyproject.toml uv override-dependencies.\n *\n * strands-agents-tools caps pillow below the release that fixes its current\n * CVEs, and uv reads `[tool.uv] override-dependencies` only from the workspace\n * root, so the root carries the override (`PY_UV_OVERRIDES`). It applies when\n * any project's `[project].dependencies` names strands-agents-tools. A user\n * override for the same package is kept as written. `uv.lock` is left to the\n * user, as the version sync leaves it, so `nextSteps` asks for `uv sync` when\n * the root changes.\n */\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n if (tree.exists('pyproject.toml')) {\n const requirements = [...getProjects(tree).values()].flatMap(({ root }) => {\n const dependencies = (\n tryReadToml(tree, joinPathFragments(root, 'pyproject.toml')) as\n | UVPyprojectToml\n | undefined\n )?.project?.dependencies;\n return Array.isArray(dependencies) ? dependencies : [];\n });\n if (addUvOverrideDependencies(tree, requirements)) {\n nextSteps.push(\n 'The workspace root pyproject.toml now overrides a dependency of strands-agents-tools. Run `uv sync` to update uv.lock.',\n );\n }\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","formatFilesInSubtree","addUvOverrideDependencies","tryReadToml","migration","tree","nextSteps","exists","requirements","values","flatMap","root","dependencies","project","Array","isArray","push"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,QAGZ,aAAa;AACpB,SAASC,oBAAoB,QAAQ,2BAA2B;AAEhE,SAASC,yBAAyB,QAAQ,uBAAuB;AACjE,SAASC,WAAW,QAAQ,yBAAyB;AAErD;;;;;;;;;;;CAWC,GACD,eAAe,eAAeC,UAC5BC,IAAU;IAEV,MAAMC,YAAsB,EAAE;IAE9B,IAAID,KAAKE,MAAM,CAAC,mBAAmB;QACjC,MAAMC,eAAe;eAAIT,YAAYM,MAAMI,MAAM;SAAG,CAACC,OAAO,CAAC,CAAC,EAAEC,IAAI,EAAE;YACpE,MAAMC,eACJT,YAAYE,MAAML,kBAAkBW,MAAM,oBAGzCE,SAASD;YACZ,OAAOE,MAAMC,OAAO,CAACH,gBAAgBA,eAAe,EAAE;QACxD;QACA,IAAIV,0BAA0BG,MAAMG,eAAe;YACjDF,UAAUU,IAAI,CACZ;QAEJ;IACF;IAEA,MAAMf,qBAAqBI;IAE3B,OAAO;QAAEC;IAAU;AACrB"}
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/v1.1.1/0001-ts-agent-guardrails-synth-input/migration.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 joinPathFragments,\n type MigrationReturnObject,\n type Tree,\n} from '@nx/devkit';\nimport { TS_AGENT_GENERATOR_INFO } from '../../../ts/agent/generator.js';\nimport { TS_AGENT_GUARDRAILS_GENERATOR_INFO } from '../../../ts/agent/guardrails/generator.js';\nimport { addGuardrailPolicySynthInputs } from '../../../ts/agent/guardrails/synth-inputs.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport type { ComponentMetadata } from '../../../utils/nx.js';\n\n/**\n * Add each CDK-guarded TypeScript agent's guardrail.json to the `synth` inputs\n * of the CDK infrastructure projects.\n *\n * The CDK guardrail construct reads guardrail.json at synth time to build the\n * guardrail's rules and version description. The file belongs to the agent's\n * project and no task output the infrastructure's `synth` hashes includes it,\n * so without an explicit input a policy change is served from the Nx cache\n * and `deploy-ci` ships the stale template.\n *\n * Guarded agents are found from the `ts#agent#guardrails` components in\n * project metadata, each paired with the `ts#agent` component of the same\n * name, and kept when that agent's IaC is CDK. An infrastructure project\n * whose `synth` has no `inputs` array, or no `synth` target, is left\n * unchanged and reported via `nextSteps`.\n */\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const policyPaths: string[] = [];\n for (const project of getProjects(tree).values()) {\n const components: ComponentMetadata[] =\n (project.metadata as { components?: ComponentMetadata[] } | undefined)\n ?.components ?? [];\n for (const guardrail of components.filter(\n (c) => c.generator === TS_AGENT_GUARDRAILS_GENERATOR_INFO.id,\n )) {\n const agent = components.find(\n (c) =>\n c.generator === TS_AGENT_GENERATOR_INFO.id &&\n (c.name ?? 'agent') === guardrail.name,\n );\n if (agent?.iac === 'cdk') {\n policyPaths.push(\n joinPathFragments(project.root, guardrail.path, 'guardrail.json'),\n );\n }\n }\n }\n\n const nextSteps = addGuardrailPolicySynthInputs(tree, policyPaths);\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","TS_AGENT_GENERATOR_INFO","TS_AGENT_GUARDRAILS_GENERATOR_INFO","addGuardrailPolicySynthInputs","formatFilesInSubtree","migration","tree","policyPaths","project","values","components","metadata","guardrail","filter","c","generator","id","agent","find","name","iac","push","root","path","nextSteps"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,QAGZ,aAAa;AACpB,SAASC,uBAAuB,QAAQ,iCAAiC;AACzE,SAASC,kCAAkC,QAAQ,4CAA4C;AAC/F,SAASC,6BAA6B,QAAQ,+CAA+C;AAC7F,SAASC,oBAAoB,QAAQ,2BAA2B;AAGhE;;;;;;;;;;;;;;;CAeC,GACD,eAAe,eAAeC,UAC5BC,IAAU;IAEV,MAAMC,cAAwB,EAAE;IAChC,KAAK,MAAMC,WAAWT,YAAYO,MAAMG,MAAM,GAAI;QAChD,MAAMC,aACJ,AAACF,QAAQG,QAAQ,EACbD,cAAc,EAAE;QACtB,KAAK,MAAME,aAAaF,WAAWG,MAAM,CACvC,CAACC,IAAMA,EAAEC,SAAS,KAAKb,mCAAmCc,EAAE,EAC3D;YACD,MAAMC,QAAQP,WAAWQ,IAAI,CAC3B,CAACJ,IACCA,EAAEC,SAAS,KAAKd,wBAAwBe,EAAE,IAC1C,AAACF,CAAAA,EAAEK,IAAI,IAAI,OAAM,MAAOP,UAAUO,IAAI;YAE1C,IAAIF,OAAOG,QAAQ,OAAO;gBACxBb,YAAYc,IAAI,CACdrB,kBAAkBQ,QAAQc,IAAI,EAAEV,UAAUW,IAAI,EAAE;YAEpD;QACF;IACF;IAEA,MAAMC,YAAYrB,8BAA8BG,MAAMC;IAEtD,MAAMH,qBAAqBE;IAE3B,OAAO;QAAEkB;IAAU;AACrB"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ */
5
+ import { type MigrationReturnObject, type Tree } from '@nx/devkit';
6
+ export default function migration(tree: Tree): Promise<MigrationReturnObject>;
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../packages/nx-plugin/src/migrations/v1.3.0/0001-ts-agent-guardrails-terraform-version-retention/migration.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 joinPathFragments,\n type MigrationReturnObject,\n type Tree,\n} from '@nx/devkit';\nimport { TS_AGENT_GENERATOR_INFO } from '../../../ts/agent/generator.js';\nimport { TS_AGENT_GUARDRAILS_GENERATOR_INFO } from '../../../ts/agent/guardrails/generator.js';\nimport {\n applyGritQL,\n GRIT_INSERT_PLACEHOLDER,\n insertViaGritQL,\n matchGritQL,\n} from '../../../utils/ast.js';\nimport { formatFilesInSubtree } from '../../../utils/format.js';\nimport { kebabCase, toClassName } from '../../../utils/names.js';\nimport type { ComponentMetadata } from '../../../utils/nx.js';\nimport {\n PACKAGES_DIR,\n SHARED_TERRAFORM_DIR,\n} from '../../../utils/shared-constructs-constants.js';\nimport { TERRAFORM_VERSIONS } from '../../../utils/versions.js';\n\n/**\n * Keep a replaced guardrail version for 15 seconds after the runtime-config\n * deployment in each Terraform guardrail module of a `ts#agent#guardrails`\n * agent.\n *\n * When `guardrail.json` changes, `aws_bedrock_guardrail_version.this` is\n * replaced with `create_before_destroy`, and Terraform destroyed the old\n * version as soon as the runtime-config deployment completed. Agents cache\n * their runtime-config entry for 5 seconds, so a request in that window used\n * the deleted version and failed. The module now has a `time_sleep` whose\n * `triggers` hold the guardrail ID and version, and the runtime-config entry\n * reads both from those triggers. On a version change the sleep is replaced\n * too: the deposed sleep is destroyed after everything that depends on the new\n * one (the entry and, through the root module's `depends_on`, the\n * runtime-config deployment), waits its 15-second `destroy_duration`, and only\n * then is the deposed version, which it depends on, destroyed.\n *\n * Guarded agents are found from the `ts#agent#guardrails` components in project\n * metadata, each paired with the `ts#agent` component of the same name whose\n * IaC is Terraform. The module is written with `KeepExisting`, so an upgraded\n * workspace keeps the older module until this runs. A module that no longer\n * has the generated shape is left untouched and reported via `nextSteps` with\n * the lines to add.\n */\n\nconst TERRAFORM_GUARDRAILS_DIR = `${PACKAGES_DIR}/${SHARED_TERRAFORM_DIR}/src/app/guardrails`;\n\nconst hcl = (pattern: string) => `language hcl\\n${pattern}`;\n\nconst TIME_SLEEP = '`resource \"time_sleep\" \"version_retention\" { $_ }`';\n\n/** Indented as `terraform fmt` writes it, since `.tf` files are not reformatted. */\nconst TIME_PROVIDER_TEXT = ` time = {\n source = \"hashicorp/time\"\n version = \"${TERRAFORM_VERSIONS.time}\"\n }`;\n\nconst TIME_SLEEP_TEXT = `resource \"time_sleep\" \"version_retention\" {\n destroy_duration = \"15s\"\n\n triggers = {\n guardrail_id = aws_bedrock_guardrail.this.guardrail_id\n guardrail_version = aws_bedrock_guardrail_version.this.version\n }\n\n lifecycle {\n create_before_destroy = true\n }\n}`;\n\nconst ENTRY_ID = 'guardrailId = aws_bedrock_guardrail.this.guardrail_id';\nconst ENTRY_VERSION =\n 'guardrailVersion = aws_bedrock_guardrail_version.this.version';\n\n/** Every shape the migration rewrites, so a module missing one is reported rather than half-migrated. */\nconst REQUIRED_SHAPES = [\n '`required_providers { $_ }`',\n '`resource \"aws_bedrock_guardrail_version\" \"this\" { $_ }`',\n `\\`module \"add_guardrail_to_runtime_config\" { $body }\\` where { $body <: and { contains \\`${ENTRY_ID}\\`, contains \\`${ENTRY_VERSION}\\` } }`,\n];\n\nconst divergedMessage = (filePath: string) =>\n `${filePath}: has diverged from the generated shape - left untouched. To keep a replaced guardrail version until agents have read the new one, add the time provider to required_providers:\n\n${TIME_PROVIDER_TEXT}\n\nadd this resource:\n\n${TIME_SLEEP_TEXT}\n\nand make the runtime-config entry read guardrailId = time_sleep.version_retention.triggers.guardrail_id and guardrailVersion = time_sleep.version_retention.triggers.guardrail_version.`;\n\n/** The Terraform guardrail module of each Terraform-deployed `ts#agent#guardrails` agent. */\nconst guardedTerraformModules = (tree: Tree): string[] => {\n const files = new Set<string>();\n for (const project of getProjects(tree).values()) {\n const components: ComponentMetadata[] =\n (project.metadata as { components?: ComponentMetadata[] } | undefined)\n ?.components ?? [];\n for (const guardrail of components.filter(\n (c) => c.generator === TS_AGENT_GUARDRAILS_GENERATOR_INFO.id,\n )) {\n const agent = components.find(\n (c) =>\n c.generator === TS_AGENT_GENERATOR_INFO.id &&\n (c.name ?? 'agent') === guardrail.name,\n );\n if (agent?.iac !== 'terraform') {\n continue;\n }\n const nameKebabCase = kebabCase(\n agent.rc ?? toClassName(agent.name ?? 'agent'),\n );\n files.add(\n joinPathFragments(\n TERRAFORM_GUARDRAILS_DIR,\n nameKebabCase,\n `${nameKebabCase}-guardrail.tf`,\n ),\n );\n }\n }\n return [...files];\n};\n\nconst migrateModule = async (\n tree: Tree,\n filePath: string,\n nextSteps: string[],\n): Promise<void> => {\n if (await matchGritQL(tree, filePath, hcl(TIME_SLEEP))) {\n return; // Already migrated.\n }\n\n const shapeChecks = await Promise.all(\n REQUIRED_SHAPES.map((shape) => matchGritQL(tree, filePath, hcl(shape))),\n );\n if (shapeChecks.includes(false)) {\n nextSteps.push(divergedMessage(filePath));\n return;\n }\n\n // Appended after the existing providers, so an entry the user changed is kept.\n await insertViaGritQL(\n tree,\n filePath,\n hcl(\n `\\`required_providers { $body }\\` => \\`required_providers {\\n $body\\n ${GRIT_INSERT_PLACEHOLDER}\\n }\\`` +\n ' where { $body <: not contains `time = { $_ }` }',\n ),\n // The placeholder already sits at the entry's indentation.\n TIME_PROVIDER_TEXT.replace(/^ {4}/, ''),\n );\n\n // After the version it keeps, where the generator writes it.\n await insertViaGritQL(\n tree,\n filePath,\n hcl(\n `\\`resource \"aws_bedrock_guardrail_version\" \"this\" { $body }\\` => \\`resource \"aws_bedrock_guardrail_version\" \"this\" {\\n $body\\n}\\n\\n${GRIT_INSERT_PLACEHOLDER}\\``,\n ),\n TIME_SLEEP_TEXT,\n );\n\n // Only the entry reads through the sleep; the module's outputs are unchanged.\n await applyGritQL(\n tree,\n filePath,\n hcl(\n `\\`module \"add_guardrail_to_runtime_config\" { $body }\\` where { $body <: contains bubble \\`${ENTRY_ID}\\` => \\`guardrailId = time_sleep.version_retention.triggers.guardrail_id\\`, $body <: contains bubble \\`${ENTRY_VERSION}\\` => \\`guardrailVersion = time_sleep.version_retention.triggers.guardrail_version\\` }`,\n ),\n );\n};\n\nexport default async function migration(\n tree: Tree,\n): Promise<MigrationReturnObject> {\n const nextSteps: string[] = [];\n\n for (const filePath of guardedTerraformModules(tree)) {\n if (!tree.exists(filePath)) {\n continue; // The guardrail module was removed or never added.\n }\n await migrateModule(tree, filePath, nextSteps);\n }\n\n await formatFilesInSubtree(tree);\n\n return { nextSteps };\n}\n"],"names":["getProjects","joinPathFragments","TS_AGENT_GENERATOR_INFO","TS_AGENT_GUARDRAILS_GENERATOR_INFO","applyGritQL","GRIT_INSERT_PLACEHOLDER","insertViaGritQL","matchGritQL","formatFilesInSubtree","kebabCase","toClassName","PACKAGES_DIR","SHARED_TERRAFORM_DIR","TERRAFORM_VERSIONS","TERRAFORM_GUARDRAILS_DIR","hcl","pattern","TIME_SLEEP","TIME_PROVIDER_TEXT","time","TIME_SLEEP_TEXT","ENTRY_ID","ENTRY_VERSION","REQUIRED_SHAPES","divergedMessage","filePath","guardedTerraformModules","tree","files","Set","project","values","components","metadata","guardrail","filter","c","generator","id","agent","find","name","iac","nameKebabCase","rc","add","migrateModule","nextSteps","shapeChecks","Promise","all","map","shape","includes","push","replace","migration","exists"],"mappings":"AAAA;;;CAGC,GACD,SACEA,WAAW,EACXC,iBAAiB,QAGZ,aAAa;AACpB,SAASC,uBAAuB,QAAQ,iCAAiC;AACzE,SAASC,kCAAkC,QAAQ,4CAA4C;AAC/F,SACEC,WAAW,EACXC,uBAAuB,EACvBC,eAAe,EACfC,WAAW,QACN,wBAAwB;AAC/B,SAASC,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,SAAS,EAAEC,WAAW,QAAQ,0BAA0B;AAEjE,SACEC,YAAY,EACZC,oBAAoB,QACf,gDAAgD;AACvD,SAASC,kBAAkB,QAAQ,6BAA6B;AAEhE;;;;;;;;;;;;;;;;;;;;;;;CAuBC,GAED,MAAMC,2BAA2B,GAAGH,aAAa,CAAC,EAAEC,qBAAqB,mBAAmB,CAAC;AAE7F,MAAMG,MAAM,CAACC,UAAoB,CAAC,cAAc,EAAEA,SAAS;AAE3D,MAAMC,aAAa;AAEnB,kFAAkF,GAClF,MAAMC,qBAAqB,CAAC;;iBAEX,EAAEL,mBAAmBM,IAAI,CAAC;KACtC,CAAC;AAEN,MAAMC,kBAAkB,CAA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C;IAEjE,IAAIJ,YAAYK,QAAQ,CAAC,QAAQ;QAC/BN,UAAUO,IAAI,CAAC9B,gBAAgBC;QAC/B;IACF;IAEA,+EAA+E;IAC/E,MAAMnB,gBACJqB,MACAF,UACAV,IACE,CAAC,2EAA2E,EAAEV,wBAAwB,OAAO,CAAC,GAC5G,qDAEJ,2DAA2D;IAC3Da,mBAAmBqC,OAAO,CAAC,SAAS;IAGtC,6DAA6D;IAC7D,MAAMjD,gBACJqB,MACAF,UACAV,IACE,CAAC,oIAAoI,EAAEV,wBAAwB,EAAE,CAAC,GAEpKe;IAGF,8EAA8E;IAC9E,MAAMhB,YACJuB,MACAF,UACAV,IACE,CAAC,0FAA0F,EAAEM,SAAS,uGAAuG,EAAEC,cAAc,sFAAsF,CAAC;AAG1T;AAEA,eAAe,eAAekC,UAC5B7B,IAAU;IAEV,MAAMoB,YAAsB,EAAE;IAE9B,KAAK,MAAMtB,YAAYC,wBAAwBC,MAAO;QACpD,IAAI,CAACA,KAAK8B,MAAM,CAAChC,WAAW;YAC1B,UAAU,mDAAmD;QAC/D;QACA,MAAMqB,cAAcnB,MAAMF,UAAUsB;IACtC;IAEA,MAAMvC,qBAAqBmB;IAE3B,OAAO;QAAEoB;IAAU;AACrB"}
@@ -259,7 +259,7 @@ export default {
259
259
 
260
260
  exports[`preset generator > should run successfully > biome.json 1`] = `
261
261
  "{
262
- "$schema": "https://biomejs.dev/schemas/2.5.15/schema.json",
262
+ "$schema": "https://biomejs.dev/schemas/2.6.3/schema.json",
263
263
  "root": true,
264
264
  "formatter": {
265
265
  "enabled": true,
@@ -284,6 +284,16 @@ exports[`preset generator > should run successfully > biome.json 1`] = `
284
284
  "enabled": false
285
285
  }
286
286
  },
287
+ "markdown": {
288
+ "formatter": {
289
+ "enabled": false
290
+ }
291
+ },
292
+ "yaml": {
293
+ "formatter": {
294
+ "enabled": false
295
+ }
296
+ },
287
297
  "linter": {
288
298
  "enabled": true,
289
299
  "rules": {
@@ -424,11 +434,11 @@ onlyBuiltDependencies:
424
434
  - sharp
425
435
  catalogMode: strict
426
436
  catalog:
427
- nx: 23.3.0
428
- '@nx/js': 23.3.0
429
- '@nx/workspace': 23.3.0
437
+ nx: 23.3.1
438
+ '@nx/js': 23.3.1
439
+ '@nx/workspace': 23.3.1
430
440
  typescript: ~6.0.3
431
- '@biomejs/biome': 2.5.15
441
+ '@biomejs/biome': 2.6.3
432
442
  '@aws/nx-plugin': ^0.0.0
433
443
  '@aws/nx-plugin-mcp': ^0.0.0
434
444
  "
@@ -763,19 +763,19 @@ name = "proj.test_project"
763
763
  version = "0.1.0"
764
764
  dependencies = [
765
765
  "proj-agent-connection",
766
- "aws-lambda-powertools==3.36.0",
766
+ "aws-lambda-powertools==3.37.0",
767
767
  "aws-opentelemetry-distro==0.21.0",
768
- "bedrock-agentcore==1.24.2",
769
- "boto3==1.43.115",
770
- "fastapi==0.150.0",
768
+ "bedrock-agentcore==1.25.0",
769
+ "boto3==1.43.118",
770
+ "fastapi==0.162.0",
771
771
  "mcp==1.28.1",
772
- "strands-agents==1.61.1",
773
- "strands-agents-tools==0.8.9",
772
+ "strands-agents==1.62.0",
773
+ "strands-agents-tools==0.8.10",
774
774
  "uvicorn==0.54.0"
775
775
  ]
776
776
 
777
777
  [dependency-groups]
778
- dev = [ "fastapi[standard]==0.150.0" ]
778
+ dev = [ "fastapi[standard]==0.162.0" ]
779
779
 
780
780
  [tool.uv]
781
781
  dev-dependencies = [ ]
@@ -701,15 +701,15 @@ name = "proj.test_project"
701
701
  version = "0.1.0"
702
702
  dependencies = [
703
703
  "proj-agent-connection",
704
- "aws-lambda-powertools==3.36.0",
704
+ "aws-lambda-powertools==3.37.0",
705
705
  "aws-opentelemetry-distro==0.21.0",
706
- "bedrock-agentcore==1.24.2",
707
- "boto3==1.43.115",
708
- "fastapi==0.150.0",
706
+ "bedrock-agentcore==1.25.0",
707
+ "boto3==1.43.118",
708
+ "fastapi==0.162.0",
709
709
  "mcp==1.28.1",
710
- "langchain==1.4.6",
710
+ "langchain==1.4.7",
711
711
  "langchain-aws==1.9.0",
712
- "langgraph==1.2.16",
712
+ "langgraph==1.2.17",
713
713
  "langgraph-checkpoint-sqlite==3.1.2",
714
714
  "aiosqlite==0.22.1",
715
715
  "ag-ui-protocol==0.1.22",
@@ -718,7 +718,7 @@ dependencies = [
718
718
  ]
719
719
 
720
720
  [dependency-groups]
721
- dev = [ "fastapi[standard]==0.150.0" ]
721
+ dev = [ "fastapi[standard]==0.162.0" ]
722
722
 
723
723
  [tool.uv]
724
724
  dev-dependencies = [ ]
@@ -5,7 +5,7 @@ exports[`py#agent generator > should create DynamoDB checkpoint table and S3 off
5
5
  required_providers {
6
6
  aws = {
7
7
  source = "hashicorp/aws"
8
- version = "6.69.1"
8
+ version = "6.70.0"
9
9
  }
10
10
  random = {
11
11
  source = "hashicorp/random"
@@ -381,7 +381,7 @@ exports[`py#agent generator > should match snapshot for Terraform generated file
381
381
  required_providers {
382
382
  aws = {
383
383
  source = "hashicorp/aws"
384
- version = "6.69.1"
384
+ version = "6.70.0"
385
385
  }
386
386
  random = {
387
387
  source = "hashicorp/random"
@@ -704,7 +704,7 @@ exports[`py#agent generator > should match snapshot for Terraform generated file
704
704
  required_providers {
705
705
  aws = {
706
706
  source = "hashicorp/aws"
707
- version = "6.69.1"
707
+ version = "6.70.0"
708
708
  }
709
709
  null = {
710
710
  source = "hashicorp/null"
@@ -1063,7 +1063,7 @@ resource "null_resource" "runtime_ready" {
1063
1063
 
1064
1064
  provisioner "local-exec" {
1065
1065
  command = <<-EOT
1066
- uv run --with boto3==1.43.115 python -c "
1066
+ uv run --with boto3==1.43.118 python -c "
1067
1067
  import boto3
1068
1068
  import json
1069
1069
  import os
@@ -8,7 +8,7 @@ import { addPyDependencies, addTsDependencies } from "../../utils/add-dependenci
8
8
  import { addAgentChatScripts } from "../../utils/agent-chat/agent-chat.js";
9
9
  import { AGENT_CONNECTION_PY_DEPENDENCIES, addPythonFrameworkBase, ensureLangchainS3CheckpointSaver, ensurePythonAgentConnectionProject, getPythonAgentConnectionModuleName, getPythonAgentConnectionProject } from "../../utils/agent-connection/agent-connection.js";
10
10
  import { addAgentInfra } from "../../utils/agent-core-constructs/agent-core-constructs.js";
11
- import { addPythonCodePackageTarget, agentCorePythonRuntime, isAgentCoreHosted, isContainerHosted } from "../../utils/agent-core-packaging.js";
11
+ import { addPythonCodePackageTarget, agentCorePythonRuntime, isAgentCoreHosted, isContainerHosted, PYTHON_AGENT_CORE_LAUNCHER } from "../../utils/agent-core-packaging.js";
12
12
  import { addPythonBundleTarget } from "../../utils/bundle/bundle.js";
13
13
  import { resolveContainers } from "../../utils/containers.js";
14
14
  import { declareDependencies, ownedElsewhere } from "../../utils/declared-dependencies.js";
@@ -372,7 +372,7 @@ export const pyAgentGenerator = async (tree, options)=>{
372
372
  type: 'code',
373
373
  outputDir: packageOutputDir,
374
374
  runtime: agentCorePythonRuntime(),
375
- entryPoint: 'main.py'
375
+ entryPoint: PYTHON_AGENT_CORE_LAUNCHER
376
376
  };
377
377
  }
378
378
  // Add shared constructs