create-mercato-app 0.6.6-develop.5706.1.dbef29f570 → 0.6.6-develop.5707.1.bdaff19ab0

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 +64 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -775,6 +775,34 @@ var TOOLS = [
775
775
  { key: "5", label: "Skip \u2014 set up manually later", id: "skip" }
776
776
  ];
777
777
  var SELECTABLE_TOOLS = TOOLS.filter((t) => t.id !== "multiple" && t.id !== "skip");
778
+ var AGENT_TOOL_IDS = SELECTABLE_TOOLS.map((t) => t.id);
779
+ function parseAgentsValue(raw) {
780
+ const validList = `${AGENT_TOOL_IDS.join(", ")}, all, none`;
781
+ const tokens = raw.split(",").map((t) => t.trim().toLowerCase()).filter(Boolean);
782
+ if (tokens.length === 0) {
783
+ throw new Error(`--agents requires at least one value (e.g. ${validList})`);
784
+ }
785
+ const hasSkip = tokens.some((t) => t === "none" || t === "skip");
786
+ const hasAll = tokens.some((t) => t === "all");
787
+ const toolTokens = tokens.filter((t) => t !== "none" && t !== "skip" && t !== "all");
788
+ const unknown = toolTokens.filter((t) => !AGENT_TOOL_IDS.includes(t));
789
+ if (unknown.length > 0) {
790
+ throw new Error(`Unknown agent ${unknown.map((u) => `"${u}"`).join(", ")}. Valid: ${validList}`);
791
+ }
792
+ if (hasSkip) {
793
+ if (hasAll || toolTokens.length > 0) {
794
+ throw new Error("--agents none cannot be combined with other agents");
795
+ }
796
+ return { skip: true, tools: [] };
797
+ }
798
+ if (hasAll) {
799
+ if (toolTokens.length > 0) {
800
+ throw new Error("--agents all cannot be combined with individual agents");
801
+ }
802
+ return { skip: false, tools: [...AGENT_TOOL_IDS] };
803
+ }
804
+ return { skip: false, tools: [...new Set(toolTokens)] };
805
+ }
778
806
  async function promptSelection(ask) {
779
807
  console.log("");
780
808
  console.log("\u{1F916} Agentic workflow setup");
@@ -878,7 +906,9 @@ ${pc.bold("Options:")}
878
906
  --preset <id> Starter preset: classic, empty, or crm (omit to choose interactively)
879
907
  --init-git Initialize a local Git repository after scaffolding
880
908
  --no-init-git Do not prompt for or initialize a local Git repository
881
- --skip-agentic-setup Skip the interactive agentic setup wizard
909
+ --agents <list> Set up agent tooling non-interactively (skips the wizard):
910
+ comma-separated claude-code,codex,cursor \u2014 or 'all' / 'none'
911
+ --skip-agentic-setup Skip the agentic setup wizard (alias for --agents none)
882
912
  --registry <url> Custom npm registry URL
883
913
  --verdaccio Use local Verdaccio registry (http://localhost:4873)
884
914
  --help, -h Show help
@@ -890,6 +920,9 @@ ${pc.bold("Examples:")}
890
920
  npx create-mercato-app my-store --preset empty
891
921
  npx create-mercato-app my-store --preset crm
892
922
  npx create-mercato-app my-store --init-git
923
+ npx create-mercato-app my-store --agents claude-code,codex
924
+ npx create-mercato-app my-store --agents all
925
+ npx create-mercato-app my-store --agents none
893
926
  npx create-mercato-app my-prm --app prm
894
927
  npx create-mercato-app my-marketplace --app-url https://github.com/some-agency/ready-app-marketplace
895
928
  npx create-mercato-app my-store --verdaccio
@@ -913,6 +946,7 @@ function parseArgs(args) {
913
946
  preset: void 0,
914
947
  registry: void 0,
915
948
  initGit: void 0,
949
+ agents: void 0,
916
950
  skipAgenticSetup: false,
917
951
  verdaccio: false,
918
952
  help: false,
@@ -925,6 +959,9 @@ function parseArgs(args) {
925
959
  options.help = true;
926
960
  } else if (arg === "--version" || arg === "-v") {
927
961
  options.version = true;
962
+ } else if (arg === "--agents") {
963
+ options.agents = requireOptionValue(args, index, arg);
964
+ index += 1;
928
965
  } else if (arg === "--skip-agentic-setup") {
929
966
  options.skipAgenticSetup = true;
930
967
  } else if (arg === "--init-git") {
@@ -1169,11 +1206,28 @@ async function scaffoldImportedReadyApp(targetDir, source) {
1169
1206
  validateImportedReadyAppSnapshot(targetDir);
1170
1207
  ensureGeneratedCssPlaceholder(targetDir);
1171
1208
  }
1172
- async function maybeRunAgenticSetup(targetDir, skipAgenticSetup) {
1173
- if (skipAgenticSetup) {
1209
+ function resolveAgentSelection(options) {
1210
+ if (options.agents === void 0) {
1211
+ return options.skipAgenticSetup ? { mode: "skip" } : { mode: "interactive" };
1212
+ }
1213
+ const parsed = parseAgentsValue(options.agents);
1214
+ if (parsed.skip) {
1215
+ return { mode: "skip" };
1216
+ }
1217
+ if (options.skipAgenticSetup) {
1218
+ throw new Error("--skip-agentic-setup cannot be combined with --agents <tools>. Use --agents none to skip.");
1219
+ }
1220
+ return { mode: "tools", tools: parsed.tools };
1221
+ }
1222
+ async function maybeRunAgenticSetup(targetDir, selection) {
1223
+ if (selection.mode === "skip") {
1174
1224
  await runAgenticSetup(targetDir, async () => "", { tool: "skip" });
1175
1225
  return;
1176
1226
  }
1227
+ if (selection.mode === "tools") {
1228
+ await runAgenticSetup(targetDir, async () => "", { tool: selection.tools.join(",") });
1229
+ return;
1230
+ }
1177
1231
  const rl = createInterface({ input: process.stdin, output: process.stdout });
1178
1232
  const ask = (question) => new Promise((resolveAnswer) => rl.question(question, (answer) => resolveAnswer(answer.trim())));
1179
1233
  try {
@@ -1262,6 +1316,12 @@ async function main(argv = process.argv.slice(2)) {
1262
1316
  throw new Error(`Directory "${appName}" already exists`);
1263
1317
  }
1264
1318
  const readyAppSource = resolveReadyAppSource(options, PACKAGE_VERSION);
1319
+ if (options.agents !== void 0 && readyAppSource) {
1320
+ throw new Error(
1321
+ "--agents is not supported with --app/--app-url. Imported ready apps manage their own agentic tooling; run `yarn mercato agentic:init` inside the app instead."
1322
+ );
1323
+ }
1324
+ const agentSelection = resolveAgentSelection(options);
1265
1325
  const presetId = await resolveStarterPresetId(options, readyAppSource);
1266
1326
  const registryConfig = options.verdaccio ? buildRegistryConfig("http://localhost:4873") : options.registry ? buildRegistryConfig(options.registry) : "";
1267
1327
  console.log("");
@@ -1283,7 +1343,7 @@ async function main(argv = process.argv.slice(2)) {
1283
1343
  console.log(pc.green("Success!") + ` Created ${pc.bold(appName)}`);
1284
1344
  console.log("");
1285
1345
  if (!readyAppSource) {
1286
- await maybeRunAgenticSetup(targetDir, options.skipAgenticSetup);
1346
+ await maybeRunAgenticSetup(targetDir, agentSelection);
1287
1347
  }
1288
1348
  const gitResult = await maybeInitializeGitRepository(targetDir, options);
1289
1349
  if (readyAppSource) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-mercato-app",
3
- "version": "0.6.6-develop.5706.1.dbef29f570",
3
+ "version": "0.6.6-develop.5707.1.bdaff19ab0",
4
4
  "type": "module",
5
5
  "description": "Create a new Open Mercato application",
6
6
  "main": "./dist/index.js",