@papicandela/mcx-cli 0.1.2 → 0.1.3
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/index.js +27 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49365,8 +49365,19 @@ function GeneratorWizard({ onComplete }) {
|
|
|
49365
49365
|
const adaptersRegex = /adapters:\s*\[([^\]]*)\]/s;
|
|
49366
49366
|
const match = newContent.match(adaptersRegex);
|
|
49367
49367
|
if (match) {
|
|
49368
|
-
|
|
49369
|
-
const
|
|
49368
|
+
let currentAdapters = match[1];
|
|
49369
|
+
const cleanedAdapters = currentAdapters.split(`
|
|
49370
|
+
`).map((line) => {
|
|
49371
|
+
const commentIndex = line.indexOf("//");
|
|
49372
|
+
if (commentIndex !== -1) {
|
|
49373
|
+
return line.slice(0, commentIndex);
|
|
49374
|
+
}
|
|
49375
|
+
return line;
|
|
49376
|
+
}).join(`
|
|
49377
|
+
`).trim();
|
|
49378
|
+
const adapterTokens = cleanedAdapters.split(/[,\s]+/).filter((token) => token.length > 0 && token !== ",");
|
|
49379
|
+
adapterTokens.push(adapterName);
|
|
49380
|
+
const newAdapters = adapterTokens.length > 0 ? adapterTokens.join(", ") : adapterName;
|
|
49370
49381
|
newContent = newContent.replace(adaptersRegex, `adapters: [${newAdapters}]`);
|
|
49371
49382
|
}
|
|
49372
49383
|
await Bun.write(configPath, newContent);
|
|
@@ -49601,8 +49612,19 @@ Adapter already imported in mcx.config.ts`));
|
|
|
49601
49612
|
const adaptersRegex = /adapters:\s*\[([^\]]*)\]/s;
|
|
49602
49613
|
const match = newContent.match(adaptersRegex);
|
|
49603
49614
|
if (match) {
|
|
49604
|
-
|
|
49605
|
-
const
|
|
49615
|
+
let currentAdapters = match[1];
|
|
49616
|
+
const cleanedAdapters = currentAdapters.split(`
|
|
49617
|
+
`).map((line) => {
|
|
49618
|
+
const commentIndex = line.indexOf("//");
|
|
49619
|
+
if (commentIndex !== -1) {
|
|
49620
|
+
return line.slice(0, commentIndex);
|
|
49621
|
+
}
|
|
49622
|
+
return line;
|
|
49623
|
+
}).join(`
|
|
49624
|
+
`).trim();
|
|
49625
|
+
const adapterTokens = cleanedAdapters.split(/[,\s]+/).filter((token) => token.length > 0 && token !== ",");
|
|
49626
|
+
adapterTokens.push(adapterName);
|
|
49627
|
+
const newAdapters = adapterTokens.length > 0 ? adapterTokens.join(", ") : adapterName;
|
|
49606
49628
|
newContent = newContent.replace(adaptersRegex, `adapters: [${newAdapters}]`);
|
|
49607
49629
|
}
|
|
49608
49630
|
await Bun.write(configPath, newContent);
|
|
@@ -49820,7 +49842,7 @@ async function updateCommand(options) {
|
|
|
49820
49842
|
|
|
49821
49843
|
// src/index.ts
|
|
49822
49844
|
var program2 = new Command;
|
|
49823
|
-
program2.name("mcx").description("MCX - Modular Code Execution framework for AI agents").version("0.1.
|
|
49845
|
+
program2.name("mcx").description("MCX - Modular Code Execution framework for AI agents").version("0.1.3");
|
|
49824
49846
|
program2.command("init").description("Initialize a new MCX project in the current directory").action(async () => {
|
|
49825
49847
|
try {
|
|
49826
49848
|
await initCommand();
|