@aws/agentcore 0.13.0 → 0.14.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/README.md +6 -7
- package/dist/agent-inspector/index.css +1 -1
- package/dist/agent-inspector/index.js +81 -81
- package/dist/assets/__tests__/__snapshots__/assets.snapshot.test.ts.snap +629 -7
- package/dist/assets/__tests__/__snapshots__/dockerfile-render.test.ts.snap +6 -2
- package/dist/assets/cdk/test/cdk.test.ts +0 -1
- package/dist/assets/container/python/Dockerfile +3 -1
- package/dist/assets/container/typescript/Dockerfile +25 -0
- package/dist/assets/container/typescript/dockerignore.template +24 -0
- package/dist/assets/python/a2a/googleadk/base/pyproject.toml +1 -1
- package/dist/assets/python/a2a/langchain_langgraph/base/pyproject.toml +1 -1
- package/dist/assets/python/a2a/strands/base/pyproject.toml +2 -2
- package/dist/assets/python/agui/strands/base/pyproject.toml +1 -1
- package/dist/assets/python/http/strands/base/pyproject.toml +1 -1
- package/dist/assets/typescript/http/strands/base/README.md +37 -0
- package/dist/assets/typescript/http/strands/base/gitignore.template +22 -0
- package/dist/assets/typescript/http/strands/base/main.ts +71 -0
- package/dist/assets/typescript/http/strands/base/mcp_client/client.ts +11 -0
- package/dist/assets/typescript/http/strands/base/model/load.ts +102 -0
- package/dist/assets/typescript/http/strands/base/package.json +36 -0
- package/dist/assets/typescript/http/strands/base/tsconfig.json +19 -0
- package/dist/assets/typescript/http/vercelai/base/README.md +37 -0
- package/dist/assets/typescript/http/vercelai/base/gitignore.template +22 -0
- package/dist/assets/typescript/http/vercelai/base/main.ts +24 -0
- package/dist/assets/typescript/http/vercelai/base/model/load.ts +121 -0
- package/dist/assets/typescript/http/vercelai/base/package.json +35 -0
- package/dist/assets/typescript/http/vercelai/base/tsconfig.json +19 -0
- package/dist/cli/index.mjs +512 -419
- package/dist/lib/errors/index.d.ts +1 -0
- package/dist/lib/errors/index.d.ts.map +1 -1
- package/dist/lib/errors/index.js +1 -0
- package/dist/lib/errors/index.js.map +1 -1
- package/dist/lib/errors/types.d.ts +63 -0
- package/dist/lib/errors/types.d.ts.map +1 -0
- package/dist/lib/errors/types.js +109 -0
- package/dist/lib/errors/types.js.map +1 -0
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +4 -1
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/packaging/helpers.d.ts +16 -0
- package/dist/lib/packaging/helpers.d.ts.map +1 -1
- package/dist/lib/packaging/helpers.js +62 -0
- package/dist/lib/packaging/helpers.js.map +1 -1
- package/dist/lib/packaging/node.d.ts +2 -2
- package/dist/lib/packaging/node.d.ts.map +1 -1
- package/dist/lib/packaging/node.js +77 -32
- package/dist/lib/packaging/node.js.map +1 -1
- package/dist/lib/result.d.ts +29 -0
- package/dist/lib/result.d.ts.map +1 -0
- package/dist/lib/result.js +16 -0
- package/dist/lib/result.js.map +1 -0
- package/dist/lib/schemas/io/config-io.d.ts.map +1 -1
- package/dist/lib/schemas/io/config-io.js +3 -2
- package/dist/lib/schemas/io/config-io.js.map +1 -1
- package/dist/lib/schemas/io/index.d.ts +1 -1
- package/dist/lib/schemas/io/index.d.ts.map +1 -1
- package/dist/lib/schemas/io/index.js +1 -2
- package/dist/lib/schemas/io/index.js.map +1 -1
- package/dist/lib/schemas/io/path-resolver.d.ts +0 -6
- package/dist/lib/schemas/io/path-resolver.d.ts.map +1 -1
- package/dist/lib/schemas/io/path-resolver.js +3 -13
- package/dist/lib/schemas/io/path-resolver.js.map +1 -1
- package/dist/lib/time-constants.d.ts +5 -0
- package/dist/lib/time-constants.d.ts.map +1 -0
- package/dist/lib/time-constants.js +8 -0
- package/dist/lib/time-constants.js.map +1 -0
- package/dist/lib/utils/index.d.ts +1 -0
- package/dist/lib/utils/index.d.ts.map +1 -1
- package/dist/lib/utils/index.js +6 -1
- package/dist/lib/utils/index.js.map +1 -1
- package/dist/lib/utils/polling.d.ts +41 -0
- package/dist/lib/utils/polling.d.ts.map +1 -0
- package/dist/lib/utils/polling.js +78 -0
- package/dist/lib/utils/polling.js.map +1 -0
- package/dist/schema/constants.d.ts +7 -0
- package/dist/schema/constants.d.ts.map +1 -1
- package/dist/schema/constants.js +18 -3
- package/dist/schema/constants.js.map +1 -1
- package/dist/schema/schemas/agent-env.d.ts +12 -1
- package/dist/schema/schemas/agent-env.d.ts.map +1 -1
- package/dist/schema/schemas/agent-env.js +32 -5
- package/dist/schema/schemas/agent-env.js.map +1 -1
- package/dist/schema/schemas/agentcore-project.d.ts +9 -3
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.js +7 -2
- package/dist/schema/schemas/agentcore-project.js.map +1 -1
- package/dist/schema/schemas/mcp.js +1 -1
- package/dist/schema/schemas/mcp.js.map +1 -1
- package/dist/schema/schemas/primitives/evaluator.d.ts +8 -0
- package/dist/schema/schemas/primitives/evaluator.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/evaluator.js +17 -1
- package/dist/schema/schemas/primitives/evaluator.js.map +1 -1
- package/dist/schema/schemas/primitives/http-gateway.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/http-gateway.js +1 -2
- package/dist/schema/schemas/primitives/http-gateway.js.map +1 -1
- package/dist/schema/schemas/primitives/index.d.ts +1 -1
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/index.js +3 -1
- package/dist/schema/schemas/primitives/index.js.map +1 -1
- package/dist/schema/schemas/primitives/memory.d.ts +22 -4
- package/dist/schema/schemas/primitives/memory.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/memory.js +57 -16
- package/dist/schema/schemas/primitives/memory.js.map +1 -1
- package/package.json +7 -4
- package/scripts/run-e2e-local.sh +112 -0
|
@@ -16,13 +16,23 @@ export declare const MemoryStrategyTypeSchema: z.ZodEnum<{
|
|
|
16
16
|
}>;
|
|
17
17
|
export type MemoryStrategyType = z.infer<typeof MemoryStrategyTypeSchema>;
|
|
18
18
|
/**
|
|
19
|
-
* Default
|
|
19
|
+
* Default namespace templates for each memory strategy type.
|
|
20
20
|
* These match the patterns generated in CLI session.py templates.
|
|
21
21
|
*/
|
|
22
|
-
export declare const
|
|
22
|
+
export declare const DEFAULT_STRATEGY_NAMESPACE_TEMPLATES: Partial<Record<MemoryStrategyType, string[]>>;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
25
|
-
*
|
|
24
|
+
* @deprecated Use {@link DEFAULT_STRATEGY_NAMESPACE_TEMPLATES} instead.
|
|
25
|
+
* Retained as an alias for backward compatibility.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEFAULT_STRATEGY_NAMESPACES: Partial<Record<"SEMANTIC" | "SUMMARIZATION" | "USER_PREFERENCE" | "EPISODIC", string[]>>;
|
|
28
|
+
/**
|
|
29
|
+
* Default reflection namespace templates for the EPISODIC strategy.
|
|
30
|
+
* The service requires reflection templates to be the same as or a prefix of episode templates.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DEFAULT_EPISODIC_REFLECTION_NAMESPACE_TEMPLATES: string[];
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Use {@link DEFAULT_EPISODIC_REFLECTION_NAMESPACE_TEMPLATES} instead.
|
|
35
|
+
* Retained as an alias for backward compatibility.
|
|
26
36
|
*/
|
|
27
37
|
export declare const DEFAULT_EPISODIC_REFLECTION_NAMESPACES: string[];
|
|
28
38
|
/**
|
|
@@ -34,6 +44,12 @@ export declare const MemoryStrategyNameSchema: z.ZodString;
|
|
|
34
44
|
/**
|
|
35
45
|
* Memory strategy configuration.
|
|
36
46
|
* Each memory can have multiple strategies with optional namespace scoping.
|
|
47
|
+
*
|
|
48
|
+
* Field naming:
|
|
49
|
+
* - `namespaceTemplates` / `reflectionNamespaceTemplates` are the preferred field names.
|
|
50
|
+
* - `namespaces` / `reflectionNamespaces` are deprecated aliases retained for backward
|
|
51
|
+
* compatibility. Specifying both the deprecated and preferred form for the same concept
|
|
52
|
+
* is rejected by validation.
|
|
37
53
|
*/
|
|
38
54
|
export declare const MemoryStrategySchema: z.ZodObject<{
|
|
39
55
|
type: z.ZodEnum<{
|
|
@@ -44,7 +60,9 @@ export declare const MemoryStrategySchema: z.ZodObject<{
|
|
|
44
60
|
}>;
|
|
45
61
|
name: z.ZodOptional<z.ZodString>;
|
|
46
62
|
description: z.ZodOptional<z.ZodString>;
|
|
63
|
+
namespaceTemplates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
47
64
|
namespaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
65
|
+
reflectionNamespaceTemplates: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
48
66
|
reflectionNamespaces: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
49
67
|
}, z.core.$strip>;
|
|
50
68
|
export type MemoryStrategy = z.infer<typeof MemoryStrategySchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../src/schema/schemas/primitives/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB;;;;;EAAuE,CAAC;AAC7G,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../../src/schema/schemas/primitives/memory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;;;;;;;GAQG;AACH,eAAO,MAAM,wBAAwB;;;;;EAAuE,CAAC;AAC7G,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,oCAAoC,EAAE,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAK9F,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,0FAAuC,CAAC;AAEhF;;;GAGG;AACH,eAAO,MAAM,+CAA+C,EAAE,MAAM,EAA4B,CAAC;AAEjG;;;GAGG;AACH,eAAO,MAAM,sCAAsC,UAAkD,CAAC;AAEtG;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,aAOlC,CAAC;AAEJ;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBA+D9B,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MemoryStrategySchema = exports.MemoryStrategyNameSchema = exports.DEFAULT_EPISODIC_REFLECTION_NAMESPACES = exports.DEFAULT_STRATEGY_NAMESPACES = exports.MemoryStrategyTypeSchema = void 0;
|
|
3
|
+
exports.MemoryStrategySchema = exports.MemoryStrategyNameSchema = exports.DEFAULT_EPISODIC_REFLECTION_NAMESPACES = exports.DEFAULT_EPISODIC_REFLECTION_NAMESPACE_TEMPLATES = exports.DEFAULT_STRATEGY_NAMESPACES = exports.DEFAULT_STRATEGY_NAMESPACE_TEMPLATES = exports.MemoryStrategyTypeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
// ============================================================================
|
|
6
6
|
// Memory Strategy Types
|
|
@@ -16,20 +16,30 @@ const zod_1 = require("zod");
|
|
|
16
16
|
*/
|
|
17
17
|
exports.MemoryStrategyTypeSchema = zod_1.z.enum(['SEMANTIC', 'SUMMARIZATION', 'USER_PREFERENCE', 'EPISODIC']);
|
|
18
18
|
/**
|
|
19
|
-
* Default
|
|
19
|
+
* Default namespace templates for each memory strategy type.
|
|
20
20
|
* These match the patterns generated in CLI session.py templates.
|
|
21
21
|
*/
|
|
22
|
-
exports.
|
|
22
|
+
exports.DEFAULT_STRATEGY_NAMESPACE_TEMPLATES = {
|
|
23
23
|
SEMANTIC: ['/users/{actorId}/facts'],
|
|
24
24
|
USER_PREFERENCE: ['/users/{actorId}/preferences'],
|
|
25
25
|
SUMMARIZATION: ['/summaries/{actorId}/{sessionId}'],
|
|
26
26
|
EPISODIC: ['/episodes/{actorId}/{sessionId}'],
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
29
|
+
* @deprecated Use {@link DEFAULT_STRATEGY_NAMESPACE_TEMPLATES} instead.
|
|
30
|
+
* Retained as an alias for backward compatibility.
|
|
31
31
|
*/
|
|
32
|
-
exports.
|
|
32
|
+
exports.DEFAULT_STRATEGY_NAMESPACES = exports.DEFAULT_STRATEGY_NAMESPACE_TEMPLATES;
|
|
33
|
+
/**
|
|
34
|
+
* Default reflection namespace templates for the EPISODIC strategy.
|
|
35
|
+
* The service requires reflection templates to be the same as or a prefix of episode templates.
|
|
36
|
+
*/
|
|
37
|
+
exports.DEFAULT_EPISODIC_REFLECTION_NAMESPACE_TEMPLATES = ['/episodes/{actorId}'];
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Use {@link DEFAULT_EPISODIC_REFLECTION_NAMESPACE_TEMPLATES} instead.
|
|
40
|
+
* Retained as an alias for backward compatibility.
|
|
41
|
+
*/
|
|
42
|
+
exports.DEFAULT_EPISODIC_REFLECTION_NAMESPACES = exports.DEFAULT_EPISODIC_REFLECTION_NAMESPACE_TEMPLATES;
|
|
33
43
|
/**
|
|
34
44
|
* Memory strategy name validation.
|
|
35
45
|
* Pattern: ^[a-zA-Z][a-zA-Z0-9_]{0,47}$
|
|
@@ -43,6 +53,12 @@ exports.MemoryStrategyNameSchema = zod_1.z
|
|
|
43
53
|
/**
|
|
44
54
|
* Memory strategy configuration.
|
|
45
55
|
* Each memory can have multiple strategies with optional namespace scoping.
|
|
56
|
+
*
|
|
57
|
+
* Field naming:
|
|
58
|
+
* - `namespaceTemplates` / `reflectionNamespaceTemplates` are the preferred field names.
|
|
59
|
+
* - `namespaces` / `reflectionNamespaces` are deprecated aliases retained for backward
|
|
60
|
+
* compatibility. Specifying both the deprecated and preferred form for the same concept
|
|
61
|
+
* is rejected by validation.
|
|
46
62
|
*/
|
|
47
63
|
exports.MemoryStrategySchema = zod_1.z
|
|
48
64
|
.object({
|
|
@@ -52,22 +68,47 @@ exports.MemoryStrategySchema = zod_1.z
|
|
|
52
68
|
name: exports.MemoryStrategyNameSchema.optional(),
|
|
53
69
|
/** Optional description */
|
|
54
70
|
description: zod_1.z.string().optional(),
|
|
55
|
-
/** Optional
|
|
71
|
+
/** Optional namespace templates for scoping memory access */
|
|
72
|
+
namespaceTemplates: zod_1.z.array(zod_1.z.string()).optional(),
|
|
73
|
+
/** @deprecated Use `namespaceTemplates` instead. */
|
|
56
74
|
namespaces: zod_1.z.array(zod_1.z.string()).optional(),
|
|
57
|
-
/** Reflection
|
|
75
|
+
/** Reflection namespace templates for EPISODIC strategy. Required by the service for episodic strategies. */
|
|
76
|
+
reflectionNamespaceTemplates: zod_1.z.array(zod_1.z.string()).optional(),
|
|
77
|
+
/** @deprecated Use `reflectionNamespaceTemplates` instead. */
|
|
58
78
|
reflectionNamespaces: zod_1.z.array(zod_1.z.string()).optional(),
|
|
59
79
|
})
|
|
60
|
-
.refine(strategy => strategy.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
80
|
+
.refine(strategy => !((strategy.namespaces?.length ?? 0) > 0 && (strategy.namespaceTemplates?.length ?? 0) > 0), {
|
|
81
|
+
message: "'namespaces' and 'namespaceTemplates' are mutually exclusive. Prefer 'namespaceTemplates' ('namespaces' is deprecated).",
|
|
82
|
+
path: ['namespaceTemplates'],
|
|
83
|
+
})
|
|
84
|
+
.refine(strategy => !((strategy.reflectionNamespaces?.length ?? 0) > 0 && (strategy.reflectionNamespaceTemplates?.length ?? 0) > 0), {
|
|
85
|
+
message: "'reflectionNamespaces' and 'reflectionNamespaceTemplates' are mutually exclusive. Prefer 'reflectionNamespaceTemplates' ('reflectionNamespaces' is deprecated).",
|
|
86
|
+
path: ['reflectionNamespaceTemplates'],
|
|
87
|
+
})
|
|
88
|
+
.refine(strategy => strategy.type === 'EPISODIC' ||
|
|
89
|
+
(strategy.reflectionNamespaceTemplates === undefined && strategy.reflectionNamespaces === undefined), {
|
|
90
|
+
message: "'reflectionNamespaceTemplates' is only allowed on EPISODIC strategies",
|
|
91
|
+
path: ['reflectionNamespaceTemplates'],
|
|
64
92
|
})
|
|
65
93
|
.refine(strategy => {
|
|
66
|
-
if (strategy.type !== 'EPISODIC'
|
|
94
|
+
if (strategy.type !== 'EPISODIC')
|
|
95
|
+
return true;
|
|
96
|
+
const reflection = strategy.reflectionNamespaceTemplates ?? strategy.reflectionNamespaces;
|
|
97
|
+
return reflection !== undefined && reflection.length > 0;
|
|
98
|
+
}, {
|
|
99
|
+
message: 'EPISODIC strategy requires reflectionNamespaceTemplates',
|
|
100
|
+
path: ['reflectionNamespaceTemplates'],
|
|
101
|
+
})
|
|
102
|
+
.refine(strategy => {
|
|
103
|
+
if (strategy.type !== 'EPISODIC')
|
|
104
|
+
return true;
|
|
105
|
+
const reflection = strategy.reflectionNamespaceTemplates ?? strategy.reflectionNamespaces;
|
|
106
|
+
const templates = strategy.namespaceTemplates ?? strategy.namespaces;
|
|
107
|
+
if (!reflection || !templates)
|
|
67
108
|
return true;
|
|
68
|
-
return
|
|
109
|
+
return reflection.every(ref => templates.some(ns => ns.startsWith(ref)));
|
|
69
110
|
}, {
|
|
70
|
-
message: 'Each
|
|
71
|
-
path: ['
|
|
111
|
+
message: 'Each reflectionNamespaceTemplate must be a prefix of at least one namespaceTemplate',
|
|
112
|
+
path: ['reflectionNamespaceTemplates'],
|
|
72
113
|
});
|
|
73
114
|
//# sourceMappingURL=memory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../src/schema/schemas/primitives/memory.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E;;;;;;;;GAQG;AACU,QAAA,wBAAwB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;AAG7G;;;GAGG;AACU,QAAA,
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../../../../src/schema/schemas/primitives/memory.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,+EAA+E;AAC/E,wBAAwB;AACxB,+EAA+E;AAE/E;;;;;;;;GAQG;AACU,QAAA,wBAAwB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAC;AAG7G;;;GAGG;AACU,QAAA,oCAAoC,GAAkD;IACjG,QAAQ,EAAE,CAAC,wBAAwB,CAAC;IACpC,eAAe,EAAE,CAAC,8BAA8B,CAAC;IACjD,aAAa,EAAE,CAAC,kCAAkC,CAAC;IACnD,QAAQ,EAAE,CAAC,iCAAiC,CAAC;CAC9C,CAAC;AAEF;;;GAGG;AACU,QAAA,2BAA2B,GAAG,4CAAoC,CAAC;AAEhF;;;GAGG;AACU,QAAA,+CAA+C,GAAa,CAAC,qBAAqB,CAAC,CAAC;AAEjG;;;GAGG;AACU,QAAA,sCAAsC,GAAG,uDAA+C,CAAC;AAEtG;;;;GAIG;AACU,QAAA,wBAAwB,GAAG,OAAC;KACtC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CACJ,8BAA8B,EAC9B,kGAAkG,CACnG,CAAC;AAEJ;;;;;;;;;GASG;AACU,QAAA,oBAAoB,GAAG,OAAC;KAClC,MAAM,CAAC;IACN,oBAAoB;IACpB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": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "CLI for Amazon Bedrock AgentCore",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -78,19 +78,20 @@
|
|
|
78
78
|
"@aws-sdk/client-bedrock": "^3.1012.0",
|
|
79
79
|
"@aws-sdk/client-bedrock-agent": "^3.1012.0",
|
|
80
80
|
"@aws-sdk/client-bedrock-agentcore": "^3.1020.0",
|
|
81
|
-
"@aws-sdk/client-bedrock-agentcore-control": "^3.
|
|
81
|
+
"@aws-sdk/client-bedrock-agentcore-control": "^3.1039.0",
|
|
82
82
|
"@aws-sdk/client-bedrock-runtime": "^3.893.0",
|
|
83
83
|
"@aws-sdk/client-cloudformation": "^3.893.0",
|
|
84
84
|
"@aws-sdk/client-cloudwatch-logs": "^3.893.0",
|
|
85
85
|
"@aws-sdk/client-resource-groups-tagging-api": "^3.893.0",
|
|
86
86
|
"@aws-sdk/client-s3": "^3.1012.0",
|
|
87
87
|
"@aws-sdk/client-sts": "^3.893.0",
|
|
88
|
+
"@aws-sdk/region-config-resolver": "^3.972.13",
|
|
88
89
|
"@aws-sdk/client-xray": "^3.1003.0",
|
|
89
90
|
"@aws-sdk/credential-providers": "^3.893.0",
|
|
90
|
-
"@aws/agent-inspector": "0.
|
|
91
|
+
"@aws/agent-inspector": "0.4.1",
|
|
91
92
|
"@commander-js/extra-typings": "^14.0.0",
|
|
92
93
|
"@opentelemetry/api": "^1.9.1",
|
|
93
|
-
"@opentelemetry/exporter-metrics-otlp-http": "^0.
|
|
94
|
+
"@opentelemetry/exporter-metrics-otlp-http": "^0.215.0",
|
|
94
95
|
"@opentelemetry/otlp-transformer": "^0.213.0",
|
|
95
96
|
"@opentelemetry/resources": "^2.6.1",
|
|
96
97
|
"@opentelemetry/sdk-metrics": "^2.6.1",
|
|
@@ -149,11 +150,13 @@
|
|
|
149
150
|
},
|
|
150
151
|
"overridesComments": {
|
|
151
152
|
"minimatch": "GHSA-7r86-cg39-jmmj, GHSA-23c5-xmqv-rm74: minimatch 10.0.0-10.2.2 has ReDoS vulnerabilities. Multiple transitive deps (eslint, typescript-eslint, eslint-plugin-import, eslint-plugin-react, prettier-plugin-sort-imports, aws-cdk-lib) pin older versions. Remove this override once upstream packages update their minimatch dependency to >=10.2.3.",
|
|
153
|
+
"glob": "glob <12 is deprecated and emits npm install warnings (https://github.com/isaacs/node-glob). Pulled in transitively via archiver-utils@5.0.2 (latest), which still pins glob@^10.0.0. archiver-utils only uses glob.sync(pattern, options), which remains compatible in glob@13. Remove this override once archiver-utils updates its glob dependency.",
|
|
152
154
|
"fast-xml-parser": "GHSA-8gc5-j5rx-235r, GHSA-jp2q-39xq-3w4g: fast-xml-parser <=5.5.6 has entity expansion bypass (CVE-2026-33036, CVE-2026-33349). Transitive via @aws-sdk/xml-builder. Remove once @aws-sdk updates to fast-xml-parser >=5.5.7.",
|
|
153
155
|
"@aws-sdk/xml-builder": "aws/aws-sdk-js-v3#7867: @aws-sdk/xml-builder <3.972.14 does not configure maxTotalExpansions on fast-xml-parser, causing 'Entity expansion limit exceeded' on large CloudFormation responses. Remove once @aws-sdk/client-* deps are bumped past 3.972.14."
|
|
154
156
|
},
|
|
155
157
|
"overrides": {
|
|
156
158
|
"minimatch": "10.2.4",
|
|
159
|
+
"glob": "^13.0.0",
|
|
157
160
|
"fast-xml-parser": "5.5.7",
|
|
158
161
|
"@aws-sdk/xml-builder": "3.972.15"
|
|
159
162
|
},
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Run E2E tests locally, replicating the GitHub Actions e2e-tests.yml workflow.
|
|
3
|
+
#
|
|
4
|
+
# Required env vars:
|
|
5
|
+
# E2E_ROLE_ARN — IAM role ARN to assume (grants access to the test account)
|
|
6
|
+
# E2E_SECRET_ARN — Secrets Manager ARN containing ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY
|
|
7
|
+
#
|
|
8
|
+
# Optional env vars:
|
|
9
|
+
# AWS_REGION — defaults to us-east-1
|
|
10
|
+
#
|
|
11
|
+
# Usage:
|
|
12
|
+
# export E2E_ROLE_ARN=arn:aws:iam::<account>:role/<role>
|
|
13
|
+
# export E2E_SECRET_ARN=arn:aws:secretsmanager:<region>:<account>:secret:<name>
|
|
14
|
+
# ./scripts/run-e2e-local.sh # runs strands-bedrock.test.ts (CI default)
|
|
15
|
+
# ./scripts/run-e2e-local.sh --all # runs the full e2e suite
|
|
16
|
+
# ./scripts/run-e2e-local.sh e2e-tests/foo.test.ts # runs a specific test file
|
|
17
|
+
#
|
|
18
|
+
# Prerequisites: aws CLI, node >=20.19, npm, git, uv, jq
|
|
19
|
+
|
|
20
|
+
set -euo pipefail
|
|
21
|
+
|
|
22
|
+
ROLE_ARN="${E2E_ROLE_ARN:-}"
|
|
23
|
+
SECRET_ARN="${E2E_SECRET_ARN:-}"
|
|
24
|
+
AWS_REGION="${AWS_REGION:-us-east-1}"
|
|
25
|
+
|
|
26
|
+
if [[ -z "$ROLE_ARN" ]]; then
|
|
27
|
+
echo "❌ E2E_ROLE_ARN is not set. Export it before running this script:"
|
|
28
|
+
echo " export E2E_ROLE_ARN=arn:aws:iam::<account>:role/<role-name>"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if [[ -z "$SECRET_ARN" ]]; then
|
|
33
|
+
echo "❌ E2E_SECRET_ARN is not set. Export it before running this script:"
|
|
34
|
+
echo " export E2E_SECRET_ARN=arn:aws:secretsmanager:<region>:<account>:secret:<name>"
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
37
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
38
|
+
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
39
|
+
|
|
40
|
+
# ── Parse arguments ────────────────────────────────────────────────────────────
|
|
41
|
+
RUN_ALL=false
|
|
42
|
+
TEST_FILES=()
|
|
43
|
+
for arg in "$@"; do
|
|
44
|
+
if [[ "$arg" == "--all" ]]; then
|
|
45
|
+
RUN_ALL=true
|
|
46
|
+
else
|
|
47
|
+
TEST_FILES+=("$arg")
|
|
48
|
+
fi
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
echo "=== Assuming IAM role ==="
|
|
52
|
+
CREDS=$(aws sts assume-role \
|
|
53
|
+
--role-arn "$ROLE_ARN" \
|
|
54
|
+
--role-session-name "local-e2e-$(date +%s)" \
|
|
55
|
+
--duration-seconds 3600 \
|
|
56
|
+
--query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' \
|
|
57
|
+
--output text)
|
|
58
|
+
|
|
59
|
+
export AWS_ACCESS_KEY_ID=$(echo "$CREDS" | awk '{print $1}')
|
|
60
|
+
export AWS_SECRET_ACCESS_KEY=$(echo "$CREDS" | awk '{print $2}')
|
|
61
|
+
export AWS_SESSION_TOKEN=$(echo "$CREDS" | awk '{print $3}')
|
|
62
|
+
export AWS_REGION
|
|
63
|
+
|
|
64
|
+
echo "✅ Assumed role successfully"
|
|
65
|
+
|
|
66
|
+
echo "=== Fetching API keys from Secrets Manager ==="
|
|
67
|
+
SECRET_JSON=$(aws secretsmanager get-secret-value \
|
|
68
|
+
--secret-id "$SECRET_ARN" \
|
|
69
|
+
--region "$AWS_REGION" \
|
|
70
|
+
--query SecretString \
|
|
71
|
+
--output text)
|
|
72
|
+
|
|
73
|
+
# Mirror the GitHub workflow: parse-json-secrets maps keys to E2E_<KEY> then
|
|
74
|
+
# the workflow maps them to the bare names the tests expect.
|
|
75
|
+
export ANTHROPIC_API_KEY=$(echo "$SECRET_JSON" | jq -r '.ANTHROPIC_API_KEY // empty')
|
|
76
|
+
export OPENAI_API_KEY=$(echo "$SECRET_JSON" | jq -r '.OPENAI_API_KEY // empty')
|
|
77
|
+
export GEMINI_API_KEY=$(echo "$SECRET_JSON" | jq -r '.GEMINI_API_KEY // empty')
|
|
78
|
+
|
|
79
|
+
echo "✅ Secrets loaded (keys present: $(echo "$SECRET_JSON" | jq -r 'keys | join(", ")')"
|
|
80
|
+
|
|
81
|
+
echo "=== Setting AWS account env var ==="
|
|
82
|
+
export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
|
|
83
|
+
echo "✅ AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID AWS_REGION=$AWS_REGION"
|
|
84
|
+
|
|
85
|
+
echo "=== Configuring git (required for agentcore create) ==="
|
|
86
|
+
git config --global user.email "ci@local" 2>/dev/null || true
|
|
87
|
+
git config --global user.name "Local E2E" 2>/dev/null || true
|
|
88
|
+
|
|
89
|
+
cd "$REPO_ROOT"
|
|
90
|
+
|
|
91
|
+
echo "=== Installing dependencies ==="
|
|
92
|
+
npm ci
|
|
93
|
+
|
|
94
|
+
echo "=== Building CLI ==="
|
|
95
|
+
npm run build
|
|
96
|
+
|
|
97
|
+
echo "=== Installing CLI globally ==="
|
|
98
|
+
TARBALL=$(npm pack | tail -1)
|
|
99
|
+
npm install -g "$TARBALL"
|
|
100
|
+
echo "✅ Installed: $(agentcore --version)"
|
|
101
|
+
|
|
102
|
+
echo "=== Running E2E tests ==="
|
|
103
|
+
if [[ "$RUN_ALL" == "true" ]]; then
|
|
104
|
+
echo "Running full e2e suite"
|
|
105
|
+
npx vitest run --project e2e
|
|
106
|
+
elif [[ ${#TEST_FILES[@]} -gt 0 ]]; then
|
|
107
|
+
echo "Running: ${TEST_FILES[*]}"
|
|
108
|
+
npx vitest run --project e2e "${TEST_FILES[@]}"
|
|
109
|
+
else
|
|
110
|
+
echo "Running default: e2e-tests/strands-bedrock.test.ts"
|
|
111
|
+
npx vitest run --project e2e e2e-tests/strands-bedrock.test.ts
|
|
112
|
+
fi
|