@aws/nx-plugin-mcp 1.0.0-rc.45 → 1.0.0-rc.47
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/bin/aws-nx-mcp.js +63 -47
- package/docs/get_started/existing-project.mdx +4 -0
- package/docs/get_started/quick-start.mdx +1 -1
- package/docs/get_started/tutorials/contribute-generator.mdx +1 -1
- package/docs/get_started/tutorials/dungeon-game/1.mdx +2 -2
- package/docs/get_started/tutorials/dungeon-game/2.mdx +3 -3
- package/docs/guides/agentcore-gateway.mdx +1 -1
- package/docs/guides/connection/py-agent-dynamodb.mdx +1 -1
- package/docs/guides/connection/py-agent-rdb.mdx +1 -1
- package/docs/guides/connection/py-fast-api-dynamodb.mdx +1 -1
- package/docs/guides/connection/py-fast-api-rdb.mdx +2 -2
- package/docs/guides/connection/py-mcp-server-dynamodb.mdx +1 -1
- package/docs/guides/connection/py-mcp-server-rdb.mdx +1 -1
- package/docs/guides/connection/smithy-dynamodb.mdx +1 -1
- package/docs/guides/connection/smithy-rdb.mdx +3 -3
- package/docs/guides/connection/trpc-dynamodb.mdx +1 -1
- package/docs/guides/connection/ts-agent-a2a.mdx +1 -1
- package/docs/guides/connection/ts-agent-dynamodb.mdx +2 -2
- package/docs/guides/connection/ts-agent-gateway.mdx +1 -1
- package/docs/guides/connection/ts-agent-mcp.mdx +1 -1
- package/docs/guides/connection/ts-agent-rdb.mdx +4 -4
- package/docs/guides/connection/ts-mcp-server-dynamodb.mdx +2 -2
- package/docs/guides/connection/ts-mcp-server-rdb.mdx +2 -2
- package/docs/guides/docker-bundling.mdx +2 -2
- package/docs/guides/fastapi.mdx +2 -2
- package/docs/guides/react-website-auth.mdx +3 -3
- package/docs/guides/react-website.mdx +4 -3
- package/docs/guides/runtime-config.mdx +1 -1
- package/docs/guides/trpc.mdx +4 -3
- package/docs/guides/ts-dcr-proxy.mdx +1 -1
- package/docs/guides/ts-dynamodb.mdx +2 -1
- package/docs/guides/ts-mcp-server.mdx +44 -27
- package/docs/guides/ts-nx-plugin.mdx +2 -2
- package/docs/guides/ts-rdb.mdx +3 -2
- package/docs/guides/ts-smithy-api.mdx +3 -2
- package/docs/guides/typescript-infrastructure.mdx +10 -8
- package/docs/guides/typescript-project.mdx +133 -26
- package/docs/guides/workspace.mdx +6 -1
- package/docs/snippets/agent/bedrock-deployment.mdx +4 -4
- package/docs/snippets/agent/runtime-arn.mdx +1 -1
- package/docs/snippets/api/cors-configuration-cdk-note.mdx +1 -1
- package/docs/snippets/connection/lambda-dynamodb-access.mdx +1 -1
- package/docs/snippets/connection/rdb-api-infrastructure.mdx +1 -1
- package/docs/snippets/dynamodb/deploying-table.mdx +5 -5
- package/docs/snippets/lambda-function/deploying-your-function.mdx +2 -2
- package/docs/snippets/mcp/bedrock-deployment.mdx +4 -4
- package/docs/snippets/pdk-migration/example/01-migrate-api.mdx +7 -5
- package/docs/snippets/pdk-migration/example/02-migrate-website.mdx +29 -10
- package/docs/snippets/pdk-migration/example/03-migrate-infra.mdx +4 -4
- package/docs/snippets/pdk-migration/faq/type-safe-api.mdx +1 -1
- package/docs/snippets/rdb/cluster-instances.mdx +1 -1
- package/docs/snippets/rdb/deletion-protection.mdx +1 -1
- package/docs/snippets/rdb/deploying.mdx +1 -1
- package/docs/snippets/rdb/encryption-key-rotation.mdx +1 -1
- package/docs/snippets/rdb/engine-version.mdx +2 -2
- package/docs/snippets/rdb/performance-insights.mdx +1 -1
- package/docs/snippets/rdb/rds-proxy.mdx +1 -1
- package/docs/snippets/rdb/removal-policy.mdx +2 -2
- package/docs/snippets/rdb/serverless-capacity.mdx +1 -1
- package/generators.json +9 -9
- package/package.json +1 -1
- package/src/preset/schema.json +5 -0
package/bin/aws-nx-mcp.js
CHANGED
|
@@ -19758,7 +19758,7 @@ var generators$1 = {
|
|
|
19758
19758
|
"factory": "./src/init/generator",
|
|
19759
19759
|
"schema": "./src/init/schema.json",
|
|
19760
19760
|
"description": "Configure an existing Nx workspace to use the @aws/nx-plugin",
|
|
19761
|
-
"metric": "
|
|
19761
|
+
"metric": "g66",
|
|
19762
19762
|
"guidePages": ["existing-project"]
|
|
19763
19763
|
},
|
|
19764
19764
|
"agentcore-gateway": {
|
|
@@ -19778,7 +19778,7 @@ var generators$1 = {
|
|
|
19778
19778
|
"factory": "./src/agentcore-gateway/gateway-connection/generator",
|
|
19779
19779
|
"schema": "./src/agentcore-gateway/gateway-connection/schema.json",
|
|
19780
19780
|
"description": "Connect an AgentCore Gateway to another AgentCore Gateway",
|
|
19781
|
-
"metric": "
|
|
19781
|
+
"metric": "g65",
|
|
19782
19782
|
"hidden": true
|
|
19783
19783
|
},
|
|
19784
19784
|
"connection": {
|
|
@@ -19966,7 +19966,7 @@ var generators$1 = {
|
|
|
19966
19966
|
"factory": "./src/ts/dcr-proxy/generator",
|
|
19967
19967
|
"schema": "./src/ts/dcr-proxy/schema.json",
|
|
19968
19968
|
"description": "Generate an OAuth Dynamic Client Registration (DCR) proxy construct for Cognito-authenticated MCP servers",
|
|
19969
|
-
"metric": "
|
|
19969
|
+
"metric": "g67"
|
|
19970
19970
|
},
|
|
19971
19971
|
"ts#mcp-server": {
|
|
19972
19972
|
"factory": "./src/ts/mcp-server/generator",
|
|
@@ -19999,7 +19999,7 @@ var generators$1 = {
|
|
|
19999
19999
|
"factory": "./src/ts/website/app/generator",
|
|
20000
20000
|
"schema": "./src/ts/website/app/schema.json",
|
|
20001
20001
|
"description": "Generates a website application",
|
|
20002
|
-
"metric": "
|
|
20002
|
+
"metric": "g60",
|
|
20003
20003
|
"guidePages": ["website", "react-website"]
|
|
20004
20004
|
},
|
|
20005
20005
|
"ts#website#auth": {
|
|
@@ -20091,7 +20091,7 @@ var generators$1 = {
|
|
|
20091
20091
|
"ts#sync": {
|
|
20092
20092
|
"factory": "./src/ts/sync/generator",
|
|
20093
20093
|
"schema": "./src/ts/sync/schema.json",
|
|
20094
|
-
"description": "TypeScript path alias sync generator",
|
|
20094
|
+
"description": "TypeScript path alias and local workspace dependency sync generator",
|
|
20095
20095
|
"metric": "g29",
|
|
20096
20096
|
"hidden": true
|
|
20097
20097
|
},
|
|
@@ -20160,27 +20160,27 @@ var generators$1 = {
|
|
|
20160
20160
|
"factory": "./src/ts/dynamodb/generator",
|
|
20161
20161
|
"schema": "./src/ts/dynamodb/schema.json",
|
|
20162
20162
|
"description": "Create a TypeScript DynamoDB project",
|
|
20163
|
-
"metric": "
|
|
20163
|
+
"metric": "g61"
|
|
20164
20164
|
},
|
|
20165
20165
|
"ts#dynamodb#trpc-connection": {
|
|
20166
20166
|
"factory": "./src/ts/dynamodb/trpc-connection/generator",
|
|
20167
20167
|
"schema": "./src/ts/dynamodb/trpc-connection/schema.json",
|
|
20168
20168
|
"description": "Connect a ts#trpc-api project to a ts#dynamodb project",
|
|
20169
|
-
"metric": "
|
|
20169
|
+
"metric": "g62",
|
|
20170
20170
|
"hidden": true
|
|
20171
20171
|
},
|
|
20172
20172
|
"ts#dynamodb#smithy-connection": {
|
|
20173
20173
|
"factory": "./src/ts/dynamodb/smithy-connection/generator",
|
|
20174
20174
|
"schema": "./src/ts/dynamodb/smithy-connection/schema.json",
|
|
20175
20175
|
"description": "Connect a Smithy backend to a ts#dynamodb project",
|
|
20176
|
-
"metric": "
|
|
20176
|
+
"metric": "g63",
|
|
20177
20177
|
"hidden": true
|
|
20178
20178
|
},
|
|
20179
20179
|
"ts#dynamodb#agent-connection": {
|
|
20180
20180
|
"factory": "./src/ts/dynamodb/agent-connection/generator",
|
|
20181
20181
|
"schema": "./src/ts/dynamodb/agent-connection/schema.json",
|
|
20182
20182
|
"description": "Connect a ts#agent to a ts#dynamodb project",
|
|
20183
|
-
"metric": "
|
|
20183
|
+
"metric": "g64",
|
|
20184
20184
|
"hidden": true
|
|
20185
20185
|
},
|
|
20186
20186
|
"ts#dynamodb#mcp-server-connection": {
|
|
@@ -21304,6 +21304,9 @@ const NX_VERSION = {
|
|
|
21304
21304
|
"@aws/aws-distro-opentelemetry-node-autoinstrumentation": "0.12.0",
|
|
21305
21305
|
"@opentelemetry/propagator-jaeger": "2.9.0",
|
|
21306
21306
|
"@aws-sdk/client-dynamodb": "3.1090.0",
|
|
21307
|
+
"@aws-sdk/client-api-gateway": "3.1090.0",
|
|
21308
|
+
"@aws-sdk/client-iam": "3.1090.0",
|
|
21309
|
+
"@aws-sdk/client-bedrock-agentcore": "3.1090.0",
|
|
21307
21310
|
"@aws-sdk/client-bedrock-runtime": "3.1090.0",
|
|
21308
21311
|
"@aws-sdk/client-s3": "3.1090.0",
|
|
21309
21312
|
"@aws-sdk/client-sts": "3.1090.0",
|
|
@@ -21457,9 +21460,22 @@ const buildPackageManagerShortCommand = (pm, command) => {
|
|
|
21457
21460
|
return `${PACKAGE_MANAGER_COMMANDS[pm]?.run ?? pm} ${command}`;
|
|
21458
21461
|
};
|
|
21459
21462
|
/**
|
|
21460
|
-
* Build an install command
|
|
21463
|
+
* Build an install command. With `project`, targets that project's manifest
|
|
21464
|
+
* (pnpm `--filter` by unscoped name, npm/bun by `projectDir` defaulting to
|
|
21465
|
+
* `packages/<name>`, yarn by fully-qualified name); otherwise the root.
|
|
21461
21466
|
*/
|
|
21462
|
-
const buildInstallCommand = (pm, pkg, dev) => {
|
|
21467
|
+
const buildInstallCommand = (pm, pkg, dev, project, projectDir) => {
|
|
21468
|
+
if (project) {
|
|
21469
|
+
const shortName = project.split("/").pop();
|
|
21470
|
+
const dir = projectDir ?? `packages/${shortName}`;
|
|
21471
|
+
switch (pm) {
|
|
21472
|
+
case "pnpm": return `pnpm add ${dev ? "-D " : ""}${pkg} --filter ${shortName}`;
|
|
21473
|
+
case "yarn": return `yarn workspace ${project} add ${dev ? "-D " : ""}${pkg}`;
|
|
21474
|
+
case "npm": return `npm install --legacy-peer-deps ${dev ? "-D " : ""}${pkg} -w ${dir}`;
|
|
21475
|
+
case "bun": return `bun add ${dev ? "-D " : ""}${pkg} --cwd ${dir}`;
|
|
21476
|
+
default: return `${pm} install ${dev ? "-D " : ""}${pkg}`;
|
|
21477
|
+
}
|
|
21478
|
+
}
|
|
21463
21479
|
switch (pm) {
|
|
21464
21480
|
case "pnpm": return `pnpm add ${dev ? "-D" : "-"}w ${pkg}`;
|
|
21465
21481
|
case "yarn": return `yarn add ${dev ? "-D " : ""}${pkg}`;
|
|
@@ -21492,14 +21508,15 @@ const buildNxInitCommand = (pm) => {
|
|
|
21492
21508
|
* The package manager is auto-detected by @aws/create-nx-workspace from the
|
|
21493
21509
|
* invoking command, so --pm is not needed.
|
|
21494
21510
|
*/
|
|
21495
|
-
const buildCreateNxWorkspaceCommand = (pm, workspace, iac, tag, module) => {
|
|
21511
|
+
const buildCreateNxWorkspaceCommand = (pm, workspace, iac, tag, module, extraArgs) => {
|
|
21496
21512
|
return [
|
|
21497
21513
|
PACKAGE_MANAGER_COMMANDS[pm]?.create ?? `${pm} create`,
|
|
21498
21514
|
tag ? `@aws/nx-workspace@${tag}` : "@aws/nx-workspace",
|
|
21499
21515
|
...pm === "npm" ? ["--"] : [],
|
|
21500
21516
|
workspace,
|
|
21501
21517
|
...iac ? [`--iac=${iac}`] : [],
|
|
21502
|
-
...module ? [`--module=${module}`] : []
|
|
21518
|
+
...module ? [`--module=${module}`] : [],
|
|
21519
|
+
...extraArgs ? [extraArgs] : []
|
|
21503
21520
|
].join(" ");
|
|
21504
21521
|
};
|
|
21505
21522
|
//#endregion
|
|
@@ -28570,7 +28587,7 @@ var init_micromark_factory_space = __esmMin((() => {
|
|
|
28570
28587
|
init_micromark_util_character();
|
|
28571
28588
|
}));
|
|
28572
28589
|
//#endregion
|
|
28573
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
28590
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/initialize/content.js
|
|
28574
28591
|
/**
|
|
28575
28592
|
* @this {TokenizeContext}
|
|
28576
28593
|
* Context.
|
|
@@ -28632,7 +28649,7 @@ var init_content$1 = __esmMin((() => {
|
|
|
28632
28649
|
content$1 = { tokenize: initializeContent };
|
|
28633
28650
|
}));
|
|
28634
28651
|
//#endregion
|
|
28635
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
28652
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/initialize/document.js
|
|
28636
28653
|
/**
|
|
28637
28654
|
* @this {TokenizeContext}
|
|
28638
28655
|
* Self.
|
|
@@ -34320,7 +34337,7 @@ var init_micromark_core_commonmark = __esmMin((() => {
|
|
|
34320
34337
|
init_thematic_break$1();
|
|
34321
34338
|
}));
|
|
34322
34339
|
//#endregion
|
|
34323
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
34340
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/initialize/flow.js
|
|
34324
34341
|
/**
|
|
34325
34342
|
* @this {TokenizeContext}
|
|
34326
34343
|
* Self.
|
|
@@ -34363,7 +34380,7 @@ var init_flow = __esmMin((() => {
|
|
|
34363
34380
|
flow$1 = { tokenize: initializeFlow };
|
|
34364
34381
|
}));
|
|
34365
34382
|
//#endregion
|
|
34366
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
34383
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/initialize/text.js
|
|
34367
34384
|
/**
|
|
34368
34385
|
* @param {'string' | 'text'} field
|
|
34369
34386
|
* Field.
|
|
@@ -34533,7 +34550,7 @@ var init_text$1 = __esmMin((() => {
|
|
|
34533
34550
|
text$2 = initializeFactory("text");
|
|
34534
34551
|
}));
|
|
34535
34552
|
//#endregion
|
|
34536
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
34553
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/constructs.js
|
|
34537
34554
|
var constructs_exports = /* @__PURE__ */ __exportAll({
|
|
34538
34555
|
attentionMarkers: () => attentionMarkers,
|
|
34539
34556
|
contentInitial: () => contentInitial,
|
|
@@ -34604,7 +34621,7 @@ var init_constructs = __esmMin((() => {
|
|
|
34604
34621
|
disable = { null: [] };
|
|
34605
34622
|
}));
|
|
34606
34623
|
//#endregion
|
|
34607
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
34624
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/create-tokenizer.js
|
|
34608
34625
|
/**
|
|
34609
34626
|
* Create a tokenizer.
|
|
34610
34627
|
* Tokenizers deal with one type of data (e.g., containers, flow, text).
|
|
@@ -35041,7 +35058,7 @@ var init_create_tokenizer = __esmMin((() => {
|
|
|
35041
35058
|
init_micromark_util_resolve_all();
|
|
35042
35059
|
}));
|
|
35043
35060
|
//#endregion
|
|
35044
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
35061
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/parse.js
|
|
35045
35062
|
/**
|
|
35046
35063
|
* @param {ParseOptions | null | undefined} [options]
|
|
35047
35064
|
* Configuration (optional).
|
|
@@ -35085,7 +35102,7 @@ var init_parse = __esmMin((() => {
|
|
|
35085
35102
|
init_create_tokenizer();
|
|
35086
35103
|
}));
|
|
35087
35104
|
//#endregion
|
|
35088
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
35105
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/postprocess.js
|
|
35089
35106
|
/**
|
|
35090
35107
|
* @param {Array<Event>} events
|
|
35091
35108
|
* Events.
|
|
@@ -35100,7 +35117,7 @@ var init_postprocess = __esmMin((() => {
|
|
|
35100
35117
|
init_micromark_util_subtokenize();
|
|
35101
35118
|
}));
|
|
35102
35119
|
//#endregion
|
|
35103
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
35120
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/lib/preprocess.js
|
|
35104
35121
|
/**
|
|
35105
35122
|
* @returns {Preprocessor}
|
|
35106
35123
|
* Preprocess a value.
|
|
@@ -35189,7 +35206,7 @@ var init_preprocess = __esmMin((() => {
|
|
|
35189
35206
|
search = /[\0\t\n\r]/g;
|
|
35190
35207
|
}));
|
|
35191
35208
|
//#endregion
|
|
35192
|
-
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@
|
|
35209
|
+
//#region ../../node_modules/.pnpm/micromark@4.0.2_supports-color@7.2.0/node_modules/micromark/index.js
|
|
35193
35210
|
var init_micromark = __esmMin((() => {
|
|
35194
35211
|
init_decode_named_character_reference();
|
|
35195
35212
|
init_micromark_util_combine_extensions();
|
|
@@ -35241,7 +35258,7 @@ var init_micromark_util_decode_string = __esmMin((() => {
|
|
|
35241
35258
|
characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
35242
35259
|
}));
|
|
35243
35260
|
//#endregion
|
|
35244
|
-
//#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.2_supports-color@
|
|
35261
|
+
//#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.2_supports-color@7.2.0/node_modules/mdast-util-from-markdown/lib/index.js
|
|
35245
35262
|
/**
|
|
35246
35263
|
* Turn markdown into a syntax tree.
|
|
35247
35264
|
*
|
|
@@ -36177,12 +36194,12 @@ var init_lib$20 = __esmMin((() => {
|
|
|
36177
36194
|
own$4 = {}.hasOwnProperty;
|
|
36178
36195
|
}));
|
|
36179
36196
|
//#endregion
|
|
36180
|
-
//#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.2_supports-color@
|
|
36197
|
+
//#region ../../node_modules/.pnpm/mdast-util-from-markdown@2.0.2_supports-color@7.2.0/node_modules/mdast-util-from-markdown/index.js
|
|
36181
36198
|
var init_mdast_util_from_markdown = __esmMin((() => {
|
|
36182
36199
|
init_lib$20();
|
|
36183
36200
|
}));
|
|
36184
36201
|
//#endregion
|
|
36185
|
-
//#region ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@
|
|
36202
|
+
//#region ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@7.2.0/node_modules/remark-parse/lib/index.js
|
|
36186
36203
|
/**
|
|
36187
36204
|
* Aadd support for parsing from markdown.
|
|
36188
36205
|
*
|
|
@@ -36211,13 +36228,13 @@ var init_lib$19 = __esmMin((() => {
|
|
|
36211
36228
|
init_mdast_util_from_markdown();
|
|
36212
36229
|
}));
|
|
36213
36230
|
//#endregion
|
|
36214
|
-
//#region ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@
|
|
36231
|
+
//#region ../../node_modules/.pnpm/remark-parse@11.0.0_supports-color@7.2.0/node_modules/remark-parse/index.js
|
|
36215
36232
|
var remark_parse_exports = /* @__PURE__ */ __exportAll({ default: () => remarkParse });
|
|
36216
36233
|
var init_remark_parse = __esmMin((() => {
|
|
36217
36234
|
init_lib$19();
|
|
36218
36235
|
}));
|
|
36219
36236
|
//#endregion
|
|
36220
|
-
//#region ../../node_modules/.pnpm/mdast-util-mdx-expression@2.0.1_supports-color@
|
|
36237
|
+
//#region ../../node_modules/.pnpm/mdast-util-mdx-expression@2.0.1_supports-color@7.2.0/node_modules/mdast-util-mdx-expression/lib/index.js
|
|
36221
36238
|
/**
|
|
36222
36239
|
* Create an extension for `mdast-util-from-markdown` to enable MDX expressions
|
|
36223
36240
|
* in markdown.
|
|
@@ -36328,7 +36345,7 @@ var init_lib$18 = __esmMin((() => {
|
|
|
36328
36345
|
init_default();
|
|
36329
36346
|
}));
|
|
36330
36347
|
//#endregion
|
|
36331
|
-
//#region ../../node_modules/.pnpm/mdast-util-mdx-expression@2.0.1_supports-color@
|
|
36348
|
+
//#region ../../node_modules/.pnpm/mdast-util-mdx-expression@2.0.1_supports-color@7.2.0/node_modules/mdast-util-mdx-expression/index.js
|
|
36332
36349
|
var init_mdast_util_mdx_expression = __esmMin((() => {
|
|
36333
36350
|
init_lib$18();
|
|
36334
36351
|
}));
|
|
@@ -36899,7 +36916,7 @@ var init_stringify_entities = __esmMin((() => {
|
|
|
36899
36916
|
init_lib$16();
|
|
36900
36917
|
}));
|
|
36901
36918
|
//#endregion
|
|
36902
|
-
//#region ../../node_modules/.pnpm/mdast-util-mdx-jsx@3.2.0_supports-color@
|
|
36919
|
+
//#region ../../node_modules/.pnpm/mdast-util-mdx-jsx@3.2.0_supports-color@7.2.0/node_modules/mdast-util-mdx-jsx/lib/index.js
|
|
36903
36920
|
/**
|
|
36904
36921
|
* Create an extension for `mdast-util-from-markdown` to enable MDX JSX.
|
|
36905
36922
|
*
|
|
@@ -37422,12 +37439,12 @@ var init_lib$15 = __esmMin((() => {
|
|
|
37422
37439
|
indent = " ";
|
|
37423
37440
|
}));
|
|
37424
37441
|
//#endregion
|
|
37425
|
-
//#region ../../node_modules/.pnpm/mdast-util-mdx-jsx@3.2.0_supports-color@
|
|
37442
|
+
//#region ../../node_modules/.pnpm/mdast-util-mdx-jsx@3.2.0_supports-color@7.2.0/node_modules/mdast-util-mdx-jsx/index.js
|
|
37426
37443
|
var init_mdast_util_mdx_jsx = __esmMin((() => {
|
|
37427
37444
|
init_lib$15();
|
|
37428
37445
|
}));
|
|
37429
37446
|
//#endregion
|
|
37430
|
-
//#region ../../node_modules/.pnpm/mdast-util-mdxjs-esm@2.0.1_supports-color@
|
|
37447
|
+
//#region ../../node_modules/.pnpm/mdast-util-mdxjs-esm@2.0.1_supports-color@7.2.0/node_modules/mdast-util-mdxjs-esm/lib/index.js
|
|
37431
37448
|
/**
|
|
37432
37449
|
* Create an extension for `mdast-util-from-markdown` to enable MDX.js ESM in
|
|
37433
37450
|
* markdown.
|
|
@@ -37500,12 +37517,12 @@ var init_lib$14 = __esmMin((() => {
|
|
|
37500
37517
|
init_default();
|
|
37501
37518
|
}));
|
|
37502
37519
|
//#endregion
|
|
37503
|
-
//#region ../../node_modules/.pnpm/mdast-util-mdxjs-esm@2.0.1_supports-color@
|
|
37520
|
+
//#region ../../node_modules/.pnpm/mdast-util-mdxjs-esm@2.0.1_supports-color@7.2.0/node_modules/mdast-util-mdxjs-esm/index.js
|
|
37504
37521
|
var init_mdast_util_mdxjs_esm = __esmMin((() => {
|
|
37505
37522
|
init_lib$14();
|
|
37506
37523
|
}));
|
|
37507
37524
|
//#endregion
|
|
37508
|
-
//#region ../../node_modules/.pnpm/mdast-util-mdx@3.0.0_supports-color@
|
|
37525
|
+
//#region ../../node_modules/.pnpm/mdast-util-mdx@3.0.0_supports-color@7.2.0/node_modules/mdast-util-mdx/lib/index.js
|
|
37509
37526
|
/**
|
|
37510
37527
|
* Create an extension for `mdast-util-from-markdown` to enable MDX (ESM, JSX,
|
|
37511
37528
|
* expressions).
|
|
@@ -37547,7 +37564,7 @@ var init_lib$13 = __esmMin((() => {
|
|
|
37547
37564
|
init_mdast_util_mdxjs_esm();
|
|
37548
37565
|
}));
|
|
37549
37566
|
//#endregion
|
|
37550
|
-
//#region ../../node_modules/.pnpm/mdast-util-mdx@3.0.0_supports-color@
|
|
37567
|
+
//#region ../../node_modules/.pnpm/mdast-util-mdx@3.0.0_supports-color@7.2.0/node_modules/mdast-util-mdx/index.js
|
|
37551
37568
|
var init_mdast_util_mdx = __esmMin((() => {
|
|
37552
37569
|
init_lib$13();
|
|
37553
37570
|
}));
|
|
@@ -50427,7 +50444,7 @@ var init_micromark_extension_mdxjs = __esmMin((() => {
|
|
|
50427
50444
|
init_micromark_util_combine_extensions();
|
|
50428
50445
|
}));
|
|
50429
50446
|
//#endregion
|
|
50430
|
-
//#region ../../node_modules/.pnpm/remark-mdx@3.1.1_supports-color@
|
|
50447
|
+
//#region ../../node_modules/.pnpm/remark-mdx@3.1.1_supports-color@7.2.0/node_modules/remark-mdx/lib/index.js
|
|
50431
50448
|
/**
|
|
50432
50449
|
* Add support for MDX (JSX: `<Video id={123} />`, export/imports: `export {x}
|
|
50433
50450
|
* from 'y'`; and expressions: `{1 + 1}`).
|
|
@@ -50457,7 +50474,7 @@ var init_lib$8 = __esmMin((() => {
|
|
|
50457
50474
|
emptyOptions$1 = {};
|
|
50458
50475
|
}));
|
|
50459
50476
|
//#endregion
|
|
50460
|
-
//#region ../../node_modules/.pnpm/remark-mdx@3.1.1_supports-color@
|
|
50477
|
+
//#region ../../node_modules/.pnpm/remark-mdx@3.1.1_supports-color@7.2.0/node_modules/remark-mdx/index.js
|
|
50461
50478
|
var remark_mdx_exports = /* @__PURE__ */ __exportAll({ default: () => remarkMdx });
|
|
50462
50479
|
var init_remark_mdx = __esmMin((() => {
|
|
50463
50480
|
init_lib$8();
|
|
@@ -53412,7 +53429,7 @@ function escapeStringRegexp(string) {
|
|
|
53412
53429
|
}
|
|
53413
53430
|
var init_escape_string_regexp = __esmMin((() => {}));
|
|
53414
53431
|
//#endregion
|
|
53415
|
-
//#region ../../node_modules/.pnpm/mdast-util-frontmatter@2.0.1_supports-color@
|
|
53432
|
+
//#region ../../node_modules/.pnpm/mdast-util-frontmatter@2.0.1_supports-color@7.2.0/node_modules/mdast-util-frontmatter/lib/index.js
|
|
53416
53433
|
/**
|
|
53417
53434
|
* Create an extension for `mdast-util-from-markdown`.
|
|
53418
53435
|
*
|
|
@@ -53563,12 +53580,12 @@ var init_lib$1 = __esmMin((() => {
|
|
|
53563
53580
|
init_escape_string_regexp();
|
|
53564
53581
|
}));
|
|
53565
53582
|
//#endregion
|
|
53566
|
-
//#region ../../node_modules/.pnpm/mdast-util-frontmatter@2.0.1_supports-color@
|
|
53583
|
+
//#region ../../node_modules/.pnpm/mdast-util-frontmatter@2.0.1_supports-color@7.2.0/node_modules/mdast-util-frontmatter/index.js
|
|
53567
53584
|
var init_mdast_util_frontmatter = __esmMin((() => {
|
|
53568
53585
|
init_lib$1();
|
|
53569
53586
|
}));
|
|
53570
53587
|
//#endregion
|
|
53571
|
-
//#region ../../node_modules/.pnpm/remark-frontmatter@5.0.0_supports-color@
|
|
53588
|
+
//#region ../../node_modules/.pnpm/remark-frontmatter@5.0.0_supports-color@7.2.0/node_modules/remark-frontmatter/lib/index.js
|
|
53572
53589
|
/**
|
|
53573
53590
|
* Add support for frontmatter.
|
|
53574
53591
|
*
|
|
@@ -53599,7 +53616,7 @@ var init_lib = __esmMin((() => {
|
|
|
53599
53616
|
emptyOptions = "yaml";
|
|
53600
53617
|
}));
|
|
53601
53618
|
//#endregion
|
|
53602
|
-
//#region ../../node_modules/.pnpm/remark-frontmatter@5.0.0_supports-color@
|
|
53619
|
+
//#region ../../node_modules/.pnpm/remark-frontmatter@5.0.0_supports-color@7.2.0/node_modules/remark-frontmatter/index.js
|
|
53603
53620
|
var remark_frontmatter_exports = /* @__PURE__ */ __exportAll({ default: () => remarkFrontmatter });
|
|
53604
53621
|
var init_remark_frontmatter = __esmMin((() => {
|
|
53605
53622
|
init_lib();
|
|
@@ -54451,12 +54468,11 @@ ${PACKAGE_MANAGERS.map((pm) => buildNxCommand("<options>", pm)).join(" - \n")}
|
|
|
54451
54468
|
|
|
54452
54469
|
## General Instructions
|
|
54453
54470
|
|
|
54454
|
-
-
|
|
54455
|
-
- pnpm add -w
|
|
54456
|
-
- yarn add -D <package
|
|
54457
|
-
|
|
54458
|
-
|
|
54459
|
-
- (Omit -D for production dependencies)
|
|
54471
|
+
- Each project declares the third-party runtime dependencies its source imports in its own \`package.json\`; shared build/test tooling (test runners, bundlers, etc.) is declared in the root \`package.json\` \`devDependencies\`. Versions follow a single version policy, recorded in the package manager's dependency catalog where supported (referenced as \`catalog:\`). Install with the appropriate command for your package manager:
|
|
54472
|
+
- Add a project runtime dependency: \`pnpm add <package> --filter <project>\` / \`yarn workspace <project> add <package>\` / \`npm install <package> -w <project>\` / \`bun add <package> --cwd <project-directory>\`
|
|
54473
|
+
- Add a shared dev tool at the root: \`pnpm add -Dw <package>\` / \`yarn add -D <package>\` / \`npm install --legacy-peer-deps -D <package>\` / \`bun install -D <package>\`
|
|
54474
|
+
- The \`noUndeclaredDependencies\` lint rule enforces that a project's source only imports packages declared in its own \`package.json\`
|
|
54475
|
+
- Projects in the same workspace can import one another directly by package name (eg \`@workspace-name/project-name\`) without declaring a dependency in \`package.json\` — TypeScript path aliases in \`tsconfig.base.json\` resolve these imports
|
|
54460
54476
|
- When specifying project names as arguments to generators, prefer the _fully qualified_ project name, for example \`@workspace-name/project-name\`. Check the \`project.json\` file for the specific package to find its fully qualified name
|
|
54461
54477
|
- When no generator exists for a specific framework required, use the base \`ts#project\` and \`py#project\` generators and build on top.
|
|
54462
54478
|
- Leave the \`--infra\` option at its default value unless the user has explicitly instructed otherwise. Generators choose a sensible default type of infrastructure to deploy the project with, so only override \`--infra\` when the user has specified a particular requirement.
|
|
@@ -143,6 +143,10 @@ The plugin's TypeScript projects rely on these compiler options. If a `tsconfig.
|
|
|
143
143
|
|
|
144
144
|
## Troubleshooting
|
|
145
145
|
|
|
146
|
+
#### `nx build <project>` no longer works for an existing TypeScript library
|
|
147
|
+
|
|
148
|
+
The first `ts#project` run configures the `@nx/js/typescript` plugin to infer the TypeScript build target as `compile` (the plugin reserves `build` for orchestrating `lint`, `compile` and `test`). Existing libraries relying on the inferred `build` target are inferred as `compile` too — run `nx run <project>:compile`, or use `nx run-many --target build,compile`. Libraries with an explicit `build` target in their `project.json` are unaffected.
|
|
149
|
+
|
|
146
150
|
#### `The workspace is out of sync`
|
|
147
151
|
|
|
148
152
|
TypeScript project references need syncing. `init` registers the sync generators; run:
|
|
@@ -112,7 +112,7 @@ Open `packages/infra/src/stacks/application-stack.ts` and add the following code
|
|
|
112
112
|
|
|
113
113
|
```typescript
|
|
114
114
|
import { Stack, StackProps } from 'aws-cdk-lib';
|
|
115
|
-
import { DemoApi, DemoWebsite, UserIdentity } from '
|
|
115
|
+
import { DemoApi, DemoWebsite, UserIdentity } from '@my-project/common-constructs';
|
|
116
116
|
import { Construct } from 'constructs';
|
|
117
117
|
|
|
118
118
|
export class ApplicationStack extends Stack {
|
|
@@ -308,7 +308,7 @@ To test the generator, we'll link our local Nx Plugin for AWS to an existing cod
|
|
|
308
308
|
#### Create a Test Project with a tRPC API
|
|
309
309
|
|
|
310
310
|
:::note[Using Your Own Project]
|
|
311
|
-
If you have completed the <Link path="get_started/tutorials/
|
|
311
|
+
If you have completed the <Link path="get_started/tutorials/dungeon-game/overview">dungeon adventure tutorial</Link>, or already have another existing Nx workspace which uses a tRPC API, you can skip this step.
|
|
312
312
|
:::
|
|
313
313
|
|
|
314
314
|
In a separate directory, create a new test workspace:
|
|
@@ -202,7 +202,7 @@ import {
|
|
|
202
202
|
} from '../../core/api/utils.js';
|
|
203
203
|
import { AddCorsPreflightAspect, RestApi } from '../../core/api/rest-api.js';
|
|
204
204
|
import { Procedures, routerToOperations } from '../../core/api/trpc-utils.js';
|
|
205
|
-
import { AppRouter, appRouter } from '
|
|
205
|
+
import { AppRouter, appRouter } from '@dungeon-adventure/game-api';
|
|
206
206
|
|
|
207
207
|
// String union type for all API operation names
|
|
208
208
|
type Operations = Procedures<AppRouter>;
|
|
@@ -1091,7 +1091,7 @@ The `ts#infra` generator generates/updates these. Let us examine some of the key
|
|
|
1091
1091
|
```ts
|
|
1092
1092
|
// packages/infra/src/main.ts
|
|
1093
1093
|
import { ApplicationStage } from './stages/application-stage.js';
|
|
1094
|
-
import { App } from '
|
|
1094
|
+
import { App } from '@dungeon-adventure/common-constructs';
|
|
1095
1095
|
|
|
1096
1096
|
const app = new App();
|
|
1097
1097
|
|
|
@@ -78,10 +78,10 @@ game -> item: 1..*
|
|
|
78
78
|
|
|
79
79
|
The `ts#dynamodb` generator set up [ElectroDB](https://electrodb.dev/en/core-concepts/introduction/), which we will use to model our data. We will persist conversation history in S3, so we add a dependency on the S3 client:
|
|
80
80
|
|
|
81
|
-
<InstallCommand pkg={getDungeonAdventureElectroDbDependencies()} />
|
|
81
|
+
<InstallCommand pkg={getDungeonAdventureElectroDbDependencies()} project="@dungeon-adventure/game-api" />
|
|
82
82
|
|
|
83
|
-
<Aside title="
|
|
84
|
-
|
|
83
|
+
<Aside title="Project Dependencies">
|
|
84
|
+
The S3 client is added to the `game-api` project's own `package.json`, since that project's source imports it. Versions are still aligned across the workspace via the package manager's dependency catalog (where supported) ([single version policy](https://nx.dev/concepts/decisions/dependency-management#single-version-policy)). For more information, refer to the <Link path="guides/typescript-project#dependencies">ts#project guide</Link>.
|
|
85
85
|
</Aside>
|
|
86
86
|
|
|
87
87
|
Replace the generated example entity in `packages/dungeon-db/src/entities/index.ts` with our `Game` and `Inventory` entities, and delete `packages/dungeon-db/src/entities/example.ts`:
|
|
@@ -362,7 +362,7 @@ The AgentCore Gateway generator creates CDK or Terraform infrastructure as code
|
|
|
362
362
|
The CDK construct for deploying your Gateway lives in the `common/constructs` folder. You can consume this in a CDK application, for example:
|
|
363
363
|
|
|
364
364
|
```ts {7} title="packages/infra/src/stacks/application-stack.ts"
|
|
365
|
-
import { MyGateway } from '
|
|
365
|
+
import { MyGateway } from '@my-scope/common-constructs';
|
|
366
366
|
|
|
367
367
|
export class ApplicationStack extends Stack {
|
|
368
368
|
constructor(scope: Construct, id: string, props?: StackProps) {
|
|
@@ -58,7 +58,7 @@ To allow the agent's Lambda function to access the DynamoDB table, grant the nec
|
|
|
58
58
|
<Fragment slot="cdk">
|
|
59
59
|
|
|
60
60
|
```ts title="packages/infra/src/stacks/application-stack.ts"
|
|
61
|
-
import { MyTable } from '
|
|
61
|
+
import { MyTable } from '@my-scope/common-constructs';
|
|
62
62
|
|
|
63
63
|
const table = new MyTable(this, 'Table');
|
|
64
64
|
const myAgent = new MyAgent(this, 'MyAgent');
|
|
@@ -73,7 +73,7 @@ The generated agent construct implements `IGrantable` and `IConnectable`, so you
|
|
|
73
73
|
```ts title="packages/infra/src/stacks/application-stack.ts"
|
|
74
74
|
import { SecurityGroup } from 'aws-cdk-lib/aws-ec2';
|
|
75
75
|
import { RuntimeNetworkConfiguration } from 'aws-cdk-lib/aws-bedrockagentcore';
|
|
76
|
-
import { MyDatabase } from '
|
|
76
|
+
import { MyDatabase } from '@my-scope/common-constructs';
|
|
77
77
|
|
|
78
78
|
const db = new MyDatabase(this, 'Db', { vpc, ... });
|
|
79
79
|
|
|
@@ -16,7 +16,7 @@ The `connection` generator wires a <Link path="guides/fastapi">FastAPI</Link> to
|
|
|
16
16
|
|
|
17
17
|
Before using this generator, ensure you have:
|
|
18
18
|
|
|
19
|
-
1. A <Link path="guides/fastapi">`py#
|
|
19
|
+
1. A FastAPI project (generated with `py#api --framework=fastapi`), see the <Link path="guides/fastapi">`py#api`</Link> guide
|
|
20
20
|
2. A <Link path="guides/py-dynamodb">`py#dynamodb`</Link> project
|
|
21
21
|
|
|
22
22
|
## Usage
|
|
@@ -18,7 +18,7 @@ The `connection` generator wires a <Link path="guides/fastapi">FastAPI</Link> to
|
|
|
18
18
|
|
|
19
19
|
Before using this generator, ensure you have:
|
|
20
20
|
|
|
21
|
-
1. A <Link path="guides/fastapi">`py#
|
|
21
|
+
1. A FastAPI project (generated with `py#api --framework=fastapi`), see the <Link path="guides/fastapi">`py#api`</Link> guide
|
|
22
22
|
2. A <Link path="guides/py-rdb">`py#rdb`</Link> project
|
|
23
23
|
|
|
24
24
|
## Usage
|
|
@@ -82,7 +82,7 @@ To allow the FastAPI Lambda function to connect to the database at runtime, it m
|
|
|
82
82
|
In your application stack, deploy the API into the same VPC as the database, then call `allowDefaultPortFrom` and `grantConnect` to open the network path and grant IAM `rds-db:connect` permission to the Lambda handler:
|
|
83
83
|
|
|
84
84
|
```ts title="packages/infra/src/stacks/application-stack.ts"
|
|
85
|
-
import { MyDatabase } from '
|
|
85
|
+
import { MyDatabase } from '@my-scope/common-constructs';
|
|
86
86
|
|
|
87
87
|
const db = new MyDatabase(this, 'Db', { vpc, ... });
|
|
88
88
|
|
|
@@ -58,7 +58,7 @@ To allow the MCP server's Lambda function to access the DynamoDB table, grant th
|
|
|
58
58
|
<Fragment slot="cdk">
|
|
59
59
|
|
|
60
60
|
```ts title="packages/infra/src/stacks/application-stack.ts"
|
|
61
|
-
import { MyTable } from '
|
|
61
|
+
import { MyTable } from '@my-scope/common-constructs';
|
|
62
62
|
|
|
63
63
|
const table = new MyTable(this, 'Table');
|
|
64
64
|
const myMcpServer = new MyMcpServer(this, 'MyMcpServer');
|
|
@@ -82,7 +82,7 @@ The generated MCP server construct implements `IGrantable` and `IConnectable`, s
|
|
|
82
82
|
```ts title="packages/infra/src/stacks/application-stack.ts"
|
|
83
83
|
import { SecurityGroup } from 'aws-cdk-lib/aws-ec2';
|
|
84
84
|
import { RuntimeNetworkConfiguration } from 'aws-cdk-lib/aws-bedrockagentcore';
|
|
85
|
-
import { MyDatabase } from '
|
|
85
|
+
import { MyDatabase } from '@my-scope/common-constructs';
|
|
86
86
|
|
|
87
87
|
const db = new MyDatabase(this, 'Db', { vpc, ... });
|
|
88
88
|
|
|
@@ -42,7 +42,7 @@ The generator updates your Smithy API's `project.json` to add a dependency from
|
|
|
42
42
|
Import entity factories from the DynamoDB package and use them inside your operation implementations:
|
|
43
43
|
|
|
44
44
|
```ts title="packages/api/src/operations/list-examples.ts"
|
|
45
|
-
import { createExampleEntity } from '
|
|
45
|
+
import { createExampleEntity } from '@my-scope/my-table';
|
|
46
46
|
import {
|
|
47
47
|
ListExamplesOperationInput,
|
|
48
48
|
ListExamplesOperationOutput,
|
|
@@ -55,7 +55,7 @@ Additionally, it updates the API's `dev` target to start the database automatica
|
|
|
55
55
|
The generator adds a typed `db` property to `ServiceContext` in `context.ts`:
|
|
56
56
|
|
|
57
57
|
```ts title="packages/api/src/context.ts" {1,7}
|
|
58
|
-
import { getPrisma as getMyDb } from '
|
|
58
|
+
import { getPrisma as getMyDb } from '@my-scope/my-db';
|
|
59
59
|
|
|
60
60
|
export interface ServiceContext {
|
|
61
61
|
tracer: Tracer;
|
|
@@ -70,7 +70,7 @@ export interface ServiceContext {
|
|
|
70
70
|
The Prisma client is instantiated inside `lambdaHandler` and passed through the service context:
|
|
71
71
|
|
|
72
72
|
```ts title="packages/api/src/handler.ts" {1,10}
|
|
73
|
-
import { getPrisma as getMyDb } from '
|
|
73
|
+
import { getPrisma as getMyDb } from '@my-scope/my-db';
|
|
74
74
|
|
|
75
75
|
export const lambdaHandler = async (event: APIGatewayProxyEvent) => {
|
|
76
76
|
const httpRequest = convertEvent(event);
|
|
@@ -141,7 +141,7 @@ const httpResponse = await serviceHandler.handle(httpRequest, {
|
|
|
141
141
|
The generator applies the same Prisma client injection inside the request handler in `local-server.ts`:
|
|
142
142
|
|
|
143
143
|
```ts title="packages/api/src/local-server.ts" {1,5,10}
|
|
144
|
-
import { getPrisma as getMyDb } from '
|
|
144
|
+
import { getPrisma as getMyDb } from '@my-scope/my-db';
|
|
145
145
|
|
|
146
146
|
const server = createServer(async function (req, res) {
|
|
147
147
|
const httpRequest = convertRequest(req);
|
|
@@ -42,7 +42,7 @@ The generator updates your tRPC API's `project.json` to add a dependency from it
|
|
|
42
42
|
Import entity factories from the DynamoDB package and use them inside your tRPC procedures:
|
|
43
43
|
|
|
44
44
|
```ts title="packages/api/src/procedures/example.ts"
|
|
45
|
-
import { createExampleEntity } from '
|
|
45
|
+
import { createExampleEntity } from '@my-scope/my-table';
|
|
46
46
|
import { publicProcedure } from '../init.js';
|
|
47
47
|
|
|
48
48
|
export const listExamples = publicProcedure
|
|
@@ -70,7 +70,7 @@ The generator transforms your agent's `agent.ts` to wrap the remote A2A agent as
|
|
|
70
70
|
|
|
71
71
|
```ts title="packages/example/src/my-agent/agent.ts" {2,5-11,14}
|
|
72
72
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
73
|
-
import { RemoteAgentClientStrands } from '
|
|
73
|
+
import { RemoteAgentClientStrands } from '@my-scope/agent-connection';
|
|
74
74
|
import { z } from 'zod';
|
|
75
75
|
|
|
76
76
|
export const getAgent = async (sessionId: string) => {
|
|
@@ -42,7 +42,7 @@ The generator updates the agent's `<agent-name>-dev` target in `project.json` to
|
|
|
42
42
|
Import entity factories from the DynamoDB package and use them inside your agent definition:
|
|
43
43
|
|
|
44
44
|
```ts title="packages/my-service/src/my-agent/agent.ts"
|
|
45
|
-
import { createExampleEntity } from '
|
|
45
|
+
import { createExampleEntity } from '@my-scope/my-table';
|
|
46
46
|
|
|
47
47
|
export const getAgent = async () => {
|
|
48
48
|
// ...
|
|
@@ -70,7 +70,7 @@ To allow the agent's Lambda function to access the DynamoDB table, grant the nec
|
|
|
70
70
|
<Fragment slot="cdk">
|
|
71
71
|
|
|
72
72
|
```ts title="packages/infra/src/stacks/application-stack.ts"
|
|
73
|
-
import { MyTable } from '
|
|
73
|
+
import { MyTable } from '@my-scope/common-constructs';
|
|
74
74
|
|
|
75
75
|
const table = new MyTable(this, 'Table');
|
|
76
76
|
const myAgent = new MyAgent(this, 'MyAgent');
|
|
@@ -67,7 +67,7 @@ The generator transforms your agent's `agent.ts` to use the Gateway client:
|
|
|
67
67
|
|
|
68
68
|
```ts title="packages/example/src/my-agent/agent.ts" {2,5,8}
|
|
69
69
|
import { Agent } from '@strands-agents/sdk';
|
|
70
|
-
import { MyGatewayClientStrands } from '
|
|
70
|
+
import { MyGatewayClientStrands } from '@my-scope/agent-connection';
|
|
71
71
|
|
|
72
72
|
export const getAgent = async () => {
|
|
73
73
|
const myGateway = await MyGatewayClientStrands.create();
|
|
@@ -70,7 +70,7 @@ The generator transforms your agent's `agent.ts` to use the MCP server's tools:
|
|
|
70
70
|
|
|
71
71
|
```ts title="packages/example/src/my-agent/agent.ts" {2,5,8}
|
|
72
72
|
import { Agent, tool } from '@strands-agents/sdk';
|
|
73
|
-
import { MyMcpServerClientStrands } from '
|
|
73
|
+
import { MyMcpServerClientStrands } from '@my-scope/agent-connection';
|
|
74
74
|
|
|
75
75
|
export const getAgent = async (sessionId: string) => {
|
|
76
76
|
const myMcpServerClient = await MyMcpServerClientStrands.create(sessionId);
|