@frontmcp/nx 1.2.1 → 1.3.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.
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { Skill, SkillContext } from '@frontmcp/sdk';
|
|
2
2
|
|
|
3
|
+
// The class body is intentionally empty. Under `@Skill`, the runtime loads
|
|
4
|
+
// instructions (and resources) from the decorator metadata via `SkillInstance`,
|
|
5
|
+
// so `loadInstructions()` and `build()` on this class are never invoked.
|
|
6
|
+
// Override them only if you construct a SkillContext subclass manually outside
|
|
7
|
+
// the @Skill pipeline.
|
|
3
8
|
@Skill({
|
|
4
9
|
name: '<%= name %>',
|
|
5
|
-
description: 'TODO: describe what this skill does'
|
|
10
|
+
description: 'TODO: describe what this skill does',
|
|
11
|
+
instructions: 'TODO: define skill instructions',<% if (toolRefs.length > 0) { %>
|
|
6
12
|
tools: [<%- toolRefs.map(t => `'${t}'`).join(', ') %>],<% } %>
|
|
7
13
|
})
|
|
8
|
-
export default class <%= className %>Skill extends SkillContext {
|
|
9
|
-
async loadInstructions(): Promise<string> {
|
|
10
|
-
return 'TODO: define skill instructions';
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
async build(): Promise<void> {
|
|
14
|
-
// TODO: implement skill build logic
|
|
15
|
-
}
|
|
16
|
-
}
|
|
14
|
+
export default class <%= className %>Skill extends SkillContext {}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
2
|
-
|
|
1
|
+
import { Tool, ToolContext, ToolInputOf, ToolOutputOf, z } from '@frontmcp/sdk';
|
|
2
|
+
|
|
3
|
+
// Hoist only the schemas — the rest of the @Tool config (name, description,
|
|
4
|
+
// annotations, throttling, …) stays inside @Tool({…}) where it naturally
|
|
5
|
+
// lives. Changing a schema field automatically updates the derived TS types.
|
|
6
|
+
const inputSchema = {
|
|
7
|
+
value: z.string().describe('TODO: replace with actual input'),
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const outputSchema = {
|
|
11
|
+
result: z.string().describe('TODO: replace with actual output'),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type <%= className %>Input = ToolInputOf<{ inputSchema: typeof inputSchema }>;
|
|
15
|
+
export type <%= className %>Output = ToolOutputOf<{ outputSchema: typeof outputSchema }>;
|
|
3
16
|
|
|
4
17
|
@Tool({
|
|
5
18
|
name: '<%= name %>',
|
|
6
19
|
description: 'TODO: describe what this tool does',
|
|
7
|
-
inputSchema
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
outputSchema: {
|
|
11
|
-
result: z.string().describe('TODO: replace with actual output'),
|
|
12
|
-
},
|
|
20
|
+
inputSchema,
|
|
21
|
+
outputSchema,
|
|
13
22
|
})
|
|
14
23
|
export default class <%= className %>Tool extends ToolContext {
|
|
15
|
-
async execute(input:
|
|
24
|
+
async execute(input: <%= className %>Input): Promise<<%= className %>Output> {
|
|
16
25
|
// TODO: implement
|
|
17
26
|
return { result: input.value };
|
|
18
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/nx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Nx plugin for FrontMCP — generators and executors for building MCP servers",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://docs.agentfront.dev",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"node": ">=24.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@frontmcp/skills": "1.
|
|
36
|
+
"@frontmcp/skills": "1.3.0",
|
|
37
37
|
"@nx/devkit": "22.6.4",
|
|
38
38
|
"tslib": "^2.3.0"
|
|
39
39
|
},
|