@rpascene/core 0.30.9 → 0.30.10
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/LICENSE +21 -0
- package/README.md +2 -3
- package/dist/es/agent/agent.mjs +1 -1
- package/dist/es/agent/agent.mjs.map +1 -1
- package/dist/es/agent/task-cache.mjs +13 -13
- package/dist/es/agent/task-cache.mjs.map +1 -1
- package/dist/es/agent/tasks.mjs +3 -3
- package/dist/es/agent/tasks.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +4 -4
- package/dist/es/agent/utils.mjs.map +1 -1
- package/dist/es/ai-model/common.mjs +12 -12
- package/dist/es/ai-model/common.mjs.map +1 -1
- package/dist/es/ai-model/index.mjs +2 -2
- package/dist/es/ai-model/llm-planning.mjs +2 -2
- package/dist/es/ai-model/llm-planning.mjs.map +1 -1
- package/dist/es/ai-model/prompt/llm-planning.mjs +3 -3
- package/dist/es/ai-model/prompt/llm-planning.mjs.map +1 -1
- package/dist/es/ai-model/prompt/playwright-generator.mjs +4 -4
- package/dist/es/ai-model/prompt/playwright-generator.mjs.map +1 -1
- package/dist/es/ai-model/service-caller/index.mjs +2 -2
- package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
- package/dist/es/device/index.mjs +14 -14
- package/dist/es/device/index.mjs.map +1 -1
- package/dist/es/index.mjs +2 -2
- package/dist/es/index.mjs.map +1 -1
- package/dist/es/insight/index.mjs +1 -1
- package/dist/es/insight/index.mjs.map +1 -1
- package/dist/es/report.mjs +3 -3
- package/dist/es/report.mjs.map +1 -1
- package/dist/es/types.mjs.map +1 -1
- package/dist/es/utils.mjs +9 -9
- package/dist/es/utils.mjs.map +1 -1
- package/dist/es/yaml/builder.mjs.map +1 -1
- package/dist/es/yaml/player.mjs +3 -3
- package/dist/es/yaml/player.mjs.map +1 -1
- package/dist/es/yaml/utils.mjs.map +1 -1
- package/dist/lib/agent/agent.js +1 -1
- package/dist/lib/agent/agent.js.map +1 -1
- package/dist/lib/agent/task-cache.js +11 -11
- package/dist/lib/agent/task-cache.js.map +1 -1
- package/dist/lib/agent/tasks.js +2 -2
- package/dist/lib/agent/tasks.js.map +1 -1
- package/dist/lib/agent/utils.js +7 -7
- package/dist/lib/agent/utils.js.map +1 -1
- package/dist/lib/ai-model/common.js +24 -24
- package/dist/lib/ai-model/common.js.map +1 -1
- package/dist/lib/ai-model/index.js +8 -8
- package/dist/lib/ai-model/llm-planning.js +1 -1
- package/dist/lib/ai-model/llm-planning.js.map +1 -1
- package/dist/lib/ai-model/prompt/llm-planning.js +2 -2
- package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -1
- package/dist/lib/ai-model/prompt/playwright-generator.js +4 -4
- package/dist/lib/ai-model/prompt/playwright-generator.js.map +1 -1
- package/dist/lib/ai-model/service-caller/index.js +2 -2
- package/dist/lib/ai-model/service-caller/index.js.map +1 -1
- package/dist/lib/device/index.js +13 -13
- package/dist/lib/device/index.js.map +1 -1
- package/dist/lib/index.js +3 -3
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/insight/index.js +1 -1
- package/dist/lib/insight/index.js.map +1 -1
- package/dist/lib/report.js +2 -2
- package/dist/lib/report.js.map +1 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/lib/utils.js +8 -8
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/yaml/builder.js.map +1 -1
- package/dist/lib/yaml/player.js +2 -2
- package/dist/lib/yaml/player.js.map +1 -1
- package/dist/lib/yaml/utils.js.map +1 -1
- package/dist/types/agent/agent.d.ts +1 -1
- package/dist/types/agent/task-cache.d.ts +1 -1
- package/dist/types/agent/tasks.d.ts +2 -2
- package/dist/types/agent/utils.d.ts +1 -1
- package/dist/types/ai-model/common.d.ts +13 -13
- package/dist/types/ai-model/index.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/report.d.ts +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types/yaml/builder.d.ts +2 -2
- package/dist/types/yaml/player.d.ts +4 -4
- package/dist/types/yaml/utils.d.ts +2 -2
- package/dist/types/yaml.d.ts +39 -39
- package/package.json +15 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { TUserPrompt } from '../ai-model/common';
|
|
2
|
-
import type { DetailedLocateParam, LocateOption,
|
|
2
|
+
import type { DetailedLocateParam, LocateOption, RpasceneYamlScript } from '../types';
|
|
3
3
|
export declare function interpolateEnvVars(content: string): string;
|
|
4
|
-
export declare function parseYamlScript(content: string, filePath?: string):
|
|
4
|
+
export declare function parseYamlScript(content: string, filePath?: string): RpasceneYamlScript;
|
|
5
5
|
export declare function buildDetailedLocateParam(locatePrompt: TUserPrompt, opt?: LocateOption): DetailedLocateParam | undefined;
|
|
6
6
|
export declare function buildDetailedLocateParamAndRestParams(locatePrompt: TUserPrompt, opt: LocateOption | undefined, excludeKeys?: string[]): {
|
|
7
7
|
locateParam: DetailedLocateParam | undefined;
|
package/dist/types/yaml.d.ts
CHANGED
|
@@ -26,32 +26,32 @@ export interface ScrollParam {
|
|
|
26
26
|
scrollType: 'once' | 'untilBottom' | 'untilTop' | 'untilRight' | 'untilLeft';
|
|
27
27
|
distance?: null | number;
|
|
28
28
|
}
|
|
29
|
-
export interface
|
|
30
|
-
target?:
|
|
31
|
-
web?:
|
|
32
|
-
android?:
|
|
33
|
-
ios?:
|
|
34
|
-
interface?:
|
|
35
|
-
config?:
|
|
36
|
-
agent?:
|
|
37
|
-
tasks:
|
|
38
|
-
}
|
|
39
|
-
export interface
|
|
29
|
+
export interface RpasceneYamlScript {
|
|
30
|
+
target?: RpasceneYamlScriptWebEnv;
|
|
31
|
+
web?: RpasceneYamlScriptWebEnv;
|
|
32
|
+
android?: RpasceneYamlScriptAndroidEnv;
|
|
33
|
+
ios?: RpasceneYamlScriptIOSEnv;
|
|
34
|
+
interface?: RpasceneYamlScriptEnvGeneralInterface;
|
|
35
|
+
config?: RpasceneYamlScriptConfig;
|
|
36
|
+
agent?: RpasceneYamlScriptAgentOpt;
|
|
37
|
+
tasks: RpasceneYamlTask[];
|
|
38
|
+
}
|
|
39
|
+
export interface RpasceneYamlTask {
|
|
40
40
|
name: string;
|
|
41
|
-
flow:
|
|
41
|
+
flow: RpasceneYamlFlowItem[];
|
|
42
42
|
continueOnError?: boolean;
|
|
43
43
|
}
|
|
44
|
-
export type
|
|
45
|
-
export interface
|
|
44
|
+
export type RpasceneYamlScriptAgentOpt = Pick<AgentOpt, 'aiActionContext' | 'cache'>;
|
|
45
|
+
export interface RpasceneYamlScriptConfig {
|
|
46
46
|
output?: string;
|
|
47
47
|
unstableLogContent?: boolean | string;
|
|
48
48
|
}
|
|
49
|
-
export interface
|
|
49
|
+
export interface RpasceneYamlScriptEnvGeneralInterface {
|
|
50
50
|
module: string;
|
|
51
51
|
export?: string;
|
|
52
52
|
param?: Record<string, any>;
|
|
53
53
|
}
|
|
54
|
-
export interface
|
|
54
|
+
export interface RpasceneYamlScriptWebEnv extends RpasceneYamlScriptConfig, RpasceneYamlScriptAgentOpt {
|
|
55
55
|
serve?: string;
|
|
56
56
|
url: string;
|
|
57
57
|
userAgent?: string;
|
|
@@ -68,98 +68,98 @@ export interface MidsceneYamlScriptWebEnv extends MidsceneYamlScriptConfig, Mids
|
|
|
68
68
|
bridgeMode?: false | 'newTabWithUrl' | 'currentTab';
|
|
69
69
|
closeNewTabsAfterDisconnect?: boolean;
|
|
70
70
|
}
|
|
71
|
-
export interface
|
|
71
|
+
export interface RpasceneYamlScriptAndroidEnv extends RpasceneYamlScriptConfig {
|
|
72
72
|
deviceId?: string;
|
|
73
73
|
launch?: string;
|
|
74
74
|
}
|
|
75
|
-
export interface
|
|
75
|
+
export interface RpasceneYamlScriptIOSEnv extends RpasceneYamlScriptConfig {
|
|
76
76
|
wdaPort?: number;
|
|
77
77
|
wdaHost?: string;
|
|
78
78
|
autoDismissKeyboard?: boolean;
|
|
79
79
|
launch?: string;
|
|
80
80
|
}
|
|
81
|
-
export type
|
|
82
|
-
export interface
|
|
81
|
+
export type RpasceneYamlScriptEnv = RpasceneYamlScriptWebEnv | RpasceneYamlScriptAndroidEnv | RpasceneYamlScriptIOSEnv;
|
|
82
|
+
export interface RpasceneYamlFlowItemAIAction {
|
|
83
83
|
ai?: string;
|
|
84
84
|
aiAction?: string;
|
|
85
85
|
aiActionProgressTips?: string[];
|
|
86
86
|
cacheable?: boolean;
|
|
87
87
|
}
|
|
88
|
-
export interface
|
|
88
|
+
export interface RpasceneYamlFlowItemAIAssert {
|
|
89
89
|
aiAssert: string;
|
|
90
90
|
errorMessage?: string;
|
|
91
91
|
name?: string;
|
|
92
92
|
}
|
|
93
|
-
export interface
|
|
93
|
+
export interface RpasceneYamlFlowItemAIQuery extends InsightExtractOption {
|
|
94
94
|
aiQuery: string;
|
|
95
95
|
name?: string;
|
|
96
96
|
}
|
|
97
|
-
export interface
|
|
97
|
+
export interface RpasceneYamlFlowItemAINumber extends InsightExtractOption {
|
|
98
98
|
aiNumber: string;
|
|
99
99
|
name?: string;
|
|
100
100
|
}
|
|
101
|
-
export interface
|
|
101
|
+
export interface RpasceneYamlFlowItemAIString extends InsightExtractOption {
|
|
102
102
|
aiString: string;
|
|
103
103
|
name?: string;
|
|
104
104
|
}
|
|
105
|
-
export interface
|
|
105
|
+
export interface RpasceneYamlFlowItemAIAsk extends InsightExtractOption {
|
|
106
106
|
aiAsk: string;
|
|
107
107
|
name?: string;
|
|
108
108
|
}
|
|
109
|
-
export interface
|
|
109
|
+
export interface RpasceneYamlFlowItemAIBoolean extends InsightExtractOption {
|
|
110
110
|
aiBoolean: string;
|
|
111
111
|
name?: string;
|
|
112
112
|
}
|
|
113
|
-
export interface
|
|
113
|
+
export interface RpasceneYamlFlowItemAILocate extends LocateOption {
|
|
114
114
|
aiLocate: string;
|
|
115
115
|
name?: string;
|
|
116
116
|
}
|
|
117
|
-
export interface
|
|
117
|
+
export interface RpasceneYamlFlowItemAIWaitFor {
|
|
118
118
|
aiWaitFor: string;
|
|
119
119
|
timeout?: number;
|
|
120
120
|
}
|
|
121
|
-
export interface
|
|
121
|
+
export interface RpasceneYamlFlowItemEvaluateJavaScript {
|
|
122
122
|
javascript: string;
|
|
123
123
|
name?: string;
|
|
124
124
|
}
|
|
125
|
-
export interface
|
|
125
|
+
export interface RpasceneYamlFlowItemSleep {
|
|
126
126
|
sleep: number;
|
|
127
127
|
}
|
|
128
|
-
export interface
|
|
128
|
+
export interface RpasceneYamlFlowItemLogScreenshot {
|
|
129
129
|
logScreenshot?: string;
|
|
130
130
|
content?: string;
|
|
131
131
|
}
|
|
132
|
-
export type
|
|
132
|
+
export type RpasceneYamlFlowItem = RpasceneYamlFlowItemAIAction | RpasceneYamlFlowItemAIAssert | RpasceneYamlFlowItemAIQuery | RpasceneYamlFlowItemAIWaitFor | RpasceneYamlFlowItemSleep | RpasceneYamlFlowItemLogScreenshot;
|
|
133
133
|
export interface FreeFn {
|
|
134
134
|
name: string;
|
|
135
135
|
fn: () => void;
|
|
136
136
|
}
|
|
137
|
-
export interface ScriptPlayerTaskStatus extends
|
|
137
|
+
export interface ScriptPlayerTaskStatus extends RpasceneYamlTask {
|
|
138
138
|
status: ScriptPlayerStatusValue;
|
|
139
139
|
currentStep?: number;
|
|
140
140
|
totalSteps: number;
|
|
141
141
|
error?: Error;
|
|
142
142
|
}
|
|
143
143
|
export type ScriptPlayerStatusValue = 'init' | 'running' | 'done' | 'error';
|
|
144
|
-
export interface
|
|
144
|
+
export interface RpasceneYamlConfig {
|
|
145
145
|
concurrent?: number;
|
|
146
146
|
continueOnError?: boolean;
|
|
147
147
|
summary?: string;
|
|
148
148
|
shareBrowserContext?: boolean;
|
|
149
|
-
web?:
|
|
150
|
-
android?:
|
|
151
|
-
ios?:
|
|
149
|
+
web?: RpasceneYamlScriptWebEnv;
|
|
150
|
+
android?: RpasceneYamlScriptAndroidEnv;
|
|
151
|
+
ios?: RpasceneYamlScriptIOSEnv;
|
|
152
152
|
files: string[];
|
|
153
153
|
headed?: boolean;
|
|
154
154
|
keepWindow?: boolean;
|
|
155
155
|
dotenvOverride?: boolean;
|
|
156
156
|
dotenvDebug?: boolean;
|
|
157
157
|
}
|
|
158
|
-
export interface
|
|
158
|
+
export interface RpasceneYamlConfigOutput {
|
|
159
159
|
format?: 'json';
|
|
160
160
|
path?: string;
|
|
161
161
|
}
|
|
162
|
-
export interface
|
|
162
|
+
export interface RpasceneYamlConfigResult {
|
|
163
163
|
file: string;
|
|
164
164
|
success: boolean;
|
|
165
165
|
executed: boolean;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rpascene/core",
|
|
3
3
|
"description": "RPA Automate browser actions, extract data, and perform assertions using AI. It offers JavaScript SDK, Chrome extension, and support for scripting in YAML.",
|
|
4
|
-
"version": "0.30.
|
|
4
|
+
"version": "0.30.10",
|
|
5
5
|
"repository": "",
|
|
6
6
|
"homepage": "",
|
|
7
7
|
"main": "./dist/lib/index.js",
|
|
@@ -78,22 +78,10 @@
|
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
|
-
"scripts": {
|
|
82
|
-
"dev": "npm run build:watch",
|
|
83
|
-
"build": "rslib build",
|
|
84
|
-
"build:watch": "USE_DEV_REPORT=1 rslib build --watch",
|
|
85
|
-
"test": "vitest --run",
|
|
86
|
-
"test:u": "vitest --run -u",
|
|
87
|
-
"test:ai": "AITEST=true npm run test",
|
|
88
|
-
"computer": "TEST_COMPUTER=true npm run test:ai -- tests/ai/evaluate/computer.test.ts",
|
|
89
|
-
"test:parse-action": "npm run test:ai -- tests/ai/parse-action.test.ts"
|
|
90
|
-
},
|
|
91
81
|
"dependencies": {
|
|
92
82
|
"@anthropic-ai/sdk": "0.33.1",
|
|
93
83
|
"@azure/identity": "4.5.0",
|
|
94
84
|
"@langchain/core": "0.3.26",
|
|
95
|
-
"@rpascene/recorder": "0.30.9",
|
|
96
|
-
"@rpascene/shared": "0.30.9",
|
|
97
85
|
"@ui-tars/action-parser": "1.2.3",
|
|
98
86
|
"dotenv": "^16.4.5",
|
|
99
87
|
"https-proxy-agent": "7.0.2",
|
|
@@ -103,7 +91,9 @@
|
|
|
103
91
|
"socks-proxy-agent": "8.0.4",
|
|
104
92
|
"zod": "3.24.3",
|
|
105
93
|
"semver": "7.5.2",
|
|
106
|
-
"js-yaml": "4.1.0"
|
|
94
|
+
"js-yaml": "4.1.0",
|
|
95
|
+
"@rpascene/shared": "0.30.10",
|
|
96
|
+
"@rpascene/recorder": "0.30.10"
|
|
107
97
|
},
|
|
108
98
|
"devDependencies": {
|
|
109
99
|
"@rslib/core": "^0.11.2",
|
|
@@ -121,5 +111,15 @@
|
|
|
121
111
|
"access": "public",
|
|
122
112
|
"registry": "https://registry.npmjs.org"
|
|
123
113
|
},
|
|
124
|
-
"license": "MIT"
|
|
114
|
+
"license": "MIT",
|
|
115
|
+
"scripts": {
|
|
116
|
+
"dev": "npm run build:watch",
|
|
117
|
+
"build": "rslib build",
|
|
118
|
+
"build:watch": "USE_DEV_REPORT=1 rslib build --watch",
|
|
119
|
+
"test": "vitest --run",
|
|
120
|
+
"test:u": "vitest --run -u",
|
|
121
|
+
"test:ai": "AITEST=true npm run test",
|
|
122
|
+
"computer": "TEST_COMPUTER=true npm run test:ai -- tests/ai/evaluate/computer.test.ts",
|
|
123
|
+
"test:parse-action": "npm run test:ai -- tests/ai/parse-action.test.ts"
|
|
124
|
+
}
|
|
125
125
|
}
|