@frontmcp/nx 0.0.1
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 +201 -0
- package/README.md +135 -0
- package/executors/build/build.impl.d.ts +5 -0
- package/executors/build/build.impl.js +27 -0
- package/executors/build/build.impl.js.map +1 -0
- package/executors/build/schema.d.ts +5 -0
- package/executors/build/schema.js +3 -0
- package/executors/build/schema.js.map +1 -0
- package/executors/build/schema.json +22 -0
- package/executors/build-exec/build-exec.impl.d.ts +5 -0
- package/executors/build-exec/build-exec.impl.js +25 -0
- package/executors/build-exec/build-exec.impl.js.map +1 -0
- package/executors/build-exec/schema.d.ts +4 -0
- package/executors/build-exec/schema.js +3 -0
- package/executors/build-exec/schema.js.map +1 -0
- package/executors/build-exec/schema.json +11 -0
- package/executors/deploy/deploy.impl.d.ts +5 -0
- package/executors/deploy/deploy.impl.js +33 -0
- package/executors/deploy/deploy.impl.js.map +1 -0
- package/executors/deploy/schema.d.ts +3 -0
- package/executors/deploy/schema.js +3 -0
- package/executors/deploy/schema.js.map +1 -0
- package/executors/deploy/schema.json +14 -0
- package/executors/dev/dev.impl.d.ts +6 -0
- package/executors/dev/dev.impl.js +30 -0
- package/executors/dev/dev.impl.js.map +1 -0
- package/executors/dev/schema.d.ts +4 -0
- package/executors/dev/schema.js +3 -0
- package/executors/dev/schema.js.map +1 -0
- package/executors/dev/schema.json +11 -0
- package/executors/executor-context.d.ts +19 -0
- package/executors/executor-context.js +3 -0
- package/executors/executor-context.js.map +1 -0
- package/executors/inspector/inspector.impl.d.ts +5 -0
- package/executors/inspector/inspector.impl.js +28 -0
- package/executors/inspector/inspector.impl.js.map +1 -0
- package/executors/inspector/schema.d.ts +3 -0
- package/executors/inspector/schema.js +3 -0
- package/executors/inspector/schema.js.map +1 -0
- package/executors/inspector/schema.json +10 -0
- package/executors/serve/schema.d.ts +5 -0
- package/executors/serve/schema.js +3 -0
- package/executors/serve/schema.js.map +1 -0
- package/executors/serve/schema.json +12 -0
- package/executors/serve/serve.impl.d.ts +5 -0
- package/executors/serve/serve.impl.js +34 -0
- package/executors/serve/serve.impl.js.map +1 -0
- package/executors/test/schema.d.ts +7 -0
- package/executors/test/schema.js +3 -0
- package/executors/test/schema.js.map +1 -0
- package/executors/test/schema.json +14 -0
- package/executors/test/test.impl.d.ts +5 -0
- package/executors/test/test.impl.js +31 -0
- package/executors/test/test.impl.js.map +1 -0
- package/executors.json +39 -0
- package/generators/adapter/adapter.d.ts +4 -0
- package/generators/adapter/adapter.js +18 -0
- package/generators/adapter/adapter.js.map +1 -0
- package/generators/adapter/files/__fileName__.adapter.ts__tmpl__ +20 -0
- package/generators/adapter/schema.d.ts +6 -0
- package/generators/adapter/schema.js +3 -0
- package/generators/adapter/schema.js.map +1 -0
- package/generators/adapter/schema.json +32 -0
- package/generators/agent/agent.d.ts +4 -0
- package/generators/agent/agent.js +27 -0
- package/generators/agent/agent.js.map +1 -0
- package/generators/agent/files/__fileName__.agent.ts__tmpl__ +17 -0
- package/generators/agent/schema.d.ts +8 -0
- package/generators/agent/schema.js +3 -0
- package/generators/agent/schema.js.map +1 -0
- package/generators/agent/schema.json +41 -0
- package/generators/app/app.d.ts +4 -0
- package/generators/app/app.js +21 -0
- package/generators/app/app.js.map +1 -0
- package/generators/app/files/jest.config.ts__tmpl__ +21 -0
- package/generators/app/files/project.json__tmpl__ +37 -0
- package/generators/app/files/src/__fileName__.app.ts__tmpl__ +9 -0
- package/generators/app/files/src/main.ts__tmpl__ +9 -0
- package/generators/app/files/src/tools/hello.tool.ts__tmpl__ +14 -0
- package/generators/app/files/tsconfig.json__tmpl__ +17 -0
- package/generators/app/files/tsconfig.lib.json__tmpl__ +11 -0
- package/generators/app/files/tsconfig.spec.json__tmpl__ +10 -0
- package/generators/app/lib/index.d.ts +2 -0
- package/generators/app/lib/index.js +6 -0
- package/generators/app/lib/index.js.map +1 -0
- package/generators/app/lib/normalize-options.d.ts +12 -0
- package/generators/app/lib/normalize-options.js +20 -0
- package/generators/app/lib/normalize-options.js.map +1 -0
- package/generators/app/schema.d.ts +6 -0
- package/generators/app/schema.js +3 -0
- package/generators/app/schema.js.map +1 -0
- package/generators/app/schema.json +33 -0
- package/generators/auth-provider/auth-provider.d.ts +4 -0
- package/generators/auth-provider/auth-provider.js +22 -0
- package/generators/auth-provider/auth-provider.js.map +1 -0
- package/generators/auth-provider/files/__fileName__.auth-provider.ts__tmpl__ +27 -0
- package/generators/auth-provider/schema.d.ts +7 -0
- package/generators/auth-provider/schema.js +3 -0
- package/generators/auth-provider/schema.js.map +1 -0
- package/generators/auth-provider/schema.json +50 -0
- package/generators/flow/files/__fileName__.flow.ts__tmpl__ +31 -0
- package/generators/flow/flow.d.ts +4 -0
- package/generators/flow/flow.js +18 -0
- package/generators/flow/flow.js.map +1 -0
- package/generators/flow/schema.d.ts +6 -0
- package/generators/flow/schema.js +3 -0
- package/generators/flow/schema.js.map +1 -0
- package/generators/flow/schema.json +32 -0
- package/generators/job/files/__fileName__.job.ts__tmpl__ +19 -0
- package/generators/job/job.d.ts +4 -0
- package/generators/job/job.js +18 -0
- package/generators/job/job.js.map +1 -0
- package/generators/job/schema.d.ts +6 -0
- package/generators/job/schema.js +3 -0
- package/generators/job/schema.js.map +1 -0
- package/generators/job/schema.json +32 -0
- package/generators/lib/files/adapter/src/__fileName__.adapter.ts__tmpl__ +19 -0
- package/generators/lib/files/adapter/src/index.ts__tmpl__ +1 -0
- package/generators/lib/files/generic/src/__fileName__.ts__tmpl__ +5 -0
- package/generators/lib/files/generic/src/index.ts__tmpl__ +1 -0
- package/generators/lib/files/plugin/src/__fileName__.plugin.ts__tmpl__ +19 -0
- package/generators/lib/files/plugin/src/index.ts__tmpl__ +1 -0
- package/generators/lib/files/tool-register/src/__fileName__.tools.ts__tmpl__ +20 -0
- package/generators/lib/files/tool-register/src/index.ts__tmpl__ +1 -0
- package/generators/lib/lib/index.d.ts +2 -0
- package/generators/lib/lib/index.js +6 -0
- package/generators/lib/lib/index.js.map +1 -0
- package/generators/lib/lib/normalize-options.d.ts +15 -0
- package/generators/lib/lib/normalize-options.js +31 -0
- package/generators/lib/lib/normalize-options.js.map +1 -0
- package/generators/lib/lib.d.ts +4 -0
- package/generators/lib/lib.js +37 -0
- package/generators/lib/lib.js.map +1 -0
- package/generators/lib/schema.d.ts +9 -0
- package/generators/lib/schema.js +3 -0
- package/generators/lib/schema.js.map +1 -0
- package/generators/lib/schema.json +59 -0
- package/generators/plugin/files/__fileName__.context-extension.ts__tmpl__ +33 -0
- package/generators/plugin/files/__fileName__.plugin.ts__tmpl__ +19 -0
- package/generators/plugin/plugin.d.ts +4 -0
- package/generators/plugin/plugin.js +29 -0
- package/generators/plugin/plugin.js.map +1 -0
- package/generators/plugin/schema.d.ts +7 -0
- package/generators/plugin/schema.js +3 -0
- package/generators/plugin/schema.js.map +1 -0
- package/generators/plugin/schema.json +37 -0
- package/generators/prompt/files/__fileName__.prompt.ts__tmpl__ +25 -0
- package/generators/prompt/prompt.d.ts +4 -0
- package/generators/prompt/prompt.js +25 -0
- package/generators/prompt/prompt.js.map +1 -0
- package/generators/prompt/schema.d.ts +7 -0
- package/generators/prompt/schema.js +3 -0
- package/generators/prompt/schema.js.map +1 -0
- package/generators/prompt/schema.json +36 -0
- package/generators/provider/files/__fileName__.provider.ts__tmpl__ +15 -0
- package/generators/provider/provider.d.ts +4 -0
- package/generators/provider/provider.js +22 -0
- package/generators/provider/provider.js.map +1 -0
- package/generators/provider/schema.d.ts +7 -0
- package/generators/provider/schema.js +3 -0
- package/generators/provider/schema.js.map +1 -0
- package/generators/provider/schema.json +38 -0
- package/generators/resource/files/__fileName__.resource.ts__tmpl__ +43 -0
- package/generators/resource/resource.d.ts +4 -0
- package/generators/resource/resource.js +20 -0
- package/generators/resource/resource.js.map +1 -0
- package/generators/resource/schema.d.ts +7 -0
- package/generators/resource/schema.js +3 -0
- package/generators/resource/schema.js.map +1 -0
- package/generators/resource/schema.json +37 -0
- package/generators/server/files/cloudflare/wrangler.toml__tmpl__ +6 -0
- package/generators/server/files/common/project.json__tmpl__ +25 -0
- package/generators/server/files/common/src/main.ts__tmpl__ +9 -0
- package/generators/server/files/common/tsconfig.json__tmpl__ +14 -0
- package/generators/server/files/common/tsconfig.lib.json__tmpl__ +11 -0
- package/generators/server/files/lambda/template.yaml__tmpl__ +27 -0
- package/generators/server/files/node/Dockerfile__tmpl__ +17 -0
- package/generators/server/files/node/__dot__dockerignore__tmpl__ +8 -0
- package/generators/server/files/node/docker-compose.yml__tmpl__ +28 -0
- package/generators/server/files/vercel/vercel.json__tmpl__ +15 -0
- package/generators/server/lib/index.d.ts +2 -0
- package/generators/server/lib/index.js +6 -0
- package/generators/server/lib/index.js.map +1 -0
- package/generators/server/lib/normalize-options.d.ts +14 -0
- package/generators/server/lib/normalize-options.js +25 -0
- package/generators/server/lib/normalize-options.js.map +1 -0
- package/generators/server/schema.d.ts +9 -0
- package/generators/server/schema.js +3 -0
- package/generators/server/schema.js.map +1 -0
- package/generators/server/schema.json +62 -0
- package/generators/server/server.d.ts +4 -0
- package/generators/server/server.js +28 -0
- package/generators/server/server.js.map +1 -0
- package/generators/skill/files/__fileName__.skill.ts__tmpl__ +16 -0
- package/generators/skill/schema.d.ts +7 -0
- package/generators/skill/schema.js +3 -0
- package/generators/skill/schema.js.map +1 -0
- package/generators/skill/schema.json +36 -0
- package/generators/skill/skill.d.ts +4 -0
- package/generators/skill/skill.js +25 -0
- package/generators/skill/skill.js.map +1 -0
- package/generators/tool/files/__fileName__.tool.ts__tmpl__ +19 -0
- package/generators/tool/schema.d.ts +6 -0
- package/generators/tool/schema.js +3 -0
- package/generators/tool/schema.js.map +1 -0
- package/generators/tool/schema.json +32 -0
- package/generators/tool/tool.d.ts +4 -0
- package/generators/tool/tool.js +18 -0
- package/generators/tool/tool.js.map +1 -0
- package/generators/workflow/files/__fileName__.workflow.ts__tmpl__ +23 -0
- package/generators/workflow/schema.d.ts +6 -0
- package/generators/workflow/schema.js +3 -0
- package/generators/workflow/schema.js.map +1 -0
- package/generators/workflow/schema.json +32 -0
- package/generators/workflow/workflow.d.ts +4 -0
- package/generators/workflow/workflow.js +18 -0
- package/generators/workflow/workflow.js.map +1 -0
- package/generators/workspace/files/__dot__gitignore__tmpl__ +28 -0
- package/generators/workspace/files/__dot__prettierrc__tmpl__ +6 -0
- package/generators/workspace/files/nx.json__tmpl__ +52 -0
- package/generators/workspace/files/package.json__tmpl__ +46 -0
- package/generators/workspace/files/tsconfig.base.json__tmpl__ +24 -0
- package/generators/workspace/lib/index.d.ts +2 -0
- package/generators/workspace/lib/index.js +6 -0
- package/generators/workspace/lib/index.js.map +1 -0
- package/generators/workspace/lib/normalize-options.d.ts +5 -0
- package/generators/workspace/lib/normalize-options.js +14 -0
- package/generators/workspace/lib/normalize-options.js.map +1 -0
- package/generators/workspace/schema.d.ts +7 -0
- package/generators/workspace/schema.js +3 -0
- package/generators/workspace/schema.js.map +1 -0
- package/generators/workspace/schema.json +42 -0
- package/generators/workspace/workspace.d.ts +4 -0
- package/generators/workspace/workspace.js +47 -0
- package/generators/workspace/workspace.js.map +1 -0
- package/generators.json +84 -0
- package/index.d.ts +16 -0
- package/index.js +44 -0
- package/index.js.map +1 -0
- package/package.json +24 -0
- package/utils/add-dependencies.d.ts +2 -0
- package/utils/add-dependencies.js +8 -0
- package/utils/add-dependencies.js.map +1 -0
- package/utils/names.d.ts +5 -0
- package/utils/names.js +27 -0
- package/utils/names.js.map +1 -0
- package/utils/normalize-options.d.ts +16 -0
- package/utils/normalize-options.js +30 -0
- package/utils/normalize-options.js.map +1 -0
- package/utils/versions.d.ts +5 -0
- package/utils/versions.js +65 -0
- package/utils/versions.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../../src/generators/resource/resource.ts"],"names":[],"mappings":";;AAKA,8CAgBC;AArBD,uCAA2F;AAC3F,+BAA4B;AAE5B,2EAA6E;AAEtE,KAAK,UAAU,iBAAiB,CACrC,IAAU,EACV,MAA+B;IAE/B,MAAM,OAAO,GAAG,IAAA,gDAAyB,EAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IACrE,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC;IAE5C,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE;QAC/D,GAAG,OAAO;QACV,UAAU;QACV,IAAI,EAAE,EAAE;KACT,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,kBAAe,iBAAiB,CAAC","sourcesContent":["import { type Tree, formatFiles, generateFiles, type GeneratorCallback } from '@nx/devkit';\nimport { join } from 'path';\nimport type { ResourceGeneratorSchema } from './schema.js';\nimport { normalizePrimitiveOptions } from '../../utils/normalize-options.js';\n\nexport async function resourceGenerator(\n tree: Tree,\n schema: ResourceGeneratorSchema,\n): Promise<GeneratorCallback | void> {\n const options = normalizePrimitiveOptions(tree, schema, 'resources');\n const isTemplate = schema.template ?? false;\n\n generateFiles(tree, join(__dirname, 'files'), options.directory, {\n ...options,\n isTemplate,\n tmpl: '',\n });\n\n if (!schema.skipFormat) {\n await formatFiles(tree);\n }\n}\n\nexport default resourceGenerator;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/generators/resource/schema.ts"],"names":[],"mappings":"","sourcesContent":["export interface ResourceGeneratorSchema {\n name: string;\n project: string;\n template?: boolean;\n directory?: string;\n skipFormat?: boolean;\n}\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "FrontMcpResource",
|
|
4
|
+
"title": "FrontMCP Resource Generator",
|
|
5
|
+
"description": "Generate a @Resource or @ResourceTemplate class",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The name of the resource",
|
|
11
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
12
|
+
"x-prompt": "What name would you like for the resource?",
|
|
13
|
+
"x-priority": "important"
|
|
14
|
+
},
|
|
15
|
+
"project": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The project to add the resource to",
|
|
18
|
+
"x-dropdown": "projects",
|
|
19
|
+
"x-priority": "important"
|
|
20
|
+
},
|
|
21
|
+
"template": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Generate a @ResourceTemplate with URI template params",
|
|
24
|
+
"default": false
|
|
25
|
+
},
|
|
26
|
+
"directory": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Subdirectory within src/resources/"
|
|
29
|
+
},
|
|
30
|
+
"skipFormat": {
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"default": false,
|
|
33
|
+
"x-priority": "internal"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"required": ["name", "project"]
|
|
37
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= projectName %>",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "<%= projectRoot %>/src",
|
|
5
|
+
"projectType": "application",
|
|
6
|
+
"tags": [<%- parsedTags.map(t => `"${t}"`).join(', ') %>],
|
|
7
|
+
"targets": {
|
|
8
|
+
"build": {
|
|
9
|
+
"executor": "@frontmcp/nx:build",
|
|
10
|
+
"outputs": ["{projectRoot}/dist"],
|
|
11
|
+
"options": {
|
|
12
|
+
"entry": "{projectRoot}/src/main.ts",
|
|
13
|
+
"outputPath": "{projectRoot}/dist",
|
|
14
|
+
"adapter": "<%= deploymentTarget %>"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"deploy": {
|
|
18
|
+
"executor": "@frontmcp/nx:deploy",
|
|
19
|
+
"dependsOn": ["build"],
|
|
20
|
+
"options": {
|
|
21
|
+
"target": "<%= deploymentTarget %>"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
import { FrontMcp } from '@frontmcp/sdk';
|
|
3
|
+
<% appNames.forEach(function(appName) { %>import { <%= names(appName).className %>App } from '../../apps/<%= names(appName).fileName %>/<%= names(appName).fileName %>.app';
|
|
4
|
+
<% }); %>
|
|
5
|
+
@FrontMcp({
|
|
6
|
+
info: { name: '<%= className %> Server', version: '0.1.0' },
|
|
7
|
+
apps: [<%- appNames.map(a => names(a).className + 'App').join(', ') %>],
|
|
8
|
+
})
|
|
9
|
+
export default class Server {}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"emitDecoratorMetadata": true,
|
|
7
|
+
"experimentalDecorators": true
|
|
8
|
+
},
|
|
9
|
+
"files": [],
|
|
10
|
+
"include": [],
|
|
11
|
+
"references": [
|
|
12
|
+
{ "path": "./tsconfig.lib.json" }
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
AWSTemplateFormatVersion: '2010-09-09'
|
|
2
|
+
Transform: AWS::Serverless-2016-10-31
|
|
3
|
+
Description: '<%= className %> FrontMCP Server'
|
|
4
|
+
|
|
5
|
+
Globals:
|
|
6
|
+
Function:
|
|
7
|
+
Timeout: 30
|
|
8
|
+
Runtime: nodejs22.x
|
|
9
|
+
MemorySize: 256
|
|
10
|
+
|
|
11
|
+
Resources:
|
|
12
|
+
McpFunction:
|
|
13
|
+
Type: AWS::Serverless::Function
|
|
14
|
+
Properties:
|
|
15
|
+
CodeUri: dist/
|
|
16
|
+
Handler: main.handler
|
|
17
|
+
Events:
|
|
18
|
+
Api:
|
|
19
|
+
Type: HttpApi
|
|
20
|
+
Properties:
|
|
21
|
+
Path: /{proxy+}
|
|
22
|
+
Method: ANY
|
|
23
|
+
|
|
24
|
+
Outputs:
|
|
25
|
+
ApiUrl:
|
|
26
|
+
Description: 'API Gateway URL'
|
|
27
|
+
Value: !Sub 'https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
FROM node:24-slim AS builder
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
COPY package*.json ./
|
|
4
|
+
RUN npm ci --ignore-scripts
|
|
5
|
+
COPY . .
|
|
6
|
+
RUN npx nx build <%= projectName %>
|
|
7
|
+
|
|
8
|
+
FROM node:24-slim AS runner
|
|
9
|
+
WORKDIR /app
|
|
10
|
+
ENV NODE_ENV=production
|
|
11
|
+
RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser
|
|
12
|
+
COPY --from=builder /app/<%= projectRoot %>/dist ./dist
|
|
13
|
+
COPY --from=builder /app/package.json /app/package-lock.json* ./
|
|
14
|
+
RUN npm ci --omit=dev --ignore-scripts
|
|
15
|
+
USER appuser
|
|
16
|
+
EXPOSE 3000
|
|
17
|
+
CMD ["node", "dist/main.js"]
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
version: '3.8'
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
app:
|
|
5
|
+
build:
|
|
6
|
+
context: ../..
|
|
7
|
+
dockerfile: <%= projectRoot %>/Dockerfile
|
|
8
|
+
ports:
|
|
9
|
+
- '3000:3000'
|
|
10
|
+
environment:
|
|
11
|
+
- NODE_ENV=production
|
|
12
|
+
<% if (redis === 'docker') { %>
|
|
13
|
+
- REDIS_HOST=redis
|
|
14
|
+
- REDIS_PORT=6379
|
|
15
|
+
depends_on:
|
|
16
|
+
redis:
|
|
17
|
+
condition: service_healthy
|
|
18
|
+
|
|
19
|
+
redis:
|
|
20
|
+
image: redis:7-alpine
|
|
21
|
+
ports:
|
|
22
|
+
- '6379:6379'
|
|
23
|
+
healthcheck:
|
|
24
|
+
test: ['CMD', 'redis-cli', 'ping']
|
|
25
|
+
interval: 10s
|
|
26
|
+
timeout: 5s
|
|
27
|
+
retries: 3
|
|
28
|
+
<% } %>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = void 0;
|
|
4
|
+
var normalize_options_js_1 = require("./normalize-options.js");
|
|
5
|
+
Object.defineProperty(exports, "normalizeOptions", { enumerable: true, get: function () { return normalize_options_js_1.normalizeOptions; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/generators/server/lib/index.ts"],"names":[],"mappings":";;;AAAA,+DAA0D;AAAjD,wHAAA,gBAAgB,OAAA","sourcesContent":["export { normalizeOptions } from './normalize-options.js';\nexport type { NormalizedServerOptions } from './normalize-options.js';\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ServerGeneratorSchema } from '../schema.js';
|
|
2
|
+
export interface NormalizedServerOptions {
|
|
3
|
+
name: string;
|
|
4
|
+
projectName: string;
|
|
5
|
+
projectRoot: string;
|
|
6
|
+
className: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
deploymentTarget: 'node' | 'vercel' | 'lambda' | 'cloudflare';
|
|
9
|
+
appNames: string[];
|
|
10
|
+
redis: 'docker' | 'existing' | 'none';
|
|
11
|
+
parsedTags: string[];
|
|
12
|
+
skipFormat: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function normalizeOptions(schema: ServerGeneratorSchema): NormalizedServerOptions;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeOptions = normalizeOptions;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function normalizeOptions(schema) {
|
|
6
|
+
const { className, fileName } = (0, devkit_1.names)(schema.name);
|
|
7
|
+
const projectRoot = schema.directory ?? (0, devkit_1.joinPathFragments)('servers', fileName);
|
|
8
|
+
const parsedTags = schema.tags
|
|
9
|
+
? schema.tags.split(',').map((t) => t.trim())
|
|
10
|
+
: ['scope:servers'];
|
|
11
|
+
const appNames = schema.apps.split(',').map((a) => a.trim()).filter(Boolean);
|
|
12
|
+
return {
|
|
13
|
+
name: schema.name,
|
|
14
|
+
projectName: `server-${fileName}`,
|
|
15
|
+
projectRoot,
|
|
16
|
+
className,
|
|
17
|
+
fileName,
|
|
18
|
+
deploymentTarget: schema.deploymentTarget ?? 'node',
|
|
19
|
+
appNames,
|
|
20
|
+
redis: schema.redis ?? 'none',
|
|
21
|
+
parsedTags,
|
|
22
|
+
skipFormat: schema.skipFormat ?? false,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../src/generators/server/lib/normalize-options.ts"],"names":[],"mappings":";;AAgBA,4CAqBC;AArCD,uCAAsD;AAgBtD,SAAgB,gBAAgB,CAAC,MAA6B;IAC5D,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAA,cAAK,EAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,IAAI,IAAA,0BAAiB,EAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC/E,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI;QAC5B,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7C,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;IAEtB,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAE7E,OAAO;QACL,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,WAAW,EAAE,UAAU,QAAQ,EAAE;QACjC,WAAW;QACX,SAAS;QACT,QAAQ;QACR,gBAAgB,EAAE,MAAM,CAAC,gBAAgB,IAAI,MAAM;QACnD,QAAQ;QACR,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,MAAM;QAC7B,UAAU;QACV,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,KAAK;KACvC,CAAC;AACJ,CAAC","sourcesContent":["import { names, joinPathFragments } from '@nx/devkit';\nimport type { ServerGeneratorSchema } from '../schema.js';\n\nexport interface NormalizedServerOptions {\n name: string;\n projectName: string;\n projectRoot: string;\n className: string;\n fileName: string;\n deploymentTarget: 'node' | 'vercel' | 'lambda' | 'cloudflare';\n appNames: string[];\n redis: 'docker' | 'existing' | 'none';\n parsedTags: string[];\n skipFormat: boolean;\n}\n\nexport function normalizeOptions(schema: ServerGeneratorSchema): NormalizedServerOptions {\n const { className, fileName } = names(schema.name);\n const projectRoot = schema.directory ?? joinPathFragments('servers', fileName);\n const parsedTags = schema.tags\n ? schema.tags.split(',').map((t) => t.trim())\n : ['scope:servers'];\n\n const appNames = schema.apps.split(',').map((a) => a.trim()).filter(Boolean);\n\n return {\n name: schema.name,\n projectName: `server-${fileName}`,\n projectRoot,\n className,\n fileName,\n deploymentTarget: schema.deploymentTarget ?? 'node',\n appNames,\n redis: schema.redis ?? 'none',\n parsedTags,\n skipFormat: schema.skipFormat ?? false,\n };\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/generators/server/schema.ts"],"names":[],"mappings":"","sourcesContent":["export interface ServerGeneratorSchema {\n name: string;\n directory?: string;\n deploymentTarget?: 'node' | 'vercel' | 'lambda' | 'cloudflare';\n apps: string;\n redis?: 'docker' | 'existing' | 'none';\n tags?: string;\n skipFormat?: boolean;\n}\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "FrontMcpServer",
|
|
4
|
+
"title": "FrontMCP Server Generator",
|
|
5
|
+
"description": "Generate a deployment shell",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The name of the server deployment shell",
|
|
11
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
12
|
+
"x-prompt": "What name would you like for the server?",
|
|
13
|
+
"x-priority": "important"
|
|
14
|
+
},
|
|
15
|
+
"directory": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The directory of the server (default: servers/<name>)",
|
|
18
|
+
"x-priority": "important"
|
|
19
|
+
},
|
|
20
|
+
"deploymentTarget": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The deployment target platform",
|
|
23
|
+
"enum": ["node", "vercel", "lambda", "cloudflare"],
|
|
24
|
+
"default": "node",
|
|
25
|
+
"x-prompt": {
|
|
26
|
+
"message": "Which deployment target?",
|
|
27
|
+
"type": "list",
|
|
28
|
+
"items": [
|
|
29
|
+
{ "value": "node", "label": "Node.js (Docker)" },
|
|
30
|
+
{ "value": "vercel", "label": "Vercel" },
|
|
31
|
+
{ "value": "lambda", "label": "AWS Lambda (SAM)" },
|
|
32
|
+
{ "value": "cloudflare", "label": "Cloudflare Workers" }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
"x-priority": "important"
|
|
36
|
+
},
|
|
37
|
+
"apps": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Comma-separated app names to compose in this server",
|
|
40
|
+
"x-prompt": "Which apps should this server compose? (comma-separated)",
|
|
41
|
+
"x-priority": "important"
|
|
42
|
+
},
|
|
43
|
+
"redis": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Redis setup option (node target only)",
|
|
46
|
+
"enum": ["docker", "existing", "none"],
|
|
47
|
+
"default": "none"
|
|
48
|
+
},
|
|
49
|
+
"tags": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Comma-separated tags",
|
|
52
|
+
"x-priority": "internal"
|
|
53
|
+
},
|
|
54
|
+
"skipFormat": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"description": "Skip formatting files",
|
|
57
|
+
"default": false,
|
|
58
|
+
"x-priority": "internal"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"required": ["name", "apps"]
|
|
62
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Tree, type GeneratorCallback } from '@nx/devkit';
|
|
2
|
+
import type { ServerGeneratorSchema } from './schema.js';
|
|
3
|
+
export declare function serverGenerator(tree: Tree, schema: ServerGeneratorSchema): Promise<GeneratorCallback | void>;
|
|
4
|
+
export default serverGenerator;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.serverGenerator = serverGenerator;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const index_js_1 = require("./lib/index.js");
|
|
7
|
+
async function serverGenerator(tree, schema) {
|
|
8
|
+
return serverGeneratorInternal(tree, schema);
|
|
9
|
+
}
|
|
10
|
+
async function serverGeneratorInternal(tree, schema) {
|
|
11
|
+
const options = (0, index_js_1.normalizeOptions)(schema);
|
|
12
|
+
const templateVars = {
|
|
13
|
+
...options,
|
|
14
|
+
names: devkit_1.names,
|
|
15
|
+
tmpl: '',
|
|
16
|
+
dot: '.',
|
|
17
|
+
};
|
|
18
|
+
// Generate common files (main.ts, project.json, tsconfig)
|
|
19
|
+
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files', 'common'), options.projectRoot, templateVars);
|
|
20
|
+
// Generate target-specific files
|
|
21
|
+
const targetDir = (0, path_1.join)(__dirname, 'files', options.deploymentTarget);
|
|
22
|
+
(0, devkit_1.generateFiles)(tree, targetDir, options.projectRoot, templateVars);
|
|
23
|
+
if (!options.skipFormat) {
|
|
24
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = serverGenerator;
|
|
28
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../src/generators/server/server.ts"],"names":[],"mappings":";;AAKA,0CAEC;AAPD,uCAA6G;AAC7G,+BAA4B;AAE5B,6CAAkD;AAE3C,KAAK,UAAU,eAAe,CAAC,IAAU,EAAE,MAA6B;IAC7E,OAAO,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,KAAK,UAAU,uBAAuB,CAAC,IAAU,EAAE,MAA6B;IAC9E,MAAM,OAAO,GAAG,IAAA,2BAAgB,EAAC,MAAM,CAAC,CAAC;IAEzC,MAAM,YAAY,GAAG;QACnB,GAAG,OAAO;QACV,KAAK,EAAE,cAAO;QACd,IAAI,EAAE,EAAE;QACR,GAAG,EAAE,GAAG;KACT,CAAC;IAEF,0DAA0D;IAC1D,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAE3F,iCAAiC;IACjC,MAAM,SAAS,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACrE,IAAA,sBAAa,EAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAElE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,kBAAe,eAAe,CAAC","sourcesContent":["import { type Tree, formatFiles, generateFiles, names as nxNames, type GeneratorCallback } from '@nx/devkit';\nimport { join } from 'path';\nimport type { ServerGeneratorSchema } from './schema.js';\nimport { normalizeOptions } from './lib/index.js';\n\nexport async function serverGenerator(tree: Tree, schema: ServerGeneratorSchema): Promise<GeneratorCallback | void> {\n return serverGeneratorInternal(tree, schema);\n}\n\nasync function serverGeneratorInternal(tree: Tree, schema: ServerGeneratorSchema): Promise<GeneratorCallback | void> {\n const options = normalizeOptions(schema);\n\n const templateVars = {\n ...options,\n names: nxNames,\n tmpl: '',\n dot: '.',\n };\n\n // Generate common files (main.ts, project.json, tsconfig)\n generateFiles(tree, join(__dirname, 'files', 'common'), options.projectRoot, templateVars);\n\n // Generate target-specific files\n const targetDir = join(__dirname, 'files', options.deploymentTarget);\n generateFiles(tree, targetDir, options.projectRoot, templateVars);\n\n if (!options.skipFormat) {\n await formatFiles(tree);\n }\n}\n\nexport default serverGenerator;\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Skill, SkillContext } from '@frontmcp/sdk';
|
|
2
|
+
|
|
3
|
+
@Skill({
|
|
4
|
+
name: '<%= name %>',
|
|
5
|
+
description: 'TODO: describe what this skill does',<% if (toolRefs.length > 0) { %>
|
|
6
|
+
tools: [<%- toolRefs.map(t => `'${t}'`).join(', ') %>],<% } %>
|
|
7
|
+
})
|
|
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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/generators/skill/schema.ts"],"names":[],"mappings":"","sourcesContent":["export interface SkillGeneratorSchema {\n name: string;\n project: string;\n tools?: string;\n directory?: string;\n skipFormat?: boolean;\n}\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "FrontMcpSkill",
|
|
4
|
+
"title": "FrontMCP Skill Generator",
|
|
5
|
+
"description": "Generate a @Skill class",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The name of the skill",
|
|
11
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
12
|
+
"x-prompt": "What name would you like for the skill?",
|
|
13
|
+
"x-priority": "important"
|
|
14
|
+
},
|
|
15
|
+
"project": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The project to add the skill to",
|
|
18
|
+
"x-dropdown": "projects",
|
|
19
|
+
"x-priority": "important"
|
|
20
|
+
},
|
|
21
|
+
"tools": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Comma-separated tool names to reference"
|
|
24
|
+
},
|
|
25
|
+
"directory": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Subdirectory within src/skills/"
|
|
28
|
+
},
|
|
29
|
+
"skipFormat": {
|
|
30
|
+
"type": "boolean",
|
|
31
|
+
"default": false,
|
|
32
|
+
"x-priority": "internal"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"required": ["name", "project"]
|
|
36
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Tree, type GeneratorCallback } from '@nx/devkit';
|
|
2
|
+
import type { SkillGeneratorSchema } from './schema.js';
|
|
3
|
+
export declare function skillGenerator(tree: Tree, schema: SkillGeneratorSchema): Promise<GeneratorCallback | void>;
|
|
4
|
+
export default skillGenerator;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.skillGenerator = skillGenerator;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const normalize_options_js_1 = require("../../utils/normalize-options.js");
|
|
7
|
+
async function skillGenerator(tree, schema) {
|
|
8
|
+
const options = (0, normalize_options_js_1.normalizePrimitiveOptions)(tree, schema, 'skills');
|
|
9
|
+
const toolRefs = schema.tools
|
|
10
|
+
? schema.tools
|
|
11
|
+
.split(',')
|
|
12
|
+
.map((t) => t.trim())
|
|
13
|
+
.filter(Boolean)
|
|
14
|
+
: [];
|
|
15
|
+
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files'), options.directory, {
|
|
16
|
+
...options,
|
|
17
|
+
toolRefs,
|
|
18
|
+
tmpl: '',
|
|
19
|
+
});
|
|
20
|
+
if (!schema.skipFormat) {
|
|
21
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = skillGenerator;
|
|
25
|
+
//# sourceMappingURL=skill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../../../../src/generators/skill/skill.ts"],"names":[],"mappings":";;AAKA,wCAkBC;AAvBD,uCAA2F;AAC3F,+BAA4B;AAE5B,2EAA6E;AAEtE,KAAK,UAAU,cAAc,CAAC,IAAU,EAAE,MAA4B;IAC3E,MAAM,OAAO,GAAG,IAAA,gDAAyB,EAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK;QAC3B,CAAC,CAAC,MAAM,CAAC,KAAK;aACT,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,OAAO,CAAC;QACpB,CAAC,CAAC,EAAE,CAAC;IAEP,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE;QAC/D,GAAG,OAAO;QACV,QAAQ;QACR,IAAI,EAAE,EAAE;KACT,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,kBAAe,cAAc,CAAC","sourcesContent":["import { type Tree, formatFiles, generateFiles, type GeneratorCallback } from '@nx/devkit';\nimport { join } from 'path';\nimport type { SkillGeneratorSchema } from './schema.js';\nimport { normalizePrimitiveOptions } from '../../utils/normalize-options.js';\n\nexport async function skillGenerator(tree: Tree, schema: SkillGeneratorSchema): Promise<GeneratorCallback | void> {\n const options = normalizePrimitiveOptions(tree, schema, 'skills');\n const toolRefs = schema.tools\n ? schema.tools\n .split(',')\n .map((t) => t.trim())\n .filter(Boolean)\n : [];\n\n generateFiles(tree, join(__dirname, 'files'), options.directory, {\n ...options,\n toolRefs,\n tmpl: '',\n });\n\n if (!schema.skipFormat) {\n await formatFiles(tree);\n }\n}\n\nexport default skillGenerator;\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Tool, ToolContext } from '@frontmcp/sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
@Tool({
|
|
5
|
+
name: '<%= name %>',
|
|
6
|
+
description: 'TODO: describe what this tool does',
|
|
7
|
+
inputSchema: {
|
|
8
|
+
value: z.string().describe('TODO: replace with actual input'),
|
|
9
|
+
},
|
|
10
|
+
outputSchema: {
|
|
11
|
+
result: z.string().describe('TODO: replace with actual output'),
|
|
12
|
+
},
|
|
13
|
+
})
|
|
14
|
+
export default class <%= className %>Tool extends ToolContext {
|
|
15
|
+
async execute(input: unknown) {
|
|
16
|
+
// TODO: implement
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/generators/tool/schema.ts"],"names":[],"mappings":"","sourcesContent":["export interface ToolGeneratorSchema {\n name: string;\n project: string;\n directory?: string;\n skipFormat?: boolean;\n}\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/schema",
|
|
3
|
+
"$id": "FrontMcpTool",
|
|
4
|
+
"title": "FrontMCP Tool Generator",
|
|
5
|
+
"description": "Generate a @Tool class",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"name": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "The name of the tool",
|
|
11
|
+
"$default": { "$source": "argv", "index": 0 },
|
|
12
|
+
"x-prompt": "What name would you like for the tool?",
|
|
13
|
+
"x-priority": "important"
|
|
14
|
+
},
|
|
15
|
+
"project": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The project to add the tool to",
|
|
18
|
+
"x-dropdown": "projects",
|
|
19
|
+
"x-priority": "important"
|
|
20
|
+
},
|
|
21
|
+
"directory": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Subdirectory within src/tools/"
|
|
24
|
+
},
|
|
25
|
+
"skipFormat": {
|
|
26
|
+
"type": "boolean",
|
|
27
|
+
"default": false,
|
|
28
|
+
"x-priority": "internal"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"required": ["name", "project"]
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toolGenerator = toolGenerator;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const normalize_options_js_1 = require("../../utils/normalize-options.js");
|
|
7
|
+
async function toolGenerator(tree, schema) {
|
|
8
|
+
const options = (0, normalize_options_js_1.normalizePrimitiveOptions)(tree, schema, 'tools');
|
|
9
|
+
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files'), options.directory, {
|
|
10
|
+
...options,
|
|
11
|
+
tmpl: '',
|
|
12
|
+
});
|
|
13
|
+
if (!schema.skipFormat) {
|
|
14
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = toolGenerator;
|
|
18
|
+
//# sourceMappingURL=tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.js","sourceRoot":"","sources":["../../../../src/generators/tool/tool.ts"],"names":[],"mappings":";;AAKA,sCAWC;AAhBD,uCAA2F;AAC3F,+BAA4B;AAE5B,2EAA6E;AAEtE,KAAK,UAAU,aAAa,CAAC,IAAU,EAAE,MAA2B;IACzE,MAAM,OAAO,GAAG,IAAA,gDAAyB,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjE,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,WAAI,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE;QAC/D,GAAG,OAAO;QACV,IAAI,EAAE,EAAE;KACT,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;QACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC;AAED,kBAAe,aAAa,CAAC","sourcesContent":["import { type Tree, formatFiles, generateFiles, type GeneratorCallback } from '@nx/devkit';\nimport { join } from 'path';\nimport type { ToolGeneratorSchema } from './schema.js';\nimport { normalizePrimitiveOptions } from '../../utils/normalize-options.js';\n\nexport async function toolGenerator(tree: Tree, schema: ToolGeneratorSchema): Promise<GeneratorCallback | void> {\n const options = normalizePrimitiveOptions(tree, schema, 'tools');\n\n generateFiles(tree, join(__dirname, 'files'), options.directory, {\n ...options,\n tmpl: '',\n });\n\n if (!schema.skipFormat) {\n await formatFiles(tree);\n }\n}\n\nexport default toolGenerator;\n"]}
|