@aws/nx-plugin 0.107.0 → 0.109.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE-THIRD-PARTY +2401 -175
- package/package.json +19 -8
- package/src/infra/app/__snapshots__/generator.spec.ts.snap +13 -13
- package/src/mcp-server/generator-info.d.ts +95 -13
- package/src/mcp-server/generator-info.js +319 -164
- package/src/mcp-server/generator-info.js.map +1 -1
- package/src/mcp-server/guide-pipeline.d.ts +28 -0
- package/src/mcp-server/guide-pipeline.js +393 -0
- package/src/mcp-server/guide-pipeline.js.map +1 -0
- package/src/mcp-server/guide-render.d.ts +25 -0
- package/src/mcp-server/guide-render.js +50 -0
- package/src/mcp-server/guide-render.js.map +1 -0
- package/src/mcp-server/mdx-ast.d.ts +30 -0
- package/src/mcp-server/mdx-ast.js +96 -0
- package/src/mcp-server/mdx-ast.js.map +1 -0
- package/src/mcp-server/option-filter.d.ts +33 -0
- package/src/mcp-server/option-filter.js +119 -0
- package/src/mcp-server/option-filter.js.map +1 -0
- package/src/mcp-server/schema-registry.d.ts +36 -0
- package/src/mcp-server/schema-registry.js +79 -0
- package/src/mcp-server/schema-registry.js.map +1 -0
- package/src/mcp-server/tools/generator-guide.d.ts +7 -1
- package/src/mcp-server/tools/generator-guide.js +32 -4
- package/src/mcp-server/tools/generator-guide.js.map +1 -1
- package/src/mcp-server/tools/list-generators.d.ts +10 -1
- package/src/mcp-server/tools/list-generators.js +34 -13
- package/src/mcp-server/tools/list-generators.js.map +1 -1
- package/src/preset/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/preset/schema.json +2 -2
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/py/strands-agent/__snapshots__/generator.spec.ts.snap +4 -4
- package/src/py/strands-agent/generator.js +95 -2
- package/src/py/strands-agent/generator.js.map +1 -1
- package/src/py/strands-agent/scripts/http/chat.ts.template +38 -0
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/nx-generator/__snapshots__/generator.spec.ts.snap +2 -0
- package/src/ts/nx-generator/files/nx-plugin-for-aws/docs/__nameKebabCase__.mdx.template +2 -0
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +27 -27
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.spec.ts.snap +12 -3
- package/src/ts/strands-agent/generator.js +31 -0
- package/src/ts/strands-agent/generator.js.map +1 -1
- package/src/ts/strands-agent/scripts/http/chat.ts.template +35 -0
- package/src/utils/files/common/shadcn/src/components/ui/avatar.tsx.template +60 -4
- package/src/utils/files/common/shadcn/src/components/ui/textarea.tsx.template +1 -1
- package/src/utils/generators.d.ts +1 -1
- package/src/utils/identity-constructs/files/cdk/core/user-identity.ts.template +13 -3
- package/src/utils/versions.d.ts +39 -38
- package/src/utils/versions.js +38 -37
- package/src/utils/versions.js.map +1 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.extractStringArrayExpression = exports.describePredicate = exports.evaluatePredicate = exports.parseWhenExpression = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Turn the `data.estree` of an `MdxJsxAttributeValueExpression` into a
|
|
10
|
+
* `Predicate`. The estree is a Program wrapping a single ObjectExpression.
|
|
11
|
+
*/
|
|
12
|
+
const parseWhenExpression = (estree) => {
|
|
13
|
+
const expression = unwrapProgram(estree);
|
|
14
|
+
if (expression.type !== 'ObjectExpression') {
|
|
15
|
+
throw new Error(`[option-filter] Expected object literal in 'when' prop, got ${expression.type}`);
|
|
16
|
+
}
|
|
17
|
+
const result = {};
|
|
18
|
+
for (const prop of expression.properties) {
|
|
19
|
+
if (prop.type !== 'Property') {
|
|
20
|
+
throw new Error(`[option-filter] Unsupported entry type '${prop.type}' in 'when' prop`);
|
|
21
|
+
}
|
|
22
|
+
result[extractKey(prop)] = extractValues(prop.value);
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
exports.parseWhenExpression = parseWhenExpression;
|
|
27
|
+
/**
|
|
28
|
+
* AND across keys, OR within a key's values, `not` negates. A key not
|
|
29
|
+
* present in `options` is "no opinion". A predicate whose keys have no
|
|
30
|
+
* intersection with `options` short-circuits to true.
|
|
31
|
+
*/
|
|
32
|
+
const evaluatePredicate = (predicate, not, options) => {
|
|
33
|
+
let matched = true;
|
|
34
|
+
let anyKeyTested = false;
|
|
35
|
+
for (const [key, values] of Object.entries(predicate)) {
|
|
36
|
+
const selected = options[key];
|
|
37
|
+
if (selected === undefined)
|
|
38
|
+
continue;
|
|
39
|
+
anyKeyTested = true;
|
|
40
|
+
if (!values.includes(selected)) {
|
|
41
|
+
matched = false;
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!anyKeyTested)
|
|
46
|
+
return true;
|
|
47
|
+
return not ? !matched : matched;
|
|
48
|
+
};
|
|
49
|
+
exports.evaluatePredicate = evaluatePredicate;
|
|
50
|
+
/** Short human label used on the docs pill and in the `> [!NOTE] Only when …` marker. */
|
|
51
|
+
const describePredicate = (predicate, not) => {
|
|
52
|
+
const parts = Object.entries(predicate).map(([k, vs]) => `${k} = ${vs.join(' | ')}`);
|
|
53
|
+
return `${not ? 'Not when ' : 'Only when '}${parts.join(', ')}`;
|
|
54
|
+
};
|
|
55
|
+
exports.describePredicate = describePredicate;
|
|
56
|
+
const unwrapProgram = (estree) => {
|
|
57
|
+
if (estree.type !== 'Program')
|
|
58
|
+
return estree;
|
|
59
|
+
const program = estree;
|
|
60
|
+
if (program.body.length !== 1)
|
|
61
|
+
return estree;
|
|
62
|
+
const stmt = program.body[0];
|
|
63
|
+
return stmt.type === 'ExpressionStatement'
|
|
64
|
+
? stmt.expression
|
|
65
|
+
: estree;
|
|
66
|
+
};
|
|
67
|
+
const extractKey = (prop) => {
|
|
68
|
+
const k = prop.key;
|
|
69
|
+
if (k.type === 'Identifier')
|
|
70
|
+
return k.name;
|
|
71
|
+
if (k.type === 'Literal' && typeof k.value === 'string')
|
|
72
|
+
return k.value;
|
|
73
|
+
throw new Error(`[option-filter] Unsupported key type '${k.type}' in 'when' prop`);
|
|
74
|
+
};
|
|
75
|
+
const extractValues = (value) => {
|
|
76
|
+
if (value.type === 'ArrayExpression') {
|
|
77
|
+
const arr = value;
|
|
78
|
+
return arr.elements.map((el) => {
|
|
79
|
+
if (el === null || el.type === 'SpreadElement') {
|
|
80
|
+
throw new Error(`[option-filter] Unsupported array element in 'when' prop`);
|
|
81
|
+
}
|
|
82
|
+
return extractScalar(el);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return [extractScalar(value)];
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Extract a `string[]` from the estree of an attribute-value expression
|
|
89
|
+
* like `{['a', 'b']}`. Used by JSX attribute readers (e.g. the
|
|
90
|
+
* `commands={[...]}` prop on <NxCommands>). Throws if anything other than
|
|
91
|
+
* string / number / boolean literal array elements are encountered.
|
|
92
|
+
*/
|
|
93
|
+
const extractStringArrayExpression = (estree) => {
|
|
94
|
+
const expression = unwrapProgram(estree);
|
|
95
|
+
if (expression.type !== 'ArrayExpression') {
|
|
96
|
+
throw new Error(`[option-filter] Expected array literal, got ${expression.type}`);
|
|
97
|
+
}
|
|
98
|
+
const arr = expression;
|
|
99
|
+
return arr.elements.map((el) => {
|
|
100
|
+
if (el === null || el.type === 'SpreadElement') {
|
|
101
|
+
throw new Error(`[option-filter] Unsupported array element`);
|
|
102
|
+
}
|
|
103
|
+
return extractScalar(el);
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
exports.extractStringArrayExpression = extractStringArrayExpression;
|
|
107
|
+
const extractScalar = (node) => {
|
|
108
|
+
if (node.type === 'Literal') {
|
|
109
|
+
const lit = node;
|
|
110
|
+
if (typeof lit.value === 'string' ||
|
|
111
|
+
typeof lit.value === 'number' ||
|
|
112
|
+
typeof lit.value === 'boolean') {
|
|
113
|
+
return String(lit.value);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
throw new Error(`[option-filter] Unsupported value type '${node.type}' in 'when' prop. ` +
|
|
117
|
+
'Use string, number, boolean literals or arrays of them.');
|
|
118
|
+
};
|
|
119
|
+
//# sourceMappingURL=option-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option-filter.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/mcp-server/option-filter.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAoBH;;;GAGG;AACI,MAAM,mBAAmB,GAAG,CAAC,MAAkB,EAAa,EAAE;IACnE,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,UAAU,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CACb,+DAA+D,UAAU,CAAC,IAAI,EAAE,CACjF,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAc,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,UAAU,EAAE,CAAC;QACzC,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CACb,2CAA2C,IAAI,CAAC,IAAI,kBAAkB,CACvE,CAAC;QACJ,CAAC;QACD,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACvD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAjBW,QAAA,mBAAmB,uBAiB9B;AAEF;;;;GAIG;AACI,MAAM,iBAAiB,GAAG,CAC/B,SAAoB,EACpB,GAAY,EACZ,OAA+B,EACtB,EAA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AAE;IAC3E,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACzC,IAAI,UAAU,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CACb,+CAA+C,UAAU,CAAC,IAAI,EAAE,CACjE,CAAC;IACJ,CAAC;IACD,MAAM,GAAG,GAAG,UAA6B,CAAC;IAC1C,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QAC7B,IAAI,EAAE,KAAK,IAAI,IAAI,EAAE,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;YAC/C,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAC/D,CAAC;QACD,OAAO,aAAa,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAdW,QAAA,4BAA4B,gCAcvC;AAEF,MAAM,aAAa,GAAG,CAAC,IAAgB,EAAU,EAAE;IACjD,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,IAAe,CAAC;QAC5B,IACE,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ;YAC7B,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ;YAC7B,OAAO,GAAG,CAAC,KAAK,KAAK,SAAS,EAC9B,CAAC;YACD,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CACb,2CAA2C,IAAI,CAAC,IAAI,oBAAoB;QACtE,yDAAyD,CAC5D,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** A JSON-schema property narrowed to the bits we care about. */
|
|
2
|
+
interface SchemaProperty {
|
|
3
|
+
type?: string;
|
|
4
|
+
enum?: unknown[];
|
|
5
|
+
default?: unknown;
|
|
6
|
+
description?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GeneratorSchema {
|
|
9
|
+
properties?: Record<string, SchemaProperty>;
|
|
10
|
+
required?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface FilterableOption {
|
|
13
|
+
key: string;
|
|
14
|
+
enum: string[];
|
|
15
|
+
default?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Pull out every enum-valued property as a `FilterableOption`. Shared between
|
|
20
|
+
* the MCP server (deriving options from a generator's schema) and the docs
|
|
21
|
+
* filter bar (mapping user-referenced keys onto their enum values).
|
|
22
|
+
*/
|
|
23
|
+
export declare const filterableOptionsFromSchema: (schema: GeneratorSchema | undefined) => FilterableOption[];
|
|
24
|
+
/**
|
|
25
|
+
* Locate the monorepo's `packages/nx-plugin/generators.json` by walking
|
|
26
|
+
* upward from the caller's directory. Used by the docs filter bar and
|
|
27
|
+
* remark-option-filter; the MCP server resolves schema paths per-generator
|
|
28
|
+
* via `NxGeneratorInfo.resolvedSchemaPath` instead.
|
|
29
|
+
*/
|
|
30
|
+
export declare const resolveGeneratorsJson: (fromDir: string) => string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a generator's schema path against a `generators.json` registry,
|
|
33
|
+
* parse the schema file, and cache the result per-process.
|
|
34
|
+
*/
|
|
35
|
+
export declare const createSchemaLookup: (generatorsJsonPath: string) => (generatorId: string) => GeneratorSchema;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSchemaLookup = exports.resolveGeneratorsJson = exports.filterableOptionsFromSchema = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/**
|
|
6
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
7
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
8
|
+
*/
|
|
9
|
+
const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
|
|
10
|
+
const node_path_1 = tslib_1.__importDefault(require("node:path"));
|
|
11
|
+
/**
|
|
12
|
+
* Pull out every enum-valued property as a `FilterableOption`. Shared between
|
|
13
|
+
* the MCP server (deriving options from a generator's schema) and the docs
|
|
14
|
+
* filter bar (mapping user-referenced keys onto their enum values).
|
|
15
|
+
*/
|
|
16
|
+
const filterableOptionsFromSchema = (schema) => {
|
|
17
|
+
const props = schema?.properties ?? {};
|
|
18
|
+
const out = [];
|
|
19
|
+
for (const [key, prop] of Object.entries(props)) {
|
|
20
|
+
if (!Array.isArray(prop.enum) || prop.enum.length === 0)
|
|
21
|
+
continue;
|
|
22
|
+
out.push({
|
|
23
|
+
key,
|
|
24
|
+
enum: prop.enum.map((v) => String(v)),
|
|
25
|
+
default: prop.default !== undefined ? String(prop.default) : undefined,
|
|
26
|
+
description: prop.description,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return out;
|
|
30
|
+
};
|
|
31
|
+
exports.filterableOptionsFromSchema = filterableOptionsFromSchema;
|
|
32
|
+
/**
|
|
33
|
+
* Locate the monorepo's `packages/nx-plugin/generators.json` by walking
|
|
34
|
+
* upward from the caller's directory. Used by the docs filter bar and
|
|
35
|
+
* remark-option-filter; the MCP server resolves schema paths per-generator
|
|
36
|
+
* via `NxGeneratorInfo.resolvedSchemaPath` instead.
|
|
37
|
+
*/
|
|
38
|
+
const resolveGeneratorsJson = (fromDir) => {
|
|
39
|
+
let dir = fromDir;
|
|
40
|
+
while (true) {
|
|
41
|
+
const candidate = node_path_1.default.join(dir, 'packages', 'nx-plugin', 'generators.json');
|
|
42
|
+
if (node_fs_1.default.existsSync(candidate))
|
|
43
|
+
return candidate;
|
|
44
|
+
const parent = node_path_1.default.dirname(dir);
|
|
45
|
+
if (parent === dir)
|
|
46
|
+
return undefined;
|
|
47
|
+
dir = parent;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
exports.resolveGeneratorsJson = resolveGeneratorsJson;
|
|
51
|
+
/**
|
|
52
|
+
* Resolve a generator's schema path against a `generators.json` registry,
|
|
53
|
+
* parse the schema file, and cache the result per-process.
|
|
54
|
+
*/
|
|
55
|
+
const createSchemaLookup = (generatorsJsonPath) => {
|
|
56
|
+
const packageDir = node_path_1.default.dirname(generatorsJsonPath);
|
|
57
|
+
let registry;
|
|
58
|
+
const cache = new Map();
|
|
59
|
+
const loadRegistry = () => {
|
|
60
|
+
if (!registry) {
|
|
61
|
+
registry = JSON.parse(node_fs_1.default.readFileSync(generatorsJsonPath, 'utf-8'));
|
|
62
|
+
}
|
|
63
|
+
return registry;
|
|
64
|
+
};
|
|
65
|
+
return (generatorId) => {
|
|
66
|
+
const cached = cache.get(generatorId);
|
|
67
|
+
if (cached)
|
|
68
|
+
return cached;
|
|
69
|
+
const entry = loadRegistry().generators[generatorId];
|
|
70
|
+
if (!entry) {
|
|
71
|
+
throw new Error(`Unknown generator id '${generatorId}'`);
|
|
72
|
+
}
|
|
73
|
+
const schema = JSON.parse(node_fs_1.default.readFileSync(node_path_1.default.resolve(packageDir, entry.schema), 'utf-8'));
|
|
74
|
+
cache.set(generatorId, schema);
|
|
75
|
+
return schema;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
exports.createSchemaLookup = createSchemaLookup;
|
|
79
|
+
//# sourceMappingURL=schema-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-registry.js","sourceRoot":"","sources":["../../../../../packages/nx-plugin/src/mcp-server/schema-registry.ts"],"names":[],"mappings":";;;;AAAA;;;GAGG;AACH,8DAAyB;AACzB,kEAA6B;AA0B7B;;;;GAIG;AACI,MAAM,2BAA2B,GAAG,CACzC,MAAmC,EACf,EAAE;IACtB,MAAM,KAAK,GAAG,MAAM,EAAE,UAAU,IAAI,EAAE,CAAC;IACvC,MAAM,GAAG,GAAuB,EAAE,CAAC;IACnC,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAA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,CAAC;IACpD,IAAI,QAAoC,CAAC;IACzC,MAAM,KAAK,GAAG,IAAI,GAAG,EAA2B,CAAC;IAEjD,MAAM,YAAY,GAAG,GAAmB,EAAE;QACxC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,IAAI,CAAC,KAAK,CACnB,iBAAE,CAAC,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAC3B,CAAC;QACtB,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,CAAC,WAAmB,EAAmB,EAAE;QAC9C,MAAM,MAAM,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACtC,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;QAC1B,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QACrD,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,yBAAyB,WAAW,GAAG,CAAC,CAAC;QAC3D,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CACvB,iBAAE,CAAC,YAAY,CAAC,mBAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAC9C,CAAC;QACrB,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC/B,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC,CAAC;AA3BW,QAAA,kBAAkB,sBA2B7B"}
|
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
6
|
import { NxGeneratorInfo } from '../../utils/generators';
|
|
7
7
|
/**
|
|
8
|
-
* Add a tool which provides a detailed guide for an individual generator
|
|
8
|
+
* Add a tool which provides a detailed guide for an individual generator.
|
|
9
|
+
*
|
|
10
|
+
* `fetchGuidePagesForGenerator` handles both the "narrow by `options`"
|
|
11
|
+
* case — reading each page's frontmatter `when:` to pick matching variants
|
|
12
|
+
* — and the "unsupported combination" case, where it returns an explicit
|
|
13
|
+
* warning instead of empty guide content. The tool description points
|
|
14
|
+
* agents at `list-generators` for the list of filterable options.
|
|
9
15
|
*/
|
|
10
16
|
export declare const addGeneratorGuideTool: (server: McpServer, generators: NxGeneratorInfo[]) => void;
|
|
@@ -5,20 +5,48 @@ const zod_1 = require("zod");
|
|
|
5
5
|
const generator_info_1 = require("../generator-info");
|
|
6
6
|
const schema_1 = require("../schema");
|
|
7
7
|
/**
|
|
8
|
-
* Add a tool which provides a detailed guide for an individual generator
|
|
8
|
+
* Add a tool which provides a detailed guide for an individual generator.
|
|
9
|
+
*
|
|
10
|
+
* `fetchGuidePagesForGenerator` handles both the "narrow by `options`"
|
|
11
|
+
* case — reading each page's frontmatter `when:` to pick matching variants
|
|
12
|
+
* — and the "unsupported combination" case, where it returns an explicit
|
|
13
|
+
* warning instead of empty guide content. The tool description points
|
|
14
|
+
* agents at `list-generators` for the list of filterable options.
|
|
9
15
|
*/
|
|
10
16
|
const addGeneratorGuideTool = (server, generators) => {
|
|
11
17
|
server.registerTool('generator-guide', {
|
|
12
|
-
description: 'Tool to retrieve detailed information about a specific generator.'
|
|
18
|
+
description: 'Tool to retrieve detailed information about a specific generator. ' +
|
|
19
|
+
'Pass `options` with the values you intend to use for any filterable option ' +
|
|
20
|
+
'(e.g. computeType, iacProvider, auth, uxProvider, protocol, sourceType, targetType) ' +
|
|
21
|
+
'to receive only the guide content relevant to those choices — this cuts noise ' +
|
|
22
|
+
'and avoids suggesting configuration from a different branch. The filterable keys ' +
|
|
23
|
+
'and their valid values for each generator are listed by the `list-generators` ' +
|
|
24
|
+
'tool; call it first if you are not sure which keys to pass. When the combination ' +
|
|
25
|
+
'you pick is not supported by the generator (e.g. connection from ts#trpc-api ' +
|
|
26
|
+
'to smithy), the tool returns an "Unsupported combination" warning with the ' +
|
|
27
|
+
'list of supported pairs. When `options` is omitted, every conditional section ' +
|
|
28
|
+
'is included and prefixed with a `> [!NOTE] Only when …` marker so you can see ' +
|
|
29
|
+
'the branching condition.',
|
|
13
30
|
inputSchema: {
|
|
14
31
|
packageManager: schema_1.PackageManagerSchema,
|
|
15
32
|
generator: zod_1.z.enum(generators.map((g) => g.id)),
|
|
33
|
+
options: zod_1.z
|
|
34
|
+
.record(zod_1.z.string(), zod_1.z.string())
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Optional map of generator option values (e.g. { computeType: "ServerlessApiGatewayRestApi", iacProvider: "CDK" }) used to filter the guide to content that applies to those choices.'),
|
|
16
37
|
},
|
|
17
|
-
}, async ({ packageManager, generator: generatorId }) => {
|
|
38
|
+
}, async ({ packageManager, generator: generatorId, options }) => {
|
|
18
39
|
const generator = generators.find((g) => g.id === generatorId);
|
|
19
40
|
if (!generator) {
|
|
20
41
|
throw new Error(`No generator found with id ${generatorId}. Available generators: ${generators.map((g) => g.id).join(' ,')}`);
|
|
21
42
|
}
|
|
43
|
+
const guide = await (0, generator_info_1.fetchGuidePagesForGenerator)(generator, generators, packageManager, undefined, options);
|
|
44
|
+
// An unsupported combination renders its own self-contained warning
|
|
45
|
+
// (leads with `## <id>` and lists the supported predicates), so
|
|
46
|
+
// return it directly without the usual guide header.
|
|
47
|
+
if (guide.kind === 'unsupported') {
|
|
48
|
+
return { content: [{ type: 'text', text: guide.content }] };
|
|
49
|
+
}
|
|
22
50
|
return {
|
|
23
51
|
content: [
|
|
24
52
|
{
|
|
@@ -27,7 +55,7 @@ const addGeneratorGuideTool = (server, generators) => {
|
|
|
27
55
|
|
|
28
56
|
# Guide
|
|
29
57
|
|
|
30
|
-
${
|
|
58
|
+
${guide.content}
|
|
31
59
|
`,
|
|
32
60
|
},
|
|
33
61
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator-guide.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/mcp-server/tools/generator-guide.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AACxB,sDAG2B;AAC3B,sCAAiD;AAEjD
|
|
1
|
+
{"version":3,"file":"generator-guide.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/mcp-server/tools/generator-guide.ts"],"names":[],"mappings":";;;AAMA,6BAAwB;AACxB,sDAG2B;AAC3B,sCAAiD;AAEjD;;;;;;;;GAQG;AACI,MAAM,qBAAqB,GAAG,CACnC,MAAiB,EACjB,UAA6B,EAC7B,EAAE;IACF,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,WAAW,EACT,oEAAoE;YACpE,6EAA6E;YAC7E,sFAAsF;YACtF,gFAAgF;YAChF,mFAAmF;YACnF,gFAAgF;YAChF,mFAAmF;YACnF,+EAA+E;YAC/E,6EAA6E;YAC7E,gFAAgF;YAChF,gFAAgF;YAChF,0BAA0B;QAC5B,WAAW,EAAE;YACX,cAAc,EAAE,6BAAoB;YACpC,SAAS,EAAE,OAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC9C,OAAO,EAAE,OAAC;iBACP,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC;iBAC9B,QAAQ,EAAE;iBACV,QAAQ,CACP,sLAAsL,CACvL;SACJ;KACF,EACD,KAAK,EAAE,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5D,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,WAAW,CAAC,CAAC;QAC/D,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CACb,8BAA8B,WAAW,2BAA2B,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC7G,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAA,4CAA2B,EAC7C,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,EACT,OAAO,CACR,CAAC;QAEF,oEAAoE;QACpE,gEAAgE;QAChE,qDAAqD;QACrD,IAAI,KAAK,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;YACjC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACvE,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,MAAM,IAAA,oCAAmB,EAAC,cAAc,EAAE,SAAS,CAAC;;;;EAIpE,KAAK,CAAC,OAAO;CACd;iBACU;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AArEW,QAAA,qBAAqB,yBAqEhC"}
|
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
6
|
import { NxGeneratorInfo } from '../../utils/generators';
|
|
7
7
|
/**
|
|
8
|
-
* Adds a tool which lists details about the available generators
|
|
8
|
+
* Adds a tool which lists details about the available generators.
|
|
9
|
+
*
|
|
10
|
+
* Each entry carries a "Filterable options" section that tells the agent
|
|
11
|
+
* which keys it can pass to `generator-guide` to narrow the guide response
|
|
12
|
+
* to only the branches relevant to its selection. The keys come from two
|
|
13
|
+
* sources, merged transparently:
|
|
14
|
+
* - Enum properties from the generator's JSON schema.
|
|
15
|
+
* - The union of `when:` frontmatter keys across the generator's guide
|
|
16
|
+
* pages (lets multi-variant generators like `connection` surface
|
|
17
|
+
* `sourceType` / `targetType` / `protocol` without any bespoke config).
|
|
9
18
|
*/
|
|
10
19
|
export declare const addListGeneratorsTool: (server: McpServer, generators: NxGeneratorInfo[]) => void;
|
|
@@ -4,23 +4,44 @@ exports.addListGeneratorsTool = void 0;
|
|
|
4
4
|
const schema_1 = require("../schema");
|
|
5
5
|
const generator_info_1 = require("../generator-info");
|
|
6
6
|
/**
|
|
7
|
-
* Adds a tool which lists details about the available generators
|
|
7
|
+
* Adds a tool which lists details about the available generators.
|
|
8
|
+
*
|
|
9
|
+
* Each entry carries a "Filterable options" section that tells the agent
|
|
10
|
+
* which keys it can pass to `generator-guide` to narrow the guide response
|
|
11
|
+
* to only the branches relevant to its selection. The keys come from two
|
|
12
|
+
* sources, merged transparently:
|
|
13
|
+
* - Enum properties from the generator's JSON schema.
|
|
14
|
+
* - The union of `when:` frontmatter keys across the generator's guide
|
|
15
|
+
* pages (lets multi-variant generators like `connection` surface
|
|
16
|
+
* `sourceType` / `targetType` / `protocol` without any bespoke config).
|
|
8
17
|
*/
|
|
9
18
|
const addListGeneratorsTool = (server, generators) => {
|
|
10
19
|
server.registerTool('list-generators', {
|
|
11
|
-
description: 'Tool to discover the available generators and how to run them.'
|
|
20
|
+
description: 'Tool to discover the available generators and how to run them. ' +
|
|
21
|
+
'Each entry includes a "Filterable options" section — pass those ' +
|
|
22
|
+
'keys to `generator-guide` before invoking a generator so the guide ' +
|
|
23
|
+
'is narrowed to the variant you intend to scaffold.',
|
|
12
24
|
inputSchema: { packageManager: schema_1.PackageManagerSchema },
|
|
13
|
-
}, ({ packageManager }) =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
}, async ({ packageManager }) => {
|
|
26
|
+
const entries = await Promise.all(generators.map(async (g) => {
|
|
27
|
+
const info = (0, generator_info_1.renderGeneratorInfo)(packageManager, g);
|
|
28
|
+
const filterable = await (0, generator_info_1.renderFilterableOptionsAsync)(g);
|
|
29
|
+
return `### ${info}${filterable ? `\n${filterable}\n` : ''}`;
|
|
30
|
+
}));
|
|
31
|
+
const guidance = 'Before running any generator below, call `generator-guide` with the ' +
|
|
32
|
+
"generator's id and `options` populated from its `generator-guide options` " +
|
|
33
|
+
'list — the guide is returned narrowed to the branches that apply to ' +
|
|
34
|
+
'those choices, which keeps you from mixing configuration from a ' +
|
|
35
|
+
'different variant.';
|
|
36
|
+
return {
|
|
37
|
+
content: [
|
|
38
|
+
{
|
|
39
|
+
type: 'text',
|
|
40
|
+
text: `## Available Generators\n\n${guidance}\n\n${entries.join('\n\n')}\n`,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
};
|
|
44
|
+
});
|
|
24
45
|
};
|
|
25
46
|
exports.addListGeneratorsTool = addListGeneratorsTool;
|
|
26
47
|
//# sourceMappingURL=list-generators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-generators.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/mcp-server/tools/list-generators.ts"],"names":[],"mappings":";;;AAKA,sCAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"list-generators.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/mcp-server/tools/list-generators.ts"],"names":[],"mappings":";;;AAKA,sCAAiD;AACjD,sDAG2B;AAG3B;;;;;;;;;;;GAWG;AACI,MAAM,qBAAqB,GAAG,CACnC,MAAiB,EACjB,UAA6B,EAC7B,EAAE;IACF,MAAM,CAAC,YAAY,CACjB,iBAAiB,EACjB;QACE,WAAW,EACT,iEAAiE;YACjE,kEAAkE;YAClE,qEAAqE;YACrE,oDAAoD;QACtD,WAAW,EAAE,EAAE,cAAc,EAAE,6BAAoB,EAAE;KACtD,EACD,KAAK,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE;QAC3B,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;YACzB,MAAM,IAAI,GAAG,IAAA,oCAAmB,EAAC,cAAc,EAAE,CAAC,CAAC,CAAC;YACpD,MAAM,UAAU,GAAG,MAAM,IAAA,6CAA4B,EAAC,CAAC,CAAC,CAAC;YACzD,OAAO,OAAO,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC/D,CAAC,CAAC,CACH,CAAC;QACF,MAAM,QAAQ,GACZ,sEAAsE;YACtE,4EAA4E;YAC5E,sEAAsE;YACtE,kEAAkE;YAClE,oBAAoB,CAAC;QACvB,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI,EAAE,8BAA8B,QAAQ,OAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI;iBAC5E;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC;AAtCW,QAAA,qBAAqB,yBAsChC"}
|
|
@@ -194,14 +194,14 @@ exports[`preset generator > should run successfully > package.json 1`] = `
|
|
|
194
194
|
"name": "@proj/source",
|
|
195
195
|
"dependencies": {},
|
|
196
196
|
"devDependencies": {
|
|
197
|
-
"@nx/js": "22.7.
|
|
198
|
-
"@nx/workspace": "22.7.
|
|
197
|
+
"@nx/js": "22.7.1",
|
|
198
|
+
"@nx/workspace": "22.7.1",
|
|
199
199
|
"@swc-node/register": "~1.11.1",
|
|
200
200
|
"@swc/core": "~1.15.5",
|
|
201
201
|
"@swc/helpers": "~0.5.18",
|
|
202
202
|
"prettier": "~3.6.2",
|
|
203
203
|
"typescript": "6.0.3",
|
|
204
|
-
"typescript-eslint": "8.59.
|
|
204
|
+
"typescript-eslint": "8.59.1"
|
|
205
205
|
},
|
|
206
206
|
"type": "module",
|
|
207
207
|
"scripts": {
|
package/src/preset/schema.json
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
"type": "string",
|
|
15
15
|
"description": "The preferred IaC provider.",
|
|
16
16
|
"enum": ["CDK", "Terraform"],
|
|
17
|
+
"default": "CDK",
|
|
17
18
|
"x-priority": "important",
|
|
18
19
|
"x-prompt": "Which provider would you like to manage your infrastructure?"
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
-
"required": ["iacProvider"]
|
|
21
|
+
}
|
|
22
22
|
}
|
|
@@ -727,12 +727,12 @@ version = "0.1.0"
|
|
|
727
727
|
dependencies = [
|
|
728
728
|
"aws-lambda-powertools==3.28.0",
|
|
729
729
|
"aws-opentelemetry-distro==0.17.0",
|
|
730
|
-
"bedrock-agentcore==1.
|
|
731
|
-
"boto3==1.
|
|
730
|
+
"bedrock-agentcore==1.8.0",
|
|
731
|
+
"boto3==1.43.1",
|
|
732
732
|
"fastapi==0.136.1",
|
|
733
733
|
"mcp==1.27.0",
|
|
734
|
-
"strands-agents==1.
|
|
735
|
-
"strands-agents-tools==0.5.
|
|
734
|
+
"strands-agents==1.38.0",
|
|
735
|
+
"strands-agents-tools==0.5.2",
|
|
736
736
|
"uvicorn==0.46.0"
|
|
737
737
|
]
|
|
738
738
|
|
|
@@ -6,6 +6,9 @@ exports.pyStrandsAgentGenerator = exports.PY_STRANDS_AGENT_GENERATOR_INFO = void
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
const devkit_1 = require("@nx/devkit");
|
|
9
|
+
const versions_1 = require("../../utils/versions");
|
|
10
|
+
const git_1 = require("../../utils/git");
|
|
11
|
+
const object_1 = require("../../utils/object");
|
|
9
12
|
const nx_1 = require("../../utils/nx");
|
|
10
13
|
const metrics_1 = require("../../utils/metrics");
|
|
11
14
|
const format_1 = require("../../utils/format");
|
|
@@ -130,10 +133,86 @@ const pyStrandsAgentGenerator = async (tree, options) => {
|
|
|
130
133
|
// - A2A: A2AServer.to_fastapi_app() creates a FastAPI app in main.py
|
|
131
134
|
// - AG-UI: create_strands_app() creates a FastAPI app in main.py
|
|
132
135
|
const serveCommand = `uv run fastapi dev ${moduleName}/${agentNameSnakeCase}/main.py --port ${localDevPort}`;
|
|
136
|
+
// HTTP chat uses the type-safe TypeScript client generated from the
|
|
137
|
+
// agent's OpenAPI spec (same generated client the react-connection
|
|
138
|
+
// generator produces). A2A and AG-UI speak standard protocols, so
|
|
139
|
+
// we can run `agent-chat-cli` directly as a binary.
|
|
140
|
+
const openApiTargetName = `${agentTargetPrefix}-openapi`;
|
|
141
|
+
const clientGenTargetName = `${agentTargetPrefix}-generate-client`;
|
|
142
|
+
if (protocol === 'HTTP') {
|
|
143
|
+
// Emit the OpenAPI spec generator script (shared with react-connection)
|
|
144
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'react-connection', 'files', 'agent'), project.root, {
|
|
145
|
+
moduleName,
|
|
146
|
+
agentNameSnakeCase,
|
|
147
|
+
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
148
|
+
// Emit the chat CLI adapter script
|
|
149
|
+
const scriptsDir = (0, devkit_1.joinPathFragments)(project.root, 'scripts', agentTargetPrefix);
|
|
150
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'scripts', 'http'), scriptsDir, {
|
|
151
|
+
agentNameClassName,
|
|
152
|
+
agentTargetPrefix,
|
|
153
|
+
localDevPort,
|
|
154
|
+
}, { overwriteStrategy: devkit_1.OverwriteStrategy.KeepExisting });
|
|
155
|
+
// Ignore the generated client directory
|
|
156
|
+
(0, git_1.updateGitIgnore)(tree, project.root, (patterns) => [
|
|
157
|
+
...patterns,
|
|
158
|
+
`scripts/${agentTargetPrefix}/generated/`,
|
|
159
|
+
]);
|
|
160
|
+
}
|
|
161
|
+
// Add TypeScript deps for the chat CLI. `agent-chat-cli` transitively
|
|
162
|
+
// bundles the protocol clients (@a2a-js/sdk, @ag-ui/client) and
|
|
163
|
+
// @clack/prompts, so nothing else is needed. HTTP also needs tsx to
|
|
164
|
+
// run the adapter script.
|
|
165
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, (0, versions_1.withVersions)([
|
|
166
|
+
'agent-chat-cli',
|
|
167
|
+
...(protocol === 'HTTP'
|
|
168
|
+
? ['tsx', '@types/node']
|
|
169
|
+
: []),
|
|
170
|
+
]));
|
|
171
|
+
const chatUrl = protocol === 'AG-UI'
|
|
172
|
+
? `http://localhost:${localDevPort}/invocations`
|
|
173
|
+
: `http://localhost:${localDevPort}`;
|
|
174
|
+
const chatCommand = protocol === 'HTTP'
|
|
175
|
+
? `tsx ./scripts/${agentTargetPrefix}/chat.ts`
|
|
176
|
+
: protocol === 'AG-UI'
|
|
177
|
+
? `agent-chat-cli agui ${chatUrl}`
|
|
178
|
+
: `agent-chat-cli a2a ${chatUrl}`;
|
|
179
|
+
const httpOnlyTargets = protocol === 'HTTP'
|
|
180
|
+
? {
|
|
181
|
+
[openApiTargetName]: {
|
|
182
|
+
cache: true,
|
|
183
|
+
executor: 'nx:run-commands',
|
|
184
|
+
outputs: [
|
|
185
|
+
`{workspaceRoot}/dist/{projectRoot}/openapi/${agentNameSnakeCase}`,
|
|
186
|
+
],
|
|
187
|
+
options: {
|
|
188
|
+
commands: [
|
|
189
|
+
`uv run python {projectRoot}/scripts/${agentNameSnakeCase}_openapi.py "dist/{projectRoot}/openapi/${agentNameSnakeCase}/openapi.json"`,
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
[clientGenTargetName]: {
|
|
194
|
+
cache: true,
|
|
195
|
+
executor: 'nx:run-commands',
|
|
196
|
+
inputs: [
|
|
197
|
+
{
|
|
198
|
+
dependentTasksOutputFiles: '**/*.json',
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
outputs: [`{projectRoot}/scripts/${agentTargetPrefix}/generated`],
|
|
202
|
+
options: {
|
|
203
|
+
commands: [
|
|
204
|
+
`nx g @aws/nx-plugin:open-api#ts-client --openApiSpecPath="dist/${project.root}/openapi/${agentNameSnakeCase}/openapi.json" --outputPath="${project.root}/scripts/${agentTargetPrefix}/generated" --no-interactive`,
|
|
205
|
+
],
|
|
206
|
+
},
|
|
207
|
+
dependsOn: [openApiTargetName],
|
|
208
|
+
},
|
|
209
|
+
}
|
|
210
|
+
: {};
|
|
133
211
|
(0, devkit_1.updateProjectConfiguration)(tree, project.name, {
|
|
134
212
|
...project,
|
|
135
|
-
targets: {
|
|
213
|
+
targets: (0, object_1.sortObjectKeys)({
|
|
136
214
|
...project.targets,
|
|
215
|
+
...httpOnlyTargets,
|
|
137
216
|
[`${agentTargetPrefix}-serve`]: {
|
|
138
217
|
executor: 'nx:run-commands',
|
|
139
218
|
options: {
|
|
@@ -157,7 +236,21 @@ const pyStrandsAgentGenerator = async (tree, options) => {
|
|
|
157
236
|
},
|
|
158
237
|
continuous: true,
|
|
159
238
|
},
|
|
160
|
-
|
|
239
|
+
[`${agentTargetPrefix}-chat`]: {
|
|
240
|
+
executor: 'nx:run-commands',
|
|
241
|
+
options: {
|
|
242
|
+
commands: [chatCommand],
|
|
243
|
+
cwd: '{projectRoot}',
|
|
244
|
+
env: {
|
|
245
|
+
URL: chatUrl,
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
dependsOn: [
|
|
249
|
+
...(protocol === 'HTTP' ? [clientGenTargetName] : []),
|
|
250
|
+
`${agentTargetPrefix}-serve-local`,
|
|
251
|
+
],
|
|
252
|
+
},
|
|
253
|
+
}),
|
|
161
254
|
});
|
|
162
255
|
(0, nx_1.addComponentGeneratorMetadata)(tree, project.name, exports.PY_STRANDS_AGENT_GENERATOR_INFO, (0, paths_1.toProjectRelativePath)(project, targetSourceDir), agentTargetPrefix, {
|
|
163
256
|
port: localDevPort,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/strands-agent/generator.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../../../packages/nx-plugin/src/py/strands-agent/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