@aws/agentcore-cdk 0.1.0-alpha.35 → 0.1.0-alpha.38
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/dist/cdk/constructs/components/mcp/Gateway.d.ts +11 -0
- package/dist/cdk/constructs/components/mcp/Gateway.d.ts.map +1 -1
- package/dist/cdk/constructs/components/mcp/Gateway.js +377 -4
- package/dist/cdk/constructs/components/mcp/Gateway.js.map +1 -1
- package/dist/cdk/constructs/components/mcp/connector-defaults.d.ts +20 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.d.ts.map +1 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.js +16 -0
- package/dist/cdk/constructs/components/mcp/connector-defaults.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts +36 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js +65 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/AgentCoreConfigBundle.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/config-bundle/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js +68 -22
- package/dist/cdk/constructs/components/primitives/evaluator/AgentCoreOnlineEvaluationConfig.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts +64 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js +91 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarness.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts +25 -6
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js +133 -11
- package/dist/cdk/constructs/components/primitives/harness/AgentCoreHarnessRole.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts +47 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js +388 -0
- package/dist/cdk/constructs/components/primitives/harness/harness-cfn-mapping.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/harness/index.d.ts +1 -0
- package/dist/cdk/constructs/components/primitives/harness/index.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/harness/index.js +3 -1
- package/dist/cdk/constructs/components/primitives/harness/index.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/index.d.ts +4 -1
- package/dist/cdk/constructs/components/primitives/index.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/index.js +9 -1
- package/dist/cdk/constructs/components/primitives/index.js.map +1 -1
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts +69 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js +292 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/AgentCoreKnowledgeBase.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts +2 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.js +6 -0
- package/dist/cdk/constructs/components/primitives/knowledge-base/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts +28 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js +44 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentConnector.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts +38 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js +111 -0
- package/dist/cdk/constructs/components/primitives/payment/AgentCorePaymentManager.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/index.d.ts +3 -0
- package/dist/cdk/constructs/components/primitives/payment/index.d.ts.map +1 -0
- package/dist/cdk/constructs/components/primitives/payment/index.js +8 -0
- package/dist/cdk/constructs/components/primitives/payment/index.js.map +1 -0
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.d.ts.map +1 -1
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js +20 -5
- package/dist/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.js.map +1 -1
- package/dist/cdk/constructs/index.d.ts +2 -2
- package/dist/cdk/constructs/index.d.ts.map +1 -1
- package/dist/cdk/constructs/index.js +6 -1
- package/dist/cdk/constructs/index.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts +74 -4
- package/dist/cdk/constructs/l3/AgentCoreApplication.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreApplication.js +264 -2
- package/dist/cdk/constructs/l3/AgentCoreApplication.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts +24 -0
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js +27 -3
- package/dist/cdk/constructs/l3/AgentCoreHarnessEnvironment.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.js +25 -1
- package/dist/cdk/constructs/l3/AgentCoreMcp.js.map +1 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.d.ts +6 -0
- package/dist/cdk/constructs/l3/AgentEnvironment.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/AgentEnvironment.js +7 -0
- package/dist/cdk/constructs/l3/AgentEnvironment.js.map +1 -1
- package/dist/cdk/constructs/l3/index.d.ts +1 -1
- package/dist/cdk/constructs/l3/index.d.ts.map +1 -1
- package/dist/cdk/constructs/l3/index.js.map +1 -1
- package/dist/cdk/feature-flags.d.ts +15 -0
- package/dist/cdk/feature-flags.d.ts.map +1 -0
- package/dist/cdk/feature-flags.js +19 -0
- package/dist/cdk/feature-flags.js.map +1 -0
- package/dist/cdk/index.d.ts +1 -1
- package/dist/cdk/index.d.ts.map +1 -1
- package/dist/cdk/index.js +7 -1
- package/dist/cdk/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/schema/schemas/agent-env.d.ts +35 -0
- package/dist/schema/schemas/agent-env.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.d.ts +233 -4
- package/dist/schema/schemas/agentcore-project.d.ts.map +1 -1
- package/dist/schema/schemas/agentcore-project.js +125 -6
- package/dist/schema/schemas/agentcore-project.js.map +1 -1
- package/dist/schema/schemas/auth.d.ts +171 -0
- package/dist/schema/schemas/auth.d.ts.map +1 -1
- package/dist/schema/schemas/auth.js +125 -3
- package/dist/schema/schemas/auth.js.map +1 -1
- package/dist/schema/schemas/mcp.d.ts +254 -0
- package/dist/schema/schemas/mcp.d.ts.map +1 -1
- package/dist/schema/schemas/mcp.js +452 -4
- package/dist/schema/schemas/mcp.js.map +1 -1
- package/dist/schema/schemas/primitives/harness.d.ts +369 -19
- package/dist/schema/schemas/primitives/harness.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/harness.js +390 -21
- package/dist/schema/schemas/primitives/harness.js.map +1 -1
- package/dist/schema/schemas/primitives/index.d.ts +5 -1
- package/dist/schema/schemas/primitives/index.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/index.js +31 -1
- package/dist/schema/schemas/primitives/index.js.map +1 -1
- package/dist/schema/schemas/primitives/knowledge-base.d.ts +103 -0
- package/dist/schema/schemas/primitives/knowledge-base.d.ts.map +1 -0
- package/dist/schema/schemas/primitives/knowledge-base.js +98 -0
- package/dist/schema/schemas/primitives/knowledge-base.js.map +1 -0
- package/dist/schema/schemas/primitives/memory.d.ts +2 -2
- package/dist/schema/schemas/primitives/online-evaluation-config.d.ts +19 -2
- package/dist/schema/schemas/primitives/online-evaluation-config.d.ts.map +1 -1
- package/dist/schema/schemas/primitives/online-evaluation-config.js +39 -5
- package/dist/schema/schemas/primitives/online-evaluation-config.js.map +1 -1
- package/package.json +1 -1
|
@@ -36,14 +36,29 @@ class AgentCorePolicyEngine extends constructs_1.Construct {
|
|
|
36
36
|
const cfnPolicy = new aws_cdk_lib_1.aws_bedrockagentcore.CfnPolicy(this, `Policy${policySpec.name}`, {
|
|
37
37
|
name: policySpec.name,
|
|
38
38
|
policyEngineId: this.policyEngineId,
|
|
39
|
-
definition
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
39
|
+
// `definition` is a required prop, but the generated PolicyDefinition
|
|
40
|
+
// validator/converter in aws-cdk-lib only understands the `Cedar` variant.
|
|
41
|
+
// Pass a syntactically-valid placeholder to satisfy the type; the raw CFN
|
|
42
|
+
// Definition is set via the escape hatch below.
|
|
43
|
+
definition: { cedar: { statement: '' } },
|
|
44
44
|
...(policySpec.description && { description: policySpec.description }),
|
|
45
45
|
...(policySpec.validationMode && { validationMode: policySpec.validationMode }),
|
|
46
46
|
});
|
|
47
|
+
// CloudFormation already accepts the `Policy` variant of PolicyDefinition, but
|
|
48
|
+
// aws-cdk-lib's generated converter only emits `Cedar` (and its validator
|
|
49
|
+
// rejects `policy`), which makes synth fail with
|
|
50
|
+
// "supplied properties not correct for PolicyDefinitionProperty". Set the raw
|
|
51
|
+
// CFN Definition.Policy directly and delete the `Cedar` placeholder emitted from
|
|
52
|
+
// the typed prop above — `Definition` is `oneOf(Cedar, Policy)`, so leaving the
|
|
53
|
+
// empty placeholder in would fail deploy. (addPropertyOverride deep-merges, so
|
|
54
|
+
// the placeholder must be deleted explicitly rather than overwritten.)
|
|
55
|
+
// TODO: revert to `definition: { policy: { statement } }` once aws-cdk-lib
|
|
56
|
+
// regenerates CfnPolicy with the `policy`/`Policy` variant from the updated
|
|
57
|
+
// CFN schema (cdklabs/awscdk-service-spec).
|
|
58
|
+
cfnPolicy.addPropertyOverride('Definition.Policy', {
|
|
59
|
+
Statement: policySpec.statement,
|
|
60
|
+
});
|
|
61
|
+
cfnPolicy.addPropertyDeletionOverride('Definition.Cedar');
|
|
47
62
|
// Ensure policies are created after the engine
|
|
48
63
|
cfnPolicy.addDependency(cfnPolicyEngine);
|
|
49
64
|
this.policies.set(policySpec.name, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentCorePolicyEngine.js","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.ts"],"names":[],"mappings":";;;AACA,iDAAsE;AAEtE,6CAAuE;AACvE,2CAAuC;AASvC;;;;;;;;GAQG;AACH,MAAa,qBAAsB,SAAQ,sBAAS;IAClC,cAAc,CAAS;IACvB,eAAe,CAAS;IACxB,QAAQ,GAAG,IAAI,GAAG,EAAmD,CAAC;IAEtF,YAAY,KAAgB,EAAE,EAAU,EAAE,KAAiC;QACzE,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAEjB,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;QAC5C,MAAM,YAAY,GAAG,GAAG,WAAW,IAAI,YAAY,CAAC,IAAI,EAAE,CAAC;QAE3D,+BAA+B;QAC/B,MAAM,UAAU,GAAG,IAAA,sBAAe,EAAC,IAAA,kBAAW,EAAC,KAAK,CAAC,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QAEtF,MAAM,eAAe,GAAG,IAAI,kCAAgB,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,EAAE;YAC7E,IAAI,EAAE,YAAY;YAClB,GAAG,CAAC,YAAY,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,YAAY,CAAC,WAAW,EAAE,CAAC;YAC1E,GAAG,CAAC,YAAY,CAAC,gBAAgB,IAAI,EAAE,gBAAgB,EAAE,YAAY,CAAC,gBAAgB,EAAE,CAAC;YACzF,GAAG,CAAC,UAAU,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;SACxC,CAAC,CAAC;QAEH,IAAI,CAAC,cAAc,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACzD,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC,mBAAmB,CAAC;QAE3D,wDAAwD;QACxD,KAAK,MAAM,UAAU,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC/C,MAAM,SAAS,GAAG,IAAI,kCAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,UAAU,CAAC,IAAI,EAAE,EAAE;gBACjF,IAAI,EAAE,UAAU,CAAC,IAAI;gBACrB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,UAAU,EAAE
|
|
1
|
+
{"version":3,"file":"AgentCorePolicyEngine.js","sourceRoot":"","sources":["../../../../../../src/cdk/constructs/components/primitives/policy/AgentCorePolicyEngine.ts"],"names":[],"mappings":";;;AACA,iDAAsE;AAEtE,6CAAuE;AACvE,2CAAuC;AASvC;;;;;;;;GAQG;AACH,MAAa,qBAAsB,SAAQ,sBAAS;IAClC,cAAc,CAAS;IACvB,eAAe,CAAS;IACxB,QAAQ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AE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,EAAE;gBACxC,GAAG,CAAC,UAAU,CAAC,WAAW,IAAI,EAAE,WAAW,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC;gBACtE,GAAG,CAAC,UAAU,CAAC,cAAc,IAAI,EAAE,cAAc,EAAE,UAAU,CAAC,cAAc,EAAE,CAAC;aAChF,CAAC,CAAC;YAEH,+EAA+E;YAC/E,0EAA0E;YAC1E,iDAAiD;YACjD,8EAA8E;YAC9E,iFAAiF;YACjF,gFAAgF;YAChF,+EAA+E;YAC/E,uEAAuE;YACvE,2EAA2E;YAC3E,4EAA4E;YAC5E,4CAA4C;YAC5C,SAAS,CAAC,mBAAmB,CAAC,mBAAmB,EAAE;gBACjD,SAAS,EAAE,UAAU,CAAC,SAAS;aAChC,CAAC,CAAC;YACH,SAAS,CAAC,2BAA2B,CAAC,kBAAkB,CAAC,CAAC;YAE1D,+CAA+C;YAC/C,SAAS,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;YAEzC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE;gBACjC,QAAQ,EAAE,SAAS,CAAC,YAAY;gBAChC,SAAS,EAAE,SAAS,CAAC,aAAa;aACnC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA/DD,sDA+DC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { AgentCoreApplication, type AgentCoreApplicationProps, AgentEnvironment, type AgentEnvironmentProps, AgentCoreHarnessEnvironment, type AgentCoreHarnessEnvironmentProps, AgentCoreMcp, type AgentCoreMcpProps, } from './l3';
|
|
2
|
-
export { type AgentCoreComponentProps, AgentCoreDataset, type AgentCoreDatasetProps, AgentCoreHarnessRole, type AgentCoreHarnessRoleProps, type HarnessRoleConfig, AgentCoreMemory, type AgentCoreMemoryProps, AgentCorePolicyEngine, type AgentCorePolicyEngineProps, AgentCoreRuntime, type AgentCoreRuntimeProps, } from './components';
|
|
1
|
+
export { AgentCoreApplication, type AgentCoreApplicationProps, type HarnessDeploymentConfig, AgentEnvironment, type AgentEnvironmentProps, AgentCoreHarnessEnvironment, type AgentCoreHarnessEnvironmentProps, AgentCoreMcp, type AgentCoreMcpProps, } from './l3';
|
|
2
|
+
export { type AgentCoreComponentProps, AgentCoreDataset, type AgentCoreDatasetProps, AgentCoreHarnessRole, type AgentCoreHarnessRoleProps, type HarnessRoleConfig, AgentCoreHarness, type AgentCoreHarnessProps, AgentCoreKnowledgeBase, type AgentCoreKnowledgeBaseProps, AgentCoreConfigBundle, type AgentCoreConfigBundleProps, AgentCoreMemory, type AgentCoreMemoryProps, AgentCorePolicyEngine, type AgentCorePolicyEngineProps, AgentCoreRuntime, type AgentCoreRuntimeProps, AgentCorePaymentManager, type AgentCorePaymentManagerProps, type CustomJWTAuthorizerConfig, AgentCorePaymentConnector, type AgentCorePaymentConnectorProps, } from './components';
|
|
3
3
|
export { BundledCodeZipAsset, type BundledCodeZipAssetProps, NodeBundledCodeZipAsset, PythonBundledCodeZipAsset, } from './bundling';
|
|
4
4
|
export { ContainerSourceAssetFromPath, type ContainerSourceAssetFromPathProps } from './bundling';
|
|
5
5
|
export { AgentEcrRepository, type AgentEcrRepositoryProps } from './components/container';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cdk/constructs/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,2BAA2B,EAC3B,KAAK,gCAAgC,EACrC,YAAY,EACZ,KAAK,iBAAiB,GACvB,MAAM,MAAM,CAAC;AAGd,OAAO,EACL,KAAK,uBAAuB,EAC5B,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,oBAAoB,EACpB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,eAAe,EACf,KAAK,oBAAoB,EACzB,q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
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContainerImageBuilder = exports.ContainerBuildProject = exports.AgentEcrRepository = exports.ContainerSourceAssetFromPath = exports.PythonBundledCodeZipAsset = exports.NodeBundledCodeZipAsset = exports.BundledCodeZipAsset = exports.AgentCoreRuntime = exports.AgentCorePolicyEngine = exports.AgentCoreMemory = exports.AgentCoreHarnessRole = exports.AgentCoreDataset = exports.AgentCoreMcp = exports.AgentCoreHarnessEnvironment = exports.AgentEnvironment = exports.AgentCoreApplication = void 0;
|
|
3
|
+
exports.ContainerImageBuilder = exports.ContainerBuildProject = exports.AgentEcrRepository = exports.ContainerSourceAssetFromPath = exports.PythonBundledCodeZipAsset = exports.NodeBundledCodeZipAsset = exports.BundledCodeZipAsset = exports.AgentCorePaymentConnector = exports.AgentCorePaymentManager = exports.AgentCoreRuntime = exports.AgentCorePolicyEngine = exports.AgentCoreMemory = exports.AgentCoreConfigBundle = exports.AgentCoreKnowledgeBase = exports.AgentCoreHarness = exports.AgentCoreHarnessRole = exports.AgentCoreDataset = exports.AgentCoreMcp = exports.AgentCoreHarnessEnvironment = exports.AgentEnvironment = exports.AgentCoreApplication = void 0;
|
|
4
4
|
// L3 Constructs
|
|
5
5
|
var l3_1 = require("./l3");
|
|
6
6
|
Object.defineProperty(exports, "AgentCoreApplication", { enumerable: true, get: function () { return l3_1.AgentCoreApplication; } });
|
|
@@ -11,9 +11,14 @@ Object.defineProperty(exports, "AgentCoreMcp", { enumerable: true, get: function
|
|
|
11
11
|
var components_1 = require("./components");
|
|
12
12
|
Object.defineProperty(exports, "AgentCoreDataset", { enumerable: true, get: function () { return components_1.AgentCoreDataset; } });
|
|
13
13
|
Object.defineProperty(exports, "AgentCoreHarnessRole", { enumerable: true, get: function () { return components_1.AgentCoreHarnessRole; } });
|
|
14
|
+
Object.defineProperty(exports, "AgentCoreHarness", { enumerable: true, get: function () { return components_1.AgentCoreHarness; } });
|
|
15
|
+
Object.defineProperty(exports, "AgentCoreKnowledgeBase", { enumerable: true, get: function () { return components_1.AgentCoreKnowledgeBase; } });
|
|
16
|
+
Object.defineProperty(exports, "AgentCoreConfigBundle", { enumerable: true, get: function () { return components_1.AgentCoreConfigBundle; } });
|
|
14
17
|
Object.defineProperty(exports, "AgentCoreMemory", { enumerable: true, get: function () { return components_1.AgentCoreMemory; } });
|
|
15
18
|
Object.defineProperty(exports, "AgentCorePolicyEngine", { enumerable: true, get: function () { return components_1.AgentCorePolicyEngine; } });
|
|
16
19
|
Object.defineProperty(exports, "AgentCoreRuntime", { enumerable: true, get: function () { return components_1.AgentCoreRuntime; } });
|
|
20
|
+
Object.defineProperty(exports, "AgentCorePaymentManager", { enumerable: true, get: function () { return components_1.AgentCorePaymentManager; } });
|
|
21
|
+
Object.defineProperty(exports, "AgentCorePaymentConnector", { enumerable: true, get: function () { return components_1.AgentCorePaymentConnector; } });
|
|
17
22
|
// Bundling Constructs
|
|
18
23
|
var bundling_1 = require("./bundling");
|
|
19
24
|
Object.defineProperty(exports, "BundledCodeZipAsset", { enumerable: true, get: function () { return bundling_1.BundledCodeZipAsset; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cdk/constructs/index.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cdk/constructs/index.ts"],"names":[],"mappings":";;;AAAA,gBAAgB;AAChB,2BAUc;AATZ,0GAAA,oBAAoB,OAAA;AAGpB,sGAAA,gBAAgB,OAAA;AAEhB,iHAAA,2BAA2B,OAAA;AAE3B,kGAAA,YAAY,OAAA;AAId,uBAAuB;AACvB,2CAwBsB;AAtBpB,8GAAA,gBAAgB,OAAA;AAEhB,kHAAA,oBAAoB,OAAA;AAGpB,8GAAA,gBAAgB,OAAA;AAEhB,oHAAA,sBAAsB,OAAA;AAEtB,mHAAA,qBAAqB,OAAA;AAErB,6GAAA,eAAe,OAAA;AAEf,mHAAA,qBAAqB,OAAA;AAErB,8GAAA,gBAAgB,OAAA;AAEhB,qHAAA,uBAAuB,OAAA;AAGvB,uHAAA,yBAAyB,OAAA;AAI3B,sBAAsB;AACtB,uCAKoB;AAJlB,+GAAA,mBAAmB,OAAA;AAEnB,mHAAA,uBAAuB,OAAA;AACvB,qHAAA,yBAAyB,OAAA;AAE3B,uCAAkG;AAAzF,wHAAA,4BAA4B,OAAA;AAErC,uBAAuB;AACvB,oDAA0F;AAAjF,+GAAA,kBAAkB,OAAA;AAC3B,oDAA+D;AAAtD,kHAAA,qBAAqB,OAAA;AAC9B,oDAAgG;AAAvF,kHAAA,qBAAqB,OAAA"}
|
|
@@ -1,23 +1,51 @@
|
|
|
1
|
-
import type { AgentCoreProjectSpec } from '../../../schema';
|
|
1
|
+
import type { AgentCoreProjectSpec, HarnessSpec } from '../../../schema';
|
|
2
|
+
import { AgentCoreConfigBundle } from '../components/primitives/config-bundle/AgentCoreConfigBundle';
|
|
2
3
|
import { AgentCoreDataset } from '../components/primitives/dataset/AgentCoreDataset';
|
|
3
4
|
import { AgentCoreEvaluator } from '../components/primitives/evaluator/AgentCoreEvaluator';
|
|
4
5
|
import { AgentCoreOnlineEvaluationConfig } from '../components/primitives/evaluator/AgentCoreOnlineEvaluationConfig';
|
|
6
|
+
import type { AgentCoreHarness } from '../components/primitives/harness/AgentCoreHarness';
|
|
5
7
|
import type { AgentCoreHarnessRole } from '../components/primitives/harness/AgentCoreHarnessRole';
|
|
6
8
|
import type { HarnessRoleConfig } from '../components/primitives/harness/AgentCoreHarnessRole';
|
|
9
|
+
import { AgentCoreKnowledgeBase } from '../components/primitives/knowledge-base/AgentCoreKnowledgeBase';
|
|
7
10
|
import { AgentCoreMemory } from '../components/primitives/memory/AgentCoreMemory';
|
|
8
11
|
import { AgentCorePolicyEngine } from '../components/primitives/policy/AgentCorePolicyEngine';
|
|
9
12
|
import { AgentEnvironment } from './AgentEnvironment';
|
|
10
13
|
import { Construct } from 'constructs';
|
|
14
|
+
/**
|
|
15
|
+
* A harness deployment unit: the role-scoped config (for the IAM role + container build)
|
|
16
|
+
* plus, when deploying via CDK, the full validated spec and its config directory.
|
|
17
|
+
*/
|
|
18
|
+
export interface HarnessDeploymentConfig extends HarnessRoleConfig {
|
|
19
|
+
/** Full validated harness spec — when present, the harness is synthesized as a CFN resource. */
|
|
20
|
+
readonly spec?: HarnessSpec;
|
|
21
|
+
/** Directory containing this harness's harness.json (for resolving a system-prompt file path). */
|
|
22
|
+
readonly harnessDir?: string;
|
|
23
|
+
}
|
|
11
24
|
export interface AgentCoreApplicationProps {
|
|
12
25
|
/**
|
|
13
26
|
* The full project specification (v2 schema).
|
|
14
27
|
*/
|
|
15
28
|
spec: AgentCoreProjectSpec;
|
|
16
29
|
/**
|
|
17
|
-
* Optional harness
|
|
18
|
-
* Each entry creates (or imports) an IAM execution role for a harness
|
|
30
|
+
* Optional harness configurations.
|
|
31
|
+
* Each entry creates (or imports) an IAM execution role for a harness, and — when a full
|
|
32
|
+
* `spec` is provided — synthesizes the `AWS::BedrockAgentCore::Harness` CFN resource.
|
|
33
|
+
*/
|
|
34
|
+
harnesses?: HarnessDeploymentConfig[];
|
|
35
|
+
/**
|
|
36
|
+
* Parsed connectorParameters for non-S3 KB data sources, keyed by the data
|
|
37
|
+
* source's `connectorConfigFile` path. Supplied by the caller (which reads
|
|
38
|
+
* the JSON files); forwarded to each AgentCoreKnowledgeBase. Optional —
|
|
39
|
+
* required only when a KB has non-S3 data sources.
|
|
19
40
|
*/
|
|
20
|
-
|
|
41
|
+
connectorParametersByFile?: Record<string, Record<string, unknown>>;
|
|
42
|
+
/**
|
|
43
|
+
* Deployed credential state for resolving credential names to ARNs.
|
|
44
|
+
* Used by harness skill git auth to look up credential provider ARNs at synth time.
|
|
45
|
+
*/
|
|
46
|
+
credentials?: Record<string, {
|
|
47
|
+
credentialProviderArn: string;
|
|
48
|
+
}>;
|
|
21
49
|
}
|
|
22
50
|
/**
|
|
23
51
|
* AgentCore Application L3 Construct - v2 resource-centric model.
|
|
@@ -40,17 +68,42 @@ export declare class AgentCoreApplication extends Construct {
|
|
|
40
68
|
readonly environments: Map<string, AgentEnvironment>;
|
|
41
69
|
/** Memories keyed by memory name */
|
|
42
70
|
readonly memories: Map<string, AgentCoreMemory>;
|
|
71
|
+
/**
|
|
72
|
+
* Knowledge bases keyed by KB name.
|
|
73
|
+
*
|
|
74
|
+
* Public so Wave 2 can resolve `knowledgeBaseId` when wiring connector
|
|
75
|
+
* gateway targets — `app.knowledgeBases.get(kbName).knowledgeBaseId`.
|
|
76
|
+
* Do not narrow this back to private without updating Wave 2's lookup
|
|
77
|
+
* path; the contract is consumed cross-construct.
|
|
78
|
+
*/
|
|
79
|
+
readonly knowledgeBases: Map<string, AgentCoreKnowledgeBase>;
|
|
43
80
|
/** Evaluators keyed by evaluator name */
|
|
44
81
|
readonly evaluators: Map<string, AgentCoreEvaluator>;
|
|
45
82
|
/** Online evaluation configs keyed by config name */
|
|
46
83
|
readonly onlineEvalConfigs: Map<string, AgentCoreOnlineEvaluationConfig>;
|
|
47
84
|
/** Policy engines keyed by engine name */
|
|
48
85
|
readonly policyEngines: Map<string, AgentCorePolicyEngine>;
|
|
86
|
+
/** Config bundles keyed by bundle name */
|
|
87
|
+
readonly configBundles: Map<string, AgentCoreConfigBundle>;
|
|
49
88
|
/** Datasets keyed by dataset name */
|
|
50
89
|
readonly datasets: Map<string, AgentCoreDataset>;
|
|
51
90
|
/** Harness roles keyed by harness name */
|
|
52
91
|
readonly harnessRoles: Map<string, AgentCoreHarnessRole>;
|
|
92
|
+
/** Harness CFN resources keyed by harness name (only those deployed via CDK with a full spec) */
|
|
93
|
+
readonly harnesses: Map<string, AgentCoreHarness>;
|
|
53
94
|
constructor(scope: Construct, id: string, props: AgentCoreApplicationProps);
|
|
95
|
+
/**
|
|
96
|
+
* Resolve a harness's referenced memory into the in-stack ARN token + the
|
|
97
|
+
* retrievalConfig derived from that memory's strategy namespaces.
|
|
98
|
+
* Direct ARN (`memory.arn`) takes precedence over a by-name reference.
|
|
99
|
+
*/
|
|
100
|
+
private resolveHarnessMemory;
|
|
101
|
+
/**
|
|
102
|
+
* Creates CloudFormation outputs for harnesses deployed via CDK.
|
|
103
|
+
* Per-harness: HarnessId, HarnessArn, Status, Version, AgentRuntimeArn.
|
|
104
|
+
* (The execution-role ARN output is emitted separately by AgentCoreHarnessRole.)
|
|
105
|
+
*/
|
|
106
|
+
private createHarnessOutputs;
|
|
54
107
|
/**
|
|
55
108
|
* Wire all memories to all agents in the project.
|
|
56
109
|
* In the v2 schema, all resources within a project have implicit access.
|
|
@@ -85,10 +138,27 @@ export declare class AgentCoreApplication extends Construct {
|
|
|
85
138
|
* Produces per-dataset outputs (Id, Arn).
|
|
86
139
|
*/
|
|
87
140
|
private createDatasetOutputs;
|
|
141
|
+
/**
|
|
142
|
+
* Creates CloudFormation outputs for knowledge bases and their data sources.
|
|
143
|
+
*
|
|
144
|
+
* Per-KB outputs: Id, Arn.
|
|
145
|
+
* Per-DS outputs: DataSourceN.Id and DataSourceN.Uri, where N is the index
|
|
146
|
+
* into the local `dataSources[]` array. Consumers (e.g. the CLI post-deploy
|
|
147
|
+
* hook) read these to map local URI → deployed DS id deterministically
|
|
148
|
+
* instead of parsing physical names.
|
|
149
|
+
*/
|
|
150
|
+
private createKnowledgeBaseOutputs;
|
|
88
151
|
/**
|
|
89
152
|
* Creates CloudFormation outputs for policy engines and their policies.
|
|
90
153
|
* Produces per-engine outputs (Id, Arn) and per-policy outputs (Id, Arn).
|
|
91
154
|
*/
|
|
92
155
|
private createPolicyOutputs;
|
|
156
|
+
private createConfigBundleOutputs;
|
|
157
|
+
/**
|
|
158
|
+
* Resolve placeholder component keys (e.g., {{runtime:name}}, {{gateway:name}})
|
|
159
|
+
* to CDK token references from already-created constructs.
|
|
160
|
+
*/
|
|
161
|
+
private resolveConfigBundleComponents;
|
|
162
|
+
private resolveComponentKey;
|
|
93
163
|
}
|
|
94
164
|
//# sourceMappingURL=AgentCoreApplication.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentCoreApplication.d.ts","sourceRoot":"","sources":["../../../../src/cdk/constructs/l3/AgentCoreApplication.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,
|
|
1
|
+
{"version":3,"file":"AgentCoreApplication.d.ts","sourceRoot":"","sources":["../../../../src/cdk/constructs/l3/AgentCoreApplication.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAc,WAAW,EAAU,MAAM,iBAAiB,CAAC;AAE7F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uDAAuD,CAAC;AAC3F,OAAO,EAAE,+BAA+B,EAAE,MAAM,oEAAoE,CAAC;AACrH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAC1F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uDAAuD,CAAC;AAClG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,iDAAiD,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uDAAuD,CAAC;AAE9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,gGAAgG;IAChG,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B,kGAAkG;IAClG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,yB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IACH,OAAO,CAAC,mCAAmC;IAoB3C;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAoB5B;;;;;;;;OAQG;IACH,OAAO,CAAC,0BAA0B;IAkClC;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAoC3B,OAAO,CAAC,yBAAyB;IA0BjC;;;OAGG;IACH,OAAO,CAAC,6BAA6B;IAiBrC,OAAO,CAAC,mBAAmB;CA0B5B"}
|
|
@@ -3,9 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AgentCoreApplication = void 0;
|
|
4
4
|
const lib_1 = require("../../../lib");
|
|
5
5
|
const logical_ids_1 = require("../../logical-ids");
|
|
6
|
+
const AgentCoreConfigBundle_1 = require("../components/primitives/config-bundle/AgentCoreConfigBundle");
|
|
6
7
|
const AgentCoreDataset_1 = require("../components/primitives/dataset/AgentCoreDataset");
|
|
7
8
|
const AgentCoreEvaluator_1 = require("../components/primitives/evaluator/AgentCoreEvaluator");
|
|
8
9
|
const AgentCoreOnlineEvaluationConfig_1 = require("../components/primitives/evaluator/AgentCoreOnlineEvaluationConfig");
|
|
10
|
+
const AgentCoreKnowledgeBase_1 = require("../components/primitives/knowledge-base/AgentCoreKnowledgeBase");
|
|
9
11
|
const AgentCoreMemory_1 = require("../components/primitives/memory/AgentCoreMemory");
|
|
10
12
|
const AgentCorePolicyEngine_1 = require("../components/primitives/policy/AgentCorePolicyEngine");
|
|
11
13
|
const AgentCoreHarnessEnvironment_1 = require("./AgentCoreHarnessEnvironment");
|
|
@@ -34,19 +36,32 @@ class AgentCoreApplication extends constructs_1.Construct {
|
|
|
34
36
|
environments = new Map();
|
|
35
37
|
/** Memories keyed by memory name */
|
|
36
38
|
memories = new Map();
|
|
39
|
+
/**
|
|
40
|
+
* Knowledge bases keyed by KB name.
|
|
41
|
+
*
|
|
42
|
+
* Public so Wave 2 can resolve `knowledgeBaseId` when wiring connector
|
|
43
|
+
* gateway targets — `app.knowledgeBases.get(kbName).knowledgeBaseId`.
|
|
44
|
+
* Do not narrow this back to private without updating Wave 2's lookup
|
|
45
|
+
* path; the contract is consumed cross-construct.
|
|
46
|
+
*/
|
|
47
|
+
knowledgeBases = new Map();
|
|
37
48
|
/** Evaluators keyed by evaluator name */
|
|
38
49
|
evaluators = new Map();
|
|
39
50
|
/** Online evaluation configs keyed by config name */
|
|
40
51
|
onlineEvalConfigs = new Map();
|
|
41
52
|
/** Policy engines keyed by engine name */
|
|
42
53
|
policyEngines = new Map();
|
|
54
|
+
/** Config bundles keyed by bundle name */
|
|
55
|
+
configBundles = new Map();
|
|
43
56
|
/** Datasets keyed by dataset name */
|
|
44
57
|
datasets = new Map();
|
|
45
58
|
/** Harness roles keyed by harness name */
|
|
46
59
|
harnessRoles = new Map();
|
|
60
|
+
/** Harness CFN resources keyed by harness name (only those deployed via CDK with a full spec) */
|
|
61
|
+
harnesses = new Map();
|
|
47
62
|
constructor(scope, id, props) {
|
|
48
63
|
super(scope, id);
|
|
49
|
-
const { spec } = props;
|
|
64
|
+
const { spec, connectorParametersByFile } = props;
|
|
50
65
|
const projectName = spec.name;
|
|
51
66
|
const projectTags = spec.tags;
|
|
52
67
|
// Apply project-level tags via Tags.of() for propagation to supporting AWS resources.
|
|
@@ -63,6 +78,7 @@ class AgentCoreApplication extends constructs_1.Construct {
|
|
|
63
78
|
'AWS::BedrockAgentCore::PolicyEngine',
|
|
64
79
|
'AWS::BedrockAgentCore::Gateway',
|
|
65
80
|
'AWS::BedrockAgentCore::Dataset',
|
|
81
|
+
'AWS::BedrockAgentCore::Harness',
|
|
66
82
|
],
|
|
67
83
|
});
|
|
68
84
|
}
|
|
@@ -84,6 +100,18 @@ class AgentCoreApplication extends constructs_1.Construct {
|
|
|
84
100
|
this.memories.set(memorySpec.name, memory);
|
|
85
101
|
}
|
|
86
102
|
// ═══════════════════════════════════════════════════════════════════
|
|
103
|
+
// Create all knowledge bases (project-level resources)
|
|
104
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
105
|
+
for (const kbSpec of spec.knowledgeBases ?? []) {
|
|
106
|
+
const kb = new AgentCoreKnowledgeBase_1.AgentCoreKnowledgeBase(this, (0, logical_ids_1.toPascalId)('KnowledgeBase', kbSpec.name), {
|
|
107
|
+
projectName,
|
|
108
|
+
knowledgeBase: kbSpec,
|
|
109
|
+
projectTags,
|
|
110
|
+
connectorParametersByFile,
|
|
111
|
+
});
|
|
112
|
+
this.knowledgeBases.set(kbSpec.name, kb);
|
|
113
|
+
}
|
|
114
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
87
115
|
// Create all evaluators (project-level resources)
|
|
88
116
|
// ═══════════════════════════════════════════════════════════════════
|
|
89
117
|
for (const evalSpec of spec.evaluators ?? []) {
|
|
@@ -129,15 +157,36 @@ class AgentCoreApplication extends constructs_1.Construct {
|
|
|
129
157
|
this.environments.set(agentSpec.name, env);
|
|
130
158
|
}
|
|
131
159
|
// ═══════════════════════════════════════════════════════════════════
|
|
132
|
-
// Create all
|
|
160
|
+
// Create all config bundles (depend on runtimes/gateways for ARN refs)
|
|
161
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
162
|
+
for (const bundleSpec of spec.configBundles ?? []) {
|
|
163
|
+
const resolvedComponents = this.resolveConfigBundleComponents(bundleSpec.components);
|
|
164
|
+
const configBundle = new AgentCoreConfigBundle_1.AgentCoreConfigBundle(this, (0, logical_ids_1.toPascalId)('ConfigBundle', bundleSpec.name), {
|
|
165
|
+
projectName,
|
|
166
|
+
configBundle: bundleSpec,
|
|
167
|
+
resolvedComponents,
|
|
168
|
+
projectTags,
|
|
169
|
+
});
|
|
170
|
+
this.configBundles.set(bundleSpec.name, configBundle);
|
|
171
|
+
}
|
|
172
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
173
|
+
// Create all harnesses (IAM role + optional container + the CFN resource)
|
|
133
174
|
// ═══════════════════════════════════════════════════════════════════
|
|
134
175
|
for (const harness of props.harnesses ?? []) {
|
|
176
|
+
const { memoryArn, retrievalConfig } = this.resolveHarnessMemory(harness, spec.memories ?? []);
|
|
135
177
|
const harnessEnv = new AgentCoreHarnessEnvironment_1.AgentCoreHarnessEnvironment(this, (0, logical_ids_1.toPascalId)('Harness', harness.name), {
|
|
136
178
|
projectName,
|
|
137
179
|
projectTags,
|
|
138
180
|
harness,
|
|
181
|
+
spec: harness.spec,
|
|
182
|
+
harnessDir: harness.harnessDir,
|
|
183
|
+
memoryArn,
|
|
184
|
+
retrievalConfig,
|
|
185
|
+
credentials: props.credentials,
|
|
139
186
|
});
|
|
140
187
|
this.harnessRoles.set(harness.name, harnessEnv.harnessRole);
|
|
188
|
+
if (harnessEnv.harness)
|
|
189
|
+
this.harnesses.set(harness.name, harnessEnv.harness);
|
|
141
190
|
}
|
|
142
191
|
// ═══════════════════════════════════════════════════════════════════
|
|
143
192
|
// Create all online eval configs (depend on evaluators + agents)
|
|
@@ -178,6 +227,87 @@ class AgentCoreApplication extends constructs_1.Construct {
|
|
|
178
227
|
// Create dataset outputs
|
|
179
228
|
// ═══════════════════════════════════════════════════════════════════
|
|
180
229
|
this.createDatasetOutputs();
|
|
230
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
231
|
+
// Create config bundle outputs
|
|
232
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
233
|
+
this.createConfigBundleOutputs();
|
|
234
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
235
|
+
// Create knowledge base outputs
|
|
236
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
237
|
+
this.createKnowledgeBaseOutputs();
|
|
238
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
239
|
+
// Create harness outputs
|
|
240
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
241
|
+
this.createHarnessOutputs();
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Resolve a harness's referenced memory into the in-stack ARN token + the
|
|
245
|
+
* retrievalConfig derived from that memory's strategy namespaces.
|
|
246
|
+
* Direct ARN (`memory.arn`) takes precedence over a by-name reference.
|
|
247
|
+
*/
|
|
248
|
+
resolveHarnessMemory(harness, memories) {
|
|
249
|
+
const memoryRef = harness.spec?.memory;
|
|
250
|
+
if (!memoryRef)
|
|
251
|
+
return {};
|
|
252
|
+
// Managed memory is owned by the harness internally; disabled has none. Neither resolves a
|
|
253
|
+
// sibling memory ARN or per-namespace retrievalConfig — those only apply to `existing`.
|
|
254
|
+
if (memoryRef.mode !== 'existing')
|
|
255
|
+
return {};
|
|
256
|
+
let memoryArn;
|
|
257
|
+
let memorySpec;
|
|
258
|
+
if (memoryRef.arn) {
|
|
259
|
+
memoryArn = memoryRef.arn;
|
|
260
|
+
}
|
|
261
|
+
else if (memoryRef.name) {
|
|
262
|
+
const memory = this.memories.get(memoryRef.name);
|
|
263
|
+
if (!memory) {
|
|
264
|
+
throw new Error(`Memory "${memoryRef.name}" referenced by harness "${harness.name}" is not defined in this project.`);
|
|
265
|
+
}
|
|
266
|
+
memoryArn = memory.memoryArn;
|
|
267
|
+
memorySpec = memories.find(m => m.name === memoryRef.name);
|
|
268
|
+
}
|
|
269
|
+
return { memoryArn, retrievalConfig: buildRetrievalConfig(memorySpec, memoryRef.retrievalConfig) };
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Creates CloudFormation outputs for harnesses deployed via CDK.
|
|
273
|
+
* Per-harness: HarnessId, HarnessArn, Status, Version, AgentRuntimeArn.
|
|
274
|
+
* (The execution-role ARN output is emitted separately by AgentCoreHarnessRole.)
|
|
275
|
+
*/
|
|
276
|
+
createHarnessOutputs() {
|
|
277
|
+
if (this.harnesses.size === 0)
|
|
278
|
+
return;
|
|
279
|
+
const stack = aws_cdk_lib_1.Stack.of(this);
|
|
280
|
+
for (const [harnessName, harness] of this.harnesses) {
|
|
281
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Id'), {
|
|
282
|
+
description: `Harness ID for: ${harnessName}`,
|
|
283
|
+
value: harness.harnessId,
|
|
284
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Id'),
|
|
285
|
+
});
|
|
286
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Arn'), {
|
|
287
|
+
description: `Harness ARN for: ${harnessName}`,
|
|
288
|
+
value: harness.harnessArn,
|
|
289
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Arn'),
|
|
290
|
+
});
|
|
291
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Status'), {
|
|
292
|
+
description: `Harness status for: ${harnessName}`,
|
|
293
|
+
value: harness.status,
|
|
294
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Status'),
|
|
295
|
+
});
|
|
296
|
+
// Version output is gated: harness.harnessVersion is only populated (via getAtt) when gated
|
|
297
|
+
// features are enabled, since the `Version` attribute is absent on the pre-NY-Summit resource type.
|
|
298
|
+
if (harness.harnessVersion !== undefined) {
|
|
299
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'Version'), {
|
|
300
|
+
description: `Harness config version for: ${harnessName}`,
|
|
301
|
+
value: harness.harnessVersion,
|
|
302
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'Version'),
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('Harness', harnessName), 'AgentRuntimeArn'), {
|
|
306
|
+
description: `Underlying AgentCore Runtime ARN for harness: ${harnessName}`,
|
|
307
|
+
value: harness.agentRuntimeArn,
|
|
308
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'Harness', harnessName, 'AgentRuntimeArn'),
|
|
309
|
+
});
|
|
310
|
+
}
|
|
181
311
|
}
|
|
182
312
|
/**
|
|
183
313
|
* Wire all memories to all agents in the project.
|
|
@@ -338,6 +468,45 @@ class AgentCoreApplication extends constructs_1.Construct {
|
|
|
338
468
|
});
|
|
339
469
|
}
|
|
340
470
|
}
|
|
471
|
+
/**
|
|
472
|
+
* Creates CloudFormation outputs for knowledge bases and their data sources.
|
|
473
|
+
*
|
|
474
|
+
* Per-KB outputs: Id, Arn.
|
|
475
|
+
* Per-DS outputs: DataSourceN.Id and DataSourceN.Uri, where N is the index
|
|
476
|
+
* into the local `dataSources[]` array. Consumers (e.g. the CLI post-deploy
|
|
477
|
+
* hook) read these to map local URI → deployed DS id deterministically
|
|
478
|
+
* instead of parsing physical names.
|
|
479
|
+
*/
|
|
480
|
+
createKnowledgeBaseOutputs() {
|
|
481
|
+
if (this.knowledgeBases.size === 0)
|
|
482
|
+
return;
|
|
483
|
+
const stack = aws_cdk_lib_1.Stack.of(this);
|
|
484
|
+
for (const [kbName, kb] of this.knowledgeBases) {
|
|
485
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), 'Id'), {
|
|
486
|
+
description: `Knowledge Base ID for: ${kbName}`,
|
|
487
|
+
value: kb.knowledgeBaseId,
|
|
488
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, 'Id'),
|
|
489
|
+
});
|
|
490
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), 'Arn'), {
|
|
491
|
+
description: `Knowledge Base ARN for: ${kbName}`,
|
|
492
|
+
value: kb.knowledgeBaseArn,
|
|
493
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, 'Arn'),
|
|
494
|
+
});
|
|
495
|
+
kb.dataSources.forEach((ds, index) => {
|
|
496
|
+
const dsLabel = `DataSource${index}`;
|
|
497
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), dsLabel, 'Id'), {
|
|
498
|
+
description: `Data Source ${index} ID for KB: ${kbName}`,
|
|
499
|
+
value: ds.id,
|
|
500
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, dsLabel, 'Id'),
|
|
501
|
+
});
|
|
502
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('KnowledgeBase', kbName), dsLabel, 'Uri'), {
|
|
503
|
+
description: `Data Source ${index} URI for KB: ${kbName}`,
|
|
504
|
+
value: ds.uri,
|
|
505
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'KnowledgeBase', kbName, dsLabel, 'Uri'),
|
|
506
|
+
});
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
}
|
|
341
510
|
/**
|
|
342
511
|
* Creates CloudFormation outputs for policy engines and their policies.
|
|
343
512
|
* Produces per-engine outputs (Id, Arn) and per-policy outputs (Id, Arn).
|
|
@@ -373,6 +542,99 @@ class AgentCoreApplication extends constructs_1.Construct {
|
|
|
373
542
|
}
|
|
374
543
|
}
|
|
375
544
|
}
|
|
545
|
+
createConfigBundleOutputs() {
|
|
546
|
+
if (this.configBundles.size === 0)
|
|
547
|
+
return;
|
|
548
|
+
const stack = aws_cdk_lib_1.Stack.of(this);
|
|
549
|
+
for (const [bundleName, bundle] of this.configBundles) {
|
|
550
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'Id'), {
|
|
551
|
+
description: `ConfigBundle ID for: ${bundleName}`,
|
|
552
|
+
value: bundle.bundleId,
|
|
553
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'Id'),
|
|
554
|
+
});
|
|
555
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'Arn'), {
|
|
556
|
+
description: `ConfigBundle ARN for: ${bundleName}`,
|
|
557
|
+
value: bundle.bundleArn,
|
|
558
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'Arn'),
|
|
559
|
+
});
|
|
560
|
+
new aws_cdk_lib_1.CfnOutput(this, (0, logical_ids_1.outputId)((0, logical_ids_1.toPascalId)('ConfigBundle', bundleName), 'VersionId'), {
|
|
561
|
+
description: `ConfigBundle VersionId for: ${bundleName}`,
|
|
562
|
+
value: bundle.versionId,
|
|
563
|
+
exportName: (0, logical_ids_1.exportName)(stack.stackName, 'ConfigBundle', bundleName, 'VersionId'),
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Resolve placeholder component keys (e.g., {{runtime:name}}, {{gateway:name}})
|
|
569
|
+
* to CDK token references from already-created constructs.
|
|
570
|
+
*/
|
|
571
|
+
resolveConfigBundleComponents(components) {
|
|
572
|
+
const resolved = {};
|
|
573
|
+
for (const [key, value] of Object.entries(components)) {
|
|
574
|
+
// resolveComponentKey turns a {{runtime:name}} placeholder into the runtime ARN, which is an
|
|
575
|
+
// unresolved CDK token (cfnRuntime.attrAgentRuntimeArn → Fn::GetAtt). A token can't be used as
|
|
576
|
+
// a CFN map key directly, but that's fine here: AgentCoreConfigBundle wraps the whole Components
|
|
577
|
+
// map in CfnJson, which defers resolution to deploy time and emits a concrete ARN-keyed object.
|
|
578
|
+
// (resolveComponentKey still throws for unknown runtimes and unsupported {{gateway:...}} keys.)
|
|
579
|
+
resolved[this.resolveComponentKey(key)] = value;
|
|
580
|
+
}
|
|
581
|
+
return resolved;
|
|
582
|
+
}
|
|
583
|
+
resolveComponentKey(key) {
|
|
584
|
+
if (key.startsWith('arn:'))
|
|
585
|
+
return key;
|
|
586
|
+
const rtMatch = /^\{\{runtime:(.+)\}\}$/.exec(key);
|
|
587
|
+
if (rtMatch) {
|
|
588
|
+
const rtName = rtMatch[1];
|
|
589
|
+
const env = this.environments.get(rtName);
|
|
590
|
+
if (!env) {
|
|
591
|
+
throw new Error(`Config bundle references runtime "${rtName}" but it is not defined in runtimes[]. ` +
|
|
592
|
+
'Ensure the runtime is listed in agentcore.json.');
|
|
593
|
+
}
|
|
594
|
+
return env.runtime.runtimeArn;
|
|
595
|
+
}
|
|
596
|
+
const gwMatch = /^\{\{gateway:(.+)\}\}$/.exec(key);
|
|
597
|
+
if (gwMatch) {
|
|
598
|
+
throw new Error(`Config bundle references gateway "${gwMatch[1]}" — gateway ARN resolution in config bundles ` +
|
|
599
|
+
'requires the MCP construct. Use the full gateway ARN as the component key instead.');
|
|
600
|
+
}
|
|
601
|
+
return key;
|
|
602
|
+
}
|
|
376
603
|
}
|
|
377
604
|
exports.AgentCoreApplication = AgentCoreApplication;
|
|
605
|
+
/**
|
|
606
|
+
* Derive a harness retrievalConfig from the referenced memory's strategy namespaces,
|
|
607
|
+
* so the harness runtime knows which namespaces to search at inference time. The
|
|
608
|
+
* user-supplied flat tuning (`harness.memory.retrievalConfig`) is fanned out to every
|
|
609
|
+
* namespace — namespaces are only known here (from the resolved Memory's strategies),
|
|
610
|
+
* so a per-namespace map cannot be authored in the harness spec.
|
|
611
|
+
*
|
|
612
|
+
* Reads `namespaceTemplates` (preferred) and falls back to the deprecated `namespaces`,
|
|
613
|
+
* matching AgentCoreMemory's own resolution — a memory defined with only the new
|
|
614
|
+
* template fields would otherwise produce no retrieval namespaces at all.
|
|
615
|
+
*/
|
|
616
|
+
function buildRetrievalConfig(memorySpec, tuning) {
|
|
617
|
+
if (!memorySpec?.strategies?.length)
|
|
618
|
+
return undefined;
|
|
619
|
+
// Multiple strategies can declare the same namespace template (e.g. SEMANTIC + USER_PREFERENCE
|
|
620
|
+
// both scoped to /users/{actorId}/profile). Dedup explicitly rather than relying on
|
|
621
|
+
// Object.fromEntries' implicit last-write-wins, which would silently collapse duplicates. The
|
|
622
|
+
// dedup is safe today only because every namespace receives the identical `perNamespace` value;
|
|
623
|
+
// if per-strategy tuning overrides are ever added, this must merge per namespace instead.
|
|
624
|
+
const namespaces = [
|
|
625
|
+
...new Set(memorySpec.strategies.flatMap(s => [
|
|
626
|
+
...(s.namespaceTemplates ?? s.namespaces ?? []),
|
|
627
|
+
...(s.type === 'EPISODIC' ? (s.reflectionNamespaceTemplates ?? s.reflectionNamespaces ?? []) : []),
|
|
628
|
+
])),
|
|
629
|
+
];
|
|
630
|
+
if (namespaces.length === 0)
|
|
631
|
+
return undefined;
|
|
632
|
+
const perNamespace = {
|
|
633
|
+
...(tuning?.topK !== undefined && { TopK: tuning.topK }),
|
|
634
|
+
...(tuning?.relevanceScore !== undefined && { RelevanceScore: tuning.relevanceScore }),
|
|
635
|
+
};
|
|
636
|
+
// Spread a fresh copy per namespace so the entries don't alias one shared object — a future
|
|
637
|
+
// per-namespace tweak would otherwise mutate every namespace at once.
|
|
638
|
+
return Object.fromEntries(namespaces.map(ns => [ns, { ...perNamespace }]));
|
|
639
|
+
}
|
|
378
640
|
//# sourceMappingURL=AgentCoreApplication.js.map
|