@agiflowai/aicode-toolkit 1.0.25 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +164 -172
- package/dist/cli.mjs +51 -59
- package/dist/index.cjs +3 -4
- package/dist/index.d.cts +0 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +2 -4
- package/dist/{mcp--A-5zuBI.cjs → mcp-CwMcfNLE.mjs} +23 -25
- package/dist/{mcp-CBcPdzNG.mjs → mcp-HNZY6MpT.cjs} +23 -7
- package/dist/mcp-XXavvCHL.cjs +3 -0
- package/dist/{utils-DMP5MQCv.cjs → utils-BCVXMGNF.cjs} +198 -206
- package/dist/{utils-BTSpNlWu.mjs → utils-BM7-O0sC.mjs} +18 -21
- package/package.json +21 -21
- package/dist/mcp-B9X7HURl.cjs +0 -4
- package/dist/mcp-Cvo6pkS0.mjs +0 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "./mcp-CwMcfNLE.mjs";
|
|
1
2
|
import { CLAUDE_CODE, CODEX, CURSOR, ClaudeCodeService, CodexService, CursorService, GEMINI_CLI, GITHUB_COPILOT, GeminiCliService, GitHubCopilotService, NONE } from "@agiflowai/coding-agent-bridge";
|
|
2
3
|
import { ProjectType, cloneRepository, cloneSubdirectory, copy, ensureDir, fetchGitHubDirectoryContents, gitInit, messages, mkdir, parseGitHubUrl, pathExists, print, readFile, readdir, remove, writeFile } from "@agiflowai/aicode-utils";
|
|
3
4
|
import fs from "node:fs/promises";
|
|
@@ -5,9 +6,8 @@ import path from "node:path";
|
|
|
5
6
|
import { execa } from "execa";
|
|
6
7
|
import { Liquid } from "liquidjs";
|
|
7
8
|
import os from "node:os";
|
|
8
|
-
import
|
|
9
|
+
import * as chalkImport from "chalk";
|
|
9
10
|
import gradient from "gradient-string";
|
|
10
|
-
|
|
11
11
|
//#region src/constants/theme.ts
|
|
12
12
|
/**
|
|
13
13
|
* Theme color constants for AICode Toolkit
|
|
@@ -68,7 +68,6 @@ const BANNER_GRADIENT = [
|
|
|
68
68
|
THEME.colors.secondary.default,
|
|
69
69
|
THEME.colors.secondary.dark
|
|
70
70
|
];
|
|
71
|
-
|
|
72
71
|
//#endregion
|
|
73
72
|
//#region src/services/CodingAgentService.ts
|
|
74
73
|
/**
|
|
@@ -274,7 +273,7 @@ var CodingAgentService = class {
|
|
|
274
273
|
*/
|
|
275
274
|
async createMcpConfigYaml(selectedMcpServers) {
|
|
276
275
|
const { execSync } = await import("node:child_process");
|
|
277
|
-
const path
|
|
276
|
+
const path = await import("node:path");
|
|
278
277
|
const servers = {};
|
|
279
278
|
const serversToInclude = selectedMcpServers?.filter((s) => s !== "one-mcp") ?? [];
|
|
280
279
|
for (const server of serversToInclude) if (server === "scaffold-mcp") servers["scaffold-mcp"] = {
|
|
@@ -315,13 +314,12 @@ var CodingAgentService = class {
|
|
|
315
314
|
]
|
|
316
315
|
};
|
|
317
316
|
}
|
|
318
|
-
execSync(`npx -y @agiflowai/one-mcp init -o "${path
|
|
317
|
+
execSync(`npx -y @agiflowai/one-mcp init -o "${path.join(this.workspaceRoot, "mcp-config.yaml")}" -f --mcp-servers '${JSON.stringify(servers)}'`, {
|
|
319
318
|
cwd: this.workspaceRoot,
|
|
320
319
|
stdio: "inherit"
|
|
321
320
|
});
|
|
322
321
|
}
|
|
323
322
|
};
|
|
324
|
-
|
|
325
323
|
//#endregion
|
|
326
324
|
//#region src/services/NewProjectService.ts
|
|
327
325
|
/**
|
|
@@ -459,11 +457,9 @@ var NewProjectService = class {
|
|
|
459
457
|
return true;
|
|
460
458
|
}
|
|
461
459
|
};
|
|
462
|
-
|
|
463
460
|
//#endregion
|
|
464
461
|
//#region src/instructions/specs/openspec.md?raw
|
|
465
462
|
var openspec_default = "When working on this project, follow the OpenSpec spec-driven development workflow{% if scaffoldMcp or architectMcp %} integrated with MCP tools{% endif %}.\n\n{% if scaffoldMcp %}\n\n## {% if scaffoldMcp %}1{% else %}1{% endif %}. Create Proposals with scaffold-mcp\n\nWhen implementing new features or changes, use scaffold-mcp MCP tools:\n\n**For new projects/features:**\n1. Use `list-boilerplates` MCP tool to see available templates\n2. Use `use-boilerplate` MCP tool to scaffold new projects{% if projectType == 'monolith' %} (set `monolith: true`){% elsif projectType == 'monorepo' %} (omit `monolith` parameter){% endif %}\n3. Use `list-scaffolding-methods` MCP tool to understand which methods can be used to add features\n4. Create OpenSpec proposal with available scaffolding methods in mind: \"Create an OpenSpec proposal for [feature description]\"\n\n**For adding features to existing code:**\n1. Use `list-scaffolding-methods` MCP tool with projectPath to see available features{% if projectType == 'monolith' %} (`projectPath` = workspace root){% elsif projectType == 'monorepo' %} (`projectPath` = project directory with project.json){% endif %}\n2. Review available methods and plan which ones to use for the feature\n3. Use `use-scaffold-method` MCP tool to generate boilerplate code\n4. Create OpenSpec proposal to capture the specs\n{% if projectType %}\n\n**Path Mapping ({% if projectType == 'monolith' %}Monolith{% else %}Monorepo{% endif %} Project):**\n{% if projectType == 'monolith' %}\n*This is a monolith project:*\n- Single project at workspace root\n- Config file: `.toolkit/settings.yaml` at root\n- All code in workspace root (src/, lib/, etc.)\n- When scaffolding: Use `monolith: true` parameter\n- When using scaffold methods: `projectPath` = workspace root\n\nExample: For workspace at `/path/to/project`:\n- Project config: `/path/to/project/.toolkit/settings.yaml`\n- Source code: `/path/to/project/src/`\n- OpenSpec: `/path/to/project/openspec/`\n{% else %}\n*This is a monorepo project:*\n- Multiple projects in subdirectories\n- Config file: `project.json` in each project\n- Projects in apps/, packages/, libs/, etc.\n- When scaffolding: Omit `monolith` parameter (defaults to false)\n- When using scaffold methods: `projectPath` = path to specific project\n\nExample: For workspace at `/path/to/workspace`:\n- App config: `/path/to/workspace/apps/my-app/project.json`\n- App source: `/path/to/workspace/apps/my-app/src/`\n- OpenSpec: `/path/to/workspace/openspec/` (workspace-level)\n{% endif %}\n{% endif %}\n\nAI will scaffold: openspec/changes/[feature-name]/ with proposal.md, tasks.md, and spec deltas\n{% endif %}\n{% if architectMcp %}\n\n## {% if scaffoldMcp %}2{% else %}1{% endif %}. Review & Validate with architect-mcp\n\nBefore and after editing files, use architect-mcp MCP tools:\n\n**Before editing:**\n- Use `get-file-design-pattern` MCP tool to understand:\n - Applicable design patterns from architect.yaml\n - Coding rules from RULES.yaml (must_do, should_do, must_not_do)\n - Code examples showing the patterns\n\n**After editing:**\n- Use `review-code-change` MCP tool to check for:\n - Must not do violations (critical issues)\n - Must do missing (required patterns not followed)\n - Should do suggestions (best practices)\n\n**Validate OpenSpec specs:**\n- Use `openspec validate [feature-name]` to check spec formatting\n- Iterate with AI until specs are agreed upon\n{% endif %}\n\n## {% if scaffoldMcp and architectMcp %}3{% elsif scaffoldMcp or architectMcp %}2{% else %}1{% endif %}. Implement{% if architectMcp %} with MCP-Guided Development{% endif %}\n\nDuring implementation:\n1. Ask AI to implement: \"Apply the OpenSpec change [feature-name]\"\n{% if architectMcp %}\n2. **Before each file edit**: Use `get-file-design-pattern` to understand patterns\n3. AI implements tasks from tasks.md following design patterns\n4. **After each file edit**: Use `review-code-change` to verify compliance\n5. Fix any violations before proceeding\n{% else %}\n2. AI implements tasks from tasks.md following the agreed specs\n{% endif %}\n\n## {% if scaffoldMcp and architectMcp %}4{% elsif scaffoldMcp or architectMcp %}3{% else %}2{% endif %}. Archive Completed Changes\n{% if scaffoldMcp or architectMcp %}\n\n## MCP Tools Reference\n{% endif %}\n{% if scaffoldMcp %}\n\n### scaffold-mcp\n- `list-boilerplates` - List available project templates\n- `use-boilerplate` - Create new project from template\n- `list-scaffolding-methods` - List features for existing project\n- `use-scaffold-method` - Add feature to existing project\n{% endif %}\n{% if architectMcp %}\n\n### architect-mcp\n- `get-file-design-pattern` - Get design patterns for file\n- `review-code-change` - Review code for violations\n{% endif %}\n\n## Workflow Summary\n\n{% if scaffoldMcp %}\n1. **Plan**: Use scaffold-mcp to generate boilerplate + OpenSpec proposal for specs\n{% else %}\n1. **Plan**: Create OpenSpec proposal with specs\n{% endif %}\n{% if architectMcp %}\n{% if scaffoldMcp %}2{% else %}2{% endif %}. **Design**: Use architect-mcp to understand patterns before editing\n{% endif %}\n{% if scaffoldMcp and architectMcp %}3{% elsif scaffoldMcp or architectMcp %}{% if architectMcp %}3{% else %}2{% endif %}{% else %}2{% endif %}. **Implement**: Follow specs{% if architectMcp %} and patterns{% endif %}\n{% if architectMcp %}\n{% if scaffoldMcp %}4{% else %}4{% endif %}. **Review**: Use architect-mcp to validate code quality\n{% endif %}\n{% if scaffoldMcp and architectMcp %}5{% elsif scaffoldMcp or architectMcp %}{% if architectMcp %}5{% else %}3{% endif %}{% else %}3{% endif %}. **Archive**: Merge specs into source of truth\n";
|
|
466
|
-
|
|
467
463
|
//#endregion
|
|
468
464
|
//#region src/specs/openspec.ts
|
|
469
465
|
/**
|
|
@@ -540,7 +536,6 @@ var OpenSpecBridge = class {
|
|
|
540
536
|
return (await new Liquid().parseAndRender(openspec_default, enabledMcps)).trim();
|
|
541
537
|
}
|
|
542
538
|
};
|
|
543
|
-
|
|
544
539
|
//#endregion
|
|
545
540
|
//#region src/services/SpecToolService.ts
|
|
546
541
|
/**
|
|
@@ -558,9 +553,9 @@ var OpenSpecBridge = class {
|
|
|
558
553
|
/**
|
|
559
554
|
* Available spec tools
|
|
560
555
|
*/
|
|
561
|
-
let SpecTool = /* @__PURE__ */ function(SpecTool
|
|
562
|
-
SpecTool
|
|
563
|
-
return SpecTool
|
|
556
|
+
let SpecTool = /* @__PURE__ */ function(SpecTool) {
|
|
557
|
+
SpecTool["OPENSPEC"] = "openspec";
|
|
558
|
+
return SpecTool;
|
|
564
559
|
}({});
|
|
565
560
|
/**
|
|
566
561
|
* Spec tool information
|
|
@@ -630,7 +625,6 @@ var SpecToolService = class {
|
|
|
630
625
|
return prompt;
|
|
631
626
|
}
|
|
632
627
|
};
|
|
633
|
-
|
|
634
628
|
//#endregion
|
|
635
629
|
//#region src/services/TemplateSelectionService.ts
|
|
636
630
|
/**
|
|
@@ -758,10 +752,10 @@ var TemplateSelectionService = class {
|
|
|
758
752
|
* @param selectedMcpServers - Selected MCP servers
|
|
759
753
|
*/
|
|
760
754
|
async copyTemplateWithMcpFilter(sourcePath, targetPath, selectedMcpServers) {
|
|
761
|
-
const { MCPServer
|
|
762
|
-
const architectFiles = MCP_CONFIG_FILES
|
|
763
|
-
const hasArchitect = selectedMcpServers.includes(MCPServer
|
|
764
|
-
const hasScaffold = selectedMcpServers.includes(MCPServer
|
|
755
|
+
const { MCPServer, MCP_CONFIG_FILES } = await import("./mcp-CwMcfNLE.mjs").then((n) => n.r);
|
|
756
|
+
const architectFiles = MCP_CONFIG_FILES[MCPServer.ARCHITECT];
|
|
757
|
+
const hasArchitect = selectedMcpServers.includes(MCPServer.ARCHITECT);
|
|
758
|
+
const hasScaffold = selectedMcpServers.includes(MCPServer.SCAFFOLD);
|
|
765
759
|
await ensureDir(targetPath);
|
|
766
760
|
const entries = await readdir(sourcePath, { withFileTypes: true });
|
|
767
761
|
for (const entry of entries) {
|
|
@@ -817,7 +811,6 @@ var TemplateSelectionService = class {
|
|
|
817
811
|
}
|
|
818
812
|
}
|
|
819
813
|
};
|
|
820
|
-
|
|
821
814
|
//#endregion
|
|
822
815
|
//#region src/services/TemplatesService.ts
|
|
823
816
|
/**
|
|
@@ -913,9 +906,14 @@ See existing templates for examples and documentation for more details.
|
|
|
913
906
|
`);
|
|
914
907
|
}
|
|
915
908
|
};
|
|
916
|
-
|
|
917
909
|
//#endregion
|
|
918
910
|
//#region src/utils/banner.ts
|
|
911
|
+
function resolveChalk(value, depth = 0) {
|
|
912
|
+
if (value && (typeof value === "object" || typeof value === "function") && "red" in value && typeof value.red === "function") return value;
|
|
913
|
+
if (depth < 3 && value && (typeof value === "object" || typeof value === "function") && "default" in value) return resolveChalk(value.default, depth + 1);
|
|
914
|
+
throw new Error("Unable to resolve chalk instance");
|
|
915
|
+
}
|
|
916
|
+
const chalk = resolveChalk(chalkImport);
|
|
919
917
|
/**
|
|
920
918
|
* ASCII art for AICode Toolkit - simple and highly readable design
|
|
921
919
|
* Uses clean block style with clear spacing
|
|
@@ -956,6 +954,5 @@ function displayCompactBanner() {
|
|
|
956
954
|
console.log(chalk.dim(" AI-Powered Code Toolkit"));
|
|
957
955
|
console.log();
|
|
958
956
|
}
|
|
959
|
-
|
|
960
957
|
//#endregion
|
|
961
|
-
export { SPEC_TOOL_INFO as a, NewProjectService as c, THEME as d, TemplateSelectionService as i, CodingAgentService as l, displayCompactBanner as n, SpecTool as o, TemplatesService as r, SpecToolService as s, displayBanner as t, BANNER_GRADIENT as u };
|
|
958
|
+
export { SPEC_TOOL_INFO as a, NewProjectService as c, THEME as d, TemplateSelectionService as i, CodingAgentService as l, displayCompactBanner as n, SpecTool as o, TemplatesService as r, SpecToolService as s, displayBanner as t, BANNER_GRADIENT as u };
|
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.1.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"author": "AgiflowIO",
|
|
7
7
|
"repository": {
|
|
@@ -35,31 +35,31 @@
|
|
|
35
35
|
"README.md"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@composio/json-schema-to-zod": "0.1.
|
|
39
|
-
"@inquirer/prompts": "
|
|
40
|
-
"@modelcontextprotocol/sdk": "1.
|
|
38
|
+
"@composio/json-schema-to-zod": "0.1.20",
|
|
39
|
+
"@inquirer/prompts": "8.4.1",
|
|
40
|
+
"@modelcontextprotocol/sdk": "1.29.0",
|
|
41
41
|
"chalk": "5.6.2",
|
|
42
|
-
"commander": "14.0.
|
|
43
|
-
"execa": "
|
|
44
|
-
"express": "
|
|
45
|
-
"gradient-string": "
|
|
42
|
+
"commander": "14.0.3",
|
|
43
|
+
"execa": "9.6.1",
|
|
44
|
+
"express": "5.2.1",
|
|
45
|
+
"gradient-string": "3.0.0",
|
|
46
46
|
"js-yaml": "4.1.1",
|
|
47
|
-
"liquidjs": "10.25.
|
|
48
|
-
"ora": "
|
|
49
|
-
"pino": "
|
|
50
|
-
"pino-pretty": "
|
|
51
|
-
"xstate": "
|
|
52
|
-
"zod": "3.
|
|
53
|
-
"@agiflowai/aicode-utils": "1.0
|
|
54
|
-
"@agiflowai/coding-agent-bridge": "1.0
|
|
47
|
+
"liquidjs": "10.25.5",
|
|
48
|
+
"ora": "9.3.0",
|
|
49
|
+
"pino": "10.3.1",
|
|
50
|
+
"pino-pretty": "13.1.3",
|
|
51
|
+
"xstate": "5.30.0",
|
|
52
|
+
"zod": "4.3.6",
|
|
53
|
+
"@agiflowai/aicode-utils": "1.1.0",
|
|
54
|
+
"@agiflowai/coding-agent-bridge": "1.1.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@types/express": "
|
|
58
|
-
"@types/js-yaml": "
|
|
59
|
-
"@types/node": "
|
|
60
|
-
"tsdown": "
|
|
57
|
+
"@types/express": "5.0.6",
|
|
58
|
+
"@types/js-yaml": "4.0.9",
|
|
59
|
+
"@types/node": "25.6.0",
|
|
60
|
+
"tsdown": "0.21.8",
|
|
61
61
|
"typescript": "5.9.3",
|
|
62
|
-
"unplugin-raw": "
|
|
62
|
+
"unplugin-raw": "0.7.0"
|
|
63
63
|
},
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
package/dist/mcp-B9X7HURl.cjs
DELETED
package/dist/mcp-Cvo6pkS0.mjs
DELETED