@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.
Files changed (2) hide show
  1. package/dist/index.js +27 -5
  2. 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
- const currentAdapters = match[1].trim();
49369
- const newAdapters = currentAdapters ? `${currentAdapters}, ${adapterName}` : adapterName;
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
- const currentAdapters = match[1].trim();
49605
- const newAdapters = currentAdapters ? `${currentAdapters}, ${adapterName}` : adapterName;
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.2");
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();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@papicandela/mcx-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "CLI for the MCX framework - MCP Code Execution",
5
5
  "author": "papicandela",
6
6
  "license": "MIT",