@agiflowai/aicode-toolkit 1.1.0 → 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 +19 -14
- package/dist/cli.mjs +10 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.mjs +1 -1
- package/dist/{utils-BCVXMGNF.cjs → utils-BdZqGo-L.cjs} +30 -4
- package/dist/{utils-BM7-O0sC.mjs → utils-re_0nbT6.mjs} +24 -4
- package/package.json +5 -5
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_utils = require("./utils-
|
|
2
|
+
const require_utils = require("./utils-BdZqGo-L.cjs");
|
|
3
3
|
const require_mcp = require("./mcp-HNZY6MpT.cjs");
|
|
4
4
|
let _agiflowai_aicode_utils = require("@agiflowai/aicode-utils");
|
|
5
5
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -14,7 +14,7 @@ let xstate = require("xstate");
|
|
|
14
14
|
let js_yaml = require("js-yaml");
|
|
15
15
|
js_yaml = require_utils.__toESM(js_yaml, 1);
|
|
16
16
|
//#region package.json
|
|
17
|
-
var version = "1.0
|
|
17
|
+
var version = "1.1.0";
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/commands/add.ts
|
|
20
20
|
/**
|
|
@@ -432,6 +432,12 @@ const initMachine = (0, xstate.createMachine)({
|
|
|
432
432
|
}, { guards: {} });
|
|
433
433
|
//#endregion
|
|
434
434
|
//#region src/commands/init.ts
|
|
435
|
+
function resolveOra(value, depth = 0) {
|
|
436
|
+
if (typeof value === "function") return value;
|
|
437
|
+
if (depth < 3 && value && (typeof value === "object" || typeof value === "function") && "default" in value) return resolveOra(value.default, depth + 1);
|
|
438
|
+
throw new Error("Unable to resolve ora instance");
|
|
439
|
+
}
|
|
440
|
+
const ora$1 = resolveOra(ora);
|
|
435
441
|
const DEFAULT_TEMPLATE_REPO = {
|
|
436
442
|
owner: "AgiFlow",
|
|
437
443
|
repo: "aicode-toolkit",
|
|
@@ -523,7 +529,7 @@ const initActors = {
|
|
|
523
529
|
_agiflowai_aicode_utils.print.success(`Using current directory: ${projectPath}`);
|
|
524
530
|
return { projectPath };
|
|
525
531
|
}
|
|
526
|
-
const spinner =
|
|
532
|
+
const spinner = ora$1("Creating project directory...").start();
|
|
527
533
|
try {
|
|
528
534
|
const projectPath = node_path.default.join(process.cwd(), actorInput.projectName.trim());
|
|
529
535
|
await new require_utils.NewProjectService(void 0, void 0).createProjectDirectory(projectPath, actorInput.projectName);
|
|
@@ -553,7 +559,7 @@ const initActors = {
|
|
|
553
559
|
});
|
|
554
560
|
_agiflowai_aicode_utils.print.info("");
|
|
555
561
|
if (repoUrl && repoUrl.trim() !== "") {
|
|
556
|
-
const spinner =
|
|
562
|
+
const spinner = ora$1("Cloning repository...").start();
|
|
557
563
|
try {
|
|
558
564
|
await newProjectService.cloneExistingRepository(repoUrl.trim(), actorInput.projectPath);
|
|
559
565
|
spinner.succeed("Repository cloned successfully");
|
|
@@ -570,7 +576,7 @@ const initActors = {
|
|
|
570
576
|
});
|
|
571
577
|
_agiflowai_aicode_utils.print.info("");
|
|
572
578
|
if (initGit) {
|
|
573
|
-
const spinner =
|
|
579
|
+
const spinner = ora$1("Initializing Git repository...").start();
|
|
574
580
|
try {
|
|
575
581
|
await newProjectService.initializeGitRepository(actorInput.projectPath);
|
|
576
582
|
spinner.succeed("Git repository initialized");
|
|
@@ -661,7 +667,7 @@ const initActors = {
|
|
|
661
667
|
}
|
|
662
668
|
}),
|
|
663
669
|
downloadTemplates: (0, xstate.fromPromise)(async () => {
|
|
664
|
-
const spinner =
|
|
670
|
+
const spinner = ora$1("Downloading templates from AgiFlow/aicode-toolkit...").start();
|
|
665
671
|
try {
|
|
666
672
|
const tmpPath = await new require_utils.TemplateSelectionService().downloadTemplatesToTmp(DEFAULT_TEMPLATE_REPO);
|
|
667
673
|
spinner.succeed("Templates downloaded successfully");
|
|
@@ -712,7 +718,7 @@ const initActors = {
|
|
|
712
718
|
return selected;
|
|
713
719
|
}),
|
|
714
720
|
copyTemplates: (0, xstate.fromPromise)(async ({ input: actorInput }) => {
|
|
715
|
-
const spinner =
|
|
721
|
+
const spinner = ora$1("Copying templates to workspace...").start();
|
|
716
722
|
try {
|
|
717
723
|
await new require_utils.TemplateSelectionService(actorInput.tmpTemplatesPath).copyTemplates(actorInput.selectedTemplates, actorInput.templatesPath, actorInput.projectType, actorInput.selectedMcpServers);
|
|
718
724
|
spinner.succeed(`Templates copied to ${actorInput.templatesPath}`);
|
|
@@ -771,7 +777,7 @@ const initActors = {
|
|
|
771
777
|
return selected;
|
|
772
778
|
}),
|
|
773
779
|
configureMCP: (0, xstate.fromPromise)(async ({ input: actorInput }) => {
|
|
774
|
-
const spinner =
|
|
780
|
+
const spinner = ora$1(`Setting up MCP for ${actorInput.codingAgent}...`).start();
|
|
775
781
|
try {
|
|
776
782
|
await new require_utils.CodingAgentService(actorInput.workspaceRoot).setupMCP(actorInput.codingAgent, actorInput.selectedMcpServers);
|
|
777
783
|
spinner.succeed("MCP configuration completed");
|
|
@@ -782,7 +788,7 @@ const initActors = {
|
|
|
782
788
|
}),
|
|
783
789
|
cleanup: (0, xstate.fromPromise)(async ({ input }) => {
|
|
784
790
|
if (input.tmpTemplatesPath) {
|
|
785
|
-
const spinner =
|
|
791
|
+
const spinner = ora$1("Cleaning up temporary files...").start();
|
|
786
792
|
try {
|
|
787
793
|
await new require_utils.TemplateSelectionService(input.tmpTemplatesPath).cleanup();
|
|
788
794
|
spinner.succeed("Cleaned up temporary files");
|
|
@@ -820,7 +826,7 @@ const initActors = {
|
|
|
820
826
|
const codingAgentService = new require_utils.CodingAgentService(input.workspaceRoot);
|
|
821
827
|
const specToolService = new require_utils.SpecToolService(input.workspaceRoot, require_utils.SpecTool.OPENSPEC, codingAgentService);
|
|
822
828
|
if (input.isAlreadyInstalled) {
|
|
823
|
-
const spinner =
|
|
829
|
+
const spinner = ora$1("Updating OpenSpec agent instructions...").start();
|
|
824
830
|
try {
|
|
825
831
|
const enabledMcps = {
|
|
826
832
|
scaffoldMcp: input.selectedMcpServers?.includes(require_mcp.MCPServer.SCAFFOLD) ?? false,
|
|
@@ -834,7 +840,7 @@ const initActors = {
|
|
|
834
840
|
throw error;
|
|
835
841
|
}
|
|
836
842
|
} else {
|
|
837
|
-
const spinner =
|
|
843
|
+
const spinner = ora$1("Initializing OpenSpec...").start();
|
|
838
844
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
839
845
|
spinner.stop();
|
|
840
846
|
try {
|
|
@@ -856,7 +862,7 @@ const initActors = {
|
|
|
856
862
|
return result;
|
|
857
863
|
}),
|
|
858
864
|
updateSpecInstructions: (0, xstate.fromPromise)(async ({ input }) => {
|
|
859
|
-
const spinner =
|
|
865
|
+
const spinner = ora$1("Updating OpenSpec agent instructions...").start();
|
|
860
866
|
try {
|
|
861
867
|
const codingAgentService = new require_utils.CodingAgentService(input.workspaceRoot);
|
|
862
868
|
const specToolService = new require_utils.SpecToolService(input.workspaceRoot, require_utils.SpecTool.OPENSPEC, codingAgentService);
|
|
@@ -907,9 +913,8 @@ const initCommand = new commander.Command("init").description("Initialize projec
|
|
|
907
913
|
_agiflowai_aicode_utils.print.header("\nSetup Complete!");
|
|
908
914
|
if (templatesPath) _agiflowai_aicode_utils.print.info(`Templates location: ${templatesPath}`);
|
|
909
915
|
if (projectType) _agiflowai_aicode_utils.print.info(`Project type: ${projectType}`);
|
|
910
|
-
const gradient = await import("gradient-string");
|
|
911
916
|
_agiflowai_aicode_utils.print.newline();
|
|
912
|
-
|
|
917
|
+
require_utils.displaySuccessMessage("🎉 Congratulations! Your project is ready to go!");
|
|
913
918
|
_agiflowai_aicode_utils.print.newline();
|
|
914
919
|
} catch (error) {
|
|
915
920
|
_agiflowai_aicode_utils.print.error(`\nError: ${error.message}`);
|
package/dist/cli.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { n as MCP_SERVER_INFO, t as MCPServer } from "./mcp-CwMcfNLE.mjs";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as TemplateSelectionService, c as SpecToolService, l as NewProjectService, o as SPEC_TOOL_INFO, r as displaySuccessMessage, s as SpecTool, t as displayBanner, u as CodingAgentService } from "./utils-re_0nbT6.mjs";
|
|
4
4
|
import { ProjectType, TemplatesManagerService, cloneRepository, cloneSubdirectory, detectProjectType, ensureDir, findWorkspaceRoot, icons, messages, parseGitHubUrl, pathExists, print, sections } from "@agiflowai/aicode-utils";
|
|
5
5
|
import { mkdir as mkdir$1, readFile as readFile$1, writeFile as writeFile$1 } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { Liquid } from "liquidjs";
|
|
8
8
|
import { Command } from "commander";
|
|
9
9
|
import { confirm, input, select } from "@inquirer/prompts";
|
|
10
|
-
import
|
|
10
|
+
import * as oraImport from "ora";
|
|
11
11
|
import { assign, createActor, createMachine, fromPromise } from "xstate";
|
|
12
12
|
import yaml from "js-yaml";
|
|
13
13
|
//#region package.json
|
|
14
|
-
var version = "1.0
|
|
14
|
+
var version = "1.1.0";
|
|
15
15
|
//#endregion
|
|
16
16
|
//#region src/commands/add.ts
|
|
17
17
|
/**
|
|
@@ -429,6 +429,12 @@ const initMachine = createMachine({
|
|
|
429
429
|
}, { guards: {} });
|
|
430
430
|
//#endregion
|
|
431
431
|
//#region src/commands/init.ts
|
|
432
|
+
function resolveOra(value, depth = 0) {
|
|
433
|
+
if (typeof value === "function") return value;
|
|
434
|
+
if (depth < 3 && value && (typeof value === "object" || typeof value === "function") && "default" in value) return resolveOra(value.default, depth + 1);
|
|
435
|
+
throw new Error("Unable to resolve ora instance");
|
|
436
|
+
}
|
|
437
|
+
const ora = resolveOra(oraImport);
|
|
432
438
|
const DEFAULT_TEMPLATE_REPO = {
|
|
433
439
|
owner: "AgiFlow",
|
|
434
440
|
repo: "aicode-toolkit",
|
|
@@ -904,9 +910,8 @@ const initCommand = new Command("init").description("Initialize project with tem
|
|
|
904
910
|
print.header("\nSetup Complete!");
|
|
905
911
|
if (templatesPath) print.info(`Templates location: ${templatesPath}`);
|
|
906
912
|
if (projectType) print.info(`Project type: ${projectType}`);
|
|
907
|
-
const gradient = await import("gradient-string");
|
|
908
913
|
print.newline();
|
|
909
|
-
|
|
914
|
+
displaySuccessMessage("🎉 Congratulations! Your project is ready to go!");
|
|
910
915
|
print.newline();
|
|
911
916
|
} catch (error) {
|
|
912
917
|
print.error(`\nError: ${error.message}`);
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_utils = require("./utils-
|
|
2
|
+
const require_utils = require("./utils-BdZqGo-L.cjs");
|
|
3
3
|
exports.BANNER_GRADIENT = require_utils.BANNER_GRADIENT;
|
|
4
4
|
exports.CodingAgentService = require_utils.CodingAgentService;
|
|
5
5
|
exports.NewProjectService = require_utils.NewProjectService;
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as TemplateSelectionService, d as BANNER_GRADIENT, f as THEME, i as TemplatesService, l as NewProjectService, n as displayCompactBanner, t as displayBanner, u as CodingAgentService } from "./utils-re_0nbT6.mjs";
|
|
2
2
|
export { BANNER_GRADIENT, CodingAgentService, NewProjectService, THEME, TemplateSelectionService, TemplatesService, displayBanner, displayCompactBanner };
|
|
@@ -299,7 +299,7 @@ var CodingAgentService = class {
|
|
|
299
299
|
* @param selectedMcpServers - Array of selected MCP servers
|
|
300
300
|
*/
|
|
301
301
|
async createMcpConfigYaml(selectedMcpServers) {
|
|
302
|
-
const {
|
|
302
|
+
const { execFileSync } = await import("node:child_process");
|
|
303
303
|
const path = await import("node:path");
|
|
304
304
|
const servers = {};
|
|
305
305
|
const serversToInclude = selectedMcpServers?.filter((s) => s !== "one-mcp") ?? [];
|
|
@@ -341,7 +341,18 @@ var CodingAgentService = class {
|
|
|
341
341
|
]
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
execFileSync("npx", [
|
|
345
|
+
"--yes",
|
|
346
|
+
"--package",
|
|
347
|
+
"@agiflowai/one-mcp",
|
|
348
|
+
"one-mcp",
|
|
349
|
+
"init",
|
|
350
|
+
"-o",
|
|
351
|
+
path.join(this.workspaceRoot, "mcp-config.yaml"),
|
|
352
|
+
"-f",
|
|
353
|
+
"--mcp-servers",
|
|
354
|
+
JSON.stringify(servers)
|
|
355
|
+
], {
|
|
345
356
|
cwd: this.workspaceRoot,
|
|
346
357
|
stdio: "inherit"
|
|
347
358
|
});
|
|
@@ -941,6 +952,12 @@ function resolveChalk(value, depth = 0) {
|
|
|
941
952
|
throw new Error("Unable to resolve chalk instance");
|
|
942
953
|
}
|
|
943
954
|
const chalk$1 = resolveChalk(chalk);
|
|
955
|
+
function resolveGradient(value, depth = 0) {
|
|
956
|
+
if (typeof value === "function") return value;
|
|
957
|
+
if (depth < 3 && value && (typeof value === "object" || typeof value === "function") && "default" in value) return resolveGradient(value.default, depth + 1);
|
|
958
|
+
throw new Error("Unable to resolve gradient-string instance");
|
|
959
|
+
}
|
|
960
|
+
const gradient = resolveGradient(gradient_string);
|
|
944
961
|
/**
|
|
945
962
|
* ASCII art for AICode Toolkit - simple and highly readable design
|
|
946
963
|
* Uses clean block style with clear spacing
|
|
@@ -965,7 +982,7 @@ const ASCII_ART = `
|
|
|
965
982
|
* Uses gradient-string with theme colors (primary green -> secondary teal)
|
|
966
983
|
*/
|
|
967
984
|
function displayBanner() {
|
|
968
|
-
const bannerGradient = (
|
|
985
|
+
const bannerGradient = gradient(BANNER_GRADIENT);
|
|
969
986
|
console.log(bannerGradient.multiline(ASCII_ART));
|
|
970
987
|
console.log(bannerGradient(" AI-Powered Code Toolkit for Modern Development"));
|
|
971
988
|
console.log(chalk$1.dim(" v0.6.0"));
|
|
@@ -975,12 +992,15 @@ function displayBanner() {
|
|
|
975
992
|
* Simplified banner for compact display
|
|
976
993
|
*/
|
|
977
994
|
function displayCompactBanner() {
|
|
978
|
-
const titleGradient = (
|
|
995
|
+
const titleGradient = gradient(BANNER_GRADIENT);
|
|
979
996
|
console.log();
|
|
980
997
|
console.log(chalk$1.bold("▸ ") + titleGradient("AICode Toolkit") + chalk$1.dim(" v0.6.0"));
|
|
981
998
|
console.log(chalk$1.dim(" AI-Powered Code Toolkit"));
|
|
982
999
|
console.log();
|
|
983
1000
|
}
|
|
1001
|
+
function displaySuccessMessage(message) {
|
|
1002
|
+
console.log(gradient.pastel.multiline(message));
|
|
1003
|
+
}
|
|
984
1004
|
//#endregion
|
|
985
1005
|
Object.defineProperty(exports, "BANNER_GRADIENT", {
|
|
986
1006
|
enumerable: true,
|
|
@@ -1054,3 +1074,9 @@ Object.defineProperty(exports, "displayCompactBanner", {
|
|
|
1054
1074
|
return displayCompactBanner;
|
|
1055
1075
|
}
|
|
1056
1076
|
});
|
|
1077
|
+
Object.defineProperty(exports, "displaySuccessMessage", {
|
|
1078
|
+
enumerable: true,
|
|
1079
|
+
get: function() {
|
|
1080
|
+
return displaySuccessMessage;
|
|
1081
|
+
}
|
|
1082
|
+
});
|
|
@@ -7,7 +7,7 @@ import { execa } from "execa";
|
|
|
7
7
|
import { Liquid } from "liquidjs";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import * as chalkImport from "chalk";
|
|
10
|
-
import
|
|
10
|
+
import * as gradientImport from "gradient-string";
|
|
11
11
|
//#region src/constants/theme.ts
|
|
12
12
|
/**
|
|
13
13
|
* Theme color constants for AICode Toolkit
|
|
@@ -272,7 +272,7 @@ var CodingAgentService = class {
|
|
|
272
272
|
* @param selectedMcpServers - Array of selected MCP servers
|
|
273
273
|
*/
|
|
274
274
|
async createMcpConfigYaml(selectedMcpServers) {
|
|
275
|
-
const {
|
|
275
|
+
const { execFileSync } = await import("node:child_process");
|
|
276
276
|
const path = await import("node:path");
|
|
277
277
|
const servers = {};
|
|
278
278
|
const serversToInclude = selectedMcpServers?.filter((s) => s !== "one-mcp") ?? [];
|
|
@@ -314,7 +314,18 @@ var CodingAgentService = class {
|
|
|
314
314
|
]
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
|
-
|
|
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
|
+
], {
|
|
318
329
|
cwd: this.workspaceRoot,
|
|
319
330
|
stdio: "inherit"
|
|
320
331
|
});
|
|
@@ -914,6 +925,12 @@ function resolveChalk(value, depth = 0) {
|
|
|
914
925
|
throw new Error("Unable to resolve chalk instance");
|
|
915
926
|
}
|
|
916
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);
|
|
917
934
|
/**
|
|
918
935
|
* ASCII art for AICode Toolkit - simple and highly readable design
|
|
919
936
|
* Uses clean block style with clear spacing
|
|
@@ -954,5 +971,8 @@ function displayCompactBanner() {
|
|
|
954
971
|
console.log(chalk.dim(" AI-Powered Code Toolkit"));
|
|
955
972
|
console.log();
|
|
956
973
|
}
|
|
974
|
+
function displaySuccessMessage(message) {
|
|
975
|
+
console.log(gradient.pastel.multiline(message));
|
|
976
|
+
}
|
|
957
977
|
//#endregion
|
|
958
|
-
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.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"author": "AgiflowIO",
|
|
7
7
|
"repository": {
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"execa": "9.6.1",
|
|
44
44
|
"express": "5.2.1",
|
|
45
45
|
"gradient-string": "3.0.0",
|
|
46
|
-
"js-yaml": "4.
|
|
47
|
-
"liquidjs": "10.
|
|
46
|
+
"js-yaml": "4.2.0",
|
|
47
|
+
"liquidjs": "10.27.0",
|
|
48
48
|
"ora": "9.3.0",
|
|
49
49
|
"pino": "10.3.1",
|
|
50
50
|
"pino-pretty": "13.1.3",
|
|
51
51
|
"xstate": "5.30.0",
|
|
52
52
|
"zod": "4.3.6",
|
|
53
|
-
"@agiflowai/aicode-utils": "1.
|
|
54
|
-
"@agiflowai/coding-agent-bridge": "1.
|
|
53
|
+
"@agiflowai/aicode-utils": "1.2.0",
|
|
54
|
+
"@agiflowai/coding-agent-bridge": "1.2.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@types/express": "5.0.6",
|