weapp-ide-cli 6.3.0 → 6.4.0
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/README.md +2 -0
- package/dist/automator-BqhUtMJp.js +1 -0
- package/dist/{automator-BOe32upt.js → automator-Esp3BjoT.js} +11 -18
- package/dist/{automator-session-VOB03glx.js → automator-session-Ba27VW0_.js} +4 -6
- package/dist/{automatorProject-DjYLqMj6.js → automatorProject-DPU-pEF0.js} +19 -38
- package/dist/{cli-CFlqFpIw.js → cli-Dd1RJ5PH.js} +41 -71
- package/dist/cli.js +3 -4
- package/dist/{commands-mslf7-sP.js → commands-5entj0Rh.js} +5 -7
- package/dist/commands-DR-8MVFm.js +1 -0
- package/dist/{devtoolsProjectOwnership-BMfSAg4n.js → devtoolsProjectOwnership-C4jj8msU.js} +116 -89
- package/dist/index.d.ts +0 -110
- package/dist/index.js +7 -7
- package/dist/{managed-B04Xo9U_.js → managed-hSCZXTon.js} +4 -6
- package/dist/{run-mcp-Ni139Z5C.js → run-mcp-CbmskSgr.js} +4 -7
- package/dist/run-mcp-D1w7-oPp.js +1 -0
- package/package.json +9 -9
- package/dist/automator-VSjgHujY.js +0 -1
- package/dist/commands-DmirGBy4.js +0 -1
- package/dist/run-mcp-83-VKZVA.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,20 +3,15 @@ import { Buffer } from "node:buffer";
|
|
|
3
3
|
import { OperationLifecycle } from "@weapp-vite/miniprogram-automator/operation";
|
|
4
4
|
import { MiniProgram } from "@weapp-vite/miniprogram-automator";
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/server";
|
|
6
|
-
//#region src/devtoolsTarget/metadata.d.ts
|
|
7
6
|
interface WechatDevtoolsMetadata {
|
|
8
7
|
version?: string;
|
|
9
8
|
channel?: 'stable' | 'rc' | 'nightly' | 'unknown';
|
|
10
9
|
}
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/devtoolsTarget/profile.d.ts
|
|
13
10
|
interface WechatDevtoolsProfileOptions {
|
|
14
11
|
homeDir?: string;
|
|
15
12
|
localAppDataDir?: string;
|
|
16
13
|
platform?: NodeJS.Platform;
|
|
17
14
|
}
|
|
18
|
-
//#endregion
|
|
19
|
-
//#region src/devtoolsTarget/types.d.ts
|
|
20
15
|
type WechatDevtoolsChannel = 'stable' | 'rc' | 'nightly';
|
|
21
16
|
interface ResolvedWechatDevtoolsTarget extends WechatDevtoolsMetadata {
|
|
22
17
|
cliPath: string;
|
|
@@ -40,14 +35,10 @@ interface WechatDevtoolsInstallation {
|
|
|
40
35
|
target?: ResolvedWechatDevtoolsTarget;
|
|
41
36
|
error?: string;
|
|
42
37
|
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/devtoolsTarget/discovery.d.ts
|
|
45
38
|
/** 产品版本按数字段比较,避免日期版本的字符串排序漂移。 */
|
|
46
39
|
export declare function compareWechatDevtoolsVersions(a: string, b: string): number;
|
|
47
40
|
/** 只扫描已知安装根,不递归遍历磁盘,也不执行候选应用。 */
|
|
48
41
|
export declare function listWechatDevtoolsInstallations(options?: ResolveWechatDevtoolsTargetOptions): Promise<WechatDevtoolsInstallation[]>;
|
|
49
|
-
//#endregion
|
|
50
|
-
//#region src/devtoolsTarget/host.d.ts
|
|
51
42
|
interface WechatDevtoolsHostInspectionOptions {
|
|
52
43
|
platform?: NodeJS.Platform;
|
|
53
44
|
signal?: AbortSignal;
|
|
@@ -57,8 +48,6 @@ interface WechatDevtoolsHostInspectionOptions {
|
|
|
57
48
|
export declare function assertWechatDevtoolsHost(target: ResolvedWechatDevtoolsTarget, options?: WechatDevtoolsHostInspectionOptions): Promise<void>;
|
|
58
49
|
/** HTTP 与 WebSocket 的显式端口均需由所选安装持有,端口号本身不是宿主身份。 */
|
|
59
50
|
export declare function assertWechatDevtoolsPort(target: ResolvedWechatDevtoolsTarget, port: number, options?: WechatDevtoolsHostInspectionOptions): Promise<void>;
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/devtoolsTarget/official.d.ts
|
|
62
51
|
export declare const WECHAT_DEVTOOLS_OFFICIAL_CHANNELS_URL = "https://devtools.wxqcloud.qq.com.cn/WechatWebDev/nightly/versions/config.json";
|
|
63
52
|
/** 官方查询只提供版本证据,默认选择不依赖网络可用性。 */
|
|
64
53
|
export declare function readOfficialWechatDevtoolsVersion(channel?: WechatDevtoolsChannel): Promise<{
|
|
@@ -72,14 +61,10 @@ export declare function assertOfficialWechatDevtoolsVersion(target: ResolvedWech
|
|
|
72
61
|
source: string;
|
|
73
62
|
queriedAt: string;
|
|
74
63
|
}>;
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/devtoolsTarget/registry.d.ts
|
|
77
64
|
/** 校验安装后登记真实 CLI 路径,不更改默认选择或登录数据。 */
|
|
78
65
|
export declare function registerWechatDevtoolsInstallation(cliPath: string, registryPath?: string): Promise<ResolvedWechatDevtoolsTarget>;
|
|
79
66
|
/** 允许移除已经失效的登记;不会删除应用或用户配置。 */
|
|
80
67
|
export declare function unregisterWechatDevtoolsInstallation(cliPath: string, registryPath?: string): Promise<void>;
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/devtoolsTarget/index.d.ts
|
|
83
68
|
export declare function validateWechatDevtoolsSelection(options: WechatDevtoolsSelectionOptions): void;
|
|
84
69
|
export declare function readWechatDevtoolsSelectionEnvironment(env?: NodeJS.ProcessEnv): WechatDevtoolsSelectionOptions;
|
|
85
70
|
/** 每次操作只解析一次安装,显式选择覆盖继承的配置但不写回全局设置。 */
|
|
@@ -88,8 +73,6 @@ export declare function resolveWechatDevtoolsTarget(options?: ResolveWechatDevto
|
|
|
88
73
|
export declare function withWechatDevtoolsSelection<T>(options: ResolveWechatDevtoolsTargetOptions, runner: (target: ResolvedWechatDevtoolsTarget) => Promise<T>): Promise<T>;
|
|
89
74
|
/** 读取当前操作固定的安装;没有活动选择时不触发发现或启动。 */
|
|
90
75
|
export declare function getActiveWechatDevtoolsTarget(): ResolvedWechatDevtoolsTarget | undefined;
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/cli/agentStart.d.ts
|
|
93
76
|
export interface StartWechatIdeAgentOptions {
|
|
94
77
|
projectPath: string;
|
|
95
78
|
port: number;
|
|
@@ -110,8 +93,6 @@ export interface StartWechatIdeAgentResult {
|
|
|
110
93
|
}
|
|
111
94
|
/** 使用所选安装的官方 agent start,并保留其窗口复用和端口冲突语义。 */
|
|
112
95
|
export declare function startWechatIdeAgent(options: StartWechatIdeAgentOptions): Promise<StartWechatIdeAgentResult>;
|
|
113
|
-
//#endregion
|
|
114
|
-
//#region src/cli/automator/context.d.ts
|
|
115
96
|
interface AutomatorInstallationOptions extends DevtoolsRuntimeSessionOptions, WechatDevtoolsSelectionOptions {
|
|
116
97
|
target?: ResolvedWechatDevtoolsTarget;
|
|
117
98
|
signal?: AbortSignal;
|
|
@@ -120,8 +101,6 @@ interface AutomatorInstallationOptions extends DevtoolsRuntimeSessionOptions, We
|
|
|
120
101
|
export declare function resolveAutomatorSessionOptions<T extends AutomatorInstallationOptions>(options: T): Promise<T & AutomatorInstallationOptions & {
|
|
121
102
|
installationId: string;
|
|
122
103
|
}>;
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region src/cli/automator/errors.d.ts
|
|
125
104
|
/**
|
|
126
105
|
* @description 判断错误是否属于开发者工具服务端口不可用。
|
|
127
106
|
*/
|
|
@@ -158,8 +137,6 @@ export declare function isAutomatorLoginError(error: unknown): boolean;
|
|
|
158
137
|
* @description 格式化开发者工具登录失效错误,便于终端展示。
|
|
159
138
|
*/
|
|
160
139
|
export declare function formatAutomatorLoginError(error: unknown): string;
|
|
161
|
-
//#endregion
|
|
162
|
-
//#region src/cli/automator.d.ts
|
|
163
140
|
export interface AutomatorOptions extends AutomatorInstallationOptions {
|
|
164
141
|
projectPath: string;
|
|
165
142
|
timeout?: number;
|
|
@@ -190,8 +167,6 @@ export declare function persistOpenedAutomatorSession(options: AutomatorOptions
|
|
|
190
167
|
* @description 只读连接当前项目已打开的自动化会话;失败不证明缓存过期,也不删除其他操作持有的会话记录。
|
|
191
168
|
*/
|
|
192
169
|
export declare function connectOpenedAutomator(options: AutomatorOptions): Promise<MiniProgram>;
|
|
193
|
-
//#endregion
|
|
194
|
-
//#region src/cli/automator-argv.d.ts
|
|
195
170
|
export interface ParsedAutomatorArgs {
|
|
196
171
|
cliPath?: string;
|
|
197
172
|
projectPath: string;
|
|
@@ -218,8 +193,6 @@ export declare function readBooleanOption(argv: readonly string[], ...optionName
|
|
|
218
193
|
* @description 删除参数中的指定选项(同时支持 --opt value 与 --opt=value)。
|
|
219
194
|
*/
|
|
220
195
|
export declare function removeOption(argv: readonly string[], optionName: string): string[];
|
|
221
|
-
//#endregion
|
|
222
|
-
//#region src/cli/automator-session.d.ts
|
|
223
196
|
type MiniProgramLike = AutomatorMiniProgram;
|
|
224
197
|
type MiniProgramPage = AutomatorPage;
|
|
225
198
|
type MiniProgramElement = AutomatorElement;
|
|
@@ -237,8 +210,6 @@ export declare function acquireSharedMiniProgram(options: AutomatorSessionOption
|
|
|
237
210
|
* @description 统一管理 automator 会话生命周期。
|
|
238
211
|
*/
|
|
239
212
|
export declare function withMiniProgram<T>(options: AutomatorSessionOptions, runner: (miniProgram: MiniProgramLike) => Promise<T>): Promise<T>;
|
|
240
|
-
//#endregion
|
|
241
|
-
//#region src/cli/command-catalog.d.ts
|
|
242
213
|
export declare const WECHAT_CLI_COMMAND_NAMES: readonly ["open", "login", "islogin", "preview", "auto-preview", "upload", "build-npm", "auto", "auto-replay", "reset-fileutils", "close", "quit", "cache", "engine", "open-other", "build-ipa", "build-apk", "cloud"];
|
|
243
214
|
export declare const MINIDEV_NAMESPACE_COMMAND_NAMES: readonly ["alipay", "ali", "minidev"];
|
|
244
215
|
export declare const CONFIG_COMMAND_NAME: "config";
|
|
@@ -248,8 +219,6 @@ export declare const WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES: string[];
|
|
|
248
219
|
* @description 判断是否为 weapp-ide-cli 支持的顶层命令。
|
|
249
220
|
*/
|
|
250
221
|
export declare function isWeappIdeTopLevelCommand(command: string | undefined): boolean;
|
|
251
|
-
//#endregion
|
|
252
|
-
//#region src/cli/commands.d.ts
|
|
253
222
|
export interface AutomatorCommandOptions extends AutomatorSessionOptions {}
|
|
254
223
|
export interface NavigateOptions extends AutomatorCommandOptions {
|
|
255
224
|
url: string;
|
|
@@ -354,8 +323,6 @@ export declare function takeScreenshot(options: ScreenshotOptions): Promise<Scre
|
|
|
354
323
|
* @description 开关远程调试。
|
|
355
324
|
*/
|
|
356
325
|
export declare function remote(options: RemoteOptions): Promise<void>;
|
|
357
|
-
//#endregion
|
|
358
|
-
//#region src/cli/compare.d.ts
|
|
359
326
|
interface CompareOptions extends ScreenshotOptions {
|
|
360
327
|
baselinePath: string;
|
|
361
328
|
currentOutputPath?: string;
|
|
@@ -372,14 +339,10 @@ export declare function printCompareHelp(): void;
|
|
|
372
339
|
* @description 解析 compare 命令参数。
|
|
373
340
|
*/
|
|
374
341
|
export declare function parseCompareArgs(argv: string[]): CompareOptions;
|
|
375
|
-
//#endregion
|
|
376
|
-
//#region src/cli/config-command.d.ts
|
|
377
342
|
/**
|
|
378
343
|
* @description 处理 config 子命令。
|
|
379
344
|
*/
|
|
380
345
|
export declare function handleConfigCommand(argv: string[]): Promise<void>;
|
|
381
|
-
//#endregion
|
|
382
|
-
//#region src/cli/devtoolsSelection.d.ts
|
|
383
346
|
/** 包装参数不会透传官方 CLI,选项值和双横线后的内容保持原样。 */
|
|
384
347
|
export declare function splitWechatDevtoolsSelectionArgs(argv: readonly string[]): {
|
|
385
348
|
args: string[];
|
|
@@ -387,8 +350,6 @@ export declare function splitWechatDevtoolsSelectionArgs(argv: readonly string[]
|
|
|
387
350
|
};
|
|
388
351
|
/** 显式选择在任何 helper 或 CLI 回退之前固定,避免入口间选版漂移。 */
|
|
389
352
|
export declare function withWechatDevtoolsSelectionArgs<T>(argv: readonly string[], runner: (args: string[]) => Promise<T>): Promise<T>;
|
|
390
|
-
//#endregion
|
|
391
|
-
//#region src/cli/http.d.ts
|
|
392
353
|
export interface WechatDevtoolsHttpCommandOptions extends WechatDevtoolsSelectionOptions {
|
|
393
354
|
cliPath?: string;
|
|
394
355
|
target?: ResolvedWechatDevtoolsTarget;
|
|
@@ -433,8 +394,6 @@ export declare const WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES: {
|
|
|
433
394
|
readonly NOT_START: "NOT_START";
|
|
434
395
|
readonly OPEN_PROJECT: "OPEN_PROJECT";
|
|
435
396
|
};
|
|
436
|
-
//#endregion
|
|
437
|
-
//#region src/cli/engine.d.ts
|
|
438
397
|
export interface RunWechatIdeEngineBuildByHttpOptions extends WechatDevtoolsHttpCommandOptions {
|
|
439
398
|
onProgress?: (result: PollWechatIdeEngineBuildResult) => void;
|
|
440
399
|
overallTimeoutMs?: number;
|
|
@@ -455,8 +414,6 @@ export declare function runWechatIdeEngineBuild(projectPath: string, options?: R
|
|
|
455
414
|
export declare function prepareAcceptanceProject(projectPath: string, signal: AbortSignal, options?: WechatDevtoolsHttpCommandOptions & {
|
|
456
415
|
runtimeProvider?: 'headless' | 'devtools';
|
|
457
416
|
}): Promise<void | PollWechatIdeEngineBuildResult>;
|
|
458
|
-
//#endregion
|
|
459
|
-
//#region src/cli/forwardConsole.d.ts
|
|
460
417
|
export type ForwardConsoleLogLevel = 'debug' | 'log' | 'info' | 'warn' | 'error';
|
|
461
418
|
export interface ForwardConsoleEvent {
|
|
462
419
|
level: ForwardConsoleLogLevel;
|
|
@@ -476,8 +433,6 @@ export interface ForwardConsoleSession {
|
|
|
476
433
|
* @description 启动小程序控制台日志转发,并保持 automator 会话常驻。
|
|
477
434
|
*/
|
|
478
435
|
export declare function startForwardConsole(options: ForwardConsoleOptions): Promise<ForwardConsoleSession>;
|
|
479
|
-
//#endregion
|
|
480
|
-
//#region src/cli/inputCoordinator.d.ts
|
|
481
436
|
export interface SharedInputSessionOptions {
|
|
482
437
|
onData?: (chunk: string | Uint8Array) => void;
|
|
483
438
|
onKeypress?: (str: string, key: {
|
|
@@ -502,8 +457,6 @@ export interface ExclusiveKeypressOptions<T> {
|
|
|
502
457
|
export declare function createSharedInputSession(options: SharedInputSessionOptions): SharedInputSession | undefined;
|
|
503
458
|
export declare function waitForExclusiveKeypress<T>(options: ExclusiveKeypressOptions<T>): Promise<T | 'timeout'>;
|
|
504
459
|
export declare function runWithSuspendedSharedInput<T>(runner: () => Promise<T>): Promise<T>;
|
|
505
|
-
//#endregion
|
|
506
|
-
//#region src/cli/loginQuery.d.ts
|
|
507
460
|
export type WechatIdeLoginQueryResult = {
|
|
508
461
|
status: 'success';
|
|
509
462
|
login: boolean;
|
|
@@ -516,20 +469,14 @@ export declare function queryWechatIdeLogin(cliPath: string, options?: {
|
|
|
516
469
|
timeout?: number;
|
|
517
470
|
signal?: AbortSignal;
|
|
518
471
|
}): Promise<WechatIdeLoginQueryResult>;
|
|
519
|
-
//#endregion
|
|
520
|
-
//#region src/cli/minidev.d.ts
|
|
521
472
|
/**
|
|
522
473
|
* @description 运行支付宝小程序 CLI(minidev)
|
|
523
474
|
*/
|
|
524
475
|
export declare function runMinidev(argv: readonly string[]): Promise<void>;
|
|
525
|
-
//#endregion
|
|
526
|
-
//#region src/cli/prompt.d.ts
|
|
527
476
|
/**
|
|
528
477
|
* @description 交互式提示并保存 CLI 路径
|
|
529
478
|
*/
|
|
530
479
|
export declare function promptForCliPath(): Promise<string | null>;
|
|
531
|
-
//#endregion
|
|
532
|
-
//#region src/cli/resolver.d.ts
|
|
533
480
|
/**
|
|
534
481
|
* @description 解析 CLI 路径并校验可用性
|
|
535
482
|
*/
|
|
@@ -537,8 +484,6 @@ export declare function resolveCliPath(): Promise<{
|
|
|
537
484
|
cliPath: string | null;
|
|
538
485
|
source: ConfigSource;
|
|
539
486
|
}>;
|
|
540
|
-
//#endregion
|
|
541
|
-
//#region src/cli/retry.d.ts
|
|
542
487
|
export interface RetryKeypressOptions {
|
|
543
488
|
signal?: AbortSignal;
|
|
544
489
|
timeoutMs?: number;
|
|
@@ -605,16 +550,12 @@ export declare function promptRetryKeypress(options: RetryPromptOptions): Promis
|
|
|
605
550
|
* @description 统一处理微信开发者工具登录失效场景下的提示与重试交互。
|
|
606
551
|
*/
|
|
607
552
|
export declare function promptWechatIdeLoginRetry(options: WechatIdeLoginRetryOptions): Promise<"cancel" | "retry">;
|
|
608
|
-
//#endregion
|
|
609
|
-
//#region src/cli/run.d.ts
|
|
610
553
|
/**
|
|
611
554
|
* @description 基于 cac 注册顶层命令,用于统一识别入口。
|
|
612
555
|
*/
|
|
613
556
|
export declare function createCli(): import("cac").CAC;
|
|
614
557
|
/** 在分发前剥离公共选择参数并固定本次安装。 */
|
|
615
558
|
export declare function parse(argv: string[]): Promise<void>;
|
|
616
|
-
//#endregion
|
|
617
|
-
//#region src/cli/run-automator.d.ts
|
|
618
559
|
export declare const AUTOMATOR_COMMAND_NAMES: string[];
|
|
619
560
|
/**
|
|
620
561
|
* @description 判断是否属于 automator 子命令。
|
|
@@ -628,8 +569,6 @@ export declare function getAutomatorCommandHelp(command: string): string | undef
|
|
|
628
569
|
* @description 执行 automator 子命令。
|
|
629
570
|
*/
|
|
630
571
|
export declare function runAutomatorCommand(command: string, argv: string[]): Promise<void>;
|
|
631
|
-
//#endregion
|
|
632
|
-
//#region src/cli/run-login.d.ts
|
|
633
572
|
export interface RunWechatCliWithRetryOptions extends WechatDevtoolsSelectionOptions {
|
|
634
573
|
target?: ResolvedWechatDevtoolsTarget;
|
|
635
574
|
silent?: boolean;
|
|
@@ -638,8 +577,6 @@ export interface RunWechatCliWithRetryOptions extends WechatDevtoolsSelectionOpt
|
|
|
638
577
|
}
|
|
639
578
|
/** 原生 CLI 可能启动或改变共享宿主,完整命令与有限重试共用机器租约。 */
|
|
640
579
|
export declare function runWechatCliWithRetry(cliPath: string, argv: string[], options?: RunWechatCliWithRetryOptions): Promise<void>;
|
|
641
|
-
//#endregion
|
|
642
|
-
//#region src/cli/run-login-executor.d.ts
|
|
643
580
|
export interface RetryableCommandExecutorOptions<TResult, TPromptResult> {
|
|
644
581
|
timeout?: number;
|
|
645
582
|
signal?: AbortSignal;
|
|
@@ -655,15 +592,11 @@ export interface RetryableCommandExecutorOptions<TResult, TPromptResult> {
|
|
|
655
592
|
}
|
|
656
593
|
/** 命令、登录提示和有限重试共用一个 deadline,取消信号由执行边界传入 I/O。 */
|
|
657
594
|
export declare function runRetryableCommand<TResult, TPromptResult>(options: RetryableCommandExecutorOptions<TResult, TPromptResult>): Promise<TResult>;
|
|
658
|
-
//#endregion
|
|
659
|
-
//#region src/cli/run-mcp.d.ts
|
|
660
595
|
export interface McpCommandOptions {
|
|
661
596
|
cliPath?: string;
|
|
662
597
|
workspaceRoot?: string;
|
|
663
598
|
}
|
|
664
599
|
export declare function runMcpCommand(argv: string[]): Promise<void>;
|
|
665
|
-
//#endregion
|
|
666
|
-
//#region src/cli/screenshot.d.ts
|
|
667
600
|
/**
|
|
668
601
|
* @description Print help for screenshot command
|
|
669
602
|
*/
|
|
@@ -672,14 +605,10 @@ export declare function printScreenshotHelp(): void;
|
|
|
672
605
|
* @description Parse command line arguments for screenshot command
|
|
673
606
|
*/
|
|
674
607
|
export declare function parseScreenshotArgs(argv: string[]): ScreenshotOptions;
|
|
675
|
-
//#endregion
|
|
676
|
-
//#region src/cli/wechat-command-schema.d.ts
|
|
677
608
|
/**
|
|
678
609
|
* @description 在调用官方微信 CLI 前做轻量参数校验。
|
|
679
610
|
*/
|
|
680
611
|
export declare function validateWechatCliCommandArgs(argv: readonly string[]): void;
|
|
681
|
-
//#endregion
|
|
682
|
-
//#region src/cli/wechat-commands.d.ts
|
|
683
612
|
export interface LoginWechatIdeOptions extends WechatDevtoolsSelectionOptions {
|
|
684
613
|
qrFormat?: 'base64' | 'image' | 'terminal';
|
|
685
614
|
qrOutput?: string;
|
|
@@ -898,14 +827,10 @@ export declare function buildWechatIdeApk(options: BuildWechatIdeApkOptions): Pr
|
|
|
898
827
|
* @description 调用微信开发者工具 build-ipa 命令。
|
|
899
828
|
*/
|
|
900
829
|
export declare function buildWechatIdeIpa(options: BuildWechatIdeIpaOptions): Promise<void>;
|
|
901
|
-
//#endregion
|
|
902
|
-
//#region src/cli/wechat-dispatch.d.ts
|
|
903
830
|
/**
|
|
904
831
|
* @description 优先将高频官方命令分发到 weapp-ide-cli 的稳定 helper,实现更清晰的程序化命令层。
|
|
905
832
|
*/
|
|
906
833
|
export declare function dispatchWechatCliCommand(argv: string[]): Promise<boolean>;
|
|
907
|
-
//#endregion
|
|
908
|
-
//#region src/cli/wechatDevtoolsRuntimePort.d.ts
|
|
909
834
|
type PortTarget = Pick<ResolvedWechatDevtoolsTarget, 'installationId'>;
|
|
910
835
|
/**
|
|
911
836
|
* @description 标记所选安装检测到的服务端口;无身份的旧调用仅保留在独立兼容槽中。
|
|
@@ -915,8 +840,6 @@ export declare function setRuntimeWechatDevtoolsServicePort(port: number | undef
|
|
|
915
840
|
* @description 只读取所选安装的服务端口,不借用其他安装或无身份的旧记录。
|
|
916
841
|
*/
|
|
917
842
|
export declare function getRuntimeWechatDevtoolsServicePort(target?: PortTarget): number | undefined;
|
|
918
|
-
//#endregion
|
|
919
|
-
//#region src/cli/wechatDevtoolsSettings.d.ts
|
|
920
843
|
export interface WechatDevtoolsSecuritySettings {
|
|
921
844
|
enableServicePort: boolean;
|
|
922
845
|
port: number;
|
|
@@ -952,8 +875,6 @@ export declare function detectWechatDevtoolsServicePort(options?: DetectWechatDe
|
|
|
952
875
|
* @description 在启动微信开发者工具前,检测服务端口配置,并按需写入项目信任信息。
|
|
953
876
|
*/
|
|
954
877
|
export declare function bootstrapWechatDevtoolsSettings(options?: BootstrapWechatDevtoolsSettingsOptions): Promise<BootstrapWechatDevtoolsSettingsResult>;
|
|
955
|
-
//#endregion
|
|
956
|
-
//#region src/types.d.ts
|
|
957
878
|
/**
|
|
958
879
|
* @description 基础配置
|
|
959
880
|
*/
|
|
@@ -980,8 +901,6 @@ interface AliasEntry {
|
|
|
980
901
|
find: string;
|
|
981
902
|
replacement: string;
|
|
982
903
|
}
|
|
983
|
-
//#endregion
|
|
984
|
-
//#region src/config/custom.d.ts
|
|
985
904
|
interface CustomConfigFile {
|
|
986
905
|
cliPath?: string;
|
|
987
906
|
locale?: 'zh' | 'en';
|
|
@@ -1013,8 +932,6 @@ export declare function removeCustomConfigKey(key: keyof CustomConfigFile): Prom
|
|
|
1013
932
|
* @description 覆盖写入配置内容(会替换原内容)。
|
|
1014
933
|
*/
|
|
1015
934
|
export declare function overwriteCustomConfig(config: CustomConfigFile): Promise<void>;
|
|
1016
|
-
//#endregion
|
|
1017
|
-
//#region src/config/paths.d.ts
|
|
1018
935
|
/**
|
|
1019
936
|
* @description 默认自定义配置目录
|
|
1020
937
|
*/
|
|
@@ -1023,8 +940,6 @@ export declare const defaultCustomConfigDirPath: string;
|
|
|
1023
940
|
* @description 默认自定义配置文件路径
|
|
1024
941
|
*/
|
|
1025
942
|
export declare const defaultCustomConfigFilePath: string;
|
|
1026
|
-
//#endregion
|
|
1027
|
-
//#region src/config/resolver.d.ts
|
|
1028
943
|
/**
|
|
1029
944
|
* @description 解析开发者工具自动预热相关配置的最终生效值。
|
|
1030
945
|
*/
|
|
@@ -1043,8 +958,6 @@ export declare function getConfig(): Promise<ResolvedConfig>;
|
|
|
1043
958
|
* @description 获取用户配置的语言偏好。
|
|
1044
959
|
*/
|
|
1045
960
|
export declare function getConfiguredLocale(): Promise<"zh" | "en" | undefined>;
|
|
1046
|
-
//#endregion
|
|
1047
|
-
//#region src/devtoolsProjectOwnership/types.d.ts
|
|
1048
961
|
interface ManagedWechatHostIdentity {
|
|
1049
962
|
pid: number;
|
|
1050
963
|
executable: string;
|
|
@@ -1184,8 +1097,6 @@ interface CleanupManagedWechatProjectsOptions {
|
|
|
1184
1097
|
journalPath?: string;
|
|
1185
1098
|
scope?: 'process' | 'journal';
|
|
1186
1099
|
}
|
|
1187
|
-
//#endregion
|
|
1188
|
-
//#region src/devtoolsProjectOwnership/installationExit/index.d.ts
|
|
1189
1100
|
export interface RecoverManagedWechatProjectsAfterInstallationExitOptions {
|
|
1190
1101
|
target: ResolvedWechatDevtoolsTarget;
|
|
1191
1102
|
recoveryScope: MachineE2ELeaseRecoveryScope;
|
|
@@ -1195,25 +1106,17 @@ export interface ManagedWechatInstallationExitRecoveryResult {
|
|
|
1195
1106
|
}
|
|
1196
1107
|
/** 在精确恢复租约中终结已退出安装的未知启动或失败关窗;保留原证据,不补造销毁事件。 */
|
|
1197
1108
|
export declare function recoverManagedWechatProjectsAfterInstallationExit(options: RecoverManagedWechatProjectsAfterInstallationExitOptions): Promise<ManagedWechatInstallationExitRecoveryResult>;
|
|
1198
|
-
//#endregion
|
|
1199
|
-
//#region src/devtoolsProjectOwnership/journal/constants.d.ts
|
|
1200
1109
|
/** 受管项目日志的环境变量名称;基础设施预检可在构建包之前读取。 */
|
|
1201
1110
|
export declare const MANAGED_PROJECT_JOURNAL_ENV = "WEAPP_IDE_MANAGED_PROJECT_JOURNAL";
|
|
1202
1111
|
/** 仅供显式受管任务声明双项目窗口验收;不允许无限扩大并行窗口。 */
|
|
1203
1112
|
export declare const MANAGED_PROJECT_MAX_WINDOWS_ENV = "WEAPP_IDE_MANAGED_PROJECT_MAX_WINDOWS";
|
|
1204
|
-
//#endregion
|
|
1205
|
-
//#region src/devtoolsProjectOwnership/journal.d.ts
|
|
1206
1113
|
/** 仅递归当前任务明确传递的 children;不扫描用户缓存,不跟随符号链接。 */
|
|
1207
1114
|
export declare function readManagedWechatProjectRecords(journalPath?: string): Promise<ManagedWechatProjectRecord[]>;
|
|
1208
|
-
//#endregion
|
|
1209
|
-
//#region src/devtoolsProjectOwnership/snapshot/index.d.ts
|
|
1210
1115
|
/** 窗口已经释放不代表本任务快照也已回收。 */
|
|
1211
1116
|
export declare function isManagedWechatProjectFullyReleased(record: {
|
|
1212
1117
|
state: ManagedWechatProjectRecord['state'];
|
|
1213
1118
|
snapshot?: Pick<NonNullable<ManagedWechatProjectRecord['snapshot']>, 'state'>;
|
|
1214
1119
|
}): boolean;
|
|
1215
|
-
//#endregion
|
|
1216
|
-
//#region src/devtoolsProjectOwnership/index.d.ts
|
|
1217
1120
|
/** 窗口销毁与连接断开分别验证;失败保留登记供后续继续观察。 */
|
|
1218
1121
|
export declare function closeManagedWechatProject(options: {
|
|
1219
1122
|
journalPath?: string;
|
|
@@ -1223,8 +1126,6 @@ export declare function closeManagedWechatProject(options: {
|
|
|
1223
1126
|
export declare function beginManagedWechatProject(options: BeginManagedWechatProjectOptions): Promise<ManagedWechatProjectIntent | undefined>;
|
|
1224
1127
|
/** 父进程可回收已退出工作进程的确认所有权;未知启动结果严格阻止后续任务。 */
|
|
1225
1128
|
export declare function cleanupManagedWechatProjects(options?: CleanupManagedWechatProjectsOptions): Promise<void>;
|
|
1226
|
-
//#endregion
|
|
1227
|
-
//#region src/mcp/runtime.d.ts
|
|
1228
1129
|
export interface StartWeappIdeMcpServerOptions {
|
|
1229
1130
|
cliPath?: string;
|
|
1230
1131
|
workspaceRoot?: string;
|
|
@@ -1232,8 +1133,6 @@ export interface StartWeappIdeMcpServerOptions {
|
|
|
1232
1133
|
export declare function startWeappIdeMcpServer(options?: StartWeappIdeMcpServerOptions): Promise<{
|
|
1233
1134
|
close: () => Promise<void>;
|
|
1234
1135
|
}>;
|
|
1235
|
-
//#endregion
|
|
1236
|
-
//#region src/mcp/server.d.ts
|
|
1237
1136
|
interface ToolRegistrar {
|
|
1238
1137
|
registerTool: McpServer['registerTool'];
|
|
1239
1138
|
}
|
|
@@ -1252,8 +1151,6 @@ export declare function createWeappIdeMcpServer(options: WeappIdeMcpServerOption
|
|
|
1252
1151
|
close: () => Promise<undefined>;
|
|
1253
1152
|
server: McpServer;
|
|
1254
1153
|
}>;
|
|
1255
|
-
//#endregion
|
|
1256
|
-
//#region src/runtime/platform.d.ts
|
|
1257
1154
|
/**
|
|
1258
1155
|
* @description 官方微信开发者工具只支持 Windows、macOS,Linux 只有社区版。
|
|
1259
1156
|
* https://github.com/msojocs/wechat-web-devtools-linux
|
|
@@ -1279,8 +1176,6 @@ export declare const operatingSystemName: string;
|
|
|
1279
1176
|
* @description 获取默认 CLI 路径(按系统)。
|
|
1280
1177
|
*/
|
|
1281
1178
|
export declare function getDefaultCliPath(targetOs?: string): Promise<string | undefined>;
|
|
1282
|
-
//#endregion
|
|
1283
|
-
//#region src/utils/argv.d.ts
|
|
1284
1179
|
/**
|
|
1285
1180
|
* @description argv 处理函数
|
|
1286
1181
|
*/
|
|
@@ -1297,8 +1192,6 @@ export declare function createAlias(entry: AliasEntry): ArgvTransform;
|
|
|
1297
1192
|
* @description 创建路径参数兼容转换器(补全或规范化路径)
|
|
1298
1193
|
*/
|
|
1299
1194
|
export declare function createPathCompat(option: string): ArgvTransform;
|
|
1300
|
-
//#endregion
|
|
1301
|
-
//#region src/utils/exec.d.ts
|
|
1302
1195
|
interface ExecuteOptions {
|
|
1303
1196
|
pipeStdout?: boolean;
|
|
1304
1197
|
pipeStderr?: boolean;
|
|
@@ -1313,11 +1206,8 @@ export declare function execute(cliPath: string, argv: string[], options?: Execu
|
|
|
1313
1206
|
cancelSignal: AbortSignal | undefined;
|
|
1314
1207
|
forceKillAfterDelay: number;
|
|
1315
1208
|
}>>;
|
|
1316
|
-
//#endregion
|
|
1317
|
-
//#region src/utils/path.d.ts
|
|
1318
1209
|
/**
|
|
1319
1210
|
* @description 解析为绝对路径(基于当前工作目录)
|
|
1320
1211
|
*/
|
|
1321
1212
|
export declare function resolvePath(filePath: string): string;
|
|
1322
|
-
//#endregion
|
|
1323
1213
|
export { type AutomatorSessionOptions, type BaseConfig, type BeginManagedWechatProjectOptions, type CleanupManagedWechatProjectsOptions, type ConfigSource, type DevtoolsConnectionInput, type DevtoolsContext, type DevtoolsElementSnapshot, type DevtoolsPageSnapshot, type DevtoolsToolResult, type ManagedWechatHostIdentity, type ManagedWechatInstallationExitEvidence, type ManagedWechatProjectIntent, type ManagedWechatProjectRecord, type ManagedWechatProjectSnapshot, type ManagedWechatProjectState, type ManagedWechatWindowCloseCall, type ManagedWechatWindowCloseEvidence, type ManagedWechatWindowLogCursor, type MiniProgramElement, type MiniProgramEventMap, type MiniProgramLike, type MiniProgramPage, type ResolveWechatDevtoolsTargetOptions, type ResolvedConfig, type ResolvedWechatDevtoolsTarget, type WechatDevtoolsChannel, type WechatDevtoolsHostInspectionOptions, type WechatDevtoolsInstallation, type WechatDevtoolsSelectionOptions, closeSharedMiniProgram, getSharedMiniProgramSessionCount, readElementSnapshot, releaseSharedMiniProgram, resolveProjectPath, toSerializableValue };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as operatingSystemName, B as removeCustomConfigKey, C as registerWechatDevtoolsInstallation, D as SupportedPlatformsMap, F as createAutoTrustProjectConfig, H as defaultCustomConfigFilePath, I as createCustomConfig, L as createLocaleConfig, O as getDefaultCliPath, P as createAutoBootstrapDevtoolsConfig, R as overwriteCustomConfig, U as resolvePath, V as defaultCustomConfigDirPath, _ as WECHAT_DEVTOOLS_OFFICIAL_CHANNELS_URL, b as compareWechatDevtoolsVersions, c as getActiveWechatDevtoolsTarget, d as validateWechatDevtoolsSelection, f as withWechatDevtoolsSelection, k as isOperatingSystemSupported, l as readWechatDevtoolsSelectionEnvironment, m as assertWechatDevtoolsPort, o as MANAGED_PROJECT_JOURNAL_ENV, p as assertWechatDevtoolsHost, s as MANAGED_PROJECT_MAX_WINDOWS_ENV, u as resolveWechatDevtoolsTarget, v as assertOfficialWechatDevtoolsVersion, w as unregisterWechatDevtoolsInstallation, x as listWechatDevtoolsInstallations, y as readOfficialWechatDevtoolsVersion, z as readCustomConfig } from "./automatorProject-
|
|
2
|
-
import { a as isManagedWechatProjectFullyReleased, i as recoverManagedWechatProjectsAfterInstallationExit, m as startWechatIdeAgent, n as cleanupManagedWechatProjects, r as closeManagedWechatProject, s as readManagedWechatProjectRecords, t as beginManagedWechatProject } from "./devtoolsProjectOwnership-
|
|
3
|
-
import { A as waitForExclusiveKeypress, C as isWechatIdeLoginRequiredError, D as waitForRetryKeypress, E as promptWechatIdeLoginRetry, O as createSharedInputSession, P as resolveAutomatorSessionOptions, S as formatWechatIdeLoginRequiredError, T as promptRetryKeypress, _ as RETRY_CONFIRM_KEYS, a as bootstrapWechatDevtoolsSettings, b as extractExecutionErrorText, c as getAutomatorProtocolTimeoutMethod, d as isAutomatorProtocolTimeoutError, f as isAutomatorWsConnectError, g as RETRY_CANCEL_KEYS, h as isRetryableAutomatorLaunchError, i as resolveProjectAutomatorPort, k as runWithSuspendedSharedInput, l as isAutomatorLoginError, m as isDevtoolsHttpPortError, n as launchAutomator, o as detectWechatDevtoolsServicePort, p as isDevtoolsExtensionContextInvalidatedError, r as persistOpenedAutomatorSession, s as formatAutomatorLoginError, t as connectOpenedAutomator, u as isAutomatorPortInUseError, v as RETRY_PROMPT_INITIAL_IGNORE_MS, w as isWechatIdeLoginRequiredExitError, x as formatRetryHotkeyPrompt, y as createWechatIdeLoginRequiredExitError } from "./automator-
|
|
4
|
-
import { $ as getConfig, A as queryWechatIdeLogin, B as WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, C as refreshWechatIdeTicket, D as validateWechatCliCommandArgs, E as uploadWechatIde, F as startForwardConsole, G as startWechatIdeEngineBuildByHttp, H as pollWechatIdeEngineBuildResultByHttp, I as isWechatIdeEngineBuildEndpointMissingError, J as splitWechatDevtoolsSelectionArgs, K as getRuntimeWechatDevtoolsServicePort, L as prepareAcceptanceProject, M as createAlias, N as createPathCompat, O as runWechatCliWithRetry, P as transformArgv, Q as promptForCliPath, R as runWechatIdeEngineBuild, S as quitWechatIde, T as setWechatIdeTicket, U as requestWechatDevtoolsHttp, V as openWechatIdeProjectByHttp, W as resetWechatIdeFileUtilsByHttp, X as handleConfigCommand, Y as withWechatDevtoolsSelectionArgs, Z as resolveCliPath, _ as isWechatIdeLoggedIn, _t as readBooleanOption, a as autoReplayWechatIde, at as WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, b as openWechatIdeOtherProject, c as buildWechatIdeIpa, ct as AUTOMATOR_COMMAND_NAMES, d as clearWechatIdeCacheByAutomator, dt as runAutomatorCommand, et as getConfiguredLocale, f as closeWechatIdeProject, ft as parseScreenshotArgs, g as getWechatIdeToolInfo, gt as parseAutomatorArgs, h as getWechatIdeTicket, ht as printCompareHelp, i as autoPreviewWechatIde, it as MINIDEV_NAMESPACE_COMMAND_NAMES, j as execute, k as runMinidev, l as buildWechatIdeNpm, lt as getAutomatorCommandHelp, m as getWechatIdeTestAccounts, mt as parseCompareArgs, n as parse, nt as CONFIG_COMMAND_NAME, o as autoWechatIde, ot as WECHAT_CLI_COMMAND_NAMES, p as compileWechatIdeByAutomator, pt as printScreenshotHelp, q as setRuntimeWechatDevtoolsServicePort, r as dispatchWechatCliCommand, rt as MCP_COMMAND_NAME, s as buildWechatIdeApk, st as isWeappIdeTopLevelCommand, t as createCli, tt as resolveDevtoolsAutomationDefaults, u as clearWechatIdeCache, ut as isAutomatorCommand, v as loginWechatIde, vt as readOptionValue, w as resetWechatIdeFileUtils, x as previewWechatIde, y as openWechatIde, yt as removeOption, z as runWechatIdeEngineBuildByHttp } from "./cli-
|
|
5
|
-
import { c as releaseSharedMiniProgram, i as closeSharedMiniProgram, l as withMiniProgram, n as acquireSharedMiniProgram, o as connectMiniProgram, s as getSharedMiniProgramSessionCount, u as runRetryableCommand } from "./automator-session-
|
|
6
|
-
import { a as navigateBack, c as pageStack, d as remote, f as scrollTo, g as tap, h as takeScreenshot, i as input, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, o as navigateTo, p as switchTab, r as currentPage, s as pageData, t as audit, u as redirectTo } from "./commands-
|
|
7
|
-
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-
|
|
1
|
+
import { A as operatingSystemName, B as removeCustomConfigKey, C as registerWechatDevtoolsInstallation, D as SupportedPlatformsMap, F as createAutoTrustProjectConfig, H as defaultCustomConfigFilePath, I as createCustomConfig, L as createLocaleConfig, O as getDefaultCliPath, P as createAutoBootstrapDevtoolsConfig, R as overwriteCustomConfig, U as resolvePath, V as defaultCustomConfigDirPath, _ as WECHAT_DEVTOOLS_OFFICIAL_CHANNELS_URL, b as compareWechatDevtoolsVersions, c as getActiveWechatDevtoolsTarget, d as validateWechatDevtoolsSelection, f as withWechatDevtoolsSelection, k as isOperatingSystemSupported, l as readWechatDevtoolsSelectionEnvironment, m as assertWechatDevtoolsPort, o as MANAGED_PROJECT_JOURNAL_ENV, p as assertWechatDevtoolsHost, s as MANAGED_PROJECT_MAX_WINDOWS_ENV, u as resolveWechatDevtoolsTarget, v as assertOfficialWechatDevtoolsVersion, w as unregisterWechatDevtoolsInstallation, x as listWechatDevtoolsInstallations, y as readOfficialWechatDevtoolsVersion, z as readCustomConfig } from "./automatorProject-DPU-pEF0.js";
|
|
2
|
+
import { a as isManagedWechatProjectFullyReleased, i as recoverManagedWechatProjectsAfterInstallationExit, m as startWechatIdeAgent, n as cleanupManagedWechatProjects, r as closeManagedWechatProject, s as readManagedWechatProjectRecords, t as beginManagedWechatProject } from "./devtoolsProjectOwnership-C4jj8msU.js";
|
|
3
|
+
import { A as waitForExclusiveKeypress, C as isWechatIdeLoginRequiredError, D as waitForRetryKeypress, E as promptWechatIdeLoginRetry, O as createSharedInputSession, P as resolveAutomatorSessionOptions, S as formatWechatIdeLoginRequiredError, T as promptRetryKeypress, _ as RETRY_CONFIRM_KEYS, a as bootstrapWechatDevtoolsSettings, b as extractExecutionErrorText, c as getAutomatorProtocolTimeoutMethod, d as isAutomatorProtocolTimeoutError, f as isAutomatorWsConnectError, g as RETRY_CANCEL_KEYS, h as isRetryableAutomatorLaunchError, i as resolveProjectAutomatorPort, k as runWithSuspendedSharedInput, l as isAutomatorLoginError, m as isDevtoolsHttpPortError, n as launchAutomator, o as detectWechatDevtoolsServicePort, p as isDevtoolsExtensionContextInvalidatedError, r as persistOpenedAutomatorSession, s as formatAutomatorLoginError, t as connectOpenedAutomator, u as isAutomatorPortInUseError, v as RETRY_PROMPT_INITIAL_IGNORE_MS, w as isWechatIdeLoginRequiredExitError, x as formatRetryHotkeyPrompt, y as createWechatIdeLoginRequiredExitError } from "./automator-Esp3BjoT.js";
|
|
4
|
+
import { $ as getConfig, A as queryWechatIdeLogin, B as WECHAT_DEVTOOLS_ENGINE_BUILD_STATUSES, C as refreshWechatIdeTicket, D as validateWechatCliCommandArgs, E as uploadWechatIde, F as startForwardConsole, G as startWechatIdeEngineBuildByHttp, H as pollWechatIdeEngineBuildResultByHttp, I as isWechatIdeEngineBuildEndpointMissingError, J as splitWechatDevtoolsSelectionArgs, K as getRuntimeWechatDevtoolsServicePort, L as prepareAcceptanceProject, M as createAlias, N as createPathCompat, O as runWechatCliWithRetry, P as transformArgv, Q as promptForCliPath, R as runWechatIdeEngineBuild, S as quitWechatIde, T as setWechatIdeTicket, U as requestWechatDevtoolsHttp, V as openWechatIdeProjectByHttp, W as resetWechatIdeFileUtilsByHttp, X as handleConfigCommand, Y as withWechatDevtoolsSelectionArgs, Z as resolveCliPath, _ as isWechatIdeLoggedIn, _t as readBooleanOption, a as autoReplayWechatIde, at as WEAPP_IDE_TOP_LEVEL_COMMAND_NAMES, b as openWechatIdeOtherProject, c as buildWechatIdeIpa, ct as AUTOMATOR_COMMAND_NAMES, d as clearWechatIdeCacheByAutomator, dt as runAutomatorCommand, et as getConfiguredLocale, f as closeWechatIdeProject, ft as parseScreenshotArgs, g as getWechatIdeToolInfo, gt as parseAutomatorArgs, h as getWechatIdeTicket, ht as printCompareHelp, i as autoPreviewWechatIde, it as MINIDEV_NAMESPACE_COMMAND_NAMES, j as execute, k as runMinidev, l as buildWechatIdeNpm, lt as getAutomatorCommandHelp, m as getWechatIdeTestAccounts, mt as parseCompareArgs, n as parse, nt as CONFIG_COMMAND_NAME, o as autoWechatIde, ot as WECHAT_CLI_COMMAND_NAMES, p as compileWechatIdeByAutomator, pt as printScreenshotHelp, q as setRuntimeWechatDevtoolsServicePort, r as dispatchWechatCliCommand, rt as MCP_COMMAND_NAME, s as buildWechatIdeApk, st as isWeappIdeTopLevelCommand, t as createCli, tt as resolveDevtoolsAutomationDefaults, u as clearWechatIdeCache, ut as isAutomatorCommand, v as loginWechatIde, vt as readOptionValue, w as resetWechatIdeFileUtils, x as previewWechatIde, y as openWechatIde, yt as removeOption, z as runWechatIdeEngineBuildByHttp } from "./cli-Dd1RJ5PH.js";
|
|
5
|
+
import { c as releaseSharedMiniProgram, i as closeSharedMiniProgram, l as withMiniProgram, n as acquireSharedMiniProgram, o as connectMiniProgram, s as getSharedMiniProgramSessionCount, u as runRetryableCommand } from "./automator-session-Ba27VW0_.js";
|
|
6
|
+
import { a as navigateBack, c as pageStack, d as remote, f as scrollTo, g as tap, h as takeScreenshot, i as input, l as reLaunch, m as systemInfo, n as captureScreenshotBuffer, o as navigateTo, p as switchTab, r as currentPage, s as pageData, t as audit, u as redirectTo } from "./commands-5entj0Rh.js";
|
|
7
|
+
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-CbmskSgr.js";
|
|
8
8
|
export { AUTOMATOR_COMMAND_NAMES, CONFIG_COMMAND_NAME, MANAGED_PROJECT_JOURNAL_ENV, MANAGED_PROJECT_MAX_WINDOWS_ENV, 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, WECHAT_DEVTOOLS_OFFICIAL_CHANNELS_URL, acquireSharedMiniProgram, assertOfficialWechatDevtoolsVersion, assertWechatDevtoolsHost, assertWechatDevtoolsPort, audit, autoPreviewWechatIde, autoReplayWechatIde, autoWechatIde, beginManagedWechatProject, bootstrapWechatDevtoolsSettings, buildWechatIdeApk, buildWechatIdeIpa, buildWechatIdeNpm, captureScreenshotBuffer, cleanupManagedWechatProjects, clearWechatIdeCache, clearWechatIdeCacheByAutomator, closeManagedWechatProject, closeSharedMiniProgram, closeWechatIdeProject, compareWechatDevtoolsVersions, compileWechatIdeByAutomator, connectMiniProgram, connectOpenedAutomator, createAlias, createAutoBootstrapDevtoolsConfig, createAutoTrustProjectConfig, createCli, createCustomConfig, createLocaleConfig, createPathCompat, createSharedInputSession, createWeappIdeMcpServer, createWechatIdeLoginRequiredExitError, currentPage, defaultCustomConfigDirPath, defaultCustomConfigFilePath, detectWechatDevtoolsServicePort, dispatchWechatCliCommand, execute, extractExecutionErrorText, formatAutomatorLoginError, formatRetryHotkeyPrompt, formatWechatIdeLoginRequiredError, getActiveWechatDevtoolsTarget, getAutomatorCommandHelp, getAutomatorProtocolTimeoutMethod, getConfig, getConfiguredLocale, getDefaultCliPath, getRuntimeWechatDevtoolsServicePort, getSharedMiniProgramSessionCount, getWechatIdeTestAccounts, getWechatIdeTicket, getWechatIdeToolInfo, handleConfigCommand, input, isAutomatorCommand, isAutomatorLoginError, isAutomatorPortInUseError, isAutomatorProtocolTimeoutError, isAutomatorWsConnectError, isDevtoolsExtensionContextInvalidatedError, isDevtoolsHttpPortError, isManagedWechatProjectFullyReleased, isOperatingSystemSupported, isRetryableAutomatorLaunchError, isWeappIdeTopLevelCommand, isWechatIdeEngineBuildEndpointMissingError, isWechatIdeLoggedIn, isWechatIdeLoginRequiredError, isWechatIdeLoginRequiredExitError, launchAutomator, listWechatDevtoolsInstallations, loginWechatIde, navigateBack, navigateTo, openWechatIde, openWechatIdeOtherProject, openWechatIdeProjectByHttp, operatingSystemName, overwriteCustomConfig, pageData, pageStack, parse, parseAutomatorArgs, parseCompareArgs, parseScreenshotArgs, persistOpenedAutomatorSession, pollWechatIdeEngineBuildResultByHttp, prepareAcceptanceProject, previewWechatIde, printCompareHelp, printScreenshotHelp, promptForCliPath, promptRetryKeypress, promptWechatIdeLoginRetry, queryWechatIdeLogin, quitWechatIde, reLaunch, readBooleanOption, readCustomConfig, readElementSnapshot, readManagedWechatProjectRecords, readOfficialWechatDevtoolsVersion, readOptionValue, readWechatDevtoolsSelectionEnvironment, recoverManagedWechatProjectsAfterInstallationExit, redirectTo, refreshWechatIdeTicket, registerWeappIdeMcpTools, registerWechatDevtoolsInstallation, releaseSharedMiniProgram, remote, removeCustomConfigKey, removeOption, requestWechatDevtoolsHttp, resetWechatIdeFileUtils, resetWechatIdeFileUtilsByHttp, resolveAutomatorSessionOptions, resolveCliPath, resolveDevtoolsAutomationDefaults, resolvePath, resolveProjectAutomatorPort, resolveProjectPath, resolveWechatDevtoolsTarget, runAutomatorCommand, runMcpCommand, runMinidev, runRetryableCommand, runWechatCliWithRetry, runWechatIdeEngineBuild, runWechatIdeEngineBuildByHttp, runWithSuspendedSharedInput, scrollTo, setRuntimeWechatDevtoolsServicePort, setWechatIdeTicket, splitWechatDevtoolsSelectionArgs, startForwardConsole, startWeappIdeMcpServer, startWechatIdeAgent, startWechatIdeEngineBuildByHttp, switchTab, systemInfo, takeScreenshot, tap, toSerializableValue, transformArgv, unregisterWechatDevtoolsInstallation, uploadWechatIde, validateWechatCliCommandArgs, validateWechatDevtoolsSelection, waitForExclusiveKeypress, waitForRetryKeypress, withMiniProgram, withWechatDevtoolsSelection, withWechatDevtoolsSelectionArgs };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { i as persistAutomatorSession, m as assertWechatDevtoolsPort, n as readAutomatorProjectPlan, t as populateAutomatorProjectSnapshot } from "./automatorProject-
|
|
2
|
-
import { m as startWechatIdeAgent, t as beginManagedWechatProject } from "./devtoolsProjectOwnership-
|
|
1
|
+
import { i as persistAutomatorSession, m as assertWechatDevtoolsPort, n as readAutomatorProjectPlan, t as populateAutomatorProjectSnapshot } from "./automatorProject-DPU-pEF0.js";
|
|
2
|
+
import { m as startWechatIdeAgent, t as beginManagedWechatProject } from "./devtoolsProjectOwnership-C4jj8msU.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { withMachineE2ELease } from "@weapp-vite/devtools-runtime";
|
|
5
5
|
import { execa } from "execa";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import process from "node:process";
|
|
8
8
|
import { acquireAutomatorPortLease } from "@weapp-vite/miniprogram-automator";
|
|
9
|
-
|
|
9
|
+
// src/cli/projectImport.ts
|
|
10
10
|
function isRecord(value) {
|
|
11
11
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12
12
|
}
|
|
@@ -65,8 +65,7 @@ async function importManagedDevtoolsProject(options) {
|
|
|
65
65
|
options.signal.throwIfAborted();
|
|
66
66
|
})));
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
//#region src/cli/automator/managed.ts
|
|
68
|
+
// src/cli/automator/managed.ts
|
|
70
69
|
/** 受管启动持有完整窗口回执,快照始终由持久 journal 持有。 */
|
|
71
70
|
async function launchManagedAutomator(options) {
|
|
72
71
|
const { launcher, scope, target, sourceProjectPath, port } = options;
|
|
@@ -260,5 +259,4 @@ async function launchManagedAutomator(options) {
|
|
|
260
259
|
throw error;
|
|
261
260
|
}
|
|
262
261
|
}
|
|
263
|
-
//#endregion
|
|
264
262
|
export { launchManagedAutomator };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { l as withMiniProgram$1 } from "./automator-session-
|
|
1
|
+
import { l as withMiniProgram$1 } from "./automator-session-Ba27VW0_.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { readDevtoolsElementSnapshot as readElementSnapshot, resolveDevtoolsProjectPath as resolveProjectPath, toDevtoolsSerializableValue as toSerializableValue } from "@weapp-vite/devtools-runtime";
|
|
4
4
|
import fs from "node:fs/promises";
|
|
5
5
|
import process from "node:process";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
7
|
import { z } from "zod";
|
|
8
|
-
|
|
8
|
+
// src/mcp/server.ts
|
|
9
9
|
function createResolvedProjectPath(workspaceRoot, projectPath) {
|
|
10
10
|
return path.isAbsolute(projectPath) ? path.normalize(projectPath) : path.resolve(workspaceRoot ?? process.cwd(), projectPath);
|
|
11
11
|
}
|
|
@@ -388,8 +388,7 @@ async function createWeappIdeMcpServer(options) {
|
|
|
388
388
|
server
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
|
-
|
|
392
|
-
//#region src/mcp/runtime.ts
|
|
391
|
+
// src/mcp/runtime.ts
|
|
393
392
|
async function startWeappIdeMcpServer(options = {}) {
|
|
394
393
|
const { serveStdio } = await import("@modelcontextprotocol/server/stdio");
|
|
395
394
|
const serverOptions = {
|
|
@@ -407,8 +406,7 @@ async function startWeappIdeMcpServer(options = {}) {
|
|
|
407
406
|
await handle.close();
|
|
408
407
|
} };
|
|
409
408
|
}
|
|
410
|
-
|
|
411
|
-
//#region src/cli/run-mcp.ts
|
|
409
|
+
// src/cli/run-mcp.ts
|
|
412
410
|
function readOptionValue(argv, optionName) {
|
|
413
411
|
const optionWithEqual = `${optionName}=`;
|
|
414
412
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -455,5 +453,4 @@ async function runMcpCommand(argv) {
|
|
|
455
453
|
workspaceRoot: readOptionValue(argv, "--workspace-root")
|
|
456
454
|
});
|
|
457
455
|
}
|
|
458
|
-
//#endregion
|
|
459
456
|
export { readElementSnapshot as a, registerWeappIdeMcpTools as i, startWeappIdeMcpServer as n, resolveProjectPath as o, createWeappIdeMcpServer as r, toSerializableValue as s, runMcpCommand as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as runMcpCommand } from "./run-mcp-CbmskSgr.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "weapp-ide-cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.4.0",
|
|
5
5
|
"description": "Command-line tools for automating WeChat DevTools and mini-program projects.",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -57,22 +57,22 @@
|
|
|
57
57
|
"dist"
|
|
58
58
|
],
|
|
59
59
|
"engines": {
|
|
60
|
-
"node": ">=
|
|
60
|
+
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"access": "public",
|
|
64
64
|
"registry": "https://registry.npmjs.org"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@modelcontextprotocol/server": "^2.
|
|
68
|
-
"@weapp-core/logger": "3.
|
|
69
|
-
"@weapp-core/shared": "3.
|
|
70
|
-
"@weapp-vite/devtools-runtime": "0.
|
|
71
|
-
"@weapp-vite/miniprogram-automator": "1.
|
|
67
|
+
"@modelcontextprotocol/server": "^2.4.0",
|
|
68
|
+
"@weapp-core/logger": "3.2.0",
|
|
69
|
+
"@weapp-core/shared": "3.4.0",
|
|
70
|
+
"@weapp-vite/devtools-runtime": "0.7.0",
|
|
71
|
+
"@weapp-vite/miniprogram-automator": "1.5.0",
|
|
72
72
|
"cac": "^7.1.0",
|
|
73
|
-
"execa": "10.
|
|
73
|
+
"execa": "10.2.1",
|
|
74
74
|
"pathe": "^2.0.3",
|
|
75
|
-
"pixelmatch": "^
|
|
75
|
+
"pixelmatch": "^8.0.0",
|
|
76
76
|
"pngjs": "^7.0.0",
|
|
77
77
|
"zod": "^4.6.7"
|
|
78
78
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { n as launchAutomator } from "./automator-BOe32upt.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { h as takeScreenshot } from "./commands-mslf7-sP.js";
|
package/dist/run-mcp-83-VKZVA.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { t as runMcpCommand } from "./run-mcp-Ni139Z5C.js";
|