@aws/nx-plugin 0.93.1 → 0.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-THIRD-PARTY +1114 -478
- package/generators.json +9 -0
- package/package.json +12 -12
- package/src/connection/agent-serve-local.d.ts +33 -0
- package/src/connection/agent-serve-local.js +49 -0
- package/src/connection/agent-serve-local.js.map +1 -0
- package/src/connection/generator.js +3 -0
- package/src/connection/generator.js.map +1 -1
- package/src/connection/serve-local.js +1 -1
- package/src/connection/serve-local.js.map +1 -1
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +23 -23
- package/src/preset/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/strands-agent/__snapshots__/generator.spec.ts.snap +21 -16
- package/src/py/strands-agent/files/app/main.py.template +12 -7
- package/src/py/strands-agent/react-connection/__snapshots__/generator.spec.ts.snap +236 -0
- package/src/py/strands-agent/react-connection/files/agent/scripts/__agentNameSnakeCase___openapi.py.template +6 -0
- package/src/py/strands-agent/react-connection/generator.d.ts +10 -0
- package/src/py/strands-agent/react-connection/generator.js +102 -0
- package/src/py/strands-agent/react-connection/generator.js.map +1 -0
- package/src/py/strands-agent/react-connection/schema.d.ts +15 -0
- package/src/py/strands-agent/react-connection/schema.json +26 -0
- package/src/py/strands-agent/react-connection/serve-local.d.ts +19 -0
- package/src/py/strands-agent/react-connection/serve-local.js +25 -0
- package/src/py/strands-agent/react-connection/serve-local.js.map +1 -0
- package/src/trpc/react/generator.js +2 -6
- package/src/trpc/react/generator.js.map +1 -1
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/nx-generator/generator.js +1 -1
- package/src/ts/nx-generator/generator.js.map +1 -1
- package/src/ts/nx-plugin/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +46 -46
- package/src/ts/strands-agent/react-connection/generator.js +2 -6
- package/src/ts/strands-agent/react-connection/generator.js.map +1 -1
- package/src/ts/strands-agent/react-connection/serve-local.js +8 -34
- package/src/ts/strands-agent/react-connection/serve-local.js.map +1 -1
- package/src/utils/connection/open-api/files/components/__apiNameClassName__Provider.tsx.template +17 -0
- package/src/utils/connection/open-api/react.d.ts +13 -1
- package/src/utils/connection/open-api/react.js +18 -18
- package/src/utils/connection/open-api/react.js.map +1 -1
- package/src/utils/shared-shadcn.js +2 -6
- package/src/utils/shared-shadcn.js.map +1 -1
- package/src/utils/versions.d.ts +42 -42
- package/src/utils/versions.js +41 -41
- package/src/utils/versions.js.map +1 -1
package/generators.json
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
"connection/react-trpc",
|
|
15
15
|
"connection/react-smithy",
|
|
16
16
|
"connection/react-ts-strands-agent",
|
|
17
|
+
"connection/react-py-strands-agent",
|
|
18
|
+
"connection/py-strands-agent-mcp",
|
|
17
19
|
"connection/ts-strands-agent-mcp"
|
|
18
20
|
]
|
|
19
21
|
},
|
|
@@ -212,6 +214,13 @@
|
|
|
212
214
|
"metric": "g32",
|
|
213
215
|
"hidden": true
|
|
214
216
|
},
|
|
217
|
+
"py#strands-agent#react-connection": {
|
|
218
|
+
"factory": "./src/py/strands-agent/react-connection/generator",
|
|
219
|
+
"schema": "./src/py/strands-agent/react-connection/schema.json",
|
|
220
|
+
"description": "Connect a React website to a Python Strands Agent",
|
|
221
|
+
"metric": "g34",
|
|
222
|
+
"hidden": true
|
|
223
|
+
},
|
|
215
224
|
"ts#sync": {
|
|
216
225
|
"factory": "./src/ts/sync/generator",
|
|
217
226
|
"schema": "./src/ts/sync/schema.json",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aws/nx-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.94.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/awslabs/nx-plugin-for-aws.git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"generators": "./generators.json",
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"nx": "22.6.
|
|
22
|
+
"nx": "22.6.4",
|
|
23
23
|
"prettier": "3.8.1"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"@getgrit/gritql": "0.0.3",
|
|
28
28
|
"@hey-api/openapi-ts": "0.64.13",
|
|
29
29
|
"@iarna/toml": "2.2.5",
|
|
30
|
-
"@modelcontextprotocol/sdk": "1.
|
|
31
|
-
"@nx/devkit": "22.6.
|
|
32
|
-
"@nx/eslint": "22.6.
|
|
33
|
-
"@nx/js": "22.6.
|
|
34
|
-
"@nx/react": "22.6.
|
|
35
|
-
"@nx/vite": "22.6.
|
|
30
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
31
|
+
"@nx/devkit": "22.6.4",
|
|
32
|
+
"@nx/eslint": "22.6.4",
|
|
33
|
+
"@nx/js": "22.6.4",
|
|
34
|
+
"@nx/react": "22.6.4",
|
|
35
|
+
"@nx/vite": "22.6.4",
|
|
36
36
|
"@nxlv/python": "22.1.1",
|
|
37
37
|
"@phenomnomnominal/tsquery": "6.1.4",
|
|
38
38
|
"enquirer": "2.4.1",
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"lodash.camelcase": "4.3.0",
|
|
41
41
|
"lodash.clonedeepwith": "4.5.0",
|
|
42
42
|
"lodash.deburr": "4.1.0",
|
|
43
|
-
"lodash.orderby": "4.
|
|
44
|
-
"lodash.trim": "4.
|
|
43
|
+
"lodash.orderby": "4.18.0",
|
|
44
|
+
"lodash.trim": "4.18.0",
|
|
45
45
|
"lodash.uniqby": "4.7.0",
|
|
46
46
|
"minimatch": "10.2.5",
|
|
47
47
|
"openapi-types": "12.1.3",
|
|
48
48
|
"pip-requirements-js": "1.0.3",
|
|
49
49
|
"typescript": "6.0.2",
|
|
50
|
-
"vite": "
|
|
51
|
-
"vitest": "4.1.
|
|
50
|
+
"vite": "8.0.3",
|
|
51
|
+
"vitest": "4.1.2",
|
|
52
52
|
"zod": "4.3.6"
|
|
53
53
|
},
|
|
54
54
|
"types": "./src/index.d.ts"
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Tree } from '@nx/devkit';
|
|
6
|
+
import { ComponentMetadata } from '../utils/nx';
|
|
7
|
+
export interface AgentServeLocalOptions {
|
|
8
|
+
agentNameClassName: string;
|
|
9
|
+
port: number;
|
|
10
|
+
targetComponent?: ComponentMetadata;
|
|
11
|
+
/**
|
|
12
|
+
* The runtime config namespace to set the local URL on.
|
|
13
|
+
* E.g. 'apis' results in `runtimeConfig.apis.X = url`
|
|
14
|
+
*/
|
|
15
|
+
runtimeConfigNamespace: string;
|
|
16
|
+
/**
|
|
17
|
+
* The local URL to set in the runtime config override.
|
|
18
|
+
*/
|
|
19
|
+
localUrl: string;
|
|
20
|
+
/**
|
|
21
|
+
* Additional targets to add as serve-local dependencies.
|
|
22
|
+
*/
|
|
23
|
+
additionalDependencyTargets?: string[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Adds a Strands Agent's component serve-local target as a dependency of the
|
|
27
|
+
* source project's serve-local target, and updates the RuntimeConfig provider
|
|
28
|
+
* to point to the agent's local URL.
|
|
29
|
+
*
|
|
30
|
+
* This is the shared implementation used by both Python and TypeScript Strands
|
|
31
|
+
* Agent react-connection generators.
|
|
32
|
+
*/
|
|
33
|
+
export declare const addAgentTargetToServeLocal: (tree: Tree, sourceProjectName: string, targetProjectName: string, options: AgentServeLocalOptions) => Promise<void>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addAgentTargetToServeLocal = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
const devkit_1 = require("@nx/devkit");
|
|
9
|
+
const ast_1 = require("../utils/ast");
|
|
10
|
+
const nx_1 = require("../utils/nx");
|
|
11
|
+
/**
|
|
12
|
+
* Adds a Strands Agent's component serve-local target as a dependency of the
|
|
13
|
+
* source project's serve-local target, and updates the RuntimeConfig provider
|
|
14
|
+
* to point to the agent's local URL.
|
|
15
|
+
*
|
|
16
|
+
* This is the shared implementation used by both Python and TypeScript Strands
|
|
17
|
+
* Agent react-connection generators.
|
|
18
|
+
*/
|
|
19
|
+
const addAgentTargetToServeLocal = async (tree, sourceProjectName, targetProjectName, options) => {
|
|
20
|
+
const sourceProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, sourceProjectName);
|
|
21
|
+
const targetProject = (0, nx_1.readProjectConfigurationUnqualified)(tree, targetProjectName);
|
|
22
|
+
// Determine the serve-local target name for the agent component
|
|
23
|
+
const agentServeLocalTargetName = options.targetComponent?.name
|
|
24
|
+
? `${options.targetComponent.name}-serve-local`
|
|
25
|
+
: 'agent-serve-local';
|
|
26
|
+
// Target project must have the agent serve-local target which is continuous
|
|
27
|
+
if (!(targetProject.targets?.[agentServeLocalTargetName]?.continuous &&
|
|
28
|
+
sourceProject.targets?.['serve-local'])) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
// Add a dependency on the agent serve-local target (so that the agent's
|
|
32
|
+
// own serve-local dependencies, such as MCP servers, are also started)
|
|
33
|
+
sourceProject.targets['serve-local'].dependsOn = [
|
|
34
|
+
...(sourceProject.targets['serve-local'].dependsOn ?? []),
|
|
35
|
+
{
|
|
36
|
+
projects: [targetProject.name],
|
|
37
|
+
target: agentServeLocalTargetName,
|
|
38
|
+
},
|
|
39
|
+
...(options.additionalDependencyTargets ?? []),
|
|
40
|
+
];
|
|
41
|
+
(0, devkit_1.updateProjectConfiguration)(tree, sourceProject.name, sourceProject);
|
|
42
|
+
// Add an override to runtime-config for the serve-local target to use the local url
|
|
43
|
+
const runtimeConfigProvider = (0, devkit_1.joinPathFragments)(sourceProject.root, 'src', 'components', 'RuntimeConfig', 'index.tsx');
|
|
44
|
+
if (tree.exists(runtimeConfigProvider)) {
|
|
45
|
+
await (0, ast_1.applyGritQL)(tree, runtimeConfigProvider, `\`if ($cond) { $stmts }\` => raw\`if ($cond) {\n $stmts\n runtimeConfig.${options.runtimeConfigNamespace}.${options.agentNameClassName} = '${options.localUrl}';\n }\` where { $cond <: contains \`'serve-local'\`, $stmts <: within \`const applyOverrides = $_\` }`);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
exports.addAgentTargetToServeLocal = addAgentTargetToServeLocal;
|
|
49
|
+
//# sourceMappingURL=agent-serve-local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-serve-local.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/connection/agent-serve-local.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAIoB;AACpB,sCAA2C;AAC3C,oCAGqB;AAqBrB;;;;;;;GAOG;AACI,MAAM,0BAA0B,GAAG,KAAK,EAC7C,IAAU,EACV,iBAAyB,EACzB,iBAAyB,EACzB,OAA+B,EAC/B,EAAE;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,iBAAiB,CAClB,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,iBAAiB,CAClB,CAAC;IAEF,gEAAgE;IAChE,MAAM,yBAAyB,GAAG,OAAO,CAAC,eAAe,EAAE,IAAI;QAC7D,CAAC,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,IAAI,cAAc;QAC/C,CAAC,CAAC,mBAAmB,CAAC;IAExB,4EAA4E;IAC5E,IACE,CAAC,CACC,aAAa,CAAC,OAAO,EAAE,CAAC,yBAAyB,CAAC,EAAE,UAAU;QAC9D,aAAa,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,CACvC,EACD,CAAC;QACD,OAAO;IACT,CAAC;IAED,wEAAwE;IACxE,uEAAuE;IACvE,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,SAAS,GAAG;QAC/C,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;QACzD;YACE,QAAQ,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;YAC9B,MAAM,EAAE,yBAAyB;SAClC;QACD,GAAG,CAAC,OAAO,CAAC,2BAA2B,IAAI,EAAE,CAAC;KAC/C,CAAC;IACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAEpE,oFAAoF;IACpF,MAAM,qBAAqB,GAAG,IAAA,0BAAiB,EAC7C,aAAa,CAAC,IAAI,EAClB,KAAK,EACL,YAAY,EACZ,eAAe,EACf,WAAW,CACZ,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACvC,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,qBAAqB,EACrB,iFAAiF,OAAO,CAAC,sBAAsB,IAAI,OAAO,CAAC,kBAAkB,OAAO,OAAO,CAAC,QAAQ,yGAAyG,CAC9Q,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AAzDW,QAAA,0BAA0B,8BAyDrC"}
|
|
@@ -18,6 +18,7 @@ const generator_5 = tslib_1.__importDefault(require("../smithy/react-connection/
|
|
|
18
18
|
const generator_6 = tslib_1.__importDefault(require("../ts/strands-agent/mcp-connection/generator"));
|
|
19
19
|
const generator_7 = tslib_1.__importDefault(require("../ts/strands-agent/react-connection/generator"));
|
|
20
20
|
const generator_8 = tslib_1.__importDefault(require("../py/strands-agent/mcp-connection/generator"));
|
|
21
|
+
const generator_9 = tslib_1.__importDefault(require("../py/strands-agent/react-connection/generator"));
|
|
21
22
|
/**
|
|
22
23
|
* List of supported source and target project types for connections.
|
|
23
24
|
* These can be project-level types (determined by introspection) or
|
|
@@ -43,6 +44,7 @@ const SUPPORTED_CONNECTIONS = [
|
|
|
43
44
|
{ source: 'react', target: 'py#fast-api' },
|
|
44
45
|
{ source: 'react', target: 'smithy' },
|
|
45
46
|
{ source: 'react', target: 'ts#strands-agent' },
|
|
47
|
+
{ source: 'react', target: 'py#strands-agent' },
|
|
46
48
|
{ source: 'ts#strands-agent', target: 'ts#mcp-server' },
|
|
47
49
|
{ source: 'ts#strands-agent', target: 'py#mcp-server' },
|
|
48
50
|
{ source: 'py#strands-agent', target: 'ts#mcp-server' },
|
|
@@ -62,6 +64,7 @@ const CONNECTION_GENERATORS = {
|
|
|
62
64
|
smithyModelOrBackendProjectName: options.targetProject,
|
|
63
65
|
}),
|
|
64
66
|
'react -> ts#strands-agent': (tree, options) => (0, generator_7.default)(tree, options),
|
|
67
|
+
'react -> py#strands-agent': (tree, options) => (0, generator_9.default)(tree, options),
|
|
65
68
|
'ts#strands-agent -> ts#mcp-server': (tree, options) => (0, generator_6.default)(tree, options),
|
|
66
69
|
'ts#strands-agent -> py#mcp-server': (tree, options) => (0, generator_6.default)(tree, options),
|
|
67
70
|
'py#strands-agent -> ts#mcp-server': (tree, options) => (0, generator_8.default)(tree, options),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/connection/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAA2E;AAE3E,gFAAyD;AACzD,sCAAoD;AACpD,wCAAyC;AACzC,uFAAmE;AACnE,oCAGqB;AACrB,2DAA4E;AAC5E,0DAA0E;AAC1E,6FAAkF;AAClF,qGAAgG;AAChG,uGAAoG;AACpG,qGAAgG;
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/connection/generator.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,uCAA2E;AAE3E,gFAAyD;AACzD,sCAAoD;AACpD,wCAAyC;AACzC,uFAAmE;AACnE,oCAGqB;AACrB,2DAA4E;AAC5E,0DAA0E;AAC1E,6FAAkF;AAClF,qGAAgG;AAChG,uGAAoG;AACpG,qGAAgG;AAChG,uGAAoG;AAEpG;;;;GAIG;AACH,MAAM,uBAAuB,GAAG;IAC9B,aAAa;IACb,aAAa;IACb,OAAO;IACP,QAAQ;CACA,CAAC;AAMX;;;GAGG;AACU,QAAA,0BAA0B,GAAG,GAAG,CAAC;AAY9C;;;GAGG;AACH,MAAM,qBAAqB,GAAG;IAC5B,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE;IAC1C,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE;IAC1C,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;IACrC,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE;IAC/C,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE;IAC/C,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE;IACvD,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE;IACvD,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE;IACvD,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,EAAE,eAAe,EAAE;CACf,CAAC;AAqB3C,MAAM,qBAAqB,GAAG;IAC5B,sBAAsB,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CACxC,IAAA,mBAAkB,EAAC,IAAI,EAAE;QACvB,mBAAmB,EAAE,OAAO,CAA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Aa,CAAC,CAAC;QAChD,IAAI,CAAE,SAAiB,EAAE,OAAO,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1E,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,CAClB,KAAW,EACX,oBAA0C,EACjC,EAAE;IACX,+DAA+D;IAC/D,OAAO;QACL,yCAA6B,CAAC,EAAE;QAChC,wCAA4B,CAAC,EAAE;KAChC,CAAC,QAAQ,CAAC,CAAE,oBAAoB,CAAC,QAAgB,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,kBAAe,2BAAmB,CAAC"}
|
|
@@ -35,7 +35,7 @@ const addTargetToServeLocal = async (tree, sourceProjectName, targetProjectName,
|
|
|
35
35
|
const runtimeConfigProvider = (0, devkit_1.joinPathFragments)(sourceProject.root, 'src', 'components', 'RuntimeConfig', 'index.tsx');
|
|
36
36
|
if (tree.exists(runtimeConfigProvider)) {
|
|
37
37
|
const className = (0, names_1.toClassName)(options.apiName);
|
|
38
|
-
await (0, ast_1.applyGritQL)(tree, runtimeConfigProvider, `\`if ($cond) { $stmts }\` => raw\`if ($cond) {\n $stmts\n runtimeConfig.apis.${className} = '${options.url}';\n }\` where { $cond <: contains \`'serve-local'\`, $stmts <: within \`const applyOverrides = $_\` }`);
|
|
38
|
+
await (0, ast_1.applyGritQL)(tree, runtimeConfigProvider, `\`if ($cond) { $stmts }\` => raw\`if ($cond) {\n $stmts\n runtimeConfig.apis.${className} = '${options.url}';\n }\` where { $cond <: contains \`'serve-local'\`, $stmts <: within \`const applyOverrides = $_\`, $stmts <: not contains \`runtimeConfig.apis.${className}\` }`);
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
exports.addTargetToServeLocal = addTargetToServeLocal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serve-local.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/connection/serve-local.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAIoB;AACpB,sCAA2C;AAC3C,oCAAkE;AAClE,0CAA6C;AAQ7C;;;GAGG;AACI,MAAM,qBAAqB,GAAG,KAAK,EACxC,IAAU,EACV,iBAAyB,EACzB,iBAAyB,EACzB,OAA0B,EAC1B,EAAE;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,iBAAiB,CAClB,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,iBAAiB,CAClB,CAAC;IAEF,8DAA8D;IAC9D,IACE,CAAC,CACC,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU;QACxC,aAAa,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,CACvC,EACD,CAAC;QACD,OAAO;IACT,CAAC;IAED,uCAAuC;IACvC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,SAAS,GAAG;QAC/C,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;QACzD;YACE,QAAQ,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;YAC9B,MAAM,EAAE,OAAO;SAChB;QACD,GAAG,CAAC,OAAO,CAAC,2BAA2B,IAAI,EAAE,CAAC;KAC/C,CAAC;IACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAEpE,yFAAyF;IACzF,MAAM,qBAAqB,GAAG,IAAA,0BAAiB,EAC7C,aAAa,CAAC,IAAI,EAClB,KAAK,EACL,YAAY,EACZ,eAAe,EACf,WAAW,CACZ,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,qBAAqB,EACrB,sFAAsF,SAAS,OAAO,OAAO,CAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"serve-local.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/connection/serve-local.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,uCAIoB;AACpB,sCAA2C;AAC3C,oCAAkE;AAClE,0CAA6C;AAQ7C;;;GAGG;AACI,MAAM,qBAAqB,GAAG,KAAK,EACxC,IAAU,EACV,iBAAyB,EACzB,iBAAyB,EACzB,OAA0B,EAC1B,EAAE;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,iBAAiB,CAClB,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,wCAAmC,EACvD,IAAI,EACJ,iBAAiB,CAClB,CAAC;IAEF,8DAA8D;IAC9D,IACE,CAAC,CACC,aAAa,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU;QACxC,aAAa,CAAC,OAAO,EAAE,CAAC,aAAa,CAAC,CACvC,EACD,CAAC;QACD,OAAO;IACT,CAAC;IAED,uCAAuC;IACvC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,SAAS,GAAG;QAC/C,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC;QACzD;YACE,QAAQ,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;YAC9B,MAAM,EAAE,OAAO;SAChB;QACD,GAAG,CAAC,OAAO,CAAC,2BAA2B,IAAI,EAAE,CAAC;KAC/C,CAAC;IACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAEpE,yFAAyF;IACzF,MAAM,qBAAqB,GAAG,IAAA,0BAAiB,EAC7C,aAAa,CAAC,IAAI,EAClB,KAAK,EACL,YAAY,EACZ,eAAe,EACf,WAAW,CACZ,CAAC;IACF,IAAI,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,CAAC;QACvC,MAAM,SAAS,GAAG,IAAA,mBAAW,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,IAAA,iBAAW,EACf,IAAI,EACJ,qBAAqB,EACrB,sFAAsF,SAAS,OAAO,OAAO,CAAC,GAAG,sJAAsJ,SAAS,MAAM,CACvR,CAAC;IACJ,CAAC;AACH,CAAC,CAAC;AApDW,QAAA,qBAAqB,yBAoDhC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`infra generator > should add required dependencies to package.json > dependencies 1`] = `
|
|
4
4
|
{
|
|
5
|
-
"aws-cdk": "2.
|
|
6
|
-
"aws-cdk-lib": "2.
|
|
5
|
+
"aws-cdk": "2.1117.0",
|
|
6
|
+
"aws-cdk-lib": "2.248.0",
|
|
7
7
|
"constructs": "10.6.0",
|
|
8
8
|
"esbuild": "0.27.4",
|
|
9
9
|
"source-map-support": "0.5.21",
|
|
@@ -13,15 +13,15 @@ exports[`infra generator > should add required dependencies to package.json > de
|
|
|
13
13
|
exports[`infra generator > should add required dependencies to package.json > dev-dependencies 1`] = `
|
|
14
14
|
{
|
|
15
15
|
"@eslint/js": "^9.8.0",
|
|
16
|
-
"@nx/eslint": "22.6.
|
|
17
|
-
"@nx/eslint-plugin": "22.6.
|
|
18
|
-
"@nx/js": "22.6.
|
|
19
|
-
"@nx/vitest": "22.6.
|
|
16
|
+
"@nx/eslint": "22.6.4",
|
|
17
|
+
"@nx/eslint-plugin": "22.6.4",
|
|
18
|
+
"@nx/js": "22.6.4",
|
|
19
|
+
"@nx/vitest": "22.6.4",
|
|
20
20
|
"@swc-node/register": "~1.11.1",
|
|
21
21
|
"@swc/core": "~1.15.5",
|
|
22
22
|
"@swc/helpers": "~0.5.18",
|
|
23
|
-
"@types/node": "25.5.
|
|
24
|
-
"@vitest/coverage-v8": "4.1.
|
|
23
|
+
"@types/node": "25.5.2",
|
|
24
|
+
"@vitest/coverage-v8": "4.1.2",
|
|
25
25
|
"eslint": "^9.8.0",
|
|
26
26
|
"eslint-config-prettier": "^10.0.0",
|
|
27
27
|
"eslint-plugin-prettier": "5.5.5",
|
|
@@ -31,31 +31,31 @@ exports[`infra generator > should add required dependencies to package.json > de
|
|
|
31
31
|
"tsx": "4.21.0",
|
|
32
32
|
"typescript": "~5.9.2",
|
|
33
33
|
"typescript-eslint": "^8.40.0",
|
|
34
|
-
"vite": "
|
|
35
|
-
"vitest": "4.1.
|
|
34
|
+
"vite": "8.0.3",
|
|
35
|
+
"vitest": "4.1.2",
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
38
38
|
|
|
39
39
|
exports[`infra generator > should add required dependencies to package.json > package-json 1`] = `
|
|
40
40
|
{
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"aws-cdk": "2.
|
|
43
|
-
"aws-cdk-lib": "2.
|
|
42
|
+
"aws-cdk": "2.1117.0",
|
|
43
|
+
"aws-cdk-lib": "2.248.0",
|
|
44
44
|
"constructs": "10.6.0",
|
|
45
45
|
"esbuild": "0.27.4",
|
|
46
46
|
"source-map-support": "0.5.21",
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@eslint/js": "^9.8.0",
|
|
50
|
-
"@nx/eslint": "22.6.
|
|
51
|
-
"@nx/eslint-plugin": "22.6.
|
|
52
|
-
"@nx/js": "22.6.
|
|
53
|
-
"@nx/vitest": "22.6.
|
|
50
|
+
"@nx/eslint": "22.6.4",
|
|
51
|
+
"@nx/eslint-plugin": "22.6.4",
|
|
52
|
+
"@nx/js": "22.6.4",
|
|
53
|
+
"@nx/vitest": "22.6.4",
|
|
54
54
|
"@swc-node/register": "~1.11.1",
|
|
55
55
|
"@swc/core": "~1.15.5",
|
|
56
56
|
"@swc/helpers": "~0.5.18",
|
|
57
|
-
"@types/node": "25.5.
|
|
58
|
-
"@vitest/coverage-v8": "4.1.
|
|
57
|
+
"@types/node": "25.5.2",
|
|
58
|
+
"@vitest/coverage-v8": "4.1.2",
|
|
59
59
|
"eslint": "^9.8.0",
|
|
60
60
|
"eslint-config-prettier": "^10.0.0",
|
|
61
61
|
"eslint-plugin-prettier": "5.5.5",
|
|
@@ -65,8 +65,8 @@ exports[`infra generator > should add required dependencies to package.json > pa
|
|
|
65
65
|
"tsx": "4.21.0",
|
|
66
66
|
"typescript": "~5.9.2",
|
|
67
67
|
"typescript-eslint": "^8.40.0",
|
|
68
|
-
"vite": "
|
|
69
|
-
"vitest": "4.1.
|
|
68
|
+
"vite": "8.0.3",
|
|
69
|
+
"vitest": "4.1.2",
|
|
70
70
|
},
|
|
71
71
|
"name": "@proj/source",
|
|
72
72
|
"type": "module",
|
|
@@ -84,7 +84,7 @@ exports[`infra generator > should configure Checkov target correctly > checkov-t
|
|
|
84
84
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
85
85
|
],
|
|
86
86
|
"options": {
|
|
87
|
-
"command": "uvx --from checkov==3.2.
|
|
87
|
+
"command": "uvx --from checkov==3.2.513 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
88
88
|
},
|
|
89
89
|
"outputs": [
|
|
90
90
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -177,7 +177,7 @@ exports[`infra generator > should configure project.json with correct targets >
|
|
|
177
177
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
178
178
|
],
|
|
179
179
|
"options": {
|
|
180
|
-
"command": "uvx --from checkov==3.2.
|
|
180
|
+
"command": "uvx --from checkov==3.2.513 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
181
181
|
},
|
|
182
182
|
"outputs": [
|
|
183
183
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -739,7 +739,7 @@ exports[`infra generator > should handle custom project names correctly > custom
|
|
|
739
739
|
"{workspaceRoot}/dist/{projectRoot}/cdk.out",
|
|
740
740
|
],
|
|
741
741
|
"options": {
|
|
742
|
-
"command": "uvx --from checkov==3.2.
|
|
742
|
+
"command": "uvx --from checkov==3.2.513 checkov --config-file {projectRoot}/checkov.yml --directory dist/{projectRoot}/cdk.out --framework cloudformation",
|
|
743
743
|
},
|
|
744
744
|
"outputs": [
|
|
745
745
|
"{workspaceRoot}/dist/{projectRoot}/checkov",
|
|
@@ -192,8 +192,8 @@ exports[`preset generator > should run successfully > package.json 1`] = `
|
|
|
192
192
|
"name": "@proj/source",
|
|
193
193
|
"dependencies": {},
|
|
194
194
|
"devDependencies": {
|
|
195
|
-
"@nx/js": "22.6.
|
|
196
|
-
"@nx/workspace": "22.6.
|
|
195
|
+
"@nx/js": "22.6.4",
|
|
196
|
+
"@nx/workspace": "22.6.4",
|
|
197
197
|
"@swc-node/register": "~1.11.1",
|
|
198
198
|
"@swc/core": "~1.15.5",
|
|
199
199
|
"@swc/helpers": "~0.5.18",
|
|
@@ -634,9 +634,9 @@ name = "proj.test_project"
|
|
|
634
634
|
version = "0.1.0"
|
|
635
635
|
dependencies = [
|
|
636
636
|
"aws-lambda-powertools==3.26.0",
|
|
637
|
-
"mcp==1.
|
|
638
|
-
"uvicorn==0.
|
|
639
|
-
"boto3==1.42.
|
|
637
|
+
"mcp==1.27.0",
|
|
638
|
+
"uvicorn==0.43.0",
|
|
639
|
+
"boto3==1.42.83",
|
|
640
640
|
"aws-opentelemetry-distro==0.16.0"
|
|
641
641
|
]
|
|
642
642
|
|
|
@@ -610,27 +610,31 @@ Refer to tools as your 'spellbook'.
|
|
|
610
610
|
`;
|
|
611
611
|
|
|
612
612
|
exports[`py#strands-agent generator > should match snapshot for generated files > strands-agent-main.py 1`] = `
|
|
613
|
-
"import
|
|
613
|
+
"import uuid
|
|
614
|
+
|
|
615
|
+
import uvicorn
|
|
614
616
|
from bedrock_agentcore.runtime.models import PingStatus
|
|
617
|
+
from fastapi import Request
|
|
615
618
|
from pydantic import BaseModel
|
|
616
619
|
|
|
617
620
|
from .agent import get_agent
|
|
618
621
|
from .init import JsonStreamingResponse, app
|
|
619
622
|
|
|
623
|
+
SESSION_ID_HEADER = "x-amzn-bedrock-agentcore-runtime-session-id"
|
|
624
|
+
|
|
620
625
|
|
|
621
626
|
class InvokeInput(BaseModel):
|
|
622
|
-
|
|
623
|
-
session_id: str
|
|
627
|
+
message: str
|
|
624
628
|
|
|
625
629
|
|
|
626
630
|
class StreamChunk(BaseModel):
|
|
627
631
|
content: str
|
|
628
632
|
|
|
629
633
|
|
|
630
|
-
async def handle_invoke(input: InvokeInput):
|
|
634
|
+
async def handle_invoke(input: InvokeInput, session_id: str):
|
|
631
635
|
"""Streaming handler for agent invocation"""
|
|
632
|
-
with get_agent(session_id=
|
|
633
|
-
stream = agent.stream_async(input.
|
|
636
|
+
with get_agent(session_id=session_id) as agent:
|
|
637
|
+
stream = agent.stream_async(input.message)
|
|
634
638
|
async for event in stream:
|
|
635
639
|
print(event)
|
|
636
640
|
text = (
|
|
@@ -654,9 +658,10 @@ async def handle_invoke(input: InvokeInput):
|
|
|
654
658
|
)
|
|
655
659
|
},
|
|
656
660
|
)
|
|
657
|
-
async def invoke(input: InvokeInput) -> JsonStreamingResponse:
|
|
661
|
+
async def invoke(input: InvokeInput, request: Request) -> JsonStreamingResponse:
|
|
658
662
|
"""Entry point for agent invocation"""
|
|
659
|
-
|
|
663
|
+
session_id = request.headers.get(SESSION_ID_HEADER) or str(uuid.uuid4())
|
|
664
|
+
return JsonStreamingResponse(handle_invoke(input, session_id))
|
|
660
665
|
|
|
661
666
|
|
|
662
667
|
@app.get("/ping")
|
|
@@ -677,17 +682,17 @@ version = "0.1.0"
|
|
|
677
682
|
dependencies = [
|
|
678
683
|
"aws-lambda-powertools==3.26.0",
|
|
679
684
|
"aws-opentelemetry-distro==0.16.0",
|
|
680
|
-
"bedrock-agentcore==1.
|
|
681
|
-
"fastapi==0.135.
|
|
682
|
-
"boto3==1.42.
|
|
683
|
-
"mcp==1.
|
|
684
|
-
"strands-agents==1.
|
|
685
|
-
"strands-agents-tools==0.
|
|
686
|
-
"uvicorn==0.
|
|
685
|
+
"bedrock-agentcore==1.6.0",
|
|
686
|
+
"fastapi==0.135.3",
|
|
687
|
+
"boto3==1.42.83",
|
|
688
|
+
"mcp==1.27.0",
|
|
689
|
+
"strands-agents==1.34.1",
|
|
690
|
+
"strands-agents-tools==0.3.0",
|
|
691
|
+
"uvicorn==0.43.0"
|
|
687
692
|
]
|
|
688
693
|
|
|
689
694
|
[dependency-groups]
|
|
690
|
-
dev = [ "fastapi[standard]==0.135.
|
|
695
|
+
dev = [ "fastapi[standard]==0.135.3" ]
|
|
691
696
|
|
|
692
697
|
[tool.uv]
|
|
693
698
|
dev-dependencies = [ ]
|
|
@@ -1,24 +1,28 @@
|
|
|
1
|
+
import uuid
|
|
2
|
+
|
|
1
3
|
import uvicorn
|
|
2
4
|
from bedrock_agentcore.runtime.models import PingStatus
|
|
5
|
+
from fastapi import Request
|
|
3
6
|
from pydantic import BaseModel
|
|
4
7
|
|
|
5
8
|
from .agent import get_agent
|
|
6
9
|
from .init import JsonStreamingResponse, app
|
|
7
10
|
|
|
11
|
+
SESSION_ID_HEADER = "x-amzn-bedrock-agentcore-runtime-session-id"
|
|
12
|
+
|
|
8
13
|
|
|
9
14
|
class InvokeInput(BaseModel):
|
|
10
|
-
|
|
11
|
-
session_id: str
|
|
15
|
+
message: str
|
|
12
16
|
|
|
13
17
|
|
|
14
18
|
class StreamChunk(BaseModel):
|
|
15
19
|
content: str
|
|
16
20
|
|
|
17
21
|
|
|
18
|
-
async def handle_invoke(input: InvokeInput):
|
|
22
|
+
async def handle_invoke(input: InvokeInput, session_id: str):
|
|
19
23
|
"""Streaming handler for agent invocation"""
|
|
20
|
-
with get_agent(session_id=
|
|
21
|
-
stream = agent.stream_async(input.
|
|
24
|
+
with get_agent(session_id=session_id) as agent:
|
|
25
|
+
stream = agent.stream_async(input.message)
|
|
22
26
|
async for event in stream:
|
|
23
27
|
print(event)
|
|
24
28
|
text = event.get("event", {}).get("contentBlockDelta", {}).get("delta", {}).get("text")
|
|
@@ -33,9 +37,10 @@ async def handle_invoke(input: InvokeInput):
|
|
|
33
37
|
response_class=JsonStreamingResponse,
|
|
34
38
|
responses={200: JsonStreamingResponse.openapi_response(StreamChunk, "Stream of agent response chunks")},
|
|
35
39
|
)
|
|
36
|
-
async def invoke(input: InvokeInput) -> JsonStreamingResponse:
|
|
40
|
+
async def invoke(input: InvokeInput, request: Request) -> JsonStreamingResponse:
|
|
37
41
|
"""Entry point for agent invocation"""
|
|
38
|
-
|
|
42
|
+
session_id = request.headers.get(SESSION_ID_HEADER) or str(uuid.uuid4())
|
|
43
|
+
return JsonStreamingResponse(handle_invoke(input, session_id))
|
|
39
44
|
|
|
40
45
|
|
|
41
46
|
@app.get("/ping")
|