@agiflowai/aicode-toolkit 1.0.26 → 1.2.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 +181 -184
- package/dist/cli.mjs +59 -62
- package/dist/index.cjs +3 -4
- package/dist/index.d.cts +0 -2
- package/dist/index.d.mts +0 -2
- 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-BdZqGo-L.cjs} +227 -209
- package/dist/{utils-BTSpNlWu.mjs → utils-re_0nbT6.mjs} +40 -23
- package/package.json +22 -22
- 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
|
|
10
|
-
|
|
9
|
+
import * as chalkImport from "chalk";
|
|
10
|
+
import * as gradientImport from "gradient-string";
|
|
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
|
/**
|
|
@@ -273,8 +272,8 @@ var CodingAgentService = class {
|
|
|
273
272
|
* @param selectedMcpServers - Array of selected MCP servers
|
|
274
273
|
*/
|
|
275
274
|
async createMcpConfigYaml(selectedMcpServers) {
|
|
276
|
-
const {
|
|
277
|
-
const path
|
|
275
|
+
const { execFileSync } = await import("node:child_process");
|
|
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,23 @@ var CodingAgentService = class {
|
|
|
315
314
|
]
|
|
316
315
|
};
|
|
317
316
|
}
|
|
318
|
-
|
|
317
|
+
execFileSync("npx", [
|
|
318
|
+
"--yes",
|
|
319
|
+
"--package",
|
|
320
|
+
"@agiflowai/one-mcp",
|
|
321
|
+
"one-mcp",
|
|
322
|
+
"init",
|
|
323
|
+
"-o",
|
|
324
|
+
path.join(this.workspaceRoot, "mcp-config.yaml"),
|
|
325
|
+
"-f",
|
|
326
|
+
"--mcp-servers",
|
|
327
|
+
JSON.stringify(servers)
|
|
328
|
+
], {
|
|
319
329
|
cwd: this.workspaceRoot,
|
|
320
330
|
stdio: "inherit"
|
|
321
331
|
});
|
|
322
332
|
}
|
|
323
333
|
};
|
|
324
|
-
|
|
325
334
|
//#endregion
|
|
326
335
|
//#region src/services/NewProjectService.ts
|
|
327
336
|
/**
|
|
@@ -459,11 +468,9 @@ var NewProjectService = class {
|
|
|
459
468
|
return true;
|
|
460
469
|
}
|
|
461
470
|
};
|
|
462
|
-
|
|
463
471
|
//#endregion
|
|
464
472
|
//#region src/instructions/specs/openspec.md?raw
|
|
465
473
|
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
474
|
//#endregion
|
|
468
475
|
//#region src/specs/openspec.ts
|
|
469
476
|
/**
|
|
@@ -540,7 +547,6 @@ var OpenSpecBridge = class {
|
|
|
540
547
|
return (await new Liquid().parseAndRender(openspec_default, enabledMcps)).trim();
|
|
541
548
|
}
|
|
542
549
|
};
|
|
543
|
-
|
|
544
550
|
//#endregion
|
|
545
551
|
//#region src/services/SpecToolService.ts
|
|
546
552
|
/**
|
|
@@ -558,9 +564,9 @@ var OpenSpecBridge = class {
|
|
|
558
564
|
/**
|
|
559
565
|
* Available spec tools
|
|
560
566
|
*/
|
|
561
|
-
let SpecTool = /* @__PURE__ */ function(SpecTool
|
|
562
|
-
SpecTool
|
|
563
|
-
return SpecTool
|
|
567
|
+
let SpecTool = /* @__PURE__ */ function(SpecTool) {
|
|
568
|
+
SpecTool["OPENSPEC"] = "openspec";
|
|
569
|
+
return SpecTool;
|
|
564
570
|
}({});
|
|
565
571
|
/**
|
|
566
572
|
* Spec tool information
|
|
@@ -630,7 +636,6 @@ var SpecToolService = class {
|
|
|
630
636
|
return prompt;
|
|
631
637
|
}
|
|
632
638
|
};
|
|
633
|
-
|
|
634
639
|
//#endregion
|
|
635
640
|
//#region src/services/TemplateSelectionService.ts
|
|
636
641
|
/**
|
|
@@ -758,10 +763,10 @@ var TemplateSelectionService = class {
|
|
|
758
763
|
* @param selectedMcpServers - Selected MCP servers
|
|
759
764
|
*/
|
|
760
765
|
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
|
|
766
|
+
const { MCPServer, MCP_CONFIG_FILES } = await import("./mcp-CwMcfNLE.mjs").then((n) => n.r);
|
|
767
|
+
const architectFiles = MCP_CONFIG_FILES[MCPServer.ARCHITECT];
|
|
768
|
+
const hasArchitect = selectedMcpServers.includes(MCPServer.ARCHITECT);
|
|
769
|
+
const hasScaffold = selectedMcpServers.includes(MCPServer.SCAFFOLD);
|
|
765
770
|
await ensureDir(targetPath);
|
|
766
771
|
const entries = await readdir(sourcePath, { withFileTypes: true });
|
|
767
772
|
for (const entry of entries) {
|
|
@@ -817,7 +822,6 @@ var TemplateSelectionService = class {
|
|
|
817
822
|
}
|
|
818
823
|
}
|
|
819
824
|
};
|
|
820
|
-
|
|
821
825
|
//#endregion
|
|
822
826
|
//#region src/services/TemplatesService.ts
|
|
823
827
|
/**
|
|
@@ -913,9 +917,20 @@ See existing templates for examples and documentation for more details.
|
|
|
913
917
|
`);
|
|
914
918
|
}
|
|
915
919
|
};
|
|
916
|
-
|
|
917
920
|
//#endregion
|
|
918
921
|
//#region src/utils/banner.ts
|
|
922
|
+
function resolveChalk(value, depth = 0) {
|
|
923
|
+
if (value && (typeof value === "object" || typeof value === "function") && "red" in value && typeof value.red === "function") return value;
|
|
924
|
+
if (depth < 3 && value && (typeof value === "object" || typeof value === "function") && "default" in value) return resolveChalk(value.default, depth + 1);
|
|
925
|
+
throw new Error("Unable to resolve chalk instance");
|
|
926
|
+
}
|
|
927
|
+
const chalk = resolveChalk(chalkImport);
|
|
928
|
+
function resolveGradient(value, depth = 0) {
|
|
929
|
+
if (typeof value === "function") return value;
|
|
930
|
+
if (depth < 3 && value && (typeof value === "object" || typeof value === "function") && "default" in value) return resolveGradient(value.default, depth + 1);
|
|
931
|
+
throw new Error("Unable to resolve gradient-string instance");
|
|
932
|
+
}
|
|
933
|
+
const gradient = resolveGradient(gradientImport);
|
|
919
934
|
/**
|
|
920
935
|
* ASCII art for AICode Toolkit - simple and highly readable design
|
|
921
936
|
* Uses clean block style with clear spacing
|
|
@@ -956,6 +971,8 @@ function displayCompactBanner() {
|
|
|
956
971
|
console.log(chalk.dim(" AI-Powered Code Toolkit"));
|
|
957
972
|
console.log();
|
|
958
973
|
}
|
|
959
|
-
|
|
974
|
+
function displaySuccessMessage(message) {
|
|
975
|
+
console.log(gradient.pastel.multiline(message));
|
|
976
|
+
}
|
|
960
977
|
//#endregion
|
|
961
|
-
export {
|
|
978
|
+
export { TemplateSelectionService as a, SpecToolService as c, BANNER_GRADIENT as d, THEME as f, TemplatesService as i, NewProjectService as l, displayCompactBanner as n, SPEC_TOOL_INFO as o, displaySuccessMessage as r, SpecTool as s, displayBanner as t, CodingAgentService 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.2.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": "
|
|
46
|
-
"js-yaml": "4.
|
|
47
|
-
"liquidjs": "10.
|
|
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
|
|
42
|
+
"commander": "14.0.3",
|
|
43
|
+
"execa": "9.6.1",
|
|
44
|
+
"express": "5.2.1",
|
|
45
|
+
"gradient-string": "3.0.0",
|
|
46
|
+
"js-yaml": "4.2.0",
|
|
47
|
+
"liquidjs": "10.27.0",
|
|
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.2.0",
|
|
54
|
+
"@agiflowai/coding-agent-bridge": "1.2.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