@rpascene/core 0.30.8 → 0.30.9

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.
Files changed (85) hide show
  1. package/README.md +2 -2
  2. package/dist/es/agent/agent.mjs +1 -1
  3. package/dist/es/agent/agent.mjs.map +1 -1
  4. package/dist/es/agent/task-cache.mjs +15 -15
  5. package/dist/es/agent/task-cache.mjs.map +1 -1
  6. package/dist/es/agent/tasks.mjs +5 -5
  7. package/dist/es/agent/tasks.mjs.map +1 -1
  8. package/dist/es/agent/utils.mjs +6 -6
  9. package/dist/es/agent/utils.mjs.map +1 -1
  10. package/dist/es/ai-model/common.mjs +12 -12
  11. package/dist/es/ai-model/common.mjs.map +1 -1
  12. package/dist/es/ai-model/index.mjs +2 -2
  13. package/dist/es/ai-model/llm-planning.mjs +2 -2
  14. package/dist/es/ai-model/llm-planning.mjs.map +1 -1
  15. package/dist/es/ai-model/prompt/llm-planning.mjs +3 -3
  16. package/dist/es/ai-model/prompt/llm-planning.mjs.map +1 -1
  17. package/dist/es/ai-model/prompt/playwright-generator.mjs +4 -4
  18. package/dist/es/ai-model/prompt/playwright-generator.mjs.map +1 -1
  19. package/dist/es/ai-model/service-caller/index.mjs +5 -5
  20. package/dist/es/ai-model/service-caller/index.mjs.map +1 -1
  21. package/dist/es/device/index.mjs +14 -14
  22. package/dist/es/device/index.mjs.map +1 -1
  23. package/dist/es/index.mjs +3 -3
  24. package/dist/es/index.mjs.map +1 -1
  25. package/dist/es/insight/index.mjs +3 -3
  26. package/dist/es/insight/index.mjs.map +1 -1
  27. package/dist/es/report.mjs +3 -3
  28. package/dist/es/report.mjs.map +1 -1
  29. package/dist/es/types.mjs.map +1 -1
  30. package/dist/es/utils.mjs +12 -12
  31. package/dist/es/utils.mjs.map +1 -1
  32. package/dist/es/yaml/builder.mjs.map +1 -1
  33. package/dist/es/yaml/player.mjs +3 -3
  34. package/dist/es/yaml/player.mjs.map +1 -1
  35. package/dist/es/yaml/utils.mjs.map +1 -1
  36. package/dist/lib/agent/agent.js +1 -1
  37. package/dist/lib/agent/agent.js.map +1 -1
  38. package/dist/lib/agent/task-cache.js +12 -12
  39. package/dist/lib/agent/task-cache.js.map +1 -1
  40. package/dist/lib/agent/tasks.js +3 -3
  41. package/dist/lib/agent/tasks.js.map +1 -1
  42. package/dist/lib/agent/utils.js +8 -8
  43. package/dist/lib/agent/utils.js.map +1 -1
  44. package/dist/lib/ai-model/common.js +24 -24
  45. package/dist/lib/ai-model/common.js.map +1 -1
  46. package/dist/lib/ai-model/index.js +8 -8
  47. package/dist/lib/ai-model/llm-planning.js +1 -1
  48. package/dist/lib/ai-model/llm-planning.js.map +1 -1
  49. package/dist/lib/ai-model/prompt/llm-planning.js +2 -2
  50. package/dist/lib/ai-model/prompt/llm-planning.js.map +1 -1
  51. package/dist/lib/ai-model/prompt/playwright-generator.js +4 -4
  52. package/dist/lib/ai-model/prompt/playwright-generator.js.map +1 -1
  53. package/dist/lib/ai-model/service-caller/index.js +4 -4
  54. package/dist/lib/ai-model/service-caller/index.js.map +1 -1
  55. package/dist/lib/device/index.js +13 -13
  56. package/dist/lib/device/index.js.map +1 -1
  57. package/dist/lib/index.js +6 -6
  58. package/dist/lib/index.js.map +1 -1
  59. package/dist/lib/insight/index.js +2 -2
  60. package/dist/lib/insight/index.js.map +1 -1
  61. package/dist/lib/report.js +2 -2
  62. package/dist/lib/report.js.map +1 -1
  63. package/dist/lib/types.js.map +1 -1
  64. package/dist/lib/utils.js +10 -10
  65. package/dist/lib/utils.js.map +1 -1
  66. package/dist/lib/yaml/builder.js.map +1 -1
  67. package/dist/lib/yaml/player.js +2 -2
  68. package/dist/lib/yaml/player.js.map +1 -1
  69. package/dist/lib/yaml/utils.js.map +1 -1
  70. package/dist/types/agent/agent.d.ts +1 -1
  71. package/dist/types/agent/task-cache.d.ts +1 -1
  72. package/dist/types/agent/tasks.d.ts +2 -2
  73. package/dist/types/agent/utils.d.ts +1 -1
  74. package/dist/types/ai-model/common.d.ts +13 -13
  75. package/dist/types/ai-model/index.d.ts +1 -1
  76. package/dist/types/index.d.ts +3 -3
  77. package/dist/types/report.d.ts +1 -1
  78. package/dist/types/types.d.ts +2 -2
  79. package/dist/types/utils.d.ts +1 -1
  80. package/dist/types/yaml/builder.d.ts +2 -2
  81. package/dist/types/yaml/player.d.ts +4 -4
  82. package/dist/types/yaml/utils.d.ts +2 -2
  83. package/dist/types/yaml.d.ts +39 -39
  84. package/package.json +30 -13
  85. package/LICENSE +0 -21
@@ -1,6 +1,6 @@
1
1
  import type { Agent } from '../agent/agent';
2
- import type { FreeFn, RpasceneYamlScript, RpasceneYamlScriptEnv, ScriptPlayerStatusValue, ScriptPlayerTaskStatus } from '../types';
3
- export declare class ScriptPlayer<T extends RpasceneYamlScriptEnv> {
2
+ import type { FreeFn, MidsceneYamlScript, MidsceneYamlScriptEnv, ScriptPlayerStatusValue, ScriptPlayerTaskStatus } from '../types';
3
+ export declare class ScriptPlayer<T extends MidsceneYamlScriptEnv> {
4
4
  private script;
5
5
  private setupAgent;
6
6
  onTaskStatusChange?: ((taskStatus: ScriptPlayerTaskStatus) => void) | undefined;
@@ -15,10 +15,10 @@ export declare class ScriptPlayer<T extends RpasceneYamlScriptEnv> {
15
15
  errorInSetup?: Error;
16
16
  private interfaceAgent;
17
17
  agentStatusTip?: string;
18
- target?: RpasceneYamlScriptEnv;
18
+ target?: MidsceneYamlScriptEnv;
19
19
  private actionSpace;
20
20
  private scriptPath?;
21
- constructor(script: RpasceneYamlScript, setupAgent: (platform: T) => Promise<{
21
+ constructor(script: MidsceneYamlScript, setupAgent: (platform: T) => Promise<{
22
22
  agent: Agent;
23
23
  freeFn: FreeFn[];
24
24
  }>, onTaskStatusChange?: ((taskStatus: ScriptPlayerTaskStatus) => void) | undefined, scriptPath?: string);
@@ -1,7 +1,7 @@
1
1
  import type { TUserPrompt } from '../ai-model/common';
2
- import type { DetailedLocateParam, LocateOption, RpasceneYamlScript } from '../types';
2
+ import type { DetailedLocateParam, LocateOption, MidsceneYamlScript } from '../types';
3
3
  export declare function interpolateEnvVars(content: string): string;
4
- export declare function parseYamlScript(content: string, filePath?: string): RpasceneYamlScript;
4
+ export declare function parseYamlScript(content: string, filePath?: string): MidsceneYamlScript;
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;
@@ -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 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 {
29
+ export interface MidsceneYamlScript {
30
+ target?: MidsceneYamlScriptWebEnv;
31
+ web?: MidsceneYamlScriptWebEnv;
32
+ android?: MidsceneYamlScriptAndroidEnv;
33
+ ios?: MidsceneYamlScriptIOSEnv;
34
+ interface?: MidsceneYamlScriptEnvGeneralInterface;
35
+ config?: MidsceneYamlScriptConfig;
36
+ agent?: MidsceneYamlScriptAgentOpt;
37
+ tasks: MidsceneYamlTask[];
38
+ }
39
+ export interface MidsceneYamlTask {
40
40
  name: string;
41
- flow: RpasceneYamlFlowItem[];
41
+ flow: MidsceneYamlFlowItem[];
42
42
  continueOnError?: boolean;
43
43
  }
44
- export type RpasceneYamlScriptAgentOpt = Pick<AgentOpt, 'aiActionContext' | 'cache'>;
45
- export interface RpasceneYamlScriptConfig {
44
+ export type MidsceneYamlScriptAgentOpt = Pick<AgentOpt, 'aiActionContext' | 'cache'>;
45
+ export interface MidsceneYamlScriptConfig {
46
46
  output?: string;
47
47
  unstableLogContent?: boolean | string;
48
48
  }
49
- export interface RpasceneYamlScriptEnvGeneralInterface {
49
+ export interface MidsceneYamlScriptEnvGeneralInterface {
50
50
  module: string;
51
51
  export?: string;
52
52
  param?: Record<string, any>;
53
53
  }
54
- export interface RpasceneYamlScriptWebEnv extends RpasceneYamlScriptConfig, RpasceneYamlScriptAgentOpt {
54
+ export interface MidsceneYamlScriptWebEnv extends MidsceneYamlScriptConfig, MidsceneYamlScriptAgentOpt {
55
55
  serve?: string;
56
56
  url: string;
57
57
  userAgent?: string;
@@ -68,98 +68,98 @@ export interface RpasceneYamlScriptWebEnv extends RpasceneYamlScriptConfig, Rpas
68
68
  bridgeMode?: false | 'newTabWithUrl' | 'currentTab';
69
69
  closeNewTabsAfterDisconnect?: boolean;
70
70
  }
71
- export interface RpasceneYamlScriptAndroidEnv extends RpasceneYamlScriptConfig {
71
+ export interface MidsceneYamlScriptAndroidEnv extends MidsceneYamlScriptConfig {
72
72
  deviceId?: string;
73
73
  launch?: string;
74
74
  }
75
- export interface RpasceneYamlScriptIOSEnv extends RpasceneYamlScriptConfig {
75
+ export interface MidsceneYamlScriptIOSEnv extends MidsceneYamlScriptConfig {
76
76
  wdaPort?: number;
77
77
  wdaHost?: string;
78
78
  autoDismissKeyboard?: boolean;
79
79
  launch?: string;
80
80
  }
81
- export type RpasceneYamlScriptEnv = RpasceneYamlScriptWebEnv | RpasceneYamlScriptAndroidEnv | RpasceneYamlScriptIOSEnv;
82
- export interface RpasceneYamlFlowItemAIAction {
81
+ export type MidsceneYamlScriptEnv = MidsceneYamlScriptWebEnv | MidsceneYamlScriptAndroidEnv | MidsceneYamlScriptIOSEnv;
82
+ export interface MidsceneYamlFlowItemAIAction {
83
83
  ai?: string;
84
84
  aiAction?: string;
85
85
  aiActionProgressTips?: string[];
86
86
  cacheable?: boolean;
87
87
  }
88
- export interface RpasceneYamlFlowItemAIAssert {
88
+ export interface MidsceneYamlFlowItemAIAssert {
89
89
  aiAssert: string;
90
90
  errorMessage?: string;
91
91
  name?: string;
92
92
  }
93
- export interface RpasceneYamlFlowItemAIQuery extends InsightExtractOption {
93
+ export interface MidsceneYamlFlowItemAIQuery extends InsightExtractOption {
94
94
  aiQuery: string;
95
95
  name?: string;
96
96
  }
97
- export interface RpasceneYamlFlowItemAINumber extends InsightExtractOption {
97
+ export interface MidsceneYamlFlowItemAINumber extends InsightExtractOption {
98
98
  aiNumber: string;
99
99
  name?: string;
100
100
  }
101
- export interface RpasceneYamlFlowItemAIString extends InsightExtractOption {
101
+ export interface MidsceneYamlFlowItemAIString extends InsightExtractOption {
102
102
  aiString: string;
103
103
  name?: string;
104
104
  }
105
- export interface RpasceneYamlFlowItemAIAsk extends InsightExtractOption {
105
+ export interface MidsceneYamlFlowItemAIAsk extends InsightExtractOption {
106
106
  aiAsk: string;
107
107
  name?: string;
108
108
  }
109
- export interface RpasceneYamlFlowItemAIBoolean extends InsightExtractOption {
109
+ export interface MidsceneYamlFlowItemAIBoolean extends InsightExtractOption {
110
110
  aiBoolean: string;
111
111
  name?: string;
112
112
  }
113
- export interface RpasceneYamlFlowItemAILocate extends LocateOption {
113
+ export interface MidsceneYamlFlowItemAILocate extends LocateOption {
114
114
  aiLocate: string;
115
115
  name?: string;
116
116
  }
117
- export interface RpasceneYamlFlowItemAIWaitFor {
117
+ export interface MidsceneYamlFlowItemAIWaitFor {
118
118
  aiWaitFor: string;
119
119
  timeout?: number;
120
120
  }
121
- export interface RpasceneYamlFlowItemEvaluateJavaScript {
121
+ export interface MidsceneYamlFlowItemEvaluateJavaScript {
122
122
  javascript: string;
123
123
  name?: string;
124
124
  }
125
- export interface RpasceneYamlFlowItemSleep {
125
+ export interface MidsceneYamlFlowItemSleep {
126
126
  sleep: number;
127
127
  }
128
- export interface RpasceneYamlFlowItemLogScreenshot {
128
+ export interface MidsceneYamlFlowItemLogScreenshot {
129
129
  logScreenshot?: string;
130
130
  content?: string;
131
131
  }
132
- export type RpasceneYamlFlowItem = RpasceneYamlFlowItemAIAction | RpasceneYamlFlowItemAIAssert | RpasceneYamlFlowItemAIQuery | RpasceneYamlFlowItemAIWaitFor | RpasceneYamlFlowItemSleep | RpasceneYamlFlowItemLogScreenshot;
132
+ export type MidsceneYamlFlowItem = MidsceneYamlFlowItemAIAction | MidsceneYamlFlowItemAIAssert | MidsceneYamlFlowItemAIQuery | MidsceneYamlFlowItemAIWaitFor | MidsceneYamlFlowItemSleep | MidsceneYamlFlowItemLogScreenshot;
133
133
  export interface FreeFn {
134
134
  name: string;
135
135
  fn: () => void;
136
136
  }
137
- export interface ScriptPlayerTaskStatus extends RpasceneYamlTask {
137
+ export interface ScriptPlayerTaskStatus extends MidsceneYamlTask {
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 RpasceneYamlConfig {
144
+ export interface MidsceneYamlConfig {
145
145
  concurrent?: number;
146
146
  continueOnError?: boolean;
147
147
  summary?: string;
148
148
  shareBrowserContext?: boolean;
149
- web?: RpasceneYamlScriptWebEnv;
150
- android?: RpasceneYamlScriptAndroidEnv;
151
- ios?: RpasceneYamlScriptIOSEnv;
149
+ web?: MidsceneYamlScriptWebEnv;
150
+ android?: MidsceneYamlScriptAndroidEnv;
151
+ ios?: MidsceneYamlScriptIOSEnv;
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 RpasceneYamlConfigOutput {
158
+ export interface MidsceneYamlConfigOutput {
159
159
  format?: 'json';
160
160
  path?: string;
161
161
  }
162
- export interface RpasceneYamlConfigResult {
162
+ export interface MidsceneYamlConfigResult {
163
163
  file: string;
164
164
  success: boolean;
165
165
  executed: boolean;
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "@rpascene/core",
3
- "description": "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.8",
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.9",
5
5
  "repository": "",
6
6
  "homepage": "",
7
7
  "main": "./dist/lib/index.js",
8
8
  "types": "./dist/types/index.d.ts",
9
9
  "module": "./dist/es/index.mjs",
10
- "files": ["dist", "README.md"],
10
+ "files": [
11
+ "dist",
12
+ "README.md"
13
+ ],
11
14
  "exports": {
12
15
  ".": {
13
16
  "types": "./dist/types/index.d.ts",
@@ -52,13 +55,27 @@
52
55
  },
53
56
  "typesVersions": {
54
57
  "*": {
55
- ".": ["./dist/types/index.d.ts"],
56
- "utils": ["./dist/types/utils.d.ts"],
57
- "ai-model": ["./dist/types/ai-model.d.ts"],
58
- "tree": ["./dist/types/tree.d.ts"],
59
- "device": ["./dist/types/device.d.ts"],
60
- "agent": ["./dist/types/agent.d.ts"],
61
- "yaml": ["./dist/types/yaml.d.ts"]
58
+ ".": [
59
+ "./dist/types/index.d.ts"
60
+ ],
61
+ "utils": [
62
+ "./dist/types/utils.d.ts"
63
+ ],
64
+ "ai-model": [
65
+ "./dist/types/ai-model.d.ts"
66
+ ],
67
+ "tree": [
68
+ "./dist/types/tree.d.ts"
69
+ ],
70
+ "device": [
71
+ "./dist/types/device.d.ts"
72
+ ],
73
+ "agent": [
74
+ "./dist/types/agent.d.ts"
75
+ ],
76
+ "yaml": [
77
+ "./dist/types/yaml.d.ts"
78
+ ]
62
79
  }
63
80
  },
64
81
  "scripts": {
@@ -75,8 +92,8 @@
75
92
  "@anthropic-ai/sdk": "0.33.1",
76
93
  "@azure/identity": "4.5.0",
77
94
  "@langchain/core": "0.3.26",
78
- "@rpascene/recorder": "workspace:*",
79
- "@rpascene/shared": "workspace:*",
95
+ "@rpascene/recorder": "0.30.9",
96
+ "@rpascene/shared": "0.30.9",
80
97
  "@ui-tars/action-parser": "1.2.3",
81
98
  "dotenv": "^16.4.5",
82
99
  "https-proxy-agent": "7.0.2",
@@ -105,4 +122,4 @@
105
122
  "registry": "https://registry.npmjs.org"
106
123
  },
107
124
  "license": "MIT"
108
- }
125
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024-present Bytedance, Inc. and its affiliates.
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.