@xiuchang-midscene/shared 2.0.2 → 2.0.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.
- package/dist/es/oss/index.mjs +1 -1
- package/dist/lib/oss/index.js +1 -1
- package/package.json +1 -1
- package/src/oss/index.ts +1 -1
- package/dist/es/baseDB.mjs.bak +0 -109
- package/dist/es/build/copy-static.mjs.bak +0 -31
- package/dist/es/build/rspack-config.mjs.bak +0 -4
- package/dist/es/cli/cli-runner.mjs.bak +0 -140
- package/dist/es/cli/index.mjs.bak +0 -2
- package/dist/es/common.mjs.bak +0 -37
- package/dist/es/constants/example-code.mjs.bak +0 -223
- package/dist/es/constants/index.mjs.bak +0 -23
- package/dist/es/env/basic.mjs.bak +0 -6
- package/dist/es/env/constants.mjs.bak +0 -70
- package/dist/es/env/global-config-manager.mjs.bak +0 -94
- package/dist/es/env/helper.mjs.bak +0 -43
- package/dist/es/env/index.mjs.bak +0 -5
- package/dist/es/env/init-debug.mjs.bak +0 -18
- package/dist/es/env/model-config-manager.mjs.bak +0 -79
- package/dist/es/env/parse-model-config.mjs.bak +0 -132
- package/dist/es/env/types.mjs.bak +0 -220
- package/dist/es/env/utils.mjs.bak +0 -26
- package/dist/es/extractor/constants.mjs.bak +0 -2
- package/dist/es/extractor/debug.mjs.bak +0 -6
- package/dist/es/extractor/dom-util.mjs.bak +0 -92
- package/dist/es/extractor/index.mjs.bak +0 -5
- package/dist/es/extractor/locator.mjs.bak +0 -250
- package/dist/es/extractor/tree.mjs.bak +0 -78
- package/dist/es/extractor/util.mjs.bak +0 -245
- package/dist/es/extractor/web-extractor.mjs.bak +0 -303
- package/dist/es/img/box-select.mjs.bak +0 -824
- package/dist/es/img/canvas-fallback.mjs.bak +0 -238
- package/dist/es/img/get-photon.mjs.bak +0 -45
- package/dist/es/img/get-sharp.mjs.bak +0 -11
- package/dist/es/img/index.mjs.bak +0 -4
- package/dist/es/img/info.mjs.bak +0 -29
- package/dist/es/img/transform.mjs.bak +0 -295
- package/dist/es/index.mjs.bak +0 -4
- package/dist/es/logger.mjs.bak +0 -64
- package/dist/es/mcp/base-server.mjs.bak +0 -281
- package/dist/es/mcp/base-tools.mjs.bak +0 -91
- package/dist/es/mcp/chrome-path.mjs.bak +0 -35
- package/dist/es/mcp/index.mjs.bak +0 -7
- package/dist/es/mcp/inject-report-html-plugin.mjs.bak +0 -53
- package/dist/es/mcp/launcher-helper.mjs.bak +0 -52
- package/dist/es/mcp/tool-generator.mjs.bak +0 -297
- package/dist/es/mcp/types.mjs.bak +0 -3
- package/dist/es/node/fs.mjs.bak +0 -44
- package/dist/es/node/index.mjs.bak +0 -2
- package/dist/es/node/port.mjs.bak +0 -24
- package/dist/es/oss/demo.mjs.bak +0 -30
- package/dist/es/oss/index.mjs.bak +0 -90
- package/dist/es/polyfills/async-hooks.mjs.bak +0 -2
- package/dist/es/polyfills/index.mjs.bak +0 -1
- package/dist/es/types/index.mjs.bak +0 -3
- package/dist/es/us-keyboard-layout.mjs.bak +0 -1414
- package/dist/es/utils.mjs.bak +0 -72
- package/dist/es/zod-schema-utils.mjs.bak +0 -54
- package/dist/lib/baseDB.js.bak +0 -149
- package/dist/lib/build/copy-static.js.bak +0 -79
- package/dist/lib/build/rspack-config.js.bak +0 -38
- package/dist/lib/cli/cli-runner.js.bak +0 -196
- package/dist/lib/cli/index.js.bak +0 -48
- package/dist/lib/common.js.bak +0 -93
- package/dist/lib/constants/example-code.js.bak +0 -260
- package/dist/lib/constants/index.js.bak +0 -96
- package/dist/lib/env/basic.js.bak +0 -40
- package/dist/lib/env/constants.js.bak +0 -113
- package/dist/lib/env/global-config-manager.js.bak +0 -128
- package/dist/lib/env/helper.js.bak +0 -80
- package/dist/lib/env/index.js.bak +0 -90
- package/dist/lib/env/init-debug.js.bak +0 -52
- package/dist/lib/env/model-config-manager.js.bak +0 -113
- package/dist/lib/env/parse-model-config.js.bak +0 -178
- package/dist/lib/env/types.js.bak +0 -554
- package/dist/lib/env/utils.js.bak +0 -72
- package/dist/lib/extractor/constants.js.bak +0 -42
- package/dist/lib/extractor/debug.js.bak +0 -12
- package/dist/lib/extractor/dom-util.js.bak +0 -153
- package/dist/lib/extractor/index.js.bak +0 -81
- package/dist/lib/extractor/locator.js.bak +0 -296
- package/dist/lib/extractor/tree.js.bak +0 -124
- package/dist/lib/extractor/util.js.bak +0 -336
- package/dist/lib/extractor/web-extractor.js.bak +0 -349
- package/dist/lib/img/box-select.js.bak +0 -875
- package/dist/lib/img/canvas-fallback.js.bak +0 -305
- package/dist/lib/img/get-photon.js.bak +0 -82
- package/dist/lib/img/get-sharp.js.bak +0 -45
- package/dist/lib/img/index.js.bak +0 -95
- package/dist/lib/img/info.js.bak +0 -83
- package/dist/lib/img/transform.js.bak +0 -387
- package/dist/lib/index.js.bak +0 -47
- package/dist/lib/logger.js.bak +0 -114
- package/dist/lib/mcp/base-server.js.bak +0 -331
- package/dist/lib/mcp/base-tools.js.bak +0 -125
- package/dist/lib/mcp/chrome-path.js.bak +0 -72
- package/dist/lib/mcp/index.js.bak +0 -100
- package/dist/lib/mcp/inject-report-html-plugin.js.bak +0 -98
- package/dist/lib/mcp/launcher-helper.js.bak +0 -86
- package/dist/lib/mcp/tool-generator.js.bak +0 -334
- package/dist/lib/mcp/types.js.bak +0 -40
- package/dist/lib/node/fs.js.bak +0 -97
- package/dist/lib/node/index.js.bak +0 -65
- package/dist/lib/node/port.js.bak +0 -61
- package/dist/lib/oss/demo.js.bak +0 -36
- package/dist/lib/oss/index.js.bak +0 -138
- package/dist/lib/polyfills/async-hooks.js.bak +0 -36
- package/dist/lib/polyfills/index.js.bak +0 -58
- package/dist/lib/types/index.js.bak +0 -37
- package/dist/lib/us-keyboard-layout.js.bak +0 -1457
- package/dist/lib/utils.js.bak +0 -148
- package/dist/lib/zod-schema-utils.js.bak +0 -97
- package/dist/types/baseDB.d.ts.bak +0 -25
- package/dist/types/build/copy-static.d.ts.bak +0 -31
- package/dist/types/build/rspack-config.d.ts.bak +0 -8
- package/dist/types/cli/cli-runner.d.ts.bak +0 -14
- package/dist/types/cli/index.d.ts.bak +0 -2
- package/dist/types/common.d.ts.bak +0 -12
- package/dist/types/constants/example-code.d.ts.bak +0 -2
- package/dist/types/constants/index.d.ts.bak +0 -21
- package/dist/types/env/basic.d.ts.bak +0 -6
- package/dist/types/env/constants.d.ts.bak +0 -40
- package/dist/types/env/global-config-manager.d.ts.bak +0 -32
- package/dist/types/env/helper.d.ts.bak +0 -4
- package/dist/types/env/index.d.ts.bak +0 -4
- package/dist/types/env/init-debug.d.ts.bak +0 -1
- package/dist/types/env/model-config-manager.d.ts.bak +0 -25
- package/dist/types/env/parse-model-config.d.ts.bak +0 -31
- package/dist/types/env/types.d.ts.bak +0 -318
- package/dist/types/env/utils.d.ts.bak +0 -38
- package/dist/types/extractor/constants.d.ts.bak +0 -1
- package/dist/types/extractor/debug.d.ts.bak +0 -1
- package/dist/types/extractor/dom-util.d.ts.bak +0 -56
- package/dist/types/extractor/index.d.ts.bak +0 -32
- package/dist/types/extractor/locator.d.ts.bak +0 -9
- package/dist/types/extractor/tree.d.ts.bak +0 -6
- package/dist/types/extractor/util.d.ts.bak +0 -47
- package/dist/types/extractor/web-extractor.d.ts.bak +0 -19
- package/dist/types/img/box-select.d.ts.bak +0 -26
- package/dist/types/img/canvas-fallback.d.ts.bak +0 -105
- package/dist/types/img/get-photon.d.ts.bak +0 -19
- package/dist/types/img/get-sharp.d.ts.bak +0 -3
- package/dist/types/img/index.d.ts.bak +0 -3
- package/dist/types/img/info.d.ts.bak +0 -29
- package/dist/types/img/transform.d.ts.bak +0 -107
- package/dist/types/index.d.ts.bak +0 -4
- package/dist/types/logger.d.ts.bak +0 -5
- package/dist/types/mcp/base-server.d.ts.bak +0 -93
- package/dist/types/mcp/base-tools.d.ts.bak +0 -79
- package/dist/types/mcp/chrome-path.d.ts.bak +0 -2
- package/dist/types/mcp/index.d.ts.bak +0 -7
- package/dist/types/mcp/inject-report-html-plugin.d.ts.bak +0 -18
- package/dist/types/mcp/launcher-helper.d.ts.bak +0 -94
- package/dist/types/mcp/tool-generator.d.ts.bak +0 -10
- package/dist/types/mcp/types.d.ts.bak +0 -103
- package/dist/types/node/fs.d.ts.bak +0 -15
- package/dist/types/node/index.d.ts.bak +0 -2
- package/dist/types/node/port.d.ts.bak +0 -8
- package/dist/types/oss/demo.d.ts.bak +0 -1
- package/dist/types/oss/index.d.ts.bak +0 -34
- package/dist/types/polyfills/async-hooks.d.ts.bak +0 -6
- package/dist/types/polyfills/index.d.ts.bak +0 -4
- package/dist/types/types/index.d.ts.bak +0 -34
- package/dist/types/us-keyboard-layout.d.ts.bak +0 -32
- package/dist/types/utils.d.ts.bak +0 -34
- package/dist/types/zod-schema-utils.d.ts.bak +0 -23
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import type { z } from 'zod';
|
|
3
|
-
/**
|
|
4
|
-
* Default timeout constants for app loading verification
|
|
5
|
-
*/
|
|
6
|
-
export declare const defaultAppLoadingTimeoutMs = 10000;
|
|
7
|
-
export declare const defaultAppLoadingCheckIntervalMs = 2000;
|
|
8
|
-
/**
|
|
9
|
-
* Content item types for tool results (MCP compatible)
|
|
10
|
-
*/
|
|
11
|
-
export type ToolResultContent = {
|
|
12
|
-
type: 'text';
|
|
13
|
-
text: string;
|
|
14
|
-
} | {
|
|
15
|
-
type: 'image';
|
|
16
|
-
data: string;
|
|
17
|
-
mimeType: string;
|
|
18
|
-
} | {
|
|
19
|
-
type: 'audio';
|
|
20
|
-
data: string;
|
|
21
|
-
mimeType: string;
|
|
22
|
-
} | {
|
|
23
|
-
type: 'resource';
|
|
24
|
-
resource: {
|
|
25
|
-
text: string;
|
|
26
|
-
uri: string;
|
|
27
|
-
mimeType?: string;
|
|
28
|
-
} | {
|
|
29
|
-
uri: string;
|
|
30
|
-
blob: string;
|
|
31
|
-
mimeType?: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Result type for tool execution (MCP compatible)
|
|
36
|
-
*/
|
|
37
|
-
export interface ToolResult {
|
|
38
|
-
[x: string]: unknown;
|
|
39
|
-
content: ToolResultContent[];
|
|
40
|
-
isError?: boolean;
|
|
41
|
-
_meta?: Record<string, unknown>;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Tool handler function type
|
|
45
|
-
* Takes parsed arguments and returns a tool result
|
|
46
|
-
*/
|
|
47
|
-
export type ToolHandler<T = Record<string, unknown>> = (args: T) => Promise<ToolResult>;
|
|
48
|
-
/**
|
|
49
|
-
* Tool schema type using Zod
|
|
50
|
-
*/
|
|
51
|
-
export type ToolSchema = Record<string, z.ZodTypeAny>;
|
|
52
|
-
/**
|
|
53
|
-
* Tool definition for MCP server
|
|
54
|
-
*/
|
|
55
|
-
export interface ToolDefinition<T = Record<string, unknown>> {
|
|
56
|
-
name: string;
|
|
57
|
-
description: string;
|
|
58
|
-
schema: ToolSchema;
|
|
59
|
-
handler: ToolHandler<T>;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Tool type for mcpKitForAgent return value
|
|
63
|
-
*/
|
|
64
|
-
export type Tool = ToolDefinition;
|
|
65
|
-
/**
|
|
66
|
-
* Action space item definition
|
|
67
|
-
* Note: Intentionally no index signature to maintain compatibility with DeviceAction
|
|
68
|
-
*/
|
|
69
|
-
export interface ActionSpaceItem {
|
|
70
|
-
name: string;
|
|
71
|
-
description?: string;
|
|
72
|
-
args?: Record<string, unknown>;
|
|
73
|
-
paramSchema?: z.ZodTypeAny;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Base agent interface
|
|
77
|
-
* Represents a platform-specific agent (Android, iOS, Web)
|
|
78
|
-
* Note: Return types use `unknown` for compatibility with platform-specific implementations
|
|
79
|
-
*/
|
|
80
|
-
export interface BaseAgent {
|
|
81
|
-
getActionSpace(): Promise<ActionSpaceItem[]>;
|
|
82
|
-
destroy?(): Promise<void>;
|
|
83
|
-
page?: {
|
|
84
|
-
screenshotBase64(): Promise<string>;
|
|
85
|
-
};
|
|
86
|
-
aiAction?: (description: string, params?: Record<string, unknown>) => Promise<unknown>;
|
|
87
|
-
aiWaitFor?: (assertion: string, options: Record<string, unknown>) => Promise<unknown>;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Base device interface for temporary device instances
|
|
91
|
-
*/
|
|
92
|
-
export interface BaseDevice {
|
|
93
|
-
actionSpace(): ActionSpaceItem[];
|
|
94
|
-
destroy?(): Promise<void>;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Interface for platform-specific MCP tools manager
|
|
98
|
-
*/
|
|
99
|
-
export interface IMidsceneTools {
|
|
100
|
-
attachToServer(server: McpServer): void;
|
|
101
|
-
initTools(): Promise<void>;
|
|
102
|
-
destroy?(): Promise<void>;
|
|
103
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
interface PkgInfo {
|
|
2
|
-
name: string;
|
|
3
|
-
version: string;
|
|
4
|
-
dir: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function getRunningPkgInfo(dir?: string): PkgInfo | null;
|
|
7
|
-
/**
|
|
8
|
-
* Find the nearest package.json file recursively
|
|
9
|
-
* @param {string} dir - Home directory
|
|
10
|
-
* @returns {string|null} - The most recent package.json file path or null
|
|
11
|
-
*/
|
|
12
|
-
export declare function findNearestPackageJson(dir: string): string | null;
|
|
13
|
-
export declare function getElementInfosScriptContent(): string;
|
|
14
|
-
export declare function getExtraReturnLogic(tree?: boolean): Promise<string | null>;
|
|
15
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if a port is available
|
|
3
|
-
*/
|
|
4
|
-
export declare function isPortAvailable(port: number): Promise<boolean>;
|
|
5
|
-
/**
|
|
6
|
-
* Find an available port starting from the given port
|
|
7
|
-
*/
|
|
8
|
-
export declare function findAvailablePort(startPort: number, maxAttempts?: number): Promise<number>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface OSSUploadConfig {
|
|
2
|
-
accessKeyId: string;
|
|
3
|
-
accessKeySecret: string;
|
|
4
|
-
stsToken: string;
|
|
5
|
-
region: string;
|
|
6
|
-
bucket: string;
|
|
7
|
-
endpoint?: string;
|
|
8
|
-
prefix?: string;
|
|
9
|
-
customDomain?: string;
|
|
10
|
-
}
|
|
11
|
-
export interface OSSUploadResult {
|
|
12
|
-
success: boolean;
|
|
13
|
-
url?: string;
|
|
14
|
-
ossPath?: string;
|
|
15
|
-
error?: string;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* 从环境变量获取 OSS 配置并动态获取 STS 凭证
|
|
19
|
-
*
|
|
20
|
-
* 默认启用上传,可通过 MIDSCENE_OSS_ENABLE=false 显式关闭。
|
|
21
|
-
* 返回 null 表示已关闭或凭证获取失败(凭证失败不影响主流程)。
|
|
22
|
-
*/
|
|
23
|
-
export declare function getOSSConfigFromEnv(): Promise<OSSUploadConfig | null>;
|
|
24
|
-
/**
|
|
25
|
-
* 上传单个 HTML 报告文件到 OSS
|
|
26
|
-
*
|
|
27
|
-
* 关于 HTML 预览:
|
|
28
|
-
* - 2017-10-01 之后创建的 Bucket,使用 OSS 默认域名访问 .html 文件时,
|
|
29
|
-
* OSS 会自动添加 x-oss-force-download: true 和 Content-Disposition: attachment,
|
|
30
|
-
* 导致浏览器强制下载而非预览。
|
|
31
|
-
* - 解决方案:使用签名 URL(signatureUrl)并通过 response 参数覆盖响应头,
|
|
32
|
-
* 或配置自定义域名绕过此限制。
|
|
33
|
-
*/
|
|
34
|
-
export declare function uploadReportToOSS(localFilePath: string, config: OSSUploadConfig): Promise<OSSUploadResult>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { NodeType } from '../constants';
|
|
2
|
-
import type { ElementInfo } from '../extractor';
|
|
3
|
-
export interface Point {
|
|
4
|
-
left: number;
|
|
5
|
-
top: number;
|
|
6
|
-
}
|
|
7
|
-
export interface Size {
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
}
|
|
11
|
-
export type Rect = Point & Size;
|
|
12
|
-
export declare abstract class BaseElement {
|
|
13
|
-
abstract id: string;
|
|
14
|
-
abstract attributes: {
|
|
15
|
-
nodeType: NodeType;
|
|
16
|
-
[key: string]: string;
|
|
17
|
-
};
|
|
18
|
-
abstract content: string;
|
|
19
|
-
abstract rect: Rect;
|
|
20
|
-
abstract center: [number, number];
|
|
21
|
-
abstract isVisible: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface ElementTreeNode<ElementType extends BaseElement = BaseElement> {
|
|
24
|
-
node: ElementType | null;
|
|
25
|
-
children: ElementTreeNode<ElementType>[];
|
|
26
|
-
}
|
|
27
|
-
export interface WebElementInfo extends ElementInfo {
|
|
28
|
-
zoom: number;
|
|
29
|
-
}
|
|
30
|
-
export type LocateResultElement = {
|
|
31
|
-
description: string;
|
|
32
|
-
center: [number, number];
|
|
33
|
-
rect: Rect;
|
|
34
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2017 Google Inc.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export interface KeyDefinition {
|
|
10
|
-
keyCode?: number;
|
|
11
|
-
shiftKeyCode?: number;
|
|
12
|
-
key?: string;
|
|
13
|
-
shiftKey?: string;
|
|
14
|
-
code?: string;
|
|
15
|
-
text?: string;
|
|
16
|
-
shiftText?: string;
|
|
17
|
-
location?: number;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* All the valid keys that can be passed to functions that take user input, such
|
|
21
|
-
* as {@link Keyboard.press | keyboard.press }
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export type KeyInput = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'Power' | 'Eject' | 'Abort' | 'Help' | 'Backspace' | 'Tab' | 'Numpad5' | 'NumpadEnter' | 'Enter' | '\r' | '\n' | 'ShiftLeft' | 'ShiftRight' | 'ControlLeft' | 'ControlRight' | 'AltLeft' | 'AltRight' | 'Pause' | 'CapsLock' | 'Escape' | 'Convert' | 'NonConvert' | 'Space' | 'Numpad9' | 'PageUp' | 'Numpad3' | 'PageDown' | 'End' | 'Numpad1' | 'Home' | 'Numpad7' | 'ArrowLeft' | 'Numpad4' | 'Numpad8' | 'ArrowUp' | 'ArrowRight' | 'Numpad6' | 'Numpad2' | 'ArrowDown' | 'Select' | 'Open' | 'PrintScreen' | 'Insert' | 'Numpad0' | 'Delete' | 'NumpadDecimal' | 'Digit0' | 'Digit1' | 'Digit2' | 'Digit3' | 'Digit4' | 'Digit5' | 'Digit6' | 'Digit7' | 'Digit8' | 'Digit9' | 'KeyA' | 'KeyB' | 'KeyC' | 'KeyD' | 'KeyE' | 'KeyF' | 'KeyG' | 'KeyH' | 'KeyI' | 'KeyJ' | 'KeyK' | 'KeyL' | 'KeyM' | 'KeyN' | 'KeyO' | 'KeyP' | 'KeyQ' | 'KeyR' | 'KeyS' | 'KeyT' | 'KeyU' | 'KeyV' | 'KeyW' | 'KeyX' | 'KeyY' | 'KeyZ' | 'MetaLeft' | 'MetaRight' | 'ContextMenu' | 'NumpadMultiply' | 'NumpadAdd' | 'NumpadSubtract' | 'NumpadDivide' | 'F1' | 'F2' | 'F3' | 'F4' | 'F5' | 'F6' | 'F7' | 'F8' | 'F9' | 'F10' | 'F11' | 'F12' | 'F13' | 'F14' | 'F15' | 'F16' | 'F17' | 'F18' | 'F19' | 'F20' | 'F21' | 'F22' | 'F23' | 'F24' | 'NumLock' | 'ScrollLock' | 'AudioVolumeMute' | 'AudioVolumeDown' | 'AudioVolumeUp' | 'MediaTrackNext' | 'MediaTrackPrevious' | 'MediaStop' | 'MediaPlayPause' | 'Semicolon' | 'Equal' | 'NumpadEqual' | 'Comma' | 'Minus' | 'Period' | 'Slash' | 'Backquote' | 'BracketLeft' | 'Backslash' | 'BracketRight' | 'Quote' | 'AltGraph' | 'Props' | 'Cancel' | 'Clear' | 'Shift' | 'Control' | 'Alt' | 'Accept' | 'ModeChange' | ' ' | 'Print' | 'Execute' | '\u0000' | 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' | 'Meta' | '*' | '+' | '-' | '/' | ';' | '=' | ',' | '.' | '`' | '[' | '\\' | ']' | "'" | 'Attn' | 'CrSel' | 'ExSel' | 'EraseEof' | 'Play' | 'ZoomOut' | ')' | '!' | '@' | '#' | '$' | '%' | '^' | '&' | '(' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' | ':' | '<' | '_' | '>' | '?' | '~' | '{' | '|' | '}' | '"' | 'SoftLeft' | 'SoftRight' | 'Camera' | 'Call' | 'EndCall' | 'VolumeDown' | 'VolumeUp';
|
|
26
|
-
/**
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
export declare const _keyDefinitions: Readonly<Record<KeyInput, KeyDefinition>>;
|
|
30
|
-
export declare const getKeyDefinition: (key: string) => KeyInput;
|
|
31
|
-
export declare const isMac: boolean;
|
|
32
|
-
export declare function transformHotkeyInput(keyInput: string): string[];
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const ifInBrowser: boolean;
|
|
2
|
-
export declare const ifInWorker: boolean;
|
|
3
|
-
export declare const ifInNode: string | false;
|
|
4
|
-
export declare function uuid(): string;
|
|
5
|
-
export declare function generateHashId(rect: any, content?: string): string;
|
|
6
|
-
/**
|
|
7
|
-
* A utility function that asserts a condition and throws an error with a message if the condition is false.
|
|
8
|
-
*
|
|
9
|
-
* @param condition - The condition to assert
|
|
10
|
-
* @param message - The error message to throw if the condition is false
|
|
11
|
-
* @throws Error with the provided message if the condition is false
|
|
12
|
-
*/
|
|
13
|
-
export declare function assert(condition: any, message?: string): asserts condition;
|
|
14
|
-
export declare function setIsMcp(value: boolean): void;
|
|
15
|
-
export declare function logMsg(...message: Parameters<typeof console.log>): void;
|
|
16
|
-
export declare function repeat(times: number, fn: (index: number) => Promise<void>): Promise<void>;
|
|
17
|
-
export declare const escapeScriptTag: (html: string) => string;
|
|
18
|
-
export declare const antiEscapeScriptTag: (html: string) => string;
|
|
19
|
-
export declare function replaceIllegalPathCharsAndSpace(str: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Check if a value is a plain object (not null, not array, not other types)
|
|
22
|
-
*/
|
|
23
|
-
export declare function isPlainObject(value: unknown): value is Record<string, any>;
|
|
24
|
-
/**
|
|
25
|
-
* Normalize string for comparison: lowercase and remove spaces, dashes, and underscores.
|
|
26
|
-
* Useful for flexible app name matching.
|
|
27
|
-
*/
|
|
28
|
-
export declare function normalizeForComparison(str: string): string;
|
|
29
|
-
/**
|
|
30
|
-
* Merge and normalize app name mappings.
|
|
31
|
-
* Keys are normalized (lowercase, no spaces/dashes/underscores) for flexible matching.
|
|
32
|
-
* User-provided mapping takes precedence over default mapping.
|
|
33
|
-
*/
|
|
34
|
-
export declare function mergeAndNormalizeAppNameMapping(defaultMapping: Record<string, string>, userMapping?: Record<string, string>): Record<string, string>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Recursively unwrap optional, nullable, default, and effects wrapper types
|
|
4
|
-
* to get the actual inner Zod type
|
|
5
|
-
*/
|
|
6
|
-
export declare function unwrapZodField(field: unknown): unknown;
|
|
7
|
-
/**
|
|
8
|
-
* Check if a field is a Midscene locator field
|
|
9
|
-
* Checks for either:
|
|
10
|
-
* 1. midscene_location_field_flag in shape (result schema)
|
|
11
|
-
* 2. prompt field in shape (input schema)
|
|
12
|
-
*/
|
|
13
|
-
export declare function isMidsceneLocatorField(field: unknown): boolean;
|
|
14
|
-
/**
|
|
15
|
-
* Get type name string from a Zod schema field
|
|
16
|
-
* @param field - Zod schema field
|
|
17
|
-
* @param locatorTypeDescription - Optional description for MidsceneLocation fields (used by core)
|
|
18
|
-
*/
|
|
19
|
-
export declare function getZodTypeName(field: unknown, locatorTypeDescription?: string): string;
|
|
20
|
-
/**
|
|
21
|
-
* Get description from a Zod schema field
|
|
22
|
-
*/
|
|
23
|
-
export declare function getZodDescription(field: z.ZodTypeAny): string | null;
|