weapp-ide-cli 5.4.2 → 5.4.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.
@@ -6,8 +6,8 @@ import { Launcher } from "@weapp-vite/miniprogram-automator";
6
6
  import { fs as fs$1 } from "@weapp-core/shared/fs";
7
7
  import process from "node:process";
8
8
  import path$1 from "pathe";
9
- import logger, { colors } from "@weapp-core/logger";
10
9
  import { createHash } from "node:crypto";
10
+ import logger, { colors } from "@weapp-core/logger";
11
11
  import { acquireSharedMiniProgram, closeSharedMiniProgram, getSharedMiniProgramSessionCount, releaseSharedMiniProgram, withMiniProgram } from "@weapp-vite/devtools-runtime";
12
12
  import { emitKeypressEvents } from "node:readline";
13
13
  //#region src/utils/path.ts
@@ -112,6 +112,111 @@ async function overwriteCustomConfig(config) {
112
112
  await writeCustomConfig(nextConfig, { replace: true });
113
113
  }
114
114
  //#endregion
115
+ //#region src/cli/automatorProject.ts
116
+ const WRAPPER_ROOT = path.join(os.tmpdir(), "weapp-ide-cli-automator-projects");
117
+ function normalizeProjectRelativeRoot(rawRoot) {
118
+ if (typeof rawRoot !== "string") return;
119
+ const normalized = rawRoot.trim().replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+$/, "");
120
+ if (!normalized || normalized === ".") return;
121
+ if (normalized.split("/").includes("..")) return;
122
+ return normalized;
123
+ }
124
+ async function pathExists(filePath) {
125
+ try {
126
+ await fs.access(filePath);
127
+ return true;
128
+ } catch {
129
+ return false;
130
+ }
131
+ }
132
+ async function readJsonObject$1(filePath) {
133
+ try {
134
+ const raw = await fs.readFile(filePath, "utf8");
135
+ const value = JSON.parse(raw);
136
+ return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
137
+ } catch {
138
+ return;
139
+ }
140
+ }
141
+ async function writeJsonObject$1(filePath, value) {
142
+ await fs.mkdir(path.dirname(filePath), { recursive: true });
143
+ await fs.writeFile(filePath, `${JSON.stringify(value, null, 2)}\n`, "utf8");
144
+ }
145
+ async function copyProjectRoot(sourceProjectPath, wrapperProjectPath, relativeRoot) {
146
+ const sourcePath = path.join(sourceProjectPath, relativeRoot);
147
+ if (!await pathExists(sourcePath)) return;
148
+ await fs.cp(sourcePath, path.join(wrapperProjectPath, relativeRoot), {
149
+ dereference: true,
150
+ force: true,
151
+ recursive: true
152
+ });
153
+ }
154
+ async function copyJsonConfigAsWrapper(sourcePath, targetPath, patch) {
155
+ const source = await readJsonObject$1(sourcePath);
156
+ if (!source) return;
157
+ await writeJsonObject$1(targetPath, {
158
+ ...source,
159
+ ...patch
160
+ });
161
+ }
162
+ async function ensureWrapperAppConfig(wrapperProjectPath) {
163
+ const appConfigPath = path.join(wrapperProjectPath, "app.json");
164
+ const appConfig = await readJsonObject$1(appConfigPath);
165
+ if (!appConfig) return;
166
+ await writeJsonObject$1(appConfigPath, {
167
+ ...appConfig,
168
+ subPackages: Array.isArray(appConfig.subPackages) ? appConfig.subPackages : []
169
+ });
170
+ }
171
+ /**
172
+ * @description 为 DevTools automator 准备稳定的小程序根目录,避免打开瞬间跨 miniprogramRoot 读取 app.json 抖动。
173
+ */
174
+ async function resolveAutomatorProjectPath(projectPath) {
175
+ const sourceProjectPath = path.resolve(projectPath);
176
+ const projectConfig = await readJsonObject$1(path.join(sourceProjectPath, "project.config.json"));
177
+ const miniprogramRoot = normalizeProjectRelativeRoot(projectConfig?.miniprogramRoot);
178
+ if (!miniprogramRoot) return {
179
+ projectPath: sourceProjectPath,
180
+ sourceProjectPath
181
+ };
182
+ const distRoot = path.join(sourceProjectPath, miniprogramRoot);
183
+ if (!await pathExists(path.join(distRoot, "app.json"))) return {
184
+ projectPath: sourceProjectPath,
185
+ sourceProjectPath
186
+ };
187
+ const wrapperHash = createHash("sha1").update(sourceProjectPath).update("\0").update(path.resolve(distRoot)).digest("hex").slice(0, 16);
188
+ const wrapperProjectPath = path.join(WRAPPER_ROOT, wrapperHash);
189
+ await fs.rm(wrapperProjectPath, {
190
+ recursive: true,
191
+ force: true
192
+ });
193
+ await fs.mkdir(wrapperProjectPath, { recursive: true });
194
+ await fs.cp(distRoot, wrapperProjectPath, {
195
+ dereference: true,
196
+ force: true,
197
+ recursive: true
198
+ });
199
+ const pluginRoot = normalizeProjectRelativeRoot(projectConfig?.pluginRoot);
200
+ if (pluginRoot) await copyProjectRoot(sourceProjectPath, wrapperProjectPath, pluginRoot);
201
+ const rootPatch = {
202
+ miniprogramRoot: "./",
203
+ srcMiniprogramRoot: "./"
204
+ };
205
+ await copyJsonConfigAsWrapper(path.join(sourceProjectPath, "project.config.json"), path.join(wrapperProjectPath, "project.config.json"), rootPatch);
206
+ await copyJsonConfigAsWrapper(path.join(sourceProjectPath, "project.private.config.json"), path.join(wrapperProjectPath, "project.private.config.json"), rootPatch);
207
+ await ensureWrapperAppConfig(wrapperProjectPath);
208
+ return {
209
+ cleanup: async () => {
210
+ await fs.rm(wrapperProjectPath, {
211
+ recursive: true,
212
+ force: true
213
+ });
214
+ },
215
+ projectPath: wrapperProjectPath,
216
+ sourceProjectPath
217
+ };
218
+ }
219
+ //#endregion
115
220
  //#region src/logger.ts
116
221
  var logger_default = logger;
117
222
  //#endregion
@@ -506,6 +611,8 @@ const AUTOMATOR_LAUNCH_TIMEOUT_RE = /Wait timed out after \d+ ms/i;
506
611
  const AUTOMATOR_WS_CONNECT_RE = /Failed connecting to ws:\/\/127\.0\.0\.1:\d+/i;
507
612
  const DEVTOOLS_PROTOCOL_TIMEOUT_RE = /DevTools did not respond to protocol method (\S+) within \d+ms/i;
508
613
  const DEVTOOLS_INFRA_ERROR_PATTERNS = [
614
+ /#initialize-error:\s*wait IDE port timeout/i,
615
+ /wait IDE port timeout/i,
509
616
  /listen EPERM/i,
510
617
  /operation not permitted 0\.0\.0\.0/i,
511
618
  /EACCES/i,
@@ -660,8 +767,9 @@ async function launchAutomator(options) {
660
767
  const launcher = new Launcher();
661
768
  let lastError = null;
662
769
  let bootstrapResult;
770
+ const resolvedProject = await resolveAutomatorProjectPath(projectPath);
663
771
  if (config.autoBootstrapDevtools !== false) bootstrapResult = await bootstrapWechatDevtoolsSettings({
664
- projectPath,
772
+ projectPath: resolvedProject.projectPath,
665
773
  trustProject: resolvedTrustProject
666
774
  });
667
775
  if (bootstrapResult?.servicePortEnabled === false) throw new Error("Detected WeChat DevTools service port is disabled in current settings. Please enable it manually; existing user settings were not modified.");
@@ -669,7 +777,7 @@ async function launchAutomator(options) {
669
777
  const miniProgram = await launcher.launch({
670
778
  cliPath: resolvedCliPath,
671
779
  ...port ? { port } : {},
672
- projectPath,
780
+ projectPath: resolvedProject.projectPath,
673
781
  timeout,
674
782
  trustProject: resolvedTrustProject
675
783
  });
@@ -1,6 +1,6 @@
1
- import { $ as readCustomConfig, B as getConfiguredLocale, C as configureLocaleFromArgv, J as createAutoBootstrapDevtoolsConfig, K as colors, Q as overwriteCustomConfig, R as resolveCliPath, T as validateLocaleOption, V as resolveDevtoolsAutomationDefaults, X as createCustomConfig, Y as createAutoTrustProjectConfig, Z as createLocaleConfig, et as removeCustomConfigKey, nt as defaultCustomConfigFilePath, q as logger_default, r as connectMiniProgram, w as i18nText } from "./automator-session-CvStbY9I.js";
2
- import { $ as parseAutomatorArgs, A as isWechatIdeLoggedIn, B as runWechatCliCommand, C as clearWechatIdeCache, F as quitWechatIde, G as transformArgv, H as execute, K as promptForCliPath, L as resetWechatIdeFileUtils, M as openWechatIde, N as openWechatIdeOtherProject, P as previewWechatIde, Q as startWechatIdeEngineBuildByHttp, S as buildWechatIdeNpm, T as closeWechatIdeProject, U as createAlias, W as createPathCompat, Y as pollWechatIdeEngineBuildResultByHttp, _ as autoPreviewWechatIde, a as navigateBack, b as buildWechatIdeApk, c as pageStack, d as remote, et as readBooleanOption, f as scrollTo, g as tap, i as input, j as loginWechatIde, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, nt as removeOption, o as navigateTo, p as switchTab, r as currentPage, s as pageData, t as audit, tt as readOptionValue, u as redirectTo, v as autoReplayWechatIde, x as buildWechatIdeIpa, y as autoWechatIde, z as uploadWechatIde } from "./commands-Js_IjVxE.js";
3
- import "./run-mcp-DvHYYX0m.js";
1
+ import { $ as readCustomConfig, B as getConfiguredLocale, C as configureLocaleFromArgv, J as createAutoBootstrapDevtoolsConfig, K as colors, Q as overwriteCustomConfig, R as resolveCliPath, T as validateLocaleOption, V as resolveDevtoolsAutomationDefaults, X as createCustomConfig, Y as createAutoTrustProjectConfig, Z as createLocaleConfig, et as removeCustomConfigKey, nt as defaultCustomConfigFilePath, q as logger_default, r as connectMiniProgram, w as i18nText } from "./automator-session-C3YxriQT.js";
2
+ import { $ as parseAutomatorArgs, A as isWechatIdeLoggedIn, B as runWechatCliCommand, C as clearWechatIdeCache, F as quitWechatIde, G as transformArgv, H as execute, K as promptForCliPath, L as resetWechatIdeFileUtils, M as openWechatIde, N as openWechatIdeOtherProject, P as previewWechatIde, Q as startWechatIdeEngineBuildByHttp, S as buildWechatIdeNpm, T as closeWechatIdeProject, U as createAlias, W as createPathCompat, Y as pollWechatIdeEngineBuildResultByHttp, _ as autoPreviewWechatIde, a as navigateBack, b as buildWechatIdeApk, c as pageStack, d as remote, et as readBooleanOption, f as scrollTo, g as tap, i as input, j as loginWechatIde, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, nt as removeOption, o as navigateTo, p as switchTab, r as currentPage, s as pageData, t as audit, tt as readOptionValue, u as redirectTo, v as autoReplayWechatIde, x as buildWechatIdeIpa, y as autoWechatIde, z as uploadWechatIde } from "./commands-DwmzgnVJ.js";
3
+ import "./run-mcp-DtQ9i813.js";
4
4
  import fs from "node:fs/promises";
5
5
  import path from "node:path";
6
6
  import { fs as fs$1 } from "@weapp-core/shared/fs";
@@ -313,7 +313,7 @@ async function runScreenshot(argv) {
313
313
  }
314
314
  const options = parseScreenshotArgs(argv);
315
315
  const isJsonOutput = argv.includes("--json");
316
- const { takeScreenshot } = await import("./commands-B4HFVW-Q.js");
316
+ const { takeScreenshot } = await import("./commands-B8GEPQkf.js");
317
317
  const result = await takeScreenshot(options);
318
318
  if (isJsonOutput) {
319
319
  console.log(JSON.stringify(result, null, 2));
@@ -533,6 +533,24 @@ function validateUnsupportedOptions(command, argv, allowedOptions) {
533
533
  throw new Error(i18nText(`'${command}' 命令不支持参数 '${optionName}'`, `Command '${command}' does not support option '${optionName}'`));
534
534
  }
535
535
  }
536
+ function createCommandTimeoutError(command, timeout) {
537
+ const error = new Error(i18nText(`${command} 命令在 ${timeout}ms 内未收到 DevTools 回包,无法连接到当前项目的微信开发者工具自动化 websocket。请确认当前打开的是目标项目;若之前跑过其他 e2e / screenshot 任务,关闭多余的微信开发者工具窗口,或结束残留的 \`wechatwebdevtools cli auto --project ...\` 进程后重试。`, `${command} command did not receive a DevTools response within ${timeout}ms. Cannot connect to the Wechat DevTools automation websocket for the current project. Please confirm the current DevTools window is the target project. If you recently ran other e2e / screenshot tasks, close extra windows or stop stale \`wechatwebdevtools cli auto --project ...\` processes and retry.`));
538
+ error.code = "DEVTOOLS_PROTOCOL_TIMEOUT";
539
+ return error;
540
+ }
541
+ async function runCommandHandlerWithTimeout(command, args, task) {
542
+ const timeout = args.timeout ?? 3e4;
543
+ let timer;
544
+ try {
545
+ await Promise.race([task, new Promise((_, reject) => {
546
+ timer = setTimeout(() => {
547
+ reject(createCommandTimeoutError(command, timeout));
548
+ }, timeout);
549
+ })]);
550
+ } finally {
551
+ if (timer) clearTimeout(timer);
552
+ }
553
+ }
536
554
  const COMMAND_DEFINITIONS = {
537
555
  "navigate": createDefinition({
538
556
  description: {
@@ -791,10 +809,10 @@ async function runAutomatorCommand(command, argv) {
791
809
  validateUnsupportedOptions(command, argv, definition.allowedOptions);
792
810
  if (await tryRunRuntimeServiceCommand(command, argv)) return;
793
811
  const args = parseAutomatorArgs(argv);
794
- await definition.handler({
812
+ await runCommandHandlerWithTimeout(command, args, definition.handler({
795
813
  argv,
796
814
  args
797
- });
815
+ }));
798
816
  }
799
817
  //#endregion
800
818
  //#region src/cli/command-catalog.ts
@@ -1605,7 +1623,7 @@ async function parse(argv) {
1605
1623
  return;
1606
1624
  }
1607
1625
  if (matchedCommand === "mcp") {
1608
- const { runMcpCommand } = await import("./run-mcp-CL909GLy.js");
1626
+ const { runMcpCommand } = await import("./run-mcp-BV3dKW1J.js");
1609
1627
  await runMcpCommand(argv.slice(1));
1610
1628
  return;
1611
1629
  }
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
- import { q as logger_default } from "./automator-session-CvStbY9I.js";
2
- import { n as parse } from "./cli-C9KfpthX.js";
1
+ import { q as logger_default } from "./automator-session-C3YxriQT.js";
2
+ import { n as parse } from "./cli-BN_7jPs2.js";
3
3
  import process from "node:process";
4
4
  //#region src/cli.ts
5
5
  const argv = process.argv.slice(2);
@@ -0,0 +1,2 @@
1
+ import { h as takeScreenshot } from "./commands-DwmzgnVJ.js";
2
+ export { takeScreenshot };
@@ -1,4 +1,4 @@
1
- import { $ as readCustomConfig, G as operatingSystemName, I as bootstrapWechatDevtoolsSettings, K as colors, L as detectWechatDevtoolsServicePort, R as resolveCliPath, W as isOperatingSystemSupported, X as createCustomConfig, d as createWechatIdeLoginRequiredExitError, h as isWechatIdeLoginRequiredError, n as closeSharedMiniProgram, nt as defaultCustomConfigFilePath, o as withMiniProgram, q as logger_default, rt as resolvePath, s as runRetryableCommand, v as promptWechatIdeLoginRetry, w as i18nText, x as runWithSuspendedSharedInput } from "./automator-session-CvStbY9I.js";
1
+ import { $ as readCustomConfig, G as operatingSystemName, I as bootstrapWechatDevtoolsSettings, K as colors, L as detectWechatDevtoolsServicePort, R as resolveCliPath, W as isOperatingSystemSupported, X as createCustomConfig, d as createWechatIdeLoginRequiredExitError, h as isWechatIdeLoginRequiredError, n as closeSharedMiniProgram, nt as defaultCustomConfigFilePath, o as withMiniProgram, q as logger_default, rt as resolvePath, s as runRetryableCommand, v as promptWechatIdeLoginRetry, w as i18nText, x as runWithSuspendedSharedInput } from "./automator-session-C3YxriQT.js";
2
2
  import { Buffer } from "node:buffer";
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
@@ -896,6 +896,9 @@ function withCommandTimeout(task, timeoutMs, message, code) {
896
896
  });
897
897
  });
898
898
  }
899
+ function createCurrentPageTimeoutMessage(commandTimeout) {
900
+ return i18nText(`当前页面请求在 ${commandTimeout}ms 内未收到 DevTools 回包,请确认当前打开的是目标项目;若之前跑过其他 e2e / screenshot 任务,关闭多余的微信开发者工具窗口,或结束残留的 \`wechatwebdevtools cli auto --project ...\` 进程后重试。`, `Current page request did not receive a DevTools response within ${commandTimeout}ms. Please confirm the current DevTools window is the target project. If you recently ran other e2e / screenshot tasks, close extra windows or stop stale \`wechatwebdevtools cli auto --project ...\` processes and retry.`);
901
+ }
899
902
  function isDevtoolsProtocolTimeoutError(error) {
900
903
  if (!(error instanceof Error)) return false;
901
904
  return error.message === "DEVTOOLS_PROTOCOL_TIMEOUT" || error.message.includes("DevTools did not respond to protocol method") || Reflect.get(error, "code") === "DEVTOOLS_PROTOCOL_TIMEOUT";
@@ -979,7 +982,8 @@ async function pageStack(options) {
979
982
  */
980
983
  async function currentPage(options) {
981
984
  return await withMiniProgram(options, async (miniProgram) => {
982
- const result = toPageSnapshot(await miniProgram.currentPage());
985
+ const commandTimeout = options.timeout ?? 3e4;
986
+ const result = toPageSnapshot(await withCommandTimeout(miniProgram.currentPage(), commandTimeout, createCurrentPageTimeoutMessage(commandTimeout), "DEVTOOLS_PROTOCOL_TIMEOUT"));
983
987
  if (options.json) console.log(JSON.stringify(result, null, 2));
984
988
  else logger_default.info(i18nText(`当前页面: ${result.path}${result.query ? ` ${JSON.stringify(result.query)}` : ""}`, `Current page: ${result.path}${result.query ? ` ${JSON.stringify(result.query)}` : ""}`));
985
989
  return result;
@@ -1045,6 +1049,7 @@ async function audit(options) {
1045
1049
  logger_default.info(i18nText("正在执行体验审计...", "Running experience audit..."));
1046
1050
  const result = await miniProgram.stopAudits();
1047
1051
  if (options.outputPath) {
1052
+ await fs.mkdir(path.dirname(options.outputPath), { recursive: true });
1048
1053
  await fs.writeFile(options.outputPath, JSON.stringify(result, null, 2));
1049
1054
  logger_default.success(i18nText(`审计报告已保存到 ${colors.cyan(options.outputPath)}`, `Audit report saved to ${colors.cyan(options.outputPath)}`));
1050
1055
  return result;
@@ -1121,6 +1126,7 @@ async function takeScreenshot(options) {
1121
1126
  if (!screenshotBuffer) throw new Error(i18nText("截图失败", "Failed to capture screenshot"));
1122
1127
  const base64 = screenshotBuffer.toString("base64");
1123
1128
  if (options.outputPath) {
1129
+ await fs.mkdir(path.dirname(options.outputPath), { recursive: true });
1124
1130
  await fs.writeFile(options.outputPath, screenshotBuffer);
1125
1131
  logger_default.success(i18nText(`截图已保存到 ${colors.cyan(options.outputPath)}`, `Screenshot saved to ${colors.cyan(options.outputPath)}`));
1126
1132
  return { path: options.outputPath };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { $ as readCustomConfig, A as isAutomatorProtocolTimeoutError, B as getConfiguredLocale, D as formatAutomatorLoginError, E as connectOpenedAutomator, F as launchAutomator, G as operatingSystemName, H as SupportedPlatformsMap, I as bootstrapWechatDevtoolsSettings, J as createAutoBootstrapDevtoolsConfig, L as detectWechatDevtoolsServicePort, M as isDevtoolsExtensionContextInvalidatedError, N as isDevtoolsHttpPortError, O as getAutomatorProtocolTimeoutMethod, P as isRetryableAutomatorLaunchError, Q as overwriteCustomConfig, R as resolveCliPath, S as waitForExclusiveKeypress, U as getDefaultCliPath, V as resolveDevtoolsAutomationDefaults, W as isOperatingSystemSupported, X as createCustomConfig, Y as createAutoTrustProjectConfig, Z as createLocaleConfig, _ as promptRetryKeypress, a as releaseSharedMiniProgram, b as createSharedInputSession, c as RETRY_CANCEL_KEYS, d as createWechatIdeLoginRequiredExitError, et as removeCustomConfigKey, f as extractExecutionErrorText, g as isWechatIdeLoginRequiredExitError, h as isWechatIdeLoginRequiredError, i as getSharedMiniProgramSessionCount, j as isAutomatorWsConnectError, k as isAutomatorLoginError, l as RETRY_CONFIRM_KEYS, m as formatWechatIdeLoginRequiredError, n as closeSharedMiniProgram, nt as defaultCustomConfigFilePath, o as withMiniProgram, p as formatRetryHotkeyPrompt, r as connectMiniProgram, rt as resolvePath, s as runRetryableCommand, t as acquireSharedMiniProgram, tt as defaultCustomConfigDirPath, u as RETRY_PROMPT_INITIAL_IGNORE_MS, v as promptWechatIdeLoginRetry, x as runWithSuspendedSharedInput, y as waitForRetryKeypress, z as getConfig } from "./automator-session-CvStbY9I.js";
2
- import { $ as parseAutomatorArgs, A as isWechatIdeLoggedIn, C as clearWechatIdeCache, D as getWechatIdeTestAccounts, E as compileWechatIdeByAutomator, F as quitWechatIde, G as transformArgv, H as execute, I as refreshWechatIdeTicket, J as openWechatIdeProjectByHttp, K as promptForCliPath, L as resetWechatIdeFileUtils, M as openWechatIde, N as openWechatIdeOtherProject, O as getWechatIdeTicket, P as previewWechatIde, Q as startWechatIdeEngineBuildByHttp, R as setWechatIdeTicket, S as buildWechatIdeNpm, T as closeWechatIdeProject, U as createAlias, V as runWechatCliWithRetry, W as createPathCompat, X as requestWechatDevtoolsHttp, Y as pollWechatIdeEngineBuildResultByHttp, Z as resetWechatIdeFileUtilsByHttp, _ as autoPreviewWechatIde, a as navigateBack, b as buildWechatIdeApk, c as pageStack, d as remote, et as readBooleanOption, f as scrollTo, g as tap, h as takeScreenshot, i as input, j as loginWechatIde, k as getWechatIdeToolInfo, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, nt as removeOption, o as navigateTo, p as switchTab, q as WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, r as currentPage, s as pageData, t as audit, tt as readOptionValue, u as redirectTo, v as autoReplayWechatIde, w as clearWechatIdeCacheByAutomator, x as buildWechatIdeIpa, y as autoWechatIde, z as uploadWechatIde } from "./commands-Js_IjVxE.js";
3
- import { C as parseCompareArgs, S as printScreenshotHelp, _ as AUTOMATOR_COMMAND_NAMES, a as runMinidev, b as runAutomatorCommand, c as runWechatIdeEngineBuild, d as CONFIG_COMMAND_NAME, f as MCP_COMMAND_NAME, g as isWeappIdeTopLevelCommand, h as WECHAT_CLI_COMMAND_NAMES, i as validateWechatCliCommandArgs, l as runWechatIdeEngineBuildByHttp, m as WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, n as parse, o as startForwardConsole, p as MINIDEV_NAMESPACE_COMMAND_NAMES, r as dispatchWechatCliCommand, s as isWechatIdeEngineBuildEndpointMissingError, t as createCli, u as handleConfigCommand, v as getAutomatorCommandHelp, w as printCompareHelp, x as parseScreenshotArgs, y as isAutomatorCommand } from "./cli-C9KfpthX.js";
4
- import { a as readElementSnapshot, i as registerWeappIdeMcpTools, n as startWeappIdeMcpServer, o as resolveProjectPath, r as createWeappIdeMcpServer, s as toSerializableValue, t as runMcpCommand } from "./run-mcp-DvHYYX0m.js";
1
+ import { $ as readCustomConfig, A as isAutomatorProtocolTimeoutError, B as getConfiguredLocale, D as formatAutomatorLoginError, E as connectOpenedAutomator, F as launchAutomator, G as operatingSystemName, H as SupportedPlatformsMap, I as bootstrapWechatDevtoolsSettings, J as createAutoBootstrapDevtoolsConfig, L as detectWechatDevtoolsServicePort, M as isDevtoolsExtensionContextInvalidatedError, N as isDevtoolsHttpPortError, O as getAutomatorProtocolTimeoutMethod, P as isRetryableAutomatorLaunchError, Q as overwriteCustomConfig, R as resolveCliPath, S as waitForExclusiveKeypress, U as getDefaultCliPath, V as resolveDevtoolsAutomationDefaults, W as isOperatingSystemSupported, X as createCustomConfig, Y as createAutoTrustProjectConfig, Z as createLocaleConfig, _ as promptRetryKeypress, a as releaseSharedMiniProgram, b as createSharedInputSession, c as RETRY_CANCEL_KEYS, d as createWechatIdeLoginRequiredExitError, et as removeCustomConfigKey, f as extractExecutionErrorText, g as isWechatIdeLoginRequiredExitError, h as isWechatIdeLoginRequiredError, i as getSharedMiniProgramSessionCount, j as isAutomatorWsConnectError, k as isAutomatorLoginError, l as RETRY_CONFIRM_KEYS, m as formatWechatIdeLoginRequiredError, n as closeSharedMiniProgram, nt as defaultCustomConfigFilePath, o as withMiniProgram, p as formatRetryHotkeyPrompt, r as connectMiniProgram, rt as resolvePath, s as runRetryableCommand, t as acquireSharedMiniProgram, tt as defaultCustomConfigDirPath, u as RETRY_PROMPT_INITIAL_IGNORE_MS, v as promptWechatIdeLoginRetry, x as runWithSuspendedSharedInput, y as waitForRetryKeypress, z as getConfig } from "./automator-session-C3YxriQT.js";
2
+ import { $ as parseAutomatorArgs, A as isWechatIdeLoggedIn, C as clearWechatIdeCache, D as getWechatIdeTestAccounts, E as compileWechatIdeByAutomator, F as quitWechatIde, G as transformArgv, H as execute, I as refreshWechatIdeTicket, J as openWechatIdeProjectByHttp, K as promptForCliPath, L as resetWechatIdeFileUtils, M as openWechatIde, N as openWechatIdeOtherProject, O as getWechatIdeTicket, P as previewWechatIde, Q as startWechatIdeEngineBuildByHttp, R as setWechatIdeTicket, S as buildWechatIdeNpm, T as closeWechatIdeProject, U as createAlias, V as runWechatCliWithRetry, W as createPathCompat, X as requestWechatDevtoolsHttp, Y as pollWechatIdeEngineBuildResultByHttp, Z as resetWechatIdeFileUtilsByHttp, _ as autoPreviewWechatIde, a as navigateBack, b as buildWechatIdeApk, c as pageStack, d as remote, et as readBooleanOption, f as scrollTo, g as tap, h as takeScreenshot, i as input, j as loginWechatIde, k as getWechatIdeToolInfo, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, nt as removeOption, o as navigateTo, p as switchTab, q as WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, r as currentPage, s as pageData, t as audit, tt as readOptionValue, u as redirectTo, v as autoReplayWechatIde, w as clearWechatIdeCacheByAutomator, x as buildWechatIdeIpa, y as autoWechatIde, z as uploadWechatIde } from "./commands-DwmzgnVJ.js";
3
+ import { C as parseCompareArgs, S as printScreenshotHelp, _ as AUTOMATOR_COMMAND_NAMES, a as runMinidev, b as runAutomatorCommand, c as runWechatIdeEngineBuild, d as CONFIG_COMMAND_NAME, f as MCP_COMMAND_NAME, g as isWeappIdeTopLevelCommand, h as WECHAT_CLI_COMMAND_NAMES, i as validateWechatCliCommandArgs, l as runWechatIdeEngineBuildByHttp, m as WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, n as parse, o as startForwardConsole, p as MINIDEV_NAMESPACE_COMMAND_NAMES, r as dispatchWechatCliCommand, s as isWechatIdeEngineBuildEndpointMissingError, t as createCli, u as handleConfigCommand, v as getAutomatorCommandHelp, w as printCompareHelp, x as parseScreenshotArgs, y as isAutomatorCommand } from "./cli-BN_7jPs2.js";
4
+ import { a as readElementSnapshot, i as registerWeappIdeMcpTools, n as startWeappIdeMcpServer, o as resolveProjectPath, r as createWeappIdeMcpServer, s as toSerializableValue, t as runMcpCommand } from "./run-mcp-DtQ9i813.js";
5
5
  export { AUTOMATOR_COMMAND_NAMES, CONFIG_COMMAND_NAME, MCP_COMMAND_NAME, MINIDEV_NAMESPACE_COMMAND_NAMES, RETRY_CANCEL_KEYS, RETRY_CONFIRM_KEYS, RETRY_PROMPT_INITIAL_IGNORE_MS, SupportedPlatformsMap, WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, WECHAT_CLI_COMMAND_NAMES, WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, acquireSharedMiniProgram, audit, autoPreviewWechatIde, autoReplayWechatIde, autoWechatIde, bootstrapWechatDevtoolsSettings, buildWechatIdeApk, buildWechatIdeIpa, buildWechatIdeNpm, captureScreenshotBuffer, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeSharedMiniProgram, closeWechatIdeProject, compileWechatIdeByAutomator, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createSharedInputSession, createWeappIdeMcpServer, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, dispatchWechatCliCommand, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getSharedMiniProgramSessionCount, getWechatIdeTestAccounts, getWechatIdeTicket, getWechatIdeToolInfo, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeEngineBuildEndpointMissingError, isWechatIdeLoggedIn, isWechatIdeLoginRequiredError, isWechatIdeLoginRequiredExitError, launchAutomator, loginWechatIde, navigateBack, navigateTo, openWechatIde, openWechatIdeOtherProject, openWechatIdeProjectByHttp, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, pollWechatIdeEngineBuildResultByHttp, previewWechatIde, printCompareHelp, printScreenshotHelp, promptForCliPath, promptRetryKeypress, promptWechatIdeLoginRetry, quitWechatIde, reLaunch, readBooleanOption, readCustomConfig, readElementSnapshot, readOptionValue, redirectTo, refreshWechatIdeTicket, registerWeappIdeMcpTools, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, requestWechatDevtoolsHttp, resetWechatIdeFileUtils, resetWechatIdeFileUtilsByHttp, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, resolveProjectPath, runAutomatorCommand, runMcpCommand, runMinidev, runRetryableCommand, runWechatCliWithRetry, runWechatIdeEngineBuild, runWechatIdeEngineBuildByHttp, runWithSuspendedSharedInput, scrollTo, setWechatIdeTicket, startForwardConsole, startWeappIdeMcpServer, startWechatIdeEngineBuildByHttp, switchTab, systemInfo, takeScreenshot, tap, toSerializableValue, transformArgv, uploadWechatIde, validateWechatCliCommandArgs, waitForExclusiveKeypress, waitForRetryKeypress, withMiniProgram };
@@ -0,0 +1,2 @@
1
+ import { t as runMcpCommand } from "./run-mcp-DtQ9i813.js";
2
+ export { runMcpCommand };
@@ -1,4 +1,4 @@
1
- import { o as withMiniProgram$1 } from "./automator-session-CvStbY9I.js";
1
+ import { o as withMiniProgram$1 } from "./automator-session-C3YxriQT.js";
2
2
  import { Buffer } from "node:buffer";
3
3
  import fs from "node:fs/promises";
4
4
  import path from "node:path";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "weapp-ide-cli",
3
3
  "type": "module",
4
- "version": "5.4.2",
4
+ "version": "5.4.3",
5
5
  "description": "让微信开发者工具,用起来更加方便!",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- import { h as takeScreenshot } from "./commands-Js_IjVxE.js";
2
- export { takeScreenshot };
@@ -1,2 +0,0 @@
1
- import { t as runMcpCommand } from "./run-mcp-DvHYYX0m.js";
2
- export { runMcpCommand };