@midscene/visualizer 0.27.1-beta-20250822053848.0 → 0.27.1-beta-20250822094725.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/dist/es/component/playground/FormField.mjs +122 -0
- package/dist/es/component/playground/HistorySelector.mjs +2 -3
- package/dist/es/component/playground/PromptInput.mjs +339 -58
- package/dist/es/component/playground/index.css +160 -2
- package/dist/es/component/playground/playground-constants.mjs +69 -1
- package/dist/es/component/playground/playground-utils.mjs +43 -1
- package/dist/es/component/playground/types.mjs +50 -0
- package/dist/es/component/replay-scripts.mjs +18 -9
- package/dist/es/component/store/history.mjs +42 -8
- package/dist/lib/component/playground/FormField.js +165 -0
- package/dist/lib/component/playground/HistorySelector.js +2 -3
- package/dist/lib/component/playground/PromptInput.js +345 -54
- package/dist/lib/component/playground/index.css +160 -2
- package/dist/lib/component/playground/playground-constants.js +76 -2
- package/dist/lib/component/playground/playground-utils.js +45 -0
- package/dist/lib/component/playground/types.js +96 -0
- package/dist/lib/component/replay-scripts.js +28 -19
- package/dist/lib/component/store/history.js +42 -8
- package/dist/types/component/playground/FormField.d.ts +15 -0
- package/dist/types/component/playground/HistorySelector.d.ts +2 -0
- package/dist/types/component/playground/PromptInput.d.ts +3 -1
- package/dist/types/component/playground/playground-constants.d.ts +63 -0
- package/dist/types/component/playground/playground-types.d.ts +1 -1
- package/dist/types/component/playground/playground-utils.d.ts +1 -0
- package/dist/types/component/playground/types.d.ts +58 -0
- package/dist/types/component/store/history.d.ts +9 -4
- package/package.json +4 -4
|
@@ -3,6 +3,8 @@ import type { HistoryItem } from '../store/history';
|
|
|
3
3
|
import './index.less';
|
|
4
4
|
interface HistorySelectorProps {
|
|
5
5
|
onSelect: (history: HistoryItem) => void;
|
|
6
|
+
history: HistoryItem[];
|
|
7
|
+
currentType: string;
|
|
6
8
|
}
|
|
7
9
|
export declare const HistorySelector: React.FC<HistorySelectorProps>;
|
|
8
10
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import type { RunType } from './playground-types';
|
|
3
3
|
import type { ServiceModeType } from './playground-types';
|
|
4
4
|
import './index.less';
|
|
5
|
+
import type { DeviceAction } from '@midscene/core';
|
|
5
6
|
interface PromptInputProps {
|
|
6
7
|
runButtonEnabled: boolean;
|
|
7
8
|
form: any;
|
|
@@ -13,6 +14,7 @@ interface PromptInputProps {
|
|
|
13
14
|
onRun: () => void;
|
|
14
15
|
onStop: () => void;
|
|
15
16
|
clearPromptAfterRun?: boolean;
|
|
17
|
+
actionSpace?: DeviceAction<any>[];
|
|
16
18
|
}
|
|
17
19
|
export declare const PromptInput: React.FC<PromptInputProps>;
|
|
18
20
|
export {};
|
|
@@ -5,3 +5,66 @@ export declare const serverLaunchTip: (notReadyMessage?: React.ReactNode | strin
|
|
|
5
5
|
export declare const emptyResultTip: React.JSX.Element;
|
|
6
6
|
export declare const trackingTip = "limit popup to current tab";
|
|
7
7
|
export declare const deepThinkTip = "deep think";
|
|
8
|
+
export declare const apiMetadata: {
|
|
9
|
+
aiAction: {
|
|
10
|
+
group: string;
|
|
11
|
+
title: string;
|
|
12
|
+
};
|
|
13
|
+
aiTap: {
|
|
14
|
+
group: string;
|
|
15
|
+
title: string;
|
|
16
|
+
};
|
|
17
|
+
aiHover: {
|
|
18
|
+
group: string;
|
|
19
|
+
title: string;
|
|
20
|
+
};
|
|
21
|
+
aiInput: {
|
|
22
|
+
group: string;
|
|
23
|
+
title: string;
|
|
24
|
+
};
|
|
25
|
+
aiRightClick: {
|
|
26
|
+
group: string;
|
|
27
|
+
title: string;
|
|
28
|
+
};
|
|
29
|
+
aiKeyboardPress: {
|
|
30
|
+
group: string;
|
|
31
|
+
title: string;
|
|
32
|
+
};
|
|
33
|
+
aiScroll: {
|
|
34
|
+
group: string;
|
|
35
|
+
title: string;
|
|
36
|
+
};
|
|
37
|
+
aiLocate: {
|
|
38
|
+
group: string;
|
|
39
|
+
title: string;
|
|
40
|
+
};
|
|
41
|
+
aiQuery: {
|
|
42
|
+
group: string;
|
|
43
|
+
title: string;
|
|
44
|
+
};
|
|
45
|
+
aiBoolean: {
|
|
46
|
+
group: string;
|
|
47
|
+
title: string;
|
|
48
|
+
};
|
|
49
|
+
aiNumber: {
|
|
50
|
+
group: string;
|
|
51
|
+
title: string;
|
|
52
|
+
};
|
|
53
|
+
aiString: {
|
|
54
|
+
group: string;
|
|
55
|
+
title: string;
|
|
56
|
+
};
|
|
57
|
+
aiAsk: {
|
|
58
|
+
group: string;
|
|
59
|
+
title: string;
|
|
60
|
+
};
|
|
61
|
+
aiAssert: {
|
|
62
|
+
group: string;
|
|
63
|
+
title: string;
|
|
64
|
+
};
|
|
65
|
+
aiWaitFor: {
|
|
66
|
+
group: string;
|
|
67
|
+
title: string;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
export declare const defaultMainButtons: string[];
|
|
@@ -18,4 +18,4 @@ export interface StaticPlaygroundProps {
|
|
|
18
18
|
context: WebUIContext | null;
|
|
19
19
|
}
|
|
20
20
|
export type ServiceModeType = 'Server' | 'In-Browser' | 'In-Browser-Extension';
|
|
21
|
-
export type RunType = 'aiAction' | 'aiQuery' | 'aiAssert' | 'aiTap';
|
|
21
|
+
export type RunType = 'aiAction' | 'aiQuery' | 'aiAssert' | 'aiTap' | 'aiHover' | 'aiInput' | 'aiRightClick' | 'aiKeyboardPress' | 'aiScroll' | 'aiLocate' | 'aiBoolean' | 'aiNumber' | 'aiString' | 'aiAsk' | 'aiWaitFor';
|
|
@@ -20,3 +20,4 @@ export declare const blankResult: {
|
|
|
20
20
|
reportHTML: null;
|
|
21
21
|
error: null;
|
|
22
22
|
};
|
|
23
|
+
export declare const isRunButtonEnabled: (runButtonEnabled: boolean, needsStructuredParams: boolean, params: any, actionSpace: any[] | undefined, selectedType: string, promptValue: string) => boolean;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { DeviceAction } from '@midscene/core';
|
|
2
|
+
export interface ZodType {
|
|
3
|
+
_def?: {
|
|
4
|
+
typeName: 'ZodOptional' | 'ZodDefault' | 'ZodNullable' | 'ZodObject' | 'ZodEnum' | 'ZodNumber' | 'ZodString';
|
|
5
|
+
innerType?: ZodType;
|
|
6
|
+
defaultValue?: () => unknown;
|
|
7
|
+
shape?: () => Record<string, ZodType>;
|
|
8
|
+
values?: string[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export interface ZodObjectSchema extends ZodType {
|
|
12
|
+
shape: Record<string, ZodType>;
|
|
13
|
+
parse: (data: unknown) => unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface ZodEnumSchema extends ZodType {
|
|
16
|
+
_def: {
|
|
17
|
+
typeName: 'ZodEnum';
|
|
18
|
+
values: string[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export interface ZodNumberSchema extends ZodType {
|
|
22
|
+
_def: {
|
|
23
|
+
typeName: 'ZodNumber';
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export interface ActionSpaceItem extends Omit<DeviceAction<any>, 'paramSchema'> {
|
|
27
|
+
paramSchema?: ZodObjectSchema;
|
|
28
|
+
}
|
|
29
|
+
export interface FormParams {
|
|
30
|
+
[key: string]: string | number | boolean | null | undefined;
|
|
31
|
+
}
|
|
32
|
+
export declare const VALIDATION_CONSTANTS: {
|
|
33
|
+
readonly ZOD_TYPES: {
|
|
34
|
+
readonly OPTIONAL: "ZodOptional";
|
|
35
|
+
readonly DEFAULT: "ZodDefault";
|
|
36
|
+
readonly NULLABLE: "ZodNullable";
|
|
37
|
+
readonly OBJECT: "ZodObject";
|
|
38
|
+
readonly ENUM: "ZodEnum";
|
|
39
|
+
readonly NUMBER: "ZodNumber";
|
|
40
|
+
readonly STRING: "ZodString";
|
|
41
|
+
};
|
|
42
|
+
readonly FIELD_FLAGS: {
|
|
43
|
+
readonly LOCATION: "midscene_location_field_flag";
|
|
44
|
+
};
|
|
45
|
+
readonly DEFAULT_VALUES: {
|
|
46
|
+
readonly ACTION_TYPE: "aiAction";
|
|
47
|
+
readonly TIMEOUT_MS: 15000;
|
|
48
|
+
readonly CHECK_INTERVAL_MS: 3000;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export declare const isZodObjectSchema: (schema: unknown) => schema is ZodObjectSchema;
|
|
52
|
+
export declare const isLocateField: (field: ZodType) => boolean;
|
|
53
|
+
export declare const unwrapZodType: (field: ZodType) => {
|
|
54
|
+
actualField: ZodType;
|
|
55
|
+
isOptional: boolean;
|
|
56
|
+
hasDefault: boolean;
|
|
57
|
+
};
|
|
58
|
+
export declare const extractDefaultValue: (field: ZodType) => unknown;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import * as Z from 'zustand';
|
|
2
2
|
export interface HistoryItem {
|
|
3
|
-
type:
|
|
3
|
+
type: string;
|
|
4
4
|
prompt: string;
|
|
5
|
+
params?: Record<string, any>;
|
|
5
6
|
timestamp: number;
|
|
6
7
|
}
|
|
8
|
+
export type HistoryState = Record<string, HistoryItem[]>;
|
|
7
9
|
export declare const useHistoryStore: Z.UseBoundStore<Z.StoreApi<{
|
|
8
|
-
history:
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
history: HistoryState;
|
|
11
|
+
lastSelectedType: string;
|
|
12
|
+
clearHistory: (type: string) => void;
|
|
13
|
+
addHistory: (historyItem: HistoryItem) => void;
|
|
14
|
+
getHistoryForType: (type: string) => HistoryItem[];
|
|
15
|
+
setLastSelectedType: (type: string) => void;
|
|
11
16
|
}>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/visualizer",
|
|
3
|
-
"version": "0.27.1-beta-
|
|
3
|
+
"version": "0.27.1-beta-20250822094725.0",
|
|
4
4
|
"repository": "https://github.com/web-infra-dev/midscene",
|
|
5
5
|
"homepage": "https://midscenejs.com/",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
"antd": "^5.21.6",
|
|
71
71
|
"buffer": "6.0.3",
|
|
72
72
|
"dayjs": "^1.11.11",
|
|
73
|
-
"@midscene/
|
|
74
|
-
"@midscene/web": "0.27.1-beta-
|
|
75
|
-
"@midscene/
|
|
73
|
+
"@midscene/shared": "0.27.1-beta-20250822094725.0",
|
|
74
|
+
"@midscene/web": "0.27.1-beta-20250822094725.0",
|
|
75
|
+
"@midscene/core": "0.27.1-beta-20250822094725.0"
|
|
76
76
|
},
|
|
77
77
|
"license": "MIT",
|
|
78
78
|
"scripts": {
|