@neural-tools/cli 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +360 -80
- package/dist/cli.mjs +364 -0
- package/dist/index.d.mts +45 -0
- package/dist/index.d.ts +45 -6
- package/dist/index.js +363 -15
- package/dist/index.mjs +363 -0
- package/package.json +5 -5
- package/dist/commands/deploy.d.ts +0 -7
- package/dist/commands/deploy.js +0 -96
- package/dist/commands/generate-agent.d.ts +0 -10
- package/dist/commands/generate-agent.js +0 -126
- package/dist/commands/generate-command.d.ts +0 -10
- package/dist/commands/generate-command.js +0 -112
- package/dist/commands/generate-mcp.d.ts +0 -10
- package/dist/commands/generate-mcp.js +0 -429
- package/dist/commands/login.d.ts +0 -5
- package/dist/commands/login.js +0 -112
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/status.js +0 -64
package/dist/index.js
CHANGED
|
@@ -1,15 +1,363 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
"use strict";var U=Object.create;var v=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var r in t)v(e,r,{get:t[r],enumerable:!0})},T=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of B(t))!z.call(e,i)&&i!==r&&v(e,i,{get:()=>t[i],enumerable:!(n=W(t,i))||n.enumerable});return e};var u=(e,t,r)=>(r=e!=null?U(K(e)):{},T(t||!e||!e.__esModule?v(r,"default",{value:e,enumerable:!0}):r,e)),H=e=>T(v({},"__esModule",{value:!0}),e);var ee={};V(ee,{deployMCP:()=>L,generateAgent:()=>I,generateCommand:()=>O,generateMCP:()=>_,loginCommand:()=>N,statusCommand:()=>q});module.exports=H(ee);var m=u(require("path")),p=u(require("fs-extra")),d=require("@neural-tools/core"),S=u(require("inquirer"));async function _(e,t){d.logger.header(`Generating MCP: ${e}`),t.deployment!=="none"&&await(0,d.requireFeature)("cloud-deployment","Cloud Deployment");let r=t.description;r||(r=(await S.default.prompt([{type:"input",name:"description",message:"Description of your MCP:",default:`${e} MCP server`}])).description);let n=m.default.resolve(t.output||"./apps",e);if(t.dryRun){d.logger.info("Dry run mode - no files will be created"),d.logger.section("Configuration",[`Name: ${e}`,`Description: ${r}`,`Output: ${n}`,`Template: ${t.fastmcp?"FastMCP":"Standard"}`,`CI/CD: ${t.cicd}`,`Deployment: ${t.deployment}`]);return}if(await p.default.pathExists(n)){let{overwrite:i}=await S.default.prompt([{type:"confirm",name:"overwrite",message:`Directory ${n} already exists. Overwrite?`,default:!1}]);if(!i){d.logger.warn("Cancelled");return}await p.default.remove(n)}d.logger.startSpinner("Creating MCP structure...");try{await p.default.ensureDir(n);let i=`[project]
|
|
2
|
+
name = "mcp-${e}"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "${r}"
|
|
5
|
+
requires-python = ">=3.10"
|
|
6
|
+
dependencies = [
|
|
7
|
+
"fastmcp>=2.2.0",
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
[project.optional-dependencies]
|
|
11
|
+
dev = [
|
|
12
|
+
"pytest>=7.0.0",
|
|
13
|
+
"black>=23.0.0",
|
|
14
|
+
"ruff>=0.1.0",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[build-system]
|
|
18
|
+
requires = ["hatchling"]
|
|
19
|
+
build-backend = "hatchling.build"
|
|
20
|
+
|
|
21
|
+
[tool.black]
|
|
22
|
+
line-length = 100
|
|
23
|
+
|
|
24
|
+
[tool.ruff]
|
|
25
|
+
line-length = 100
|
|
26
|
+
`;await p.default.writeFile(m.default.join(n,"pyproject.toml"),i,"utf-8");let s=`"""
|
|
27
|
+
${e} MCP Server
|
|
28
|
+
|
|
29
|
+
${r}
|
|
30
|
+
"""
|
|
31
|
+
from fastmcp import FastMCP
|
|
32
|
+
|
|
33
|
+
mcp = FastMCP("${e}")
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
@mcp.tool()
|
|
37
|
+
def add_numbers(a: int, b: int) -> int:
|
|
38
|
+
"""Add two numbers together"""
|
|
39
|
+
return a + b
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@mcp.tool()
|
|
43
|
+
async def process_message(message: str) -> str:
|
|
44
|
+
"""Process a message and return the result"""
|
|
45
|
+
return f"Processed: {message}"
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
@mcp.resource("config://version")
|
|
49
|
+
def get_version() -> str:
|
|
50
|
+
"""Get the current version of the MCP server"""
|
|
51
|
+
return "0.1.0"
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@mcp.resource("example://data/{item_id}")
|
|
55
|
+
async def get_item(item_id: str) -> str:
|
|
56
|
+
"""Get an item by ID"""
|
|
57
|
+
return f"Item data for: {item_id}"
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
@mcp.prompt()
|
|
61
|
+
def review_code(code: str) -> str:
|
|
62
|
+
"""Generate a code review prompt"""
|
|
63
|
+
return f"""Please review this code:
|
|
64
|
+
|
|
65
|
+
\`\`\`python
|
|
66
|
+
{code}
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
Provide feedback on:
|
|
70
|
+
1. Code quality
|
|
71
|
+
2. Potential bugs
|
|
72
|
+
3. Performance improvements
|
|
73
|
+
4. Best practices
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@mcp.prompt()
|
|
78
|
+
def brainstorm_topic(topic: str) -> str:
|
|
79
|
+
"""Generate a brainstorming prompt"""
|
|
80
|
+
return f"Let's brainstorm ideas about: {topic}"
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if __name__ == "__main__":
|
|
84
|
+
mcp.run()
|
|
85
|
+
`;await p.default.writeFile(m.default.join(n,"server.py"),s,"utf-8");let c=`# ${e} MCP Server
|
|
86
|
+
|
|
87
|
+
${r}
|
|
88
|
+
|
|
89
|
+
## Quick Start with Docker
|
|
90
|
+
|
|
91
|
+
\`\`\`bash
|
|
92
|
+
# Start the MCP server
|
|
93
|
+
docker-compose up
|
|
94
|
+
|
|
95
|
+
# In another terminal, test it
|
|
96
|
+
docker-compose exec mcp python server.py
|
|
97
|
+
\`\`\`
|
|
98
|
+
|
|
99
|
+
## Local Development
|
|
100
|
+
|
|
101
|
+
### Prerequisites
|
|
102
|
+
|
|
103
|
+
- Python 3.10+
|
|
104
|
+
- uv (recommended) or pip
|
|
105
|
+
|
|
106
|
+
### Installation
|
|
107
|
+
|
|
108
|
+
\`\`\`bash
|
|
109
|
+
# Using uv (recommended)
|
|
110
|
+
uv pip install -e .
|
|
111
|
+
|
|
112
|
+
# Or using pip
|
|
113
|
+
pip install -e .
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
### Running the Server
|
|
117
|
+
|
|
118
|
+
\`\`\`bash
|
|
119
|
+
# Development mode with MCP Inspector
|
|
120
|
+
fastmcp dev server.py
|
|
121
|
+
|
|
122
|
+
# Direct execution
|
|
123
|
+
python server.py
|
|
124
|
+
|
|
125
|
+
# Install to Claude Desktop
|
|
126
|
+
fastmcp install server.py
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
## Usage with Claude Code
|
|
130
|
+
|
|
131
|
+
Add to your Claude Code settings (\`~/.config/claude/config.json\`):
|
|
132
|
+
|
|
133
|
+
\`\`\`json
|
|
134
|
+
{
|
|
135
|
+
"mcpServers": {
|
|
136
|
+
"${e}": {
|
|
137
|
+
"command": "python",
|
|
138
|
+
"args": ["/path/to/server.py"]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
\`\`\`
|
|
143
|
+
|
|
144
|
+
Or use the Docker container:
|
|
145
|
+
|
|
146
|
+
\`\`\`json
|
|
147
|
+
{
|
|
148
|
+
"mcpServers": {
|
|
149
|
+
"${e}": {
|
|
150
|
+
"command": "docker",
|
|
151
|
+
"args": ["run", "-i", "mcp-${e}"]
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
\`\`\`
|
|
156
|
+
|
|
157
|
+
## Features
|
|
158
|
+
|
|
159
|
+
- **Tools**: Add numbers, process messages
|
|
160
|
+
- **Resources**: Get version, retrieve items by ID
|
|
161
|
+
- **Prompts**: Code review, brainstorming
|
|
162
|
+
|
|
163
|
+
## Project Structure
|
|
164
|
+
|
|
165
|
+
\`\`\`
|
|
166
|
+
.
|
|
167
|
+
\u251C\u2500\u2500 server.py # Main MCP server
|
|
168
|
+
\u251C\u2500\u2500 pyproject.toml # Python project configuration
|
|
169
|
+
\u251C\u2500\u2500 Dockerfile # Docker image definition
|
|
170
|
+
\u251C\u2500\u2500 docker-compose.yml # Local development setup
|
|
171
|
+
\u2514\u2500\u2500 README.md # This file
|
|
172
|
+
\`\`\`
|
|
173
|
+
|
|
174
|
+
## Development
|
|
175
|
+
|
|
176
|
+
### Running Tests
|
|
177
|
+
|
|
178
|
+
\`\`\`bash
|
|
179
|
+
pytest
|
|
180
|
+
\`\`\`
|
|
181
|
+
|
|
182
|
+
### Code Formatting
|
|
183
|
+
|
|
184
|
+
\`\`\`bash
|
|
185
|
+
black .
|
|
186
|
+
ruff check .
|
|
187
|
+
\`\`\`
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
MIT
|
|
192
|
+
`;await p.default.writeFile(m.default.join(n,"README.md"),c,"utf-8"),await p.default.writeFile(m.default.join(n,"Dockerfile"),`FROM python:3.11-slim
|
|
193
|
+
|
|
194
|
+
WORKDIR /app
|
|
195
|
+
|
|
196
|
+
# Install uv for faster dependency installation
|
|
197
|
+
RUN pip install --no-cache-dir uv
|
|
198
|
+
|
|
199
|
+
# Copy project files
|
|
200
|
+
COPY pyproject.toml .
|
|
201
|
+
COPY server.py .
|
|
202
|
+
|
|
203
|
+
# Install dependencies
|
|
204
|
+
RUN uv pip install --system --no-cache .
|
|
205
|
+
|
|
206
|
+
# Run the MCP server
|
|
207
|
+
CMD ["python", "server.py"]
|
|
208
|
+
`,"utf-8");let y=`version: '3.8'
|
|
209
|
+
|
|
210
|
+
services:
|
|
211
|
+
mcp:
|
|
212
|
+
build: .
|
|
213
|
+
image: mcp-${e}
|
|
214
|
+
container_name: ${e}-mcp
|
|
215
|
+
stdin_open: true
|
|
216
|
+
tty: true
|
|
217
|
+
volumes:
|
|
218
|
+
- .:/app
|
|
219
|
+
environment:
|
|
220
|
+
- PYTHONUNBUFFERED=1
|
|
221
|
+
`;if(await p.default.writeFile(m.default.join(n,"docker-compose.yml"),y,"utf-8"),await p.default.writeFile(m.default.join(n,".dockerignore"),`__pycache__
|
|
222
|
+
*.pyc
|
|
223
|
+
*.pyo
|
|
224
|
+
*.pyd
|
|
225
|
+
.Python
|
|
226
|
+
*.so
|
|
227
|
+
*.egg
|
|
228
|
+
*.egg-info
|
|
229
|
+
dist
|
|
230
|
+
build
|
|
231
|
+
.pytest_cache
|
|
232
|
+
.ruff_cache
|
|
233
|
+
.venv
|
|
234
|
+
venv
|
|
235
|
+
.git
|
|
236
|
+
.github
|
|
237
|
+
README.md
|
|
238
|
+
`,"utf-8"),t.cicd==="github"){await p.default.ensureDir(m.default.join(n,".github","workflows"));let h=`name: Deploy MCP
|
|
239
|
+
|
|
240
|
+
on:
|
|
241
|
+
push:
|
|
242
|
+
branches: [main]
|
|
243
|
+
pull_request:
|
|
244
|
+
branches: [main]
|
|
245
|
+
|
|
246
|
+
jobs:
|
|
247
|
+
build:
|
|
248
|
+
runs-on: ubuntu-latest
|
|
249
|
+
steps:
|
|
250
|
+
- uses: actions/checkout@v4
|
|
251
|
+
- uses: actions/setup-python@v5
|
|
252
|
+
with:
|
|
253
|
+
python-version: '3.11'
|
|
254
|
+
|
|
255
|
+
- name: Install uv
|
|
256
|
+
run: pip install uv
|
|
257
|
+
|
|
258
|
+
- name: Install dependencies
|
|
259
|
+
run: uv pip install --system -e ".[dev]"
|
|
260
|
+
|
|
261
|
+
- name: Run tests
|
|
262
|
+
run: pytest
|
|
263
|
+
|
|
264
|
+
- name: Check code formatting
|
|
265
|
+
run: |
|
|
266
|
+
black --check .
|
|
267
|
+
ruff check .
|
|
268
|
+
|
|
269
|
+
docker:
|
|
270
|
+
runs-on: ubuntu-latest
|
|
271
|
+
needs: build
|
|
272
|
+
steps:
|
|
273
|
+
- uses: actions/checkout@v4
|
|
274
|
+
|
|
275
|
+
- name: Build Docker image
|
|
276
|
+
run: docker build -t mcp-${e}:latest .
|
|
277
|
+
|
|
278
|
+
- name: Test Docker image
|
|
279
|
+
run: docker run --rm mcp-${e}:latest python -c "import fastmcp; print('OK')"
|
|
280
|
+
|
|
281
|
+
deploy:
|
|
282
|
+
needs: [build, docker]
|
|
283
|
+
runs-on: ubuntu-latest
|
|
284
|
+
if: github.ref == 'refs/heads/main'
|
|
285
|
+
steps:
|
|
286
|
+
- uses: actions/checkout@v4
|
|
287
|
+
${t.deployment==="aws"?`
|
|
288
|
+
- name: Configure AWS credentials
|
|
289
|
+
uses: aws-actions/configure-aws-credentials@v4
|
|
290
|
+
with:
|
|
291
|
+
aws-access-key-id: \${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
292
|
+
aws-secret-access-key: \${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
293
|
+
aws-region: us-east-1
|
|
294
|
+
|
|
295
|
+
- name: Login to Amazon ECR
|
|
296
|
+
id: login-ecr
|
|
297
|
+
uses: aws-actions/amazon-ecr-login@v2
|
|
298
|
+
|
|
299
|
+
- name: Build and push Docker image
|
|
300
|
+
env:
|
|
301
|
+
ECR_REGISTRY: \${{ steps.login-ecr.outputs.registry }}
|
|
302
|
+
ECR_REPOSITORY: mcp-${e}
|
|
303
|
+
IMAGE_TAG: \${{ github.sha }}
|
|
304
|
+
run: |
|
|
305
|
+
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
|
306
|
+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
|
307
|
+
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
|
308
|
+
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
|
|
309
|
+
`:""}${t.deployment==="gcp"?`
|
|
310
|
+
- name: Authenticate to Google Cloud
|
|
311
|
+
uses: google-github-actions/auth@v2
|
|
312
|
+
with:
|
|
313
|
+
credentials_json: \${{ secrets.GCP_CREDENTIALS }}
|
|
314
|
+
|
|
315
|
+
- name: Set up Cloud SDK
|
|
316
|
+
uses: google-github-actions/setup-gcloud@v2
|
|
317
|
+
|
|
318
|
+
- name: Build and push Docker image
|
|
319
|
+
run: |
|
|
320
|
+
gcloud builds submit --tag gcr.io/\${{ secrets.GCP_PROJECT_ID }}/mcp-${e}:latest
|
|
321
|
+
`:""}
|
|
322
|
+
`;await p.default.writeFile(m.default.join(n,".github","workflows","deploy.yml"),h,"utf-8")}d.logger.succeedSpinner("MCP created successfully!"),d.logger.section("Next steps",[`1. cd ${n}`,"2. docker-compose up # Start with Docker","","Or for local development:","2. uv pip install -e .","3. python server.py","","Or use MCP Inspector:","2. uv pip install -e .","3. fastmcp dev server.py","","Add to Claude Code settings to use this MCP"]),d.logger.success(`\u2728 MCP "${e}" ready to use!`)}catch(i){throw d.logger.failSpinner("Failed to create MCP"),i}}var $=u(require("path")),M=u(require("os")),b=u(require("fs-extra")),g=require("@neural-tools/core"),R=u(require("inquirer"));async function O(e,t){g.logger.header(`Generating Claude Command: /${e}`);let r=t.description;r||(r=(await R.default.prompt([{type:"input",name:"description",message:"Description of your command:",default:`Execute ${e}`}])).description);let n;t.global?n=$.default.join(M.default.homedir(),".claude","commands"):n=$.default.resolve(t.output||"./claude/commands");let i=$.default.join(n,`${e}.md`);if(t.dryRun){g.logger.info("Dry run mode - no files will be created"),g.logger.section("Configuration",[`Name: /${e}`,`Description: ${r}`,`Output: ${i}`,`Arguments: ${t.args?.join(", ")||"none"}`,`Allowed Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await b.default.pathExists(i)){let{overwrite:s}=await R.default.prompt([{type:"confirm",name:"overwrite",message:`Command /${e} already exists. Overwrite?`,default:!1}]);if(!s){g.logger.warn("Cancelled");return}}g.logger.startSpinner("Creating Claude command...");try{await b.default.ensureDir(n);let s=["---"];t.args&&t.args.length>0&&s.push(`argument-hint: ${t.args.join(" ")}`),s.push(`description: ${r}`),t.tools&&t.tools.length>0&&(s.push("allowed-tools:"),t.tools.forEach(h=>{s.push(` - ${h}`)})),s.push("---"),s.push("");let c=t.args||[],w=c.map((h,E)=>`$${E+1}`).join(" "),y=c.length>0?`
|
|
323
|
+
|
|
324
|
+
Arguments:
|
|
325
|
+
${c.map((h,E)=>`- $${E+1}: ${h}`).join(`
|
|
326
|
+
`)}`:"",A=`${s.join(`
|
|
327
|
+
`)}# ${e} Command
|
|
328
|
+
|
|
329
|
+
Execute the ${e} operation${y?":"+y:"."}
|
|
330
|
+
|
|
331
|
+
${w?`Using arguments: ${w}`:""}
|
|
332
|
+
|
|
333
|
+
Please proceed with the ${e} operation.
|
|
334
|
+
`;await b.default.writeFile(i,A,"utf-8"),g.logger.succeedSpinner("Claude command created successfully!"),g.logger.section("Next steps",[t.global?`Command /${e} is now available globally in Claude Code`:`Add the command to your project by copying ${i}`,"","Usage:",c.length>0?` /${e} ${c.join(" ")}`:` /${e}`]),g.logger.success(`\u2728 Command "/${e}" ready to use!`)}catch(s){throw g.logger.failSpinner("Failed to create command"),s}}var k=u(require("path")),G=u(require("os")),P=u(require("fs-extra")),f=require("@neural-tools/core"),D=u(require("inquirer"));async function I(e,t){f.logger.header(`Generating Claude Agent: ${e}`);let r=t.description;r||(r=(await D.default.prompt([{type:"input",name:"description",message:"Description of your agent:",default:`${e} specialized agent`}])).description);let n;t.global?n=k.default.join(G.default.homedir(),".claude","agents"):n=k.default.resolve(t.output||"./claude/agents");let i=k.default.join(n,`${e}.md`),s=t.model||"sonnet";if(t.dryRun){f.logger.info("Dry run mode - no files will be created"),f.logger.section("Configuration",[`Name: ${e}`,`Description: ${r}`,`Output: ${i}`,`Model: ${s}`,`Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await P.default.pathExists(i)){let{overwrite:c}=await D.default.prompt([{type:"confirm",name:"overwrite",message:`Agent ${e} already exists. Overwrite?`,default:!1}]);if(!c){f.logger.warn("Cancelled");return}}f.logger.startSpinner("Creating Claude agent...");try{await P.default.ensureDir(n);let c=["---"];c.push(`model: claude-${s}-4-5`),t.tools&&t.tools.length>0&&(c.push("tools:"),t.tools.forEach(y=>{c.push(` - ${y}`)})),c.push("---"),c.push("");let w=`${c.join(`
|
|
335
|
+
`)}# ${e} Agent
|
|
336
|
+
|
|
337
|
+
${r}
|
|
338
|
+
|
|
339
|
+
## Role
|
|
340
|
+
|
|
341
|
+
You are a specialized agent for ${e} tasks. Your primary responsibilities include:
|
|
342
|
+
|
|
343
|
+
- [Responsibility 1]
|
|
344
|
+
- [Responsibility 2]
|
|
345
|
+
- [Responsibility 3]
|
|
346
|
+
|
|
347
|
+
## Guidelines
|
|
348
|
+
|
|
349
|
+
When performing ${e} tasks:
|
|
350
|
+
|
|
351
|
+
1. [Guideline 1]
|
|
352
|
+
2. [Guideline 2]
|
|
353
|
+
3. [Guideline 3]
|
|
354
|
+
|
|
355
|
+
## Output Format
|
|
356
|
+
|
|
357
|
+
Provide clear, structured responses that:
|
|
358
|
+
- [Output requirement 1]
|
|
359
|
+
- [Output requirement 2]
|
|
360
|
+
- [Output requirement 3]
|
|
361
|
+
|
|
362
|
+
Focus on ${e} and deliver actionable results.
|
|
363
|
+
`;await P.default.writeFile(i,w,"utf-8"),f.logger.succeedSpinner("Claude agent created successfully!"),f.logger.section("Next steps",[t.global?`Agent ${e} is now available globally in Claude Code`:`Add the agent to your project by copying ${i}`,"","Customize the agent by editing:",` ${i}`,"","Use the agent via the Task tool in Claude Code"]),f.logger.success(`\u2728 Agent "${e}" ready to use!`)}catch(c){throw f.logger.failSpinner("Failed to create agent"),c}}var a=require("@neural-tools/core"),F=require("execa"),j=u(require("path")),x=u(require("fs-extra"));async function L(e,t){a.logger.header(`Deploying MCP: ${e}`),await(0,a.requireFeature)("cloud-deployment","Cloud Deployment");let r=t.platform||"aws",n=t.env||"dev";a.logger.info(`Platform: ${r}`),a.logger.info(`Environment: ${n}`);let i=j.default.resolve("./apps",e);if(!await x.default.pathExists(i))throw new Error(`MCP "${e}" not found at ${i}`);a.logger.startSpinner("Building MCP...");try{await(0,F.execa)("npm",["run","build"],{cwd:i,stdio:"pipe"}),a.logger.succeedSpinner("MCP built successfully"),r==="aws"?await J(e,i,t):r==="gcp"&&await Q(e,i,t),a.logger.success(`\u2728 MCP "${e}" deployed successfully!`)}catch(s){throw a.logger.failSpinner("Deployment failed"),s}}async function J(e,t,r){a.logger.startSpinner("Deploying to AWS Lambda..."),a.logger.updateSpinner("Packaging Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.updateSpinner("Uploading to S3..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.updateSpinner("Creating/updating Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.succeedSpinner("Deployed to AWS Lambda"),a.logger.section("Deployment Info",[`Function: ${e}-${r.env}`,`Region: ${r.region||"us-east-1"}`,`Environment: ${r.env}`,"","Configure in Claude Code:",JSON.stringify({mcpServers:{[e]:{command:"aws",args:["lambda","invoke","--function-name",`${e}-${r.env}`,"--payload","stdin","--output","stdout"]}}},null,2)])}async function Q(e,t,r){a.logger.startSpinner("Deploying to Google Cloud Functions..."),a.logger.updateSpinner("Packaging function..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.updateSpinner("Uploading to Cloud Storage..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.updateSpinner("Deploying Cloud Function..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.succeedSpinner("Deployed to Google Cloud Functions"),a.logger.section("Deployment Info",[`Function: ${e}-${r.env}`,`Region: ${r.region||"us-central1"}`,`Environment: ${r.env}`])}var o=require("@neural-tools/core"),Y=u(require("inquirer"));async function N(e){o.logger.header("AI Toolkit License Management");let t=e.key;if(t||(t=(await Y.default.prompt([{type:"input",name:"licenseKey",message:"Enter your license key:",validate:n=>!n||n.trim().length===0?"License key is required":!0}])).licenseKey),!t){o.logger.error("License key is required");return}o.logger.startSpinner("Validating license...");try{let r=t.split("-");if(r.length<2)throw new Error("Invalid license key format");let n=r[0],i=r[1];if(!Object.values(o.LicenseTier).includes(n))throw new Error("Invalid license tier");await o.licenseManager.saveLicense({tier:n,email:i,key:t,features:[]}),o.logger.succeedSpinner("License activated successfully!");let s=await o.licenseManager.loadLicense();o.logger.section("License Details",[`Tier: ${s.tier.toUpperCase()}`,`Email: ${s.email||"N/A"}`,"Status: Active"]);let c=X(n);o.logger.section("Available Features",c),n===o.LicenseTier.FREE&&(o.logger.newline(),o.logger.info("Upgrade to Pro for advanced features:"),o.logger.info("https://ai-toolkit.dev/pricing")),o.logger.success("\u2728 Ready to build!")}catch(r){o.logger.failSpinner("License validation failed"),o.logger.error(r.message||"Invalid license key"),o.logger.newline(),o.logger.info("Get a license at: https://ai-toolkit.dev/pricing"),o.logger.info("Or continue with free tier features")}}function X(e){let t=["\u2713 MCP generation","\u2713 Claude commands","\u2713 Basic templates","\u2713 Local development"],r=[...t,"\u2713 Vector database integration","\u2713 Semantic caching","\u2713 Fine-tuning workflows","\u2713 Cloud deployment (AWS/GCP)","\u2713 Premium templates","\u2713 GitHub automation"],n=[...r,"\u2713 White-label support","\u2713 Custom integrations","\u2713 Priority support","\u2713 SLA guarantee","\u2713 Team collaboration features"];switch(e){case o.LicenseTier.FREE:return t;case o.LicenseTier.PRO:return r;case o.LicenseTier.ENTERPRISE:return n;default:return t}}var l=require("@neural-tools/core");async function q(){l.logger.header("AI Toolkit Status");try{let e=await l.licenseManager.loadLicense();l.logger.section("License Information",[`Tier: ${e.tier.toUpperCase()}`,`Email: ${e.email||"N/A"}`,`Status: ${e.expiresAt?Z(e.expiresAt):"Active"}`]);let t=[{name:"MCP Generation",key:"mcp-generation"},{name:"Claude Commands",key:"claude-commands"},{name:"Vector Database",key:"vector-db"},{name:"Semantic Cache",key:"semantic-cache"},{name:"Fine-tuning",key:"fine-tuning"},{name:"Cloud Deployment",key:"cloud-deployment"},{name:"GitHub Automation",key:"github-automation"}],r=await Promise.all(t.map(async n=>`${await l.licenseManager.checkFeature(n.key)?"\u2713":"\u2717"} ${n.name}`));l.logger.section("Feature Availability",r),e.tier===l.LicenseTier.FREE&&(l.logger.newline(),l.logger.info("Unlock more features with Pro or Enterprise:"),l.logger.info("https://ai-toolkit.dev/pricing")),l.logger.newline(),l.logger.section("Quick Start",["Generate an MCP server:"," ai-toolkit generate mcp github","","Generate a Claude command:"," ai-toolkit generate command search-kb","","View all commands:"," ai-toolkit --help"])}catch{l.logger.error("Failed to load license information"),l.logger.newline(),l.logger.info('Run "ai-toolkit login" to activate your license'),l.logger.info("Or continue with free tier features")}}function Z(e){let t=new Date(e),r=new Date;if(t<r)return"Expired";let n=Math.ceil((t.getTime()-r.getTime())/(1e3*60*60*24));return n<=30?`Active (expires in ${n} days)`:"Active"}0&&(module.exports={deployMCP,generateAgent,generateCommand,generateMCP,loginCommand,statusCommand});
|