@agiflowai/aicode-toolkit 1.0.8 → 1.0.10
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/README.md +135 -100
- package/dist/cli.cjs +15 -13
- package/dist/cli.mjs +15 -13
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +9 -1
- package/dist/index.d.mts +9 -1
- package/dist/index.mjs +2 -2
- package/dist/{mcp-Dwt8nYQV.cjs → mcp--A-5zuBI.cjs} +7 -0
- package/dist/mcp-B9X7HURl.cjs +4 -0
- package/dist/{mcp-C3HR_ZNF.mjs → mcp-CBcPdzNG.mjs} +7 -0
- package/dist/mcp-Cvo6pkS0.mjs +3 -0
- package/dist/{services-DIUrmi_K.cjs → services-BoT1Avsb.cjs} +92 -16
- package/dist/{services-BvnOGCDG.mjs → services-Clvg2ZBI.mjs} +82 -10
- package/package.json +3 -3
- package/dist/mcp-Bdxvi2Ej.cjs +0 -4
- package/dist/mcp-BgNkvV6h.mjs +0 -3
package/README.md
CHANGED
|
@@ -1,150 +1,185 @@
|
|
|
1
1
|
# @agiflowai/aicode-toolkit
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> CLI for initializing projects and managing AI Code Toolkit templates
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The main entry point for setting up AI Code Toolkit in your workspace. Handles project initialization, template management, and MCP server configuration.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
- **Dynamic template discovery**: Automatically finds templates in your workspace
|
|
9
|
-
- **Multiple frameworks**: Support for Next.js, Vite React, and custom boilerplates
|
|
10
|
-
- **Git integration**: Clone templates from GitHub repositories or subdirectories
|
|
11
|
-
|
|
12
|
-
## Installation
|
|
7
|
+
## Quick Start
|
|
13
8
|
|
|
14
9
|
```bash
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
# Initialize templates in existing project
|
|
11
|
+
npx @agiflowai/aicode-toolkit init
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```bash
|
|
21
|
-
pnpm install -g @agiflowai/aicode-toolkit
|
|
13
|
+
# Create new project with templates
|
|
14
|
+
npx @agiflowai/aicode-toolkit init --name my-project --project-type monolith
|
|
22
15
|
```
|
|
23
16
|
|
|
24
|
-
|
|
17
|
+
---
|
|
25
18
|
|
|
26
|
-
|
|
19
|
+
## Commands
|
|
27
20
|
|
|
28
|
-
|
|
21
|
+
### `init`
|
|
29
22
|
|
|
23
|
+
Initialize AI Code Toolkit in your workspace.
|
|
24
|
+
|
|
25
|
+
**For existing projects:**
|
|
30
26
|
```bash
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
npx @agiflowai/aicode-toolkit init
|
|
28
|
+
```
|
|
33
29
|
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
This will:
|
|
31
|
+
1. Create `templates/` folder in your workspace
|
|
32
|
+
2. Download official templates (Next.js 15, TypeScript lib, MCP package)
|
|
33
|
+
3. Detect installed AI coding agents (Claude Code, Cursor, etc.)
|
|
34
|
+
4. Optionally configure MCP servers
|
|
35
|
+
|
|
36
|
+
**For new projects:**
|
|
37
|
+
```bash
|
|
38
|
+
# Interactive mode
|
|
39
|
+
npx @agiflowai/aicode-toolkit init
|
|
36
40
|
|
|
37
|
-
#
|
|
38
|
-
aicode init --
|
|
41
|
+
# Non-interactive mode
|
|
42
|
+
npx @agiflowai/aicode-toolkit init --name my-app --project-type monolith
|
|
39
43
|
```
|
|
40
44
|
|
|
41
|
-
|
|
42
|
-
1.
|
|
43
|
-
2.
|
|
44
|
-
3.
|
|
45
|
-
4.
|
|
45
|
+
This will:
|
|
46
|
+
1. Create project directory
|
|
47
|
+
2. Initialize git repository
|
|
48
|
+
3. Download templates
|
|
49
|
+
4. Create `toolkit.yaml` configuration
|
|
46
50
|
|
|
47
|
-
**
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
**Options:**
|
|
52
|
+
| Option | Description | Default |
|
|
53
|
+
|--------|-------------|---------|
|
|
54
|
+
| `--name <name>` | Project name (for new projects) | - |
|
|
55
|
+
| `--project-type <type>` | `monolith` or `monorepo` | - |
|
|
56
|
+
| `--path <path>` | Custom templates path | `./templates` |
|
|
57
|
+
| `--no-download` | Skip template download | `false` |
|
|
50
58
|
|
|
51
|
-
###
|
|
59
|
+
### `add`
|
|
52
60
|
|
|
53
|
-
Add templates from GitHub repositories
|
|
61
|
+
Add templates from GitHub repositories.
|
|
54
62
|
|
|
55
63
|
```bash
|
|
56
|
-
# Add
|
|
57
|
-
aicode add
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
aicode add \
|
|
66
|
-
--name react-component \
|
|
67
|
-
--url https://github.com/yourorg/react-component-scaffold \
|
|
68
|
-
--type scaffold
|
|
64
|
+
# Add from full repository
|
|
65
|
+
npx @agiflowai/aicode-toolkit add \
|
|
66
|
+
--name my-template \
|
|
67
|
+
--url https://github.com/yourorg/template-repo
|
|
68
|
+
|
|
69
|
+
# Add from repository subdirectory
|
|
70
|
+
npx @agiflowai/aicode-toolkit add \
|
|
71
|
+
--name react-vite \
|
|
72
|
+
--url https://github.com/AgiFlow/aicode-toolkit/tree/main/templates/react-vite
|
|
69
73
|
```
|
|
70
74
|
|
|
71
|
-
**
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
**Options:**
|
|
76
|
+
| Option | Description |
|
|
77
|
+
|--------|-------------|
|
|
78
|
+
| `--name <name>` | Template name (required) |
|
|
79
|
+
| `--url <url>` | GitHub URL (required) |
|
|
80
|
+
| `--type <type>` | Template type folder |
|
|
76
81
|
|
|
77
82
|
**Supported URL formats:**
|
|
78
83
|
- Full repository: `https://github.com/user/repo`
|
|
79
84
|
- Subdirectory: `https://github.com/user/repo/tree/branch/path/to/template`
|
|
80
|
-
- With
|
|
85
|
+
- With .git: `https://github.com/user/repo.git`
|
|
81
86
|
|
|
82
|
-
|
|
87
|
+
---
|
|
83
88
|
|
|
84
|
-
|
|
89
|
+
## What Gets Installed
|
|
85
90
|
|
|
86
|
-
|
|
91
|
+
When you run `init`, these official templates are downloaded:
|
|
87
92
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
| Template | Description |
|
|
94
|
+
|----------|-------------|
|
|
95
|
+
| `nextjs-15-drizzle` | Next.js 15 + App Router + TypeScript + Tailwind CSS 4 + Drizzle ORM |
|
|
96
|
+
| `typescript-lib` | TypeScript library with ESM/CJS builds |
|
|
97
|
+
| `typescript-mcp-package` | MCP server package template |
|
|
91
98
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
Each template includes:
|
|
100
|
+
- `scaffold.yaml` - Boilerplate and feature definitions
|
|
101
|
+
- `architect.yaml` - Design patterns (optional)
|
|
102
|
+
- `RULES.yaml` - Coding standards (optional)
|
|
96
103
|
|
|
97
|
-
|
|
98
|
-
aicode init --path ./custom-templates
|
|
104
|
+
---
|
|
99
105
|
|
|
100
|
-
|
|
101
|
-
aicode init --no-download
|
|
102
|
-
```
|
|
106
|
+
## Project Types
|
|
103
107
|
|
|
104
|
-
###
|
|
108
|
+
### Monolith
|
|
105
109
|
|
|
106
|
-
|
|
110
|
+
Single application with `toolkit.yaml` at root:
|
|
107
111
|
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
```
|
|
113
|
+
my-app/
|
|
114
|
+
├── toolkit.yaml # sourceTemplate: "nextjs-15"
|
|
115
|
+
├── templates/
|
|
116
|
+
│ └── nextjs-15/
|
|
117
|
+
├── src/
|
|
118
|
+
└── package.json
|
|
119
|
+
```
|
|
112
120
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
121
|
+
### Monorepo
|
|
122
|
+
|
|
123
|
+
Multiple projects with `project.json` in each:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
my-workspace/
|
|
127
|
+
├── templates/
|
|
128
|
+
│ ├── nextjs-15/
|
|
129
|
+
│ └── typescript-lib/
|
|
130
|
+
├── apps/
|
|
131
|
+
│ └── web/
|
|
132
|
+
│ └── project.json # sourceTemplate: "nextjs-15"
|
|
133
|
+
└── packages/
|
|
134
|
+
└── shared/
|
|
135
|
+
└── project.json # sourceTemplate: "typescript-lib"
|
|
128
136
|
```
|
|
129
137
|
|
|
130
|
-
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Coding Agent Detection
|
|
141
|
+
|
|
142
|
+
The CLI automatically detects installed AI coding agents:
|
|
143
|
+
|
|
144
|
+
| Agent | Config Location | Status |
|
|
145
|
+
|-------|-----------------|--------|
|
|
146
|
+
| Claude Code | `.mcp.json` | Supported |
|
|
147
|
+
| Cursor | `.cursor/mcp.json` | Supported |
|
|
148
|
+
| Gemini CLI | `.gemini/settings.json` | Supported |
|
|
149
|
+
| Codex CLI | `.codex/config.json` | Supported |
|
|
150
|
+
| GitHub Copilot | VS Code settings | Supported |
|
|
131
151
|
|
|
132
|
-
|
|
152
|
+
When detected, the CLI offers to configure MCP servers (scaffold-mcp, architect-mcp) automatically.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Template Structure
|
|
133
157
|
|
|
134
158
|
```
|
|
135
159
|
templates/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
└──
|
|
160
|
+
└── nextjs-15/
|
|
161
|
+
├── scaffold.yaml # Required: boilerplate + feature definitions
|
|
162
|
+
├── architect.yaml # Optional: design patterns
|
|
163
|
+
├── RULES.yaml # Optional: coding standards
|
|
164
|
+
└── src/ # Template files (.liquid for variable replacement)
|
|
165
|
+
├── package.json.liquid
|
|
166
|
+
└── app/
|
|
167
|
+
└── page.tsx.liquid
|
|
141
168
|
```
|
|
142
169
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
170
|
+
See [scaffold-mcp documentation](../../packages/scaffold-mcp/docs/template-conventions.md) for template creation guide.
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## Related Packages
|
|
175
|
+
|
|
176
|
+
| Package | Description |
|
|
177
|
+
|---------|-------------|
|
|
178
|
+
| [@agiflowai/scaffold-mcp](../../packages/scaffold-mcp) | MCP server for code scaffolding |
|
|
179
|
+
| [@agiflowai/architect-mcp](../../packages/architect-mcp) | MCP server for design patterns |
|
|
180
|
+
| [@agiflowai/one-mcp](../../packages/one-mcp) | MCP proxy for reduced token usage |
|
|
181
|
+
|
|
182
|
+
---
|
|
148
183
|
|
|
149
184
|
## License
|
|
150
185
|
|
package/dist/cli.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_services = require('./services-
|
|
3
|
-
const require_mcp = require('./mcp-
|
|
2
|
+
const require_services = require('./services-BoT1Avsb.cjs');
|
|
3
|
+
const require_mcp = require('./mcp--A-5zuBI.cjs');
|
|
4
4
|
let __agiflowai_aicode_utils = require("@agiflowai/aicode-utils");
|
|
5
5
|
let node_path = require("node:path");
|
|
6
6
|
node_path = require_services.__toESM(node_path);
|
|
@@ -11,7 +11,7 @@ ora = require_services.__toESM(ora);
|
|
|
11
11
|
let xstate = require("xstate");
|
|
12
12
|
|
|
13
13
|
//#region package.json
|
|
14
|
-
var version = "1.0.
|
|
14
|
+
var version = "1.0.9";
|
|
15
15
|
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region src/commands/add.ts
|
|
@@ -247,14 +247,14 @@ const initMachine = (0, xstate.createMachine)({
|
|
|
247
247
|
} },
|
|
248
248
|
downloadingTemplates: { invoke: {
|
|
249
249
|
src: "downloadTemplates",
|
|
250
|
-
onDone: {
|
|
250
|
+
onDone: [{
|
|
251
|
+
target: "checkingSkipMcp",
|
|
252
|
+
guard: ({ event }) => event.output === null
|
|
253
|
+
}, {
|
|
251
254
|
target: "listingTemplates",
|
|
252
255
|
actions: (0, xstate.assign)({ tmpTemplatesPath: ({ event }) => event.output })
|
|
253
|
-
},
|
|
254
|
-
onError: {
|
|
255
|
-
target: "failed",
|
|
256
|
-
actions: (0, xstate.assign)({ error: ({ event }) => event.error })
|
|
257
|
-
}
|
|
256
|
+
}],
|
|
257
|
+
onError: { target: "checkingSkipMcp" }
|
|
258
258
|
} },
|
|
259
259
|
listingTemplates: { invoke: {
|
|
260
260
|
src: "listTemplates",
|
|
@@ -342,7 +342,8 @@ const initMachine = (0, xstate.createMachine)({
|
|
|
342
342
|
src: "configureMCP",
|
|
343
343
|
input: ({ context }) => ({
|
|
344
344
|
workspaceRoot: context.workspaceRoot,
|
|
345
|
-
codingAgent: context.codingAgent
|
|
345
|
+
codingAgent: context.codingAgent,
|
|
346
|
+
selectedMcpServers: context.selectedMcpServers
|
|
346
347
|
}),
|
|
347
348
|
onDone: { target: "detectingSpecTool" },
|
|
348
349
|
onError: {
|
|
@@ -658,8 +659,9 @@ const initActors = {
|
|
|
658
659
|
spinner.succeed("Templates downloaded successfully");
|
|
659
660
|
return tmpPath;
|
|
660
661
|
} catch (error) {
|
|
661
|
-
spinner.
|
|
662
|
-
|
|
662
|
+
spinner.warn("Failed to download templates - skipping template setup");
|
|
663
|
+
__agiflowai_aicode_utils.print.info("You can run \"aicode-toolkit init\" again later to set up templates");
|
|
664
|
+
return null;
|
|
663
665
|
}
|
|
664
666
|
}),
|
|
665
667
|
listTemplates: (0, xstate.fromPromise)(async ({ input: input$1 }) => {
|
|
@@ -753,7 +755,7 @@ const initActors = {
|
|
|
753
755
|
configureMCP: (0, xstate.fromPromise)(async ({ input: actorInput }) => {
|
|
754
756
|
const spinner = (0, ora.default)(`Setting up MCP for ${actorInput.codingAgent}...`).start();
|
|
755
757
|
try {
|
|
756
|
-
await new require_services.CodingAgentService(actorInput.workspaceRoot).setupMCP(actorInput.codingAgent);
|
|
758
|
+
await new require_services.CodingAgentService(actorInput.workspaceRoot).setupMCP(actorInput.codingAgent, actorInput.selectedMcpServers);
|
|
757
759
|
spinner.succeed("MCP configuration completed");
|
|
758
760
|
} catch (error) {
|
|
759
761
|
spinner.fail("Failed to configure MCP");
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { r as MCP_SERVER_INFO, t as MCPServer } from "./mcp-
|
|
3
|
-
import { a as SpecToolService, c as cloneSubdirectory, f as parseGitHubUrl, h as CodingAgentService, i as SpecTool, n as TemplateSelectionService, o as NewProjectService, p as displayBanner, r as SPEC_TOOL_INFO, s as cloneRepository, u as findWorkspaceRoot } from "./services-
|
|
2
|
+
import { r as MCP_SERVER_INFO, t as MCPServer } from "./mcp-CBcPdzNG.mjs";
|
|
3
|
+
import { a as SpecToolService, c as cloneSubdirectory, f as parseGitHubUrl, h as CodingAgentService, i as SpecTool, n as TemplateSelectionService, o as NewProjectService, p as displayBanner, r as SPEC_TOOL_INFO, s as cloneRepository, u as findWorkspaceRoot } from "./services-Clvg2ZBI.mjs";
|
|
4
4
|
import { ProjectType, TemplatesManagerService, detectProjectType, ensureDir, icons, messages, pathExists, print, sections } from "@agiflowai/aicode-utils";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { Command } from "commander";
|
|
@@ -9,7 +9,7 @@ import ora from "ora";
|
|
|
9
9
|
import { assign, createActor, createMachine, fromPromise } from "xstate";
|
|
10
10
|
|
|
11
11
|
//#region package.json
|
|
12
|
-
var version = "1.0.
|
|
12
|
+
var version = "1.0.9";
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region src/commands/add.ts
|
|
@@ -245,14 +245,14 @@ const initMachine = createMachine({
|
|
|
245
245
|
} },
|
|
246
246
|
downloadingTemplates: { invoke: {
|
|
247
247
|
src: "downloadTemplates",
|
|
248
|
-
onDone: {
|
|
248
|
+
onDone: [{
|
|
249
|
+
target: "checkingSkipMcp",
|
|
250
|
+
guard: ({ event }) => event.output === null
|
|
251
|
+
}, {
|
|
249
252
|
target: "listingTemplates",
|
|
250
253
|
actions: assign({ tmpTemplatesPath: ({ event }) => event.output })
|
|
251
|
-
},
|
|
252
|
-
onError: {
|
|
253
|
-
target: "failed",
|
|
254
|
-
actions: assign({ error: ({ event }) => event.error })
|
|
255
|
-
}
|
|
254
|
+
}],
|
|
255
|
+
onError: { target: "checkingSkipMcp" }
|
|
256
256
|
} },
|
|
257
257
|
listingTemplates: { invoke: {
|
|
258
258
|
src: "listTemplates",
|
|
@@ -340,7 +340,8 @@ const initMachine = createMachine({
|
|
|
340
340
|
src: "configureMCP",
|
|
341
341
|
input: ({ context }) => ({
|
|
342
342
|
workspaceRoot: context.workspaceRoot,
|
|
343
|
-
codingAgent: context.codingAgent
|
|
343
|
+
codingAgent: context.codingAgent,
|
|
344
|
+
selectedMcpServers: context.selectedMcpServers
|
|
344
345
|
}),
|
|
345
346
|
onDone: { target: "detectingSpecTool" },
|
|
346
347
|
onError: {
|
|
@@ -656,8 +657,9 @@ const initActors = {
|
|
|
656
657
|
spinner.succeed("Templates downloaded successfully");
|
|
657
658
|
return tmpPath;
|
|
658
659
|
} catch (error) {
|
|
659
|
-
spinner.
|
|
660
|
-
|
|
660
|
+
spinner.warn("Failed to download templates - skipping template setup");
|
|
661
|
+
print.info("You can run \"aicode-toolkit init\" again later to set up templates");
|
|
662
|
+
return null;
|
|
661
663
|
}
|
|
662
664
|
}),
|
|
663
665
|
listTemplates: fromPromise(async ({ input: input$1 }) => {
|
|
@@ -751,7 +753,7 @@ const initActors = {
|
|
|
751
753
|
configureMCP: fromPromise(async ({ input: actorInput }) => {
|
|
752
754
|
const spinner = ora(`Setting up MCP for ${actorInput.codingAgent}...`).start();
|
|
753
755
|
try {
|
|
754
|
-
await new CodingAgentService(actorInput.workspaceRoot).setupMCP(actorInput.codingAgent);
|
|
756
|
+
await new CodingAgentService(actorInput.workspaceRoot).setupMCP(actorInput.codingAgent, actorInput.selectedMcpServers);
|
|
755
757
|
spinner.succeed("MCP configuration completed");
|
|
756
758
|
} catch (error) {
|
|
757
759
|
spinner.fail("Failed to configure MCP");
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_services = require('./services-
|
|
2
|
-
require('./mcp-
|
|
1
|
+
const require_services = require('./services-BoT1Avsb.cjs');
|
|
2
|
+
require('./mcp--A-5zuBI.cjs');
|
|
3
3
|
|
|
4
4
|
exports.BANNER_GRADIENT = require_services.BANNER_GRADIENT;
|
|
5
5
|
exports.CodingAgentService = require_services.CodingAgentService;
|
package/dist/index.d.cts
CHANGED
|
@@ -97,8 +97,16 @@ declare class CodingAgentService {
|
|
|
97
97
|
/**
|
|
98
98
|
* Setup MCP configuration for the selected coding agent
|
|
99
99
|
* @param agent - The coding agent to configure
|
|
100
|
+
* @param selectedMcpServers - Optional array of selected MCP servers
|
|
100
101
|
*/
|
|
101
|
-
setupMCP(agent: CodingAgent): Promise<void>;
|
|
102
|
+
setupMCP(agent: CodingAgent, selectedMcpServers?: string[]): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Create mcp-config.yaml file using one-mcp init command
|
|
105
|
+
* This is used when one-mcp is selected to configure which servers it should include
|
|
106
|
+
* Excludes one-mcp itself from the config file
|
|
107
|
+
* @param selectedMcpServers - Array of selected MCP servers
|
|
108
|
+
*/
|
|
109
|
+
private createMcpConfigYaml;
|
|
102
110
|
}
|
|
103
111
|
//#endregion
|
|
104
112
|
//#region src/services/NewProjectService.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -97,8 +97,16 @@ declare class CodingAgentService {
|
|
|
97
97
|
/**
|
|
98
98
|
* Setup MCP configuration for the selected coding agent
|
|
99
99
|
* @param agent - The coding agent to configure
|
|
100
|
+
* @param selectedMcpServers - Optional array of selected MCP servers
|
|
100
101
|
*/
|
|
101
|
-
setupMCP(agent: CodingAgent): Promise<void>;
|
|
102
|
+
setupMCP(agent: CodingAgent, selectedMcpServers?: string[]): Promise<void>;
|
|
103
|
+
/**
|
|
104
|
+
* Create mcp-config.yaml file using one-mcp init command
|
|
105
|
+
* This is used when one-mcp is selected to configure which servers it should include
|
|
106
|
+
* Excludes one-mcp itself from the config file
|
|
107
|
+
* @param selectedMcpServers - Array of selected MCP servers
|
|
108
|
+
*/
|
|
109
|
+
private createMcpConfigYaml;
|
|
102
110
|
}
|
|
103
111
|
//#endregion
|
|
104
112
|
//#region src/services/NewProjectService.d.ts
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./mcp-
|
|
2
|
-
import { _ as THEME, c as cloneSubdirectory, d as gitInit, f as parseGitHubUrl, g as BANNER_GRADIENT, h as CodingAgentService, l as fetchGitHubDirectoryContents, m as displayCompactBanner, n as TemplateSelectionService, o as NewProjectService, p as displayBanner, s as cloneRepository, t as TemplatesService, u as findWorkspaceRoot } from "./services-
|
|
1
|
+
import "./mcp-CBcPdzNG.mjs";
|
|
2
|
+
import { _ as THEME, c as cloneSubdirectory, d as gitInit, f as parseGitHubUrl, g as BANNER_GRADIENT, h as CodingAgentService, l as fetchGitHubDirectoryContents, m as displayCompactBanner, n as TemplateSelectionService, o as NewProjectService, p as displayBanner, s as cloneRepository, t as TemplatesService, u as findWorkspaceRoot } from "./services-Clvg2ZBI.mjs";
|
|
3
3
|
|
|
4
4
|
export { BANNER_GRADIENT, CodingAgentService, NewProjectService, THEME, TemplateSelectionService, TemplatesService, cloneRepository, cloneSubdirectory, displayBanner, displayCompactBanner, fetchGitHubDirectoryContents, findWorkspaceRoot, gitInit, parseGitHubUrl };
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* Available MCP servers
|
|
16
16
|
*/
|
|
17
17
|
let MCPServer = /* @__PURE__ */ function(MCPServer$1) {
|
|
18
|
+
MCPServer$1["ONE_MCP"] = "one-mcp";
|
|
18
19
|
MCPServer$1["ARCHITECT"] = "architect-mcp";
|
|
19
20
|
MCPServer$1["SCAFFOLD"] = "scaffold-mcp";
|
|
20
21
|
return MCPServer$1;
|
|
@@ -23,10 +24,12 @@ let MCPServer = /* @__PURE__ */ function(MCPServer$1) {
|
|
|
23
24
|
* MCP server configuration files
|
|
24
25
|
* Maps each MCP server to its specific configuration files
|
|
25
26
|
*
|
|
27
|
+
* - one-mcp: Unified MCP server that includes all functionality
|
|
26
28
|
* - architect-mcp: Only needs RULES.yaml and architect.yaml
|
|
27
29
|
* - scaffold-mcp: Needs all other template files (excluding architect files)
|
|
28
30
|
*/
|
|
29
31
|
const MCP_CONFIG_FILES = {
|
|
32
|
+
[MCPServer.ONE_MCP]: [],
|
|
30
33
|
[MCPServer.ARCHITECT]: ["RULES.yaml", "architect.yaml"],
|
|
31
34
|
[MCPServer.SCAFFOLD]: []
|
|
32
35
|
};
|
|
@@ -34,6 +37,10 @@ const MCP_CONFIG_FILES = {
|
|
|
34
37
|
* MCP server display names and descriptions for user prompts
|
|
35
38
|
*/
|
|
36
39
|
const MCP_SERVER_INFO = {
|
|
40
|
+
[MCPServer.ONE_MCP]: {
|
|
41
|
+
name: "One MCP (Recommended)",
|
|
42
|
+
description: "Progressive disclosed MCP that is token efficient and customizable"
|
|
43
|
+
},
|
|
37
44
|
[MCPServer.ARCHITECT]: {
|
|
38
45
|
name: "Architect MCP",
|
|
39
46
|
description: "Code review, design patterns, and coding standards enforcement"
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* Available MCP servers
|
|
15
15
|
*/
|
|
16
16
|
let MCPServer = /* @__PURE__ */ function(MCPServer$1) {
|
|
17
|
+
MCPServer$1["ONE_MCP"] = "one-mcp";
|
|
17
18
|
MCPServer$1["ARCHITECT"] = "architect-mcp";
|
|
18
19
|
MCPServer$1["SCAFFOLD"] = "scaffold-mcp";
|
|
19
20
|
return MCPServer$1;
|
|
@@ -22,10 +23,12 @@ let MCPServer = /* @__PURE__ */ function(MCPServer$1) {
|
|
|
22
23
|
* MCP server configuration files
|
|
23
24
|
* Maps each MCP server to its specific configuration files
|
|
24
25
|
*
|
|
26
|
+
* - one-mcp: Unified MCP server that includes all functionality
|
|
25
27
|
* - architect-mcp: Only needs RULES.yaml and architect.yaml
|
|
26
28
|
* - scaffold-mcp: Needs all other template files (excluding architect files)
|
|
27
29
|
*/
|
|
28
30
|
const MCP_CONFIG_FILES = {
|
|
31
|
+
[MCPServer.ONE_MCP]: [],
|
|
29
32
|
[MCPServer.ARCHITECT]: ["RULES.yaml", "architect.yaml"],
|
|
30
33
|
[MCPServer.SCAFFOLD]: []
|
|
31
34
|
};
|
|
@@ -33,6 +36,10 @@ const MCP_CONFIG_FILES = {
|
|
|
33
36
|
* MCP server display names and descriptions for user prompts
|
|
34
37
|
*/
|
|
35
38
|
const MCP_SERVER_INFO = {
|
|
39
|
+
[MCPServer.ONE_MCP]: {
|
|
40
|
+
name: "One MCP (Recommended)",
|
|
41
|
+
description: "Progressive disclosed MCP that is token efficient and customizable"
|
|
42
|
+
},
|
|
36
43
|
[MCPServer.ARCHITECT]: {
|
|
37
44
|
name: "Architect MCP",
|
|
38
45
|
description: "Code review, design patterns, and coding standards enforcement"
|
|
@@ -6,12 +6,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
8
|
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
15
19
|
}
|
|
16
20
|
return to;
|
|
17
21
|
};
|
|
@@ -217,8 +221,9 @@ var CodingAgentService = class {
|
|
|
217
221
|
/**
|
|
218
222
|
* Setup MCP configuration for the selected coding agent
|
|
219
223
|
* @param agent - The coding agent to configure
|
|
224
|
+
* @param selectedMcpServers - Optional array of selected MCP servers
|
|
220
225
|
*/
|
|
221
|
-
async setupMCP(agent) {
|
|
226
|
+
async setupMCP(agent, selectedMcpServers) {
|
|
222
227
|
if (agent === __agiflowai_coding_agent_bridge.NONE) {
|
|
223
228
|
__agiflowai_aicode_utils.print.info("Skipping MCP configuration");
|
|
224
229
|
return;
|
|
@@ -248,8 +253,23 @@ var CodingAgentService = class {
|
|
|
248
253
|
__agiflowai_aicode_utils.print.info("Please configure MCP servers manually for this coding agent.");
|
|
249
254
|
return;
|
|
250
255
|
}
|
|
251
|
-
|
|
252
|
-
|
|
256
|
+
if (selectedMcpServers?.includes("one-mcp")) {
|
|
257
|
+
await this.createMcpConfigYaml(selectedMcpServers);
|
|
258
|
+
await service.updateMcpSettings({ servers: { "one-mcp": {
|
|
259
|
+
type: "stdio",
|
|
260
|
+
command: "npx",
|
|
261
|
+
args: [
|
|
262
|
+
"-y",
|
|
263
|
+
"@agiflowai/one-mcp",
|
|
264
|
+
"mcp-serve"
|
|
265
|
+
],
|
|
266
|
+
disabled: false
|
|
267
|
+
} } });
|
|
268
|
+
__agiflowai_aicode_utils.print.success(`Added one-mcp to ${configLocation}`);
|
|
269
|
+
__agiflowai_aicode_utils.print.success("Created mcp-config.yaml with selected MCP server configurations");
|
|
270
|
+
} else {
|
|
271
|
+
const mcpServers = {};
|
|
272
|
+
if (selectedMcpServers?.includes("scaffold-mcp") ?? true) mcpServers["scaffold-mcp"] = {
|
|
253
273
|
type: "stdio",
|
|
254
274
|
command: "npx",
|
|
255
275
|
args: [
|
|
@@ -258,8 +278,8 @@ var CodingAgentService = class {
|
|
|
258
278
|
"mcp-serve"
|
|
259
279
|
],
|
|
260
280
|
disabled: false
|
|
261
|
-
}
|
|
262
|
-
"architect-mcp"
|
|
281
|
+
};
|
|
282
|
+
if (selectedMcpServers?.includes("architect-mcp") ?? true) mcpServers["architect-mcp"] = {
|
|
263
283
|
type: "stdio",
|
|
264
284
|
command: "npx",
|
|
265
285
|
args: [
|
|
@@ -268,14 +288,70 @@ var CodingAgentService = class {
|
|
|
268
288
|
"mcp-serve"
|
|
269
289
|
],
|
|
270
290
|
disabled: false
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
291
|
+
};
|
|
292
|
+
await service.updateMcpSettings({ servers: mcpServers });
|
|
293
|
+
const serverNames = Object.keys(mcpServers).join(" and ");
|
|
294
|
+
__agiflowai_aicode_utils.print.success(`Added ${serverNames} to ${configLocation}`);
|
|
295
|
+
}
|
|
274
296
|
__agiflowai_aicode_utils.print.info("\nNext steps:");
|
|
275
297
|
__agiflowai_aicode_utils.print.indent(`1. ${restartInstructions}`);
|
|
276
|
-
__agiflowai_aicode_utils.print.indent("2. The
|
|
298
|
+
__agiflowai_aicode_utils.print.indent("2. The configured MCP servers will be available");
|
|
277
299
|
__agiflowai_aicode_utils.print.success("\nMCP configuration completed!");
|
|
278
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Create mcp-config.yaml file using one-mcp init command
|
|
303
|
+
* This is used when one-mcp is selected to configure which servers it should include
|
|
304
|
+
* Excludes one-mcp itself from the config file
|
|
305
|
+
* @param selectedMcpServers - Array of selected MCP servers
|
|
306
|
+
*/
|
|
307
|
+
async createMcpConfigYaml(selectedMcpServers) {
|
|
308
|
+
const { execSync } = await import("node:child_process");
|
|
309
|
+
const path$4 = await import("node:path");
|
|
310
|
+
const servers = {};
|
|
311
|
+
const serversToInclude = selectedMcpServers?.filter((s) => s !== "one-mcp") ?? [];
|
|
312
|
+
for (const server of serversToInclude) if (server === "scaffold-mcp") servers["scaffold-mcp"] = {
|
|
313
|
+
command: "npx",
|
|
314
|
+
args: [
|
|
315
|
+
"-y",
|
|
316
|
+
"@agiflowai/scaffold-mcp",
|
|
317
|
+
"mcp-serve",
|
|
318
|
+
"--admin-enable"
|
|
319
|
+
]
|
|
320
|
+
};
|
|
321
|
+
else if (server === "architect-mcp") servers["architect-mcp"] = {
|
|
322
|
+
command: "npx",
|
|
323
|
+
args: [
|
|
324
|
+
"-y",
|
|
325
|
+
"@agiflowai/architect-mcp",
|
|
326
|
+
"mcp-serve",
|
|
327
|
+
"--admin-enable"
|
|
328
|
+
]
|
|
329
|
+
};
|
|
330
|
+
if (Object.keys(servers).length === 0) {
|
|
331
|
+
servers["scaffold-mcp"] = {
|
|
332
|
+
command: "npx",
|
|
333
|
+
args: [
|
|
334
|
+
"-y",
|
|
335
|
+
"@agiflowai/scaffold-mcp",
|
|
336
|
+
"mcp-serve",
|
|
337
|
+
"--admin-enable"
|
|
338
|
+
]
|
|
339
|
+
};
|
|
340
|
+
servers["architect-mcp"] = {
|
|
341
|
+
command: "npx",
|
|
342
|
+
args: [
|
|
343
|
+
"-y",
|
|
344
|
+
"@agiflowai/architect-mcp",
|
|
345
|
+
"mcp-serve",
|
|
346
|
+
"--admin-enable"
|
|
347
|
+
]
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
execSync(`npx -y @agiflowai/one-mcp init -o "${path$4.join(this.workspaceRoot, "mcp-config.yaml")}" -f --mcp-servers '${JSON.stringify(servers)}'`, {
|
|
351
|
+
cwd: this.workspaceRoot,
|
|
352
|
+
stdio: "inherit"
|
|
353
|
+
});
|
|
354
|
+
}
|
|
279
355
|
};
|
|
280
356
|
|
|
281
357
|
//#endregion
|
|
@@ -893,7 +969,7 @@ var TemplateSelectionService = class {
|
|
|
893
969
|
* @param selectedMcpServers - Selected MCP servers
|
|
894
970
|
*/
|
|
895
971
|
async copyTemplateWithMcpFilter(sourcePath, targetPath, selectedMcpServers) {
|
|
896
|
-
const { MCPServer: MCPServer$1, MCP_CONFIG_FILES: MCP_CONFIG_FILES$1 } = await Promise.resolve().then(() => require("./mcp-
|
|
972
|
+
const { MCPServer: MCPServer$1, MCP_CONFIG_FILES: MCP_CONFIG_FILES$1 } = await Promise.resolve().then(() => require("./mcp-B9X7HURl.cjs"));
|
|
897
973
|
const architectFiles = MCP_CONFIG_FILES$1[MCPServer$1.ARCHITECT];
|
|
898
974
|
const hasArchitect = selectedMcpServers.includes(MCPServer$1.ARCHITECT);
|
|
899
975
|
const hasScaffold = selectedMcpServers.includes(MCPServer$1.SCAFFOLD);
|
|
@@ -189,8 +189,9 @@ var CodingAgentService = class {
|
|
|
189
189
|
/**
|
|
190
190
|
* Setup MCP configuration for the selected coding agent
|
|
191
191
|
* @param agent - The coding agent to configure
|
|
192
|
+
* @param selectedMcpServers - Optional array of selected MCP servers
|
|
192
193
|
*/
|
|
193
|
-
async setupMCP(agent) {
|
|
194
|
+
async setupMCP(agent, selectedMcpServers) {
|
|
194
195
|
if (agent === NONE) {
|
|
195
196
|
print.info("Skipping MCP configuration");
|
|
196
197
|
return;
|
|
@@ -220,8 +221,23 @@ var CodingAgentService = class {
|
|
|
220
221
|
print.info("Please configure MCP servers manually for this coding agent.");
|
|
221
222
|
return;
|
|
222
223
|
}
|
|
223
|
-
|
|
224
|
-
|
|
224
|
+
if (selectedMcpServers?.includes("one-mcp")) {
|
|
225
|
+
await this.createMcpConfigYaml(selectedMcpServers);
|
|
226
|
+
await service.updateMcpSettings({ servers: { "one-mcp": {
|
|
227
|
+
type: "stdio",
|
|
228
|
+
command: "npx",
|
|
229
|
+
args: [
|
|
230
|
+
"-y",
|
|
231
|
+
"@agiflowai/one-mcp",
|
|
232
|
+
"mcp-serve"
|
|
233
|
+
],
|
|
234
|
+
disabled: false
|
|
235
|
+
} } });
|
|
236
|
+
print.success(`Added one-mcp to ${configLocation}`);
|
|
237
|
+
print.success("Created mcp-config.yaml with selected MCP server configurations");
|
|
238
|
+
} else {
|
|
239
|
+
const mcpServers = {};
|
|
240
|
+
if (selectedMcpServers?.includes("scaffold-mcp") ?? true) mcpServers["scaffold-mcp"] = {
|
|
225
241
|
type: "stdio",
|
|
226
242
|
command: "npx",
|
|
227
243
|
args: [
|
|
@@ -230,8 +246,8 @@ var CodingAgentService = class {
|
|
|
230
246
|
"mcp-serve"
|
|
231
247
|
],
|
|
232
248
|
disabled: false
|
|
233
|
-
}
|
|
234
|
-
"architect-mcp"
|
|
249
|
+
};
|
|
250
|
+
if (selectedMcpServers?.includes("architect-mcp") ?? true) mcpServers["architect-mcp"] = {
|
|
235
251
|
type: "stdio",
|
|
236
252
|
command: "npx",
|
|
237
253
|
args: [
|
|
@@ -240,14 +256,70 @@ var CodingAgentService = class {
|
|
|
240
256
|
"mcp-serve"
|
|
241
257
|
],
|
|
242
258
|
disabled: false
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
|
|
259
|
+
};
|
|
260
|
+
await service.updateMcpSettings({ servers: mcpServers });
|
|
261
|
+
const serverNames = Object.keys(mcpServers).join(" and ");
|
|
262
|
+
print.success(`Added ${serverNames} to ${configLocation}`);
|
|
263
|
+
}
|
|
246
264
|
print.info("\nNext steps:");
|
|
247
265
|
print.indent(`1. ${restartInstructions}`);
|
|
248
|
-
print.indent("2. The
|
|
266
|
+
print.indent("2. The configured MCP servers will be available");
|
|
249
267
|
print.success("\nMCP configuration completed!");
|
|
250
268
|
}
|
|
269
|
+
/**
|
|
270
|
+
* Create mcp-config.yaml file using one-mcp init command
|
|
271
|
+
* This is used when one-mcp is selected to configure which servers it should include
|
|
272
|
+
* Excludes one-mcp itself from the config file
|
|
273
|
+
* @param selectedMcpServers - Array of selected MCP servers
|
|
274
|
+
*/
|
|
275
|
+
async createMcpConfigYaml(selectedMcpServers) {
|
|
276
|
+
const { execSync } = await import("node:child_process");
|
|
277
|
+
const path$1 = await import("node:path");
|
|
278
|
+
const servers = {};
|
|
279
|
+
const serversToInclude = selectedMcpServers?.filter((s) => s !== "one-mcp") ?? [];
|
|
280
|
+
for (const server of serversToInclude) if (server === "scaffold-mcp") servers["scaffold-mcp"] = {
|
|
281
|
+
command: "npx",
|
|
282
|
+
args: [
|
|
283
|
+
"-y",
|
|
284
|
+
"@agiflowai/scaffold-mcp",
|
|
285
|
+
"mcp-serve",
|
|
286
|
+
"--admin-enable"
|
|
287
|
+
]
|
|
288
|
+
};
|
|
289
|
+
else if (server === "architect-mcp") servers["architect-mcp"] = {
|
|
290
|
+
command: "npx",
|
|
291
|
+
args: [
|
|
292
|
+
"-y",
|
|
293
|
+
"@agiflowai/architect-mcp",
|
|
294
|
+
"mcp-serve",
|
|
295
|
+
"--admin-enable"
|
|
296
|
+
]
|
|
297
|
+
};
|
|
298
|
+
if (Object.keys(servers).length === 0) {
|
|
299
|
+
servers["scaffold-mcp"] = {
|
|
300
|
+
command: "npx",
|
|
301
|
+
args: [
|
|
302
|
+
"-y",
|
|
303
|
+
"@agiflowai/scaffold-mcp",
|
|
304
|
+
"mcp-serve",
|
|
305
|
+
"--admin-enable"
|
|
306
|
+
]
|
|
307
|
+
};
|
|
308
|
+
servers["architect-mcp"] = {
|
|
309
|
+
command: "npx",
|
|
310
|
+
args: [
|
|
311
|
+
"-y",
|
|
312
|
+
"@agiflowai/architect-mcp",
|
|
313
|
+
"mcp-serve",
|
|
314
|
+
"--admin-enable"
|
|
315
|
+
]
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
execSync(`npx -y @agiflowai/one-mcp init -o "${path$1.join(this.workspaceRoot, "mcp-config.yaml")}" -f --mcp-servers '${JSON.stringify(servers)}'`, {
|
|
319
|
+
cwd: this.workspaceRoot,
|
|
320
|
+
stdio: "inherit"
|
|
321
|
+
});
|
|
322
|
+
}
|
|
251
323
|
};
|
|
252
324
|
|
|
253
325
|
//#endregion
|
|
@@ -865,7 +937,7 @@ var TemplateSelectionService = class {
|
|
|
865
937
|
* @param selectedMcpServers - Selected MCP servers
|
|
866
938
|
*/
|
|
867
939
|
async copyTemplateWithMcpFilter(sourcePath, targetPath, selectedMcpServers) {
|
|
868
|
-
const { MCPServer: MCPServer$1, MCP_CONFIG_FILES: MCP_CONFIG_FILES$1 } = await import("./mcp-
|
|
940
|
+
const { MCPServer: MCPServer$1, MCP_CONFIG_FILES: MCP_CONFIG_FILES$1 } = await import("./mcp-Cvo6pkS0.mjs");
|
|
869
941
|
const architectFiles = MCP_CONFIG_FILES$1[MCPServer$1.ARCHITECT];
|
|
870
942
|
const hasArchitect = selectedMcpServers.includes(MCPServer$1.ARCHITECT);
|
|
871
943
|
const hasScaffold = selectedMcpServers.includes(MCPServer$1.SCAFFOLD);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agiflowai/aicode-toolkit",
|
|
3
3
|
"description": "AI-powered code toolkit CLI for scaffolding, architecture management, and development workflows",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.10",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"author": "AgiflowIO",
|
|
7
7
|
"repository": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"pino-pretty": "^13.1.1",
|
|
51
51
|
"xstate": "^5.23.0",
|
|
52
52
|
"zod": "3.25.76",
|
|
53
|
-
"@agiflowai/aicode-utils": "1.0.
|
|
54
|
-
"@agiflowai/coding-agent-bridge": "1.0.
|
|
53
|
+
"@agiflowai/aicode-utils": "1.0.8",
|
|
54
|
+
"@agiflowai/coding-agent-bridge": "1.0.8"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/express": "^5.0.0",
|
package/dist/mcp-Bdxvi2Ej.cjs
DELETED
package/dist/mcp-BgNkvV6h.mjs
DELETED