@taptap/maker 0.0.21-beta.2 → 0.0.21-beta.4

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/maker.js +381 -52
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -30,4 +30,4 @@ This package contains only the Maker CLI/MCP bundle and Maker workflow skills.
30
30
  It does not include the legacy TapTap Open API MCP server, proxy, native signer,
31
31
  or OpenClaw plugin package contents.
32
32
 
33
- Version: 0.0.21-beta.2
33
+ Version: 0.0.21-beta.4
package/dist/maker.js CHANGED
@@ -34260,7 +34260,7 @@ function applyDefaults(config2) {
34260
34260
  }
34261
34261
 
34262
34262
  // src/maker/server/mcp.ts
34263
- var VERSION = true ? "0.0.21-beta.2" : "dev";
34263
+ var VERSION = true ? "0.0.21-beta.4" : "dev";
34264
34264
  var DEFAULT_BUILD_TIMEOUT_MS = 10 * 60 * 1e3;
34265
34265
  var DEFAULT_PROXY_RETRY_ATTEMPTS = 5;
34266
34266
  var DEFAULT_PROXY_RETRY_DELAY_MS = 30 * 1e3;
@@ -36663,7 +36663,7 @@ function formatError2(error2) {
36663
36663
  }
36664
36664
 
36665
36665
  // src/maker/cli/commands.ts
36666
- var VERSION2 = true ? "0.0.21-beta.2" : "dev";
36666
+ var VERSION2 = true ? "0.0.21-beta.4" : "dev";
36667
36667
  var DEFAULT_MCP_NAME = "taptap-maker";
36668
36668
  var MAKER_NPM_PACKAGE = "@taptap/maker";
36669
36669
  var TWO_PART_COMMANDS = /* @__PURE__ */ new Set(["pat", "mcp", "dev-kit", "logs", "python", "lua-lsp", "agents"]);
@@ -36866,9 +36866,9 @@ async function runInit(parsed, ctx) {
36866
36866
  environment: env
36867
36867
  });
36868
36868
  if (!skipMcpInstall) {
36869
- const ides = parseIdeList(stringOption(parsed, "register_mcp") || "codex,cursor,claude");
36869
+ const ides = parseIdeList(stringOption(parsed, "register_mcp") || "");
36870
36870
  const installResults = installMcpConfigs({
36871
- ides,
36871
+ ides: ides.length > 0 ? ides : getDefaultMcpInstallIdes(),
36872
36872
  env,
36873
36873
  pkg: MAKER_NPM_PACKAGE,
36874
36874
  mcpName: DEFAULT_MCP_NAME
@@ -37366,7 +37366,7 @@ async function runMcpInstall(parsed, ctx) {
37366
37366
  const ides = parseIdeList(stringOption(parsed, "ide") || stringOption(parsed, "ides") || "");
37367
37367
  const explicitTargetDir = stringOption(parsed, "target_dir");
37368
37368
  const results = installMcpConfigs({
37369
- ides: ides.length > 0 ? ides : ["codex", "cursor", "claude"],
37369
+ ides: ides.length > 0 ? ides : getDefaultMcpInstallIdes(),
37370
37370
  env: makerEnvOption(parsed),
37371
37371
  pkg: MAKER_NPM_PACKAGE,
37372
37372
  mcpName: stringOption(parsed, "name") || DEFAULT_MCP_NAME,
@@ -37452,7 +37452,7 @@ async function runUpgrade(parsed, ctx) {
37452
37452
  const env = makerEnvOption(parsed);
37453
37453
  const ides = parseIdeList(stringOption(parsed, "ide") || stringOption(parsed, "ides") || "");
37454
37454
  const installResults = installMcpConfigs({
37455
- ides: ides.length > 0 ? ides : ["codex", "cursor", "claude"],
37455
+ ides: ides.length > 0 ? ides : getDefaultMcpInstallIdes(),
37456
37456
  env,
37457
37457
  pkg: MAKER_NPM_PACKAGE,
37458
37458
  mcpName: stringOption(parsed, "name") || DEFAULT_MCP_NAME,
@@ -37887,85 +37887,241 @@ function isPatValidationFailure(message) {
37887
37887
  ) || /(?:过期|失效)/.test(message);
37888
37888
  }
37889
37889
  function installMcpConfigs(options) {
37890
- return options.ides.map((ide) => installMcpConfig(ide, options));
37890
+ return uniqueStrings(options.ides).flatMap((ide) => installMcpConfig(ide, options));
37891
37891
  }
37892
37892
  function installMcpConfig(ide, options) {
37893
37893
  try {
37894
37894
  return installMcpConfigUnsafe(ide, options);
37895
37895
  } catch (error2) {
37896
- return {
37897
- ide,
37898
- ok: false,
37899
- message: `✗ ${ide} MCP config update failed: ${error2 instanceof Error ? error2.message : String(error2)}`
37900
- };
37896
+ return [
37897
+ {
37898
+ ide,
37899
+ ok: false,
37900
+ message: `✗ ${ide} MCP config update failed: ${error2 instanceof Error ? error2.message : String(error2)}`
37901
+ }
37902
+ ];
37901
37903
  }
37902
37904
  }
37903
37905
  function installMcpConfigUnsafe(ide, options) {
37904
37906
  if (ide === "codex") {
37905
37907
  const configPath = path16.join(os4.homedir(), ".codex", "config.toml");
37906
37908
  const write = mergeCodexMcpConfig(configPath, options);
37907
- return {
37908
- ide,
37909
- ok: true,
37910
- path: configPath,
37911
- changed: write.changed,
37912
- backupPath: write.backupPath,
37913
- message: formatMcpInstallMessage("Codex", configPath, write)
37914
- };
37909
+ return [createMcpInstallResult(ide, "Codex", configPath, write)];
37915
37910
  }
37916
37911
  if (ide === "cursor") {
37917
37912
  const configPath = path16.join(os4.homedir(), ".cursor", "mcp.json");
37918
37913
  const write = mergeJsonMcpConfig(configPath, options);
37919
- return {
37920
- ide,
37921
- ok: true,
37922
- path: configPath,
37923
- changed: write.changed,
37924
- backupPath: write.backupPath,
37925
- message: formatMcpInstallMessage("Cursor", configPath, write)
37926
- };
37914
+ return [createMcpInstallResult(ide, "Cursor", configPath, write)];
37927
37915
  }
37928
37916
  if (ide === "claude") {
37929
37917
  if (!options.cwd) {
37930
37918
  const claudeResult = tryClaudeMcpAdd(options);
37931
37919
  if (claudeResult.ok) {
37932
- return { ide, ok: true, message: "✓ Claude Code MCP config updated with claude mcp add" };
37920
+ return [
37921
+ {
37922
+ ide,
37923
+ ok: true,
37924
+ message: "✓ Claude Code MCP config updated with claude mcp add"
37925
+ }
37926
+ ];
37933
37927
  }
37934
37928
  }
37935
37929
  const configPath = path16.join(os4.homedir(), ".claude.json");
37936
37930
  const write = mergeJsonMcpConfig(configPath, options);
37937
- return {
37931
+ return [createMcpInstallResult(ide, "Claude fallback", configPath, write)];
37932
+ }
37933
+ if (ide === "trae") {
37934
+ return installJsonMcpConfigTargets(ide, getTraeMcpInstallPaths(), "Trae", options);
37935
+ }
37936
+ if (ide === "opencode") {
37937
+ const configPath = getOpenCodeMcpConfigPath();
37938
+ if (!fs15.existsSync(configPath)) {
37939
+ return [{ ide, ok: false, message: "Skipped OpenCode: no supported config file found" }];
37940
+ }
37941
+ const write = mergeOpenCodeMcpConfig(configPath, options);
37942
+ const result = createMcpInstallResult(ide, "OpenCode", configPath, write);
37943
+ if (write.changed) {
37944
+ result.message += "\n Note: OpenCode config was rewritten as standard JSON.";
37945
+ }
37946
+ return [result];
37947
+ }
37948
+ if (ide === "workbuddy") {
37949
+ return installJsonMcpConfigTargets(
37938
37950
  ide,
37939
- ok: true,
37940
- path: configPath,
37941
- changed: write.changed,
37942
- backupPath: write.backupPath,
37943
- message: formatMcpInstallMessage("Claude fallback", configPath, write)
37944
- };
37951
+ getWorkBuddyMcpInstallPaths(options.mcpName),
37952
+ "WorkBuddy",
37953
+ options
37954
+ );
37955
+ }
37956
+ return [{ ide, ok: false, message: `Skipped unknown IDE: ${ide}` }];
37957
+ }
37958
+ function installJsonMcpConfigTargets(ide, configPaths, label, options) {
37959
+ if (configPaths.length === 0) {
37960
+ return [{ ide, ok: false, message: `Skipped ${label}: no supported config file found` }];
37961
+ }
37962
+ return configPaths.map((configPath) => {
37963
+ try {
37964
+ const write = mergeJsonMcpConfig(configPath, options);
37965
+ return createMcpInstallResult(ide, label, configPath, write);
37966
+ } catch (error2) {
37967
+ return {
37968
+ ide,
37969
+ ok: false,
37970
+ path: configPath,
37971
+ message: `✗ ${label} MCP config update failed for ${configPath}: ${error2 instanceof Error ? error2.message : String(error2)}`
37972
+ };
37973
+ }
37974
+ });
37975
+ }
37976
+ function createMcpInstallResult(ide, label, configPath, write) {
37977
+ return {
37978
+ ide,
37979
+ ok: true,
37980
+ path: configPath,
37981
+ changed: write.changed,
37982
+ backupPath: write.backupPath,
37983
+ message: formatMcpInstallMessage(label, configPath, write)
37984
+ };
37985
+ }
37986
+ function getDefaultMcpInstallIdes() {
37987
+ const ides = ["codex", "cursor", "claude"];
37988
+ if (getTraeMcpInstallPaths().length > 0) {
37989
+ ides.push("trae");
37945
37990
  }
37946
- return { ide, ok: false, message: `Skipped unknown IDE: ${ide}` };
37991
+ if (fs15.existsSync(getOpenCodeMcpConfigPath())) {
37992
+ ides.push("opencode");
37993
+ }
37994
+ if (getWorkBuddyMcpInstallPaths(DEFAULT_MCP_NAME).length > 0) {
37995
+ ides.push("workbuddy");
37996
+ }
37997
+ return ides;
37998
+ }
37999
+ function getTraeMcpInstallPaths() {
38000
+ const soloPaths = getExistingTraeUserConfigPaths(getTraeSoloMcpConfigPaths());
38001
+ const unverifiedPaths = getExistingConfigPaths(getTraeUnverifiedMcpConfigPaths());
38002
+ return uniqueStrings([...soloPaths, ...unverifiedPaths]);
38003
+ }
38004
+ function getExistingTraeUserConfigPaths(paths) {
38005
+ const seen = /* @__PURE__ */ new Set();
38006
+ return paths.filter((configPath) => {
38007
+ const key = normalizeConfigPathKey(configPath);
38008
+ if (seen.has(key) || !fs15.existsSync(path16.dirname(configPath))) {
38009
+ return false;
38010
+ }
38011
+ seen.add(key);
38012
+ return true;
38013
+ });
38014
+ }
38015
+ function getExistingConfigPaths(paths) {
38016
+ const seen = /* @__PURE__ */ new Set();
38017
+ return paths.filter((configPath) => {
38018
+ const key = normalizeConfigPathKey(configPath);
38019
+ if (seen.has(key) || !fs15.existsSync(configPath)) {
38020
+ return false;
38021
+ }
38022
+ seen.add(key);
38023
+ return true;
38024
+ });
38025
+ }
38026
+ function normalizeConfigPathKey(configPath) {
38027
+ const resolved = path16.resolve(configPath);
38028
+ return process.platform === "win32" || process.platform === "darwin" ? resolved.toLowerCase() : resolved;
38029
+ }
38030
+ function getTraeSoloMcpConfigPaths() {
38031
+ if (process.platform === "win32") {
38032
+ const roaming = process.env.APPDATA || path16.join(os4.homedir(), "AppData", "Roaming");
38033
+ return [
38034
+ path16.join(roaming, "TRAE SOLO", "User", "mcp.json"),
38035
+ path16.join(roaming, "TRAE SOLO CN", "User", "mcp.json")
38036
+ ];
38037
+ }
38038
+ const appSupport = path16.join(os4.homedir(), "Library", "Application Support");
38039
+ return [
38040
+ path16.join(appSupport, "TRAE SOLO CN", "User", "mcp.json"),
38041
+ path16.join(appSupport, "TRAE SOLO", "User", "mcp.json")
38042
+ ];
38043
+ }
38044
+ function getTraeUnverifiedMcpConfigPaths() {
38045
+ if (process.platform === "win32") {
38046
+ const roaming = process.env.APPDATA || path16.join(os4.homedir(), "AppData", "Roaming");
38047
+ return [
38048
+ path16.join(roaming, "Trae", "User", "mcp.json"),
38049
+ path16.join(roaming, "TRAE", "User", "mcp.json"),
38050
+ path16.join(roaming, "Trae CN", "User", "mcp.json")
38051
+ ];
38052
+ }
38053
+ const appSupport = path16.join(os4.homedir(), "Library", "Application Support");
38054
+ return [
38055
+ path16.join(appSupport, "Trae", "User", "mcp.json"),
38056
+ path16.join(appSupport, "TRAE", "User", "mcp.json"),
38057
+ path16.join(appSupport, "Trae CN", "User", "mcp.json")
38058
+ ];
38059
+ }
38060
+ function getOpenCodeMcpConfigPath() {
38061
+ return path16.join(os4.homedir(), ".config", "opencode", "opencode.jsonc");
38062
+ }
38063
+ function getWorkBuddyMcpInstallPaths(_mcpName) {
38064
+ const primary = path16.join(os4.homedir(), ".workbuddy", "mcp.json");
38065
+ const runtime = path16.join(os4.homedir(), ".workbuddy", ".mcp.json");
38066
+ const preferred = process.platform === "win32" ? primary : runtime;
38067
+ const fallback = process.platform === "win32" ? runtime : primary;
38068
+ const paths = [];
38069
+ if (fs15.existsSync(preferred)) {
38070
+ paths.push(preferred);
38071
+ }
38072
+ if (fs15.existsSync(fallback)) {
38073
+ paths.push(fallback);
38074
+ }
38075
+ return paths;
37947
38076
  }
37948
38077
  function mergeJsonMcpConfig(configPath, options) {
37949
38078
  const existing = readJsonObject(configPath);
37950
38079
  const mcpServers = asObject(existing.mcpServers);
37951
38080
  mcpServers[options.mcpName] = createJsonMcpServerConfig(options);
37952
38081
  existing.mcpServers = mcpServers;
37953
- return writeConfigWithTapTapBackupIfChanged(configPath, `${JSON.stringify(existing, null, 2)}
37954
- `);
38082
+ return writeConfigWithTapTapBackupIfChanged(
38083
+ configPath,
38084
+ `${JSON.stringify(existing, null, 2)}
38085
+ `,
38086
+ (updated) => validateJsonMcpServersConfig(updated, options)
38087
+ );
38088
+ }
38089
+ function mergeOpenCodeMcpConfig(configPath, options) {
38090
+ const existing = readJsonObject(configPath, { jsonc: true });
38091
+ const mcp = asObject(existing.mcp);
38092
+ mcp[options.mcpName] = createOpenCodeMcpServerConfig(options);
38093
+ existing.mcp = mcp;
38094
+ const mcpServers = asObject(existing.mcpServers);
38095
+ if (Object.prototype.hasOwnProperty.call(mcpServers, options.mcpName)) {
38096
+ delete mcpServers[options.mcpName];
38097
+ if (Object.keys(mcpServers).length === 0) {
38098
+ delete existing.mcpServers;
38099
+ } else {
38100
+ existing.mcpServers = mcpServers;
38101
+ }
38102
+ }
38103
+ if (!existing.$schema) {
38104
+ existing.$schema = "https://opencode.ai/config.json";
38105
+ }
38106
+ return writeConfigWithTapTapBackupIfChanged(
38107
+ configPath,
38108
+ `${JSON.stringify(existing, null, 2)}
38109
+ `,
38110
+ (updated) => validateOpenCodeMcpConfig(updated, options)
38111
+ );
37955
38112
  }
37956
38113
  function mergeCodexMcpConfig(configPath, options) {
37957
38114
  const existing = fs15.existsSync(configPath) ? fs15.readFileSync(configPath, "utf8") : "";
37958
38115
  const sectionPattern = createCodexMcpSectionPattern(options.mcpName);
37959
38116
  const withoutOld = existing.replace(sectionPattern, "").trimEnd();
37960
38117
  const launch = getNpxCliCommand(options.pkg);
38118
+ const envSection = options.env === "production" ? [] : ["", `[mcp_servers."${options.mcpName}".env]`, `TAPTAP_MCP_ENV = "${options.env}"`];
37961
38119
  const section = [
37962
38120
  `[mcp_servers."${options.mcpName}"]`,
37963
38121
  `command = "${escapeToml(launch.command)}"`,
37964
38122
  `args = [${launch.args.map((arg) => `"${escapeToml(arg)}"`).join(", ")}]`,
37965
38123
  options.cwd ? `cwd = "${escapeToml(options.cwd)}"` : "",
37966
- "",
37967
- `[mcp_servers."${options.mcpName}".env]`,
37968
- `TAPTAP_MCP_ENV = "${options.env}"`,
38124
+ ...envSection,
37969
38125
  ""
37970
38126
  ].join("\n");
37971
38127
  return writeConfigWithTapTapBackupIfChanged(
@@ -38032,8 +38188,7 @@ function tryClaudeMcpAdd(options) {
38032
38188
  "user",
38033
38189
  "--transport",
38034
38190
  "stdio",
38035
- "--env",
38036
- `TAPTAP_MCP_ENV=${options.env}`,
38191
+ ...options.env === "production" ? [] : ["--env", `TAPTAP_MCP_ENV=${options.env}`],
38037
38192
  options.mcpName,
38038
38193
  "--",
38039
38194
  ...npxLaunch.commandAndArgs
@@ -38052,11 +38207,31 @@ function createJsonMcpServerConfig(options) {
38052
38207
  command: launch.command,
38053
38208
  args: launch.args,
38054
38209
  ...options.cwd ? { cwd: options.cwd } : {},
38055
- env: {
38056
- TAPTAP_MCP_ENV: options.env
38210
+ ...createOptionalMcpEnvironment(options.env, "env")
38211
+ };
38212
+ }
38213
+ function createOpenCodeMcpServerConfig(options) {
38214
+ return {
38215
+ type: "local",
38216
+ command: getOpenCodeNpxCliCommand(options.pkg),
38217
+ ...options.cwd ? { cwd: options.cwd } : {},
38218
+ enabled: true
38219
+ };
38220
+ }
38221
+ function createOptionalMcpEnvironment(env, key) {
38222
+ if (env === "production") {
38223
+ return {};
38224
+ }
38225
+ return {
38226
+ [key]: {
38227
+ TAPTAP_MCP_ENV: env
38057
38228
  }
38058
38229
  };
38059
38230
  }
38231
+ function getOpenCodeNpxCliCommand(pkg) {
38232
+ const executable = process.platform === "win32" ? "npx.cmd" : "npx";
38233
+ return [executable, "-y", "-p", pkg, "taptap-maker"];
38234
+ }
38060
38235
  function getCurrentCliCommand() {
38061
38236
  if (process.argv[1]) {
38062
38237
  return { command: process.execPath, args: [process.argv[1]] };
@@ -38088,11 +38263,22 @@ function rejectPackageOption(parsed) {
38088
38263
  );
38089
38264
  }
38090
38265
  }
38091
- function readJsonObject(filePath) {
38266
+ function readJsonObject(filePath, options = {}) {
38092
38267
  if (!fs15.existsSync(filePath)) {
38093
38268
  return {};
38094
38269
  }
38095
- return JSON.parse(fs15.readFileSync(filePath, "utf8"));
38270
+ const raw = fs15.readFileSync(filePath, "utf8");
38271
+ try {
38272
+ const normalized = normalizeJsonConfigContent(raw, options);
38273
+ const parsed = JSON.parse(normalized);
38274
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
38275
+ throw new Error("top-level value must be an object");
38276
+ }
38277
+ return parsed;
38278
+ } catch (error2) {
38279
+ const detail = error2 instanceof Error ? error2.message : String(error2);
38280
+ throw new Error(`Invalid JSON in ${filePath}: ${detail}`);
38281
+ }
38096
38282
  }
38097
38283
  function asObject(value) {
38098
38284
  if (value && typeof value === "object" && !Array.isArray(value)) {
@@ -38124,6 +38310,138 @@ function writeConfigWithTapTapBackupIfChanged(filePath, nextContent, validate) {
38124
38310
  throw error2;
38125
38311
  }
38126
38312
  }
38313
+ function validateJsonMcpServersConfig(content, options) {
38314
+ const parsed = parseGeneratedJsonObject(content);
38315
+ const server = asObject(asObject(parsed.mcpServers)[options.mcpName]);
38316
+ const expected = createJsonMcpServerConfig(options);
38317
+ if (!deepJsonEqual(server, expected)) {
38318
+ throw new Error(`Generated MCP config for ${options.mcpName} failed validation.`);
38319
+ }
38320
+ }
38321
+ function validateOpenCodeMcpConfig(content, options) {
38322
+ const parsed = parseGeneratedJsonObject(content);
38323
+ const server = asObject(asObject(parsed.mcp)[options.mcpName]);
38324
+ const expected = createOpenCodeMcpServerConfig(options);
38325
+ if (!deepJsonEqual(server, expected)) {
38326
+ throw new Error(`Generated OpenCode MCP config for ${options.mcpName} failed validation.`);
38327
+ }
38328
+ const legacyServer = asObject(parsed.mcpServers)[options.mcpName];
38329
+ if (legacyServer !== void 0) {
38330
+ throw new Error(
38331
+ `Generated OpenCode config still contains legacy mcpServers.${options.mcpName}.`
38332
+ );
38333
+ }
38334
+ }
38335
+ function parseGeneratedJsonObject(content) {
38336
+ const parsed = JSON.parse(stripLeadingBom(content));
38337
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
38338
+ throw new Error("Generated JSON config top-level value must be an object.");
38339
+ }
38340
+ return parsed;
38341
+ }
38342
+ function deepJsonEqual(left, right) {
38343
+ return JSON.stringify(left) === JSON.stringify(right);
38344
+ }
38345
+ function normalizeJsonConfigContent(content, options = {}) {
38346
+ const withoutBom = stripLeadingBom(content);
38347
+ return options.jsonc ? normalizeJsonc(withoutBom) : withoutBom;
38348
+ }
38349
+ function stripLeadingBom(content) {
38350
+ return content.charCodeAt(0) === 65279 ? content.slice(1) : content;
38351
+ }
38352
+ function normalizeJsonc(content) {
38353
+ return removeTrailingCommas(stripJsonComments(content));
38354
+ }
38355
+ function stripJsonComments(content) {
38356
+ let result = "";
38357
+ let inString = false;
38358
+ let escaped = false;
38359
+ let inLineComment = false;
38360
+ let inBlockComment = false;
38361
+ for (let index = 0; index < content.length; index += 1) {
38362
+ const char = content[index];
38363
+ const next = content[index + 1];
38364
+ if (inLineComment) {
38365
+ if (char === "\n" || char === "\r") {
38366
+ inLineComment = false;
38367
+ result += char;
38368
+ }
38369
+ continue;
38370
+ }
38371
+ if (inBlockComment) {
38372
+ if (char === "*" && next === "/") {
38373
+ inBlockComment = false;
38374
+ index += 1;
38375
+ } else if (char === "\n" || char === "\r") {
38376
+ result += char;
38377
+ }
38378
+ continue;
38379
+ }
38380
+ if (inString) {
38381
+ result += char;
38382
+ if (escaped) {
38383
+ escaped = false;
38384
+ } else if (char === "\\") {
38385
+ escaped = true;
38386
+ } else if (char === '"') {
38387
+ inString = false;
38388
+ }
38389
+ continue;
38390
+ }
38391
+ if (char === '"') {
38392
+ inString = true;
38393
+ result += char;
38394
+ continue;
38395
+ }
38396
+ if (char === "/" && next === "/") {
38397
+ inLineComment = true;
38398
+ index += 1;
38399
+ continue;
38400
+ }
38401
+ if (char === "/" && next === "*") {
38402
+ inBlockComment = true;
38403
+ index += 1;
38404
+ continue;
38405
+ }
38406
+ result += char;
38407
+ }
38408
+ return result;
38409
+ }
38410
+ function removeTrailingCommas(content) {
38411
+ let result = "";
38412
+ let inString = false;
38413
+ let escaped = false;
38414
+ for (let index = 0; index < content.length; index += 1) {
38415
+ const char = content[index];
38416
+ if (inString) {
38417
+ result += char;
38418
+ if (escaped) {
38419
+ escaped = false;
38420
+ } else if (char === "\\") {
38421
+ escaped = true;
38422
+ } else if (char === '"') {
38423
+ inString = false;
38424
+ }
38425
+ continue;
38426
+ }
38427
+ if (char === '"') {
38428
+ inString = true;
38429
+ result += char;
38430
+ continue;
38431
+ }
38432
+ if (char === ",") {
38433
+ let lookahead = index + 1;
38434
+ while (/\s/.test(content[lookahead] || "")) {
38435
+ lookahead += 1;
38436
+ }
38437
+ if (content[lookahead] === "}" || content[lookahead] === "]") {
38438
+ continue;
38439
+ }
38440
+ }
38441
+ result += char;
38442
+ }
38443
+ return result;
38444
+ }
38127
38445
  function formatMcpInstallMessage(label, configPath, write) {
38128
38446
  if (!write.changed) {
38129
38447
  return `✓ ${label} MCP config unchanged: ${configPath}`;
@@ -38297,6 +38615,9 @@ function mcpVerifyModeOption(parsed) {
38297
38615
  function parseIdeList(value) {
38298
38616
  return value.split(/[\s,]+/).map((item) => item.trim().toLowerCase()).filter(Boolean);
38299
38617
  }
38618
+ function uniqueStrings(values) {
38619
+ return Array.from(new Set(values));
38620
+ }
38300
38621
  function mask(value) {
38301
38622
  if (value.length <= 12) {
38302
38623
  return "***";
@@ -38325,7 +38646,8 @@ function printHelp() {
38325
38646
  " taptap-maker Start MCP server mode",
38326
38647
  " taptap-maker init [--env rnd|production] [--app-id ID] [--target-dir DIR] [--pat PAT]",
38327
38648
  " [--create --name NAME]",
38328
- " [--skip-confirm] [--skip-mcp-install] [--register-mcp codex,cursor,claude]",
38649
+ " [--skip-confirm] [--skip-mcp-install]",
38650
+ " [--register-mcp codex,cursor,claude,trae,opencode,workbuddy]",
38329
38651
  " [--json]",
38330
38652
  "",
38331
38653
  "Init flows:",
@@ -38345,10 +38667,12 @@ function printHelp() {
38345
38667
  " taptap-maker login [--env rnd|production] [--json]",
38346
38668
  " taptap-maker pat set [--pat-stdin] [--json]",
38347
38669
  " taptap-maker pat set [PAT|--pat PAT] [--json] # fallback; warns: PAT appears in ps/history",
38348
- " taptap-maker install [--ide codex,cursor,claude] [--env rnd|production]",
38670
+ " taptap-maker install [--ide codex,cursor,claude,trae,opencode,workbuddy]",
38671
+ " [--env rnd|production]",
38349
38672
  " [--target-dir DIR]",
38350
38673
  " [--json] # alias for mcp install",
38351
- " taptap-maker mcp install [--ide codex,cursor,claude] [--env rnd|production]",
38674
+ " taptap-maker mcp install [--ide codex,cursor,claude,trae,opencode,workbuddy]",
38675
+ " [--env rnd|production]",
38352
38676
  " [--target-dir DIR] [--json]",
38353
38677
  " taptap-maker mcp verify [--mode npx|self] [--json]",
38354
38678
  " taptap-maker agents update [--target-dir DIR] [--json]",
@@ -38360,8 +38684,13 @@ function printHelp() {
38360
38684
  "MCP verify defaults to the npx command written into AI client config.",
38361
38685
  "Maker MCP configs and npx verification use @taptap/maker.",
38362
38686
  "",
38687
+ "MCP install defaults:",
38688
+ " Writes Codex, Cursor, Claude, detected Trae/OpenCode/WorkBuddy configs,",
38689
+ " unless --ide is specified. It does not create missing Trae config files.",
38690
+ "",
38363
38691
  "Windows note:",
38364
- " Generated MCP configs wrap npx.cmd with cmd.exe on Windows for spawn compatibility.",
38692
+ " mcpServers configs wrap npx.cmd with cmd.exe on Windows for spawn compatibility.",
38693
+ " OpenCode uses its own mcp schema and writes a command array with npx.cmd.",
38365
38694
  ""
38366
38695
  ].join("\n")
38367
38696
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taptap/maker",
3
- "version": "0.0.21-beta.2",
3
+ "version": "0.0.21-beta.4",
4
4
  "type": "module",
5
5
  "description": "TapTap Maker local development CLI and MCP server",
6
6
  "main": "dist/maker.js",