@roll-agent/browser-use-agent 0.13.0 → 0.15.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/SKILL.md +114 -0
- package/dist/auto-window-layout.d.ts +21 -0
- package/dist/browser-instance-pool.d.ts +39 -0
- package/dist/diagnostics/effective-env.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/pages/zhipin/semantic-refs.d.ts +1 -0
- package/dist/runtime-config.d.ts +334 -0
- package/dist/runtime-holder.d.ts +10 -1
- package/dist/tools/browser-instance-input.d.ts +8 -0
- package/dist/tools/browser-instance-platform.d.ts +3 -0
- package/dist/tools/browser-ref-schemas.d.ts +12 -12
- package/dist/tools/browser-status.d.ts +23 -0
- package/dist/tools/browser-stop.d.ts +80 -0
- package/dist/tools/click-ref.d.ts +2 -2
- package/dist/tools/type-ref.d.ts +2 -2
- package/dist/tools/zhipin-get-username.d.ts +1 -1
- package/package.json +2 -2
- package/references/env.yaml +7 -1
- package/references/zhipin-workflows.md +28 -5
|
@@ -35,6 +35,7 @@ export declare function rememberZhipinCandidateRefs(candidates: readonly ZhipinC
|
|
|
35
35
|
export declare function rememberZhipinRecommendJobRefs(jobs: readonly ZhipinRecommendJobRefSource[]): ZhipinRecommendJobRefTarget[];
|
|
36
36
|
export declare function clearZhipinCandidateRefsForTests(): void;
|
|
37
37
|
export declare function clearZhipinRecommendJobRefsForTests(): void;
|
|
38
|
+
export declare function runWithZhipinSemanticRefScopeForTests<T>(scope: string, run: () => T): T;
|
|
38
39
|
export declare function resolveZhipinCandidateRefTarget(candidateRef: string): ZhipinCandidateRefTarget;
|
|
39
40
|
export declare function resolveZhipinRecommendJobRefTarget(jobRef: string): ZhipinRecommendJobRefTarget;
|
|
40
41
|
export declare function resolveZhipinCandidateTargets(input: {
|
package/dist/runtime-config.d.ts
CHANGED
|
@@ -1,2 +1,336 @@
|
|
|
1
1
|
import type { BrowserRuntimeConfig } from "@roll-agent/browser";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
export declare const BrowserInstanceConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
4
|
+
platform: z.ZodOptional<z.ZodEnum<["zhipin", "yupao"]>>;
|
|
5
|
+
mode: z.ZodDefault<z.ZodEnum<["managed-cdp", "remote-cdp", "existing-session"]>>;
|
|
6
|
+
headless: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
cdpUrl: z.ZodOptional<z.ZodString>;
|
|
8
|
+
cdpHost: z.ZodDefault<z.ZodString>;
|
|
9
|
+
cdpPort: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
channel: z.ZodDefault<z.ZodEnum<["chrome", "chromium", "msedge"]>>;
|
|
11
|
+
executablePath: z.ZodOptional<z.ZodString>;
|
|
12
|
+
userDataDir: z.ZodString;
|
|
13
|
+
sessionsDir: z.ZodOptional<z.ZodString>;
|
|
14
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
15
|
+
profileName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
profileColor: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
17
|
+
windowBounds: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
x?: number | undefined;
|
|
24
|
+
y?: number | undefined;
|
|
25
|
+
width?: number | undefined;
|
|
26
|
+
height?: number | undefined;
|
|
27
|
+
}, {
|
|
28
|
+
x?: number | undefined;
|
|
29
|
+
y?: number | undefined;
|
|
30
|
+
width?: number | undefined;
|
|
31
|
+
height?: number | undefined;
|
|
32
|
+
}>>;
|
|
33
|
+
trackingAgentId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
mode: "managed-cdp" | "remote-cdp" | "existing-session";
|
|
36
|
+
cdpHost: string;
|
|
37
|
+
channel: "chrome" | "chromium" | "msedge";
|
|
38
|
+
userDataDir: string;
|
|
39
|
+
headless?: boolean | undefined;
|
|
40
|
+
profileName?: string | undefined;
|
|
41
|
+
profileColor?: string | undefined;
|
|
42
|
+
cdpUrl?: string | undefined;
|
|
43
|
+
cdpPort?: number | undefined;
|
|
44
|
+
executablePath?: string | undefined;
|
|
45
|
+
args?: string[] | undefined;
|
|
46
|
+
windowBounds?: {
|
|
47
|
+
x?: number | undefined;
|
|
48
|
+
y?: number | undefined;
|
|
49
|
+
width?: number | undefined;
|
|
50
|
+
height?: number | undefined;
|
|
51
|
+
} | undefined;
|
|
52
|
+
sessionsDir?: string | undefined;
|
|
53
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
54
|
+
trackingAgentId?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
userDataDir: string;
|
|
57
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
58
|
+
headless?: boolean | undefined;
|
|
59
|
+
profileName?: string | undefined;
|
|
60
|
+
profileColor?: string | undefined;
|
|
61
|
+
cdpUrl?: string | undefined;
|
|
62
|
+
cdpHost?: string | undefined;
|
|
63
|
+
cdpPort?: number | undefined;
|
|
64
|
+
channel?: "chrome" | "chromium" | "msedge" | undefined;
|
|
65
|
+
executablePath?: string | undefined;
|
|
66
|
+
args?: string[] | undefined;
|
|
67
|
+
windowBounds?: {
|
|
68
|
+
x?: number | undefined;
|
|
69
|
+
y?: number | undefined;
|
|
70
|
+
width?: number | undefined;
|
|
71
|
+
height?: number | undefined;
|
|
72
|
+
} | undefined;
|
|
73
|
+
sessionsDir?: string | undefined;
|
|
74
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
75
|
+
trackingAgentId?: string | undefined;
|
|
76
|
+
}>, {
|
|
77
|
+
mode: "managed-cdp" | "remote-cdp" | "existing-session";
|
|
78
|
+
cdpHost: string;
|
|
79
|
+
channel: "chrome" | "chromium" | "msedge";
|
|
80
|
+
userDataDir: string;
|
|
81
|
+
headless?: boolean | undefined;
|
|
82
|
+
profileName?: string | undefined;
|
|
83
|
+
profileColor?: string | undefined;
|
|
84
|
+
cdpUrl?: string | undefined;
|
|
85
|
+
cdpPort?: number | undefined;
|
|
86
|
+
executablePath?: string | undefined;
|
|
87
|
+
args?: string[] | undefined;
|
|
88
|
+
windowBounds?: {
|
|
89
|
+
x?: number | undefined;
|
|
90
|
+
y?: number | undefined;
|
|
91
|
+
width?: number | undefined;
|
|
92
|
+
height?: number | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
sessionsDir?: string | undefined;
|
|
95
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
96
|
+
trackingAgentId?: string | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
userDataDir: string;
|
|
99
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
100
|
+
headless?: boolean | undefined;
|
|
101
|
+
profileName?: string | undefined;
|
|
102
|
+
profileColor?: string | undefined;
|
|
103
|
+
cdpUrl?: string | undefined;
|
|
104
|
+
cdpHost?: string | undefined;
|
|
105
|
+
cdpPort?: number | undefined;
|
|
106
|
+
channel?: "chrome" | "chromium" | "msedge" | undefined;
|
|
107
|
+
executablePath?: string | undefined;
|
|
108
|
+
args?: string[] | undefined;
|
|
109
|
+
windowBounds?: {
|
|
110
|
+
x?: number | undefined;
|
|
111
|
+
y?: number | undefined;
|
|
112
|
+
width?: number | undefined;
|
|
113
|
+
height?: number | undefined;
|
|
114
|
+
} | undefined;
|
|
115
|
+
sessionsDir?: string | undefined;
|
|
116
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
117
|
+
trackingAgentId?: string | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
export declare const BrowserInstancesConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
120
|
+
defaultInstance: z.ZodOptional<z.ZodString>;
|
|
121
|
+
instances: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
|
|
122
|
+
platform: z.ZodOptional<z.ZodEnum<["zhipin", "yupao"]>>;
|
|
123
|
+
mode: z.ZodDefault<z.ZodEnum<["managed-cdp", "remote-cdp", "existing-session"]>>;
|
|
124
|
+
headless: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
cdpUrl: z.ZodOptional<z.ZodString>;
|
|
126
|
+
cdpHost: z.ZodDefault<z.ZodString>;
|
|
127
|
+
cdpPort: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
channel: z.ZodDefault<z.ZodEnum<["chrome", "chromium", "msedge"]>>;
|
|
129
|
+
executablePath: z.ZodOptional<z.ZodString>;
|
|
130
|
+
userDataDir: z.ZodString;
|
|
131
|
+
sessionsDir: z.ZodOptional<z.ZodString>;
|
|
132
|
+
args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
133
|
+
profileName: z.ZodOptional<z.ZodString>;
|
|
134
|
+
profileColor: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
135
|
+
windowBounds: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
}, "strip", z.ZodTypeAny, {
|
|
141
|
+
x?: number | undefined;
|
|
142
|
+
y?: number | undefined;
|
|
143
|
+
width?: number | undefined;
|
|
144
|
+
height?: number | undefined;
|
|
145
|
+
}, {
|
|
146
|
+
x?: number | undefined;
|
|
147
|
+
y?: number | undefined;
|
|
148
|
+
width?: number | undefined;
|
|
149
|
+
height?: number | undefined;
|
|
150
|
+
}>>;
|
|
151
|
+
trackingAgentId: z.ZodOptional<z.ZodString>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
mode: "managed-cdp" | "remote-cdp" | "existing-session";
|
|
154
|
+
cdpHost: string;
|
|
155
|
+
channel: "chrome" | "chromium" | "msedge";
|
|
156
|
+
userDataDir: string;
|
|
157
|
+
headless?: boolean | undefined;
|
|
158
|
+
profileName?: string | undefined;
|
|
159
|
+
profileColor?: string | undefined;
|
|
160
|
+
cdpUrl?: string | undefined;
|
|
161
|
+
cdpPort?: number | undefined;
|
|
162
|
+
executablePath?: string | undefined;
|
|
163
|
+
args?: string[] | undefined;
|
|
164
|
+
windowBounds?: {
|
|
165
|
+
x?: number | undefined;
|
|
166
|
+
y?: number | undefined;
|
|
167
|
+
width?: number | undefined;
|
|
168
|
+
height?: number | undefined;
|
|
169
|
+
} | undefined;
|
|
170
|
+
sessionsDir?: string | undefined;
|
|
171
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
172
|
+
trackingAgentId?: string | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
userDataDir: string;
|
|
175
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
176
|
+
headless?: boolean | undefined;
|
|
177
|
+
profileName?: string | undefined;
|
|
178
|
+
profileColor?: string | undefined;
|
|
179
|
+
cdpUrl?: string | undefined;
|
|
180
|
+
cdpHost?: string | undefined;
|
|
181
|
+
cdpPort?: number | undefined;
|
|
182
|
+
channel?: "chrome" | "chromium" | "msedge" | undefined;
|
|
183
|
+
executablePath?: string | undefined;
|
|
184
|
+
args?: string[] | undefined;
|
|
185
|
+
windowBounds?: {
|
|
186
|
+
x?: number | undefined;
|
|
187
|
+
y?: number | undefined;
|
|
188
|
+
width?: number | undefined;
|
|
189
|
+
height?: number | undefined;
|
|
190
|
+
} | undefined;
|
|
191
|
+
sessionsDir?: string | undefined;
|
|
192
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
193
|
+
trackingAgentId?: string | undefined;
|
|
194
|
+
}>, {
|
|
195
|
+
mode: "managed-cdp" | "remote-cdp" | "existing-session";
|
|
196
|
+
cdpHost: string;
|
|
197
|
+
channel: "chrome" | "chromium" | "msedge";
|
|
198
|
+
userDataDir: string;
|
|
199
|
+
headless?: boolean | undefined;
|
|
200
|
+
profileName?: string | undefined;
|
|
201
|
+
profileColor?: string | undefined;
|
|
202
|
+
cdpUrl?: string | undefined;
|
|
203
|
+
cdpPort?: number | undefined;
|
|
204
|
+
executablePath?: string | undefined;
|
|
205
|
+
args?: string[] | undefined;
|
|
206
|
+
windowBounds?: {
|
|
207
|
+
x?: number | undefined;
|
|
208
|
+
y?: number | undefined;
|
|
209
|
+
width?: number | undefined;
|
|
210
|
+
height?: number | undefined;
|
|
211
|
+
} | undefined;
|
|
212
|
+
sessionsDir?: string | undefined;
|
|
213
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
214
|
+
trackingAgentId?: string | undefined;
|
|
215
|
+
}, {
|
|
216
|
+
userDataDir: string;
|
|
217
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
218
|
+
headless?: boolean | undefined;
|
|
219
|
+
profileName?: string | undefined;
|
|
220
|
+
profileColor?: string | undefined;
|
|
221
|
+
cdpUrl?: string | undefined;
|
|
222
|
+
cdpHost?: string | undefined;
|
|
223
|
+
cdpPort?: number | undefined;
|
|
224
|
+
channel?: "chrome" | "chromium" | "msedge" | undefined;
|
|
225
|
+
executablePath?: string | undefined;
|
|
226
|
+
args?: string[] | undefined;
|
|
227
|
+
windowBounds?: {
|
|
228
|
+
x?: number | undefined;
|
|
229
|
+
y?: number | undefined;
|
|
230
|
+
width?: number | undefined;
|
|
231
|
+
height?: number | undefined;
|
|
232
|
+
} | undefined;
|
|
233
|
+
sessionsDir?: string | undefined;
|
|
234
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
235
|
+
trackingAgentId?: string | undefined;
|
|
236
|
+
}>>>;
|
|
237
|
+
}, "strip", z.ZodTypeAny, {
|
|
238
|
+
instances: Record<string, {
|
|
239
|
+
mode: "managed-cdp" | "remote-cdp" | "existing-session";
|
|
240
|
+
cdpHost: string;
|
|
241
|
+
channel: "chrome" | "chromium" | "msedge";
|
|
242
|
+
userDataDir: string;
|
|
243
|
+
headless?: boolean | undefined;
|
|
244
|
+
profileName?: string | undefined;
|
|
245
|
+
profileColor?: string | undefined;
|
|
246
|
+
cdpUrl?: string | undefined;
|
|
247
|
+
cdpPort?: number | undefined;
|
|
248
|
+
executablePath?: string | undefined;
|
|
249
|
+
args?: string[] | undefined;
|
|
250
|
+
windowBounds?: {
|
|
251
|
+
x?: number | undefined;
|
|
252
|
+
y?: number | undefined;
|
|
253
|
+
width?: number | undefined;
|
|
254
|
+
height?: number | undefined;
|
|
255
|
+
} | undefined;
|
|
256
|
+
sessionsDir?: string | undefined;
|
|
257
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
258
|
+
trackingAgentId?: string | undefined;
|
|
259
|
+
}>;
|
|
260
|
+
defaultInstance?: string | undefined;
|
|
261
|
+
}, {
|
|
262
|
+
instances?: Record<string, {
|
|
263
|
+
userDataDir: string;
|
|
264
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
265
|
+
headless?: boolean | undefined;
|
|
266
|
+
profileName?: string | undefined;
|
|
267
|
+
profileColor?: string | undefined;
|
|
268
|
+
cdpUrl?: string | undefined;
|
|
269
|
+
cdpHost?: string | undefined;
|
|
270
|
+
cdpPort?: number | undefined;
|
|
271
|
+
channel?: "chrome" | "chromium" | "msedge" | undefined;
|
|
272
|
+
executablePath?: string | undefined;
|
|
273
|
+
args?: string[] | undefined;
|
|
274
|
+
windowBounds?: {
|
|
275
|
+
x?: number | undefined;
|
|
276
|
+
y?: number | undefined;
|
|
277
|
+
width?: number | undefined;
|
|
278
|
+
height?: number | undefined;
|
|
279
|
+
} | undefined;
|
|
280
|
+
sessionsDir?: string | undefined;
|
|
281
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
282
|
+
trackingAgentId?: string | undefined;
|
|
283
|
+
}> | undefined;
|
|
284
|
+
defaultInstance?: string | undefined;
|
|
285
|
+
}>, {
|
|
286
|
+
instances: Record<string, {
|
|
287
|
+
mode: "managed-cdp" | "remote-cdp" | "existing-session";
|
|
288
|
+
cdpHost: string;
|
|
289
|
+
channel: "chrome" | "chromium" | "msedge";
|
|
290
|
+
userDataDir: string;
|
|
291
|
+
headless?: boolean | undefined;
|
|
292
|
+
profileName?: string | undefined;
|
|
293
|
+
profileColor?: string | undefined;
|
|
294
|
+
cdpUrl?: string | undefined;
|
|
295
|
+
cdpPort?: number | undefined;
|
|
296
|
+
executablePath?: string | undefined;
|
|
297
|
+
args?: string[] | undefined;
|
|
298
|
+
windowBounds?: {
|
|
299
|
+
x?: number | undefined;
|
|
300
|
+
y?: number | undefined;
|
|
301
|
+
width?: number | undefined;
|
|
302
|
+
height?: number | undefined;
|
|
303
|
+
} | undefined;
|
|
304
|
+
sessionsDir?: string | undefined;
|
|
305
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
306
|
+
trackingAgentId?: string | undefined;
|
|
307
|
+
}>;
|
|
308
|
+
defaultInstance?: string | undefined;
|
|
309
|
+
}, {
|
|
310
|
+
instances?: Record<string, {
|
|
311
|
+
userDataDir: string;
|
|
312
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
313
|
+
headless?: boolean | undefined;
|
|
314
|
+
profileName?: string | undefined;
|
|
315
|
+
profileColor?: string | undefined;
|
|
316
|
+
cdpUrl?: string | undefined;
|
|
317
|
+
cdpHost?: string | undefined;
|
|
318
|
+
cdpPort?: number | undefined;
|
|
319
|
+
channel?: "chrome" | "chromium" | "msedge" | undefined;
|
|
320
|
+
executablePath?: string | undefined;
|
|
321
|
+
args?: string[] | undefined;
|
|
322
|
+
windowBounds?: {
|
|
323
|
+
x?: number | undefined;
|
|
324
|
+
y?: number | undefined;
|
|
325
|
+
width?: number | undefined;
|
|
326
|
+
height?: number | undefined;
|
|
327
|
+
} | undefined;
|
|
328
|
+
sessionsDir?: string | undefined;
|
|
329
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
330
|
+
trackingAgentId?: string | undefined;
|
|
331
|
+
}> | undefined;
|
|
332
|
+
defaultInstance?: string | undefined;
|
|
333
|
+
}>;
|
|
334
|
+
export type BrowserInstancesConfig = z.infer<typeof BrowserInstancesConfigSchema>;
|
|
2
335
|
export declare function loadRuntimeConfigFromEnv(env?: NodeJS.ProcessEnv): BrowserRuntimeConfig;
|
|
336
|
+
export declare function loadBrowserInstancesConfigFromEnv(env?: NodeJS.ProcessEnv): BrowserInstancesConfig | undefined;
|
package/dist/runtime-holder.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { BrowserRuntime, BrowserContextManager, SessionStore } from "@roll-agent/browser";
|
|
2
2
|
import type { BrowserRuntimeConfig } from "@roll-agent/browser";
|
|
3
|
-
|
|
3
|
+
import { BrowserInstancePool, type BrowserRuntimeBundle } from "./browser-instance-pool.ts";
|
|
4
|
+
import type { BrowserInstancesConfig } from "./runtime-config.ts";
|
|
5
|
+
export declare function initRuntime(config: BrowserRuntimeConfig, instancesConfig?: BrowserInstancesConfig): Promise<void>;
|
|
4
6
|
export declare function getRuntime(): BrowserRuntime;
|
|
5
7
|
export declare function getContextManager(): BrowserContextManager;
|
|
6
8
|
export declare function getSessionStore(): SessionStore;
|
|
7
9
|
export declare function setReplyAuthorityKeysLoaded(loaded: boolean): void;
|
|
8
10
|
export declare function getReplyAuthorityKeysLoaded(): boolean;
|
|
11
|
+
export declare function getBrowserInstancePoolOrUndefined(): BrowserInstancePool | undefined;
|
|
12
|
+
export declare function getBrowserInstancePool(): BrowserInstancePool;
|
|
13
|
+
export declare function ensureCurrentBundleStarted(): Promise<void>;
|
|
14
|
+
export declare function isConfiguredMultiBrowserInstancePool(): boolean;
|
|
15
|
+
export declare function resolveRecruitmentTrackingAgentId(defaultAgentId?: string): string | undefined;
|
|
16
|
+
export declare function getCurrentBrowserBundle(): BrowserRuntimeBundle;
|
|
9
17
|
export declare function setRuntimeStateForTests(state: {
|
|
10
18
|
readonly runtime?: BrowserRuntime;
|
|
11
19
|
readonly contextManager?: BrowserContextManager;
|
|
12
20
|
readonly sessionStore?: SessionStore;
|
|
21
|
+
readonly instancePool?: BrowserInstancePool;
|
|
13
22
|
}): void;
|
|
14
23
|
export declare function shutdownRuntime(): Promise<void>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnyToolDefinition } from "@roll-agent/sdk";
|
|
2
|
+
import type { Platform } from "@roll-agent/browser";
|
|
3
|
+
export interface BrowserInstanceToolOptions {
|
|
4
|
+
readonly startRuntime?: boolean;
|
|
5
|
+
readonly expectedPlatform?: Platform;
|
|
6
|
+
}
|
|
7
|
+
export declare function inferExpectedPlatformFromToolName(toolName: string): Platform | undefined;
|
|
8
|
+
export declare function withBrowserInstanceInput(tool: AnyToolDefinition, options?: BrowserInstanceToolOptions): AnyToolDefinition;
|
|
@@ -11,22 +11,22 @@ export declare const BrowserElementRefTargetSchema: z.ZodObject<{
|
|
|
11
11
|
frameId: z.ZodOptional<z.ZodString>;
|
|
12
12
|
disabled: z.ZodBoolean;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
14
16
|
ref: string;
|
|
15
17
|
role: string;
|
|
16
18
|
name: string;
|
|
17
19
|
disabled: boolean;
|
|
18
|
-
x: number;
|
|
19
|
-
y: number;
|
|
20
20
|
resolvedBy: "backend_node_id" | "role_name_nth";
|
|
21
21
|
backendNodeId?: number | undefined;
|
|
22
22
|
frameId?: string | undefined;
|
|
23
23
|
}, {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
24
26
|
ref: string;
|
|
25
27
|
role: string;
|
|
26
28
|
name: string;
|
|
27
29
|
disabled: boolean;
|
|
28
|
-
x: number;
|
|
29
|
-
y: number;
|
|
30
30
|
resolvedBy: "backend_node_id" | "role_name_nth";
|
|
31
31
|
backendNodeId?: number | undefined;
|
|
32
32
|
frameId?: string | undefined;
|
|
@@ -46,22 +46,22 @@ export declare const BrowserElementRefActionOutputSchema: z.ZodObject<{
|
|
|
46
46
|
frameId: z.ZodOptional<z.ZodString>;
|
|
47
47
|
disabled: z.ZodBoolean;
|
|
48
48
|
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
x: number;
|
|
50
|
+
y: number;
|
|
49
51
|
ref: string;
|
|
50
52
|
role: string;
|
|
51
53
|
name: string;
|
|
52
54
|
disabled: boolean;
|
|
53
|
-
x: number;
|
|
54
|
-
y: number;
|
|
55
55
|
resolvedBy: "backend_node_id" | "role_name_nth";
|
|
56
56
|
backendNodeId?: number | undefined;
|
|
57
57
|
frameId?: string | undefined;
|
|
58
58
|
}, {
|
|
59
|
+
x: number;
|
|
60
|
+
y: number;
|
|
59
61
|
ref: string;
|
|
60
62
|
role: string;
|
|
61
63
|
name: string;
|
|
62
64
|
disabled: boolean;
|
|
63
|
-
x: number;
|
|
64
|
-
y: number;
|
|
65
65
|
resolvedBy: "backend_node_id" | "role_name_nth";
|
|
66
66
|
backendNodeId?: number | undefined;
|
|
67
67
|
frameId?: string | undefined;
|
|
@@ -69,12 +69,12 @@ export declare const BrowserElementRefActionOutputSchema: z.ZodObject<{
|
|
|
69
69
|
}, "strip", z.ZodTypeAny, {
|
|
70
70
|
ref: string;
|
|
71
71
|
target: {
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
72
74
|
ref: string;
|
|
73
75
|
role: string;
|
|
74
76
|
name: string;
|
|
75
77
|
disabled: boolean;
|
|
76
|
-
x: number;
|
|
77
|
-
y: number;
|
|
78
78
|
resolvedBy: "backend_node_id" | "role_name_nth";
|
|
79
79
|
backendNodeId?: number | undefined;
|
|
80
80
|
frameId?: string | undefined;
|
|
@@ -84,12 +84,12 @@ export declare const BrowserElementRefActionOutputSchema: z.ZodObject<{
|
|
|
84
84
|
}, {
|
|
85
85
|
ref: string;
|
|
86
86
|
target: {
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
87
89
|
ref: string;
|
|
88
90
|
role: string;
|
|
89
91
|
name: string;
|
|
90
92
|
disabled: boolean;
|
|
91
|
-
x: number;
|
|
92
|
-
y: number;
|
|
93
93
|
resolvedBy: "backend_node_id" | "role_name_nth";
|
|
94
94
|
backendNodeId?: number | undefined;
|
|
95
95
|
frameId?: string | undefined;
|
|
@@ -14,6 +14,7 @@ export declare const browserStatus: import("@roll-agent/sdk").ToolDefinition<{},
|
|
|
14
14
|
pagesOpen: number;
|
|
15
15
|
hasLoginState: boolean | null;
|
|
16
16
|
loginStateSource: "snapshot" | "profile" | "none" | "unknown";
|
|
17
|
+
browserInstance?: string | undefined;
|
|
17
18
|
currentUrl?: string | undefined;
|
|
18
19
|
}[];
|
|
19
20
|
replyAuthorityKeysLoaded: boolean;
|
|
@@ -33,4 +34,26 @@ export declare const browserStatus: import("@roll-agent/sdk").ToolDefinition<{},
|
|
|
33
34
|
present: boolean;
|
|
34
35
|
fingerprint?: string | undefined;
|
|
35
36
|
}>;
|
|
37
|
+
defaultInstanceId?: string | undefined;
|
|
38
|
+
primaryInstanceId?: string | undefined;
|
|
39
|
+
instances?: {
|
|
40
|
+
id: string;
|
|
41
|
+
mode: "managed-cdp" | "remote-cdp" | "existing-session";
|
|
42
|
+
profile: {
|
|
43
|
+
exists: boolean;
|
|
44
|
+
writable: boolean;
|
|
45
|
+
userDataDir?: string | undefined;
|
|
46
|
+
};
|
|
47
|
+
cdp: {
|
|
48
|
+
endpoint: string;
|
|
49
|
+
versionReachable: boolean;
|
|
50
|
+
listReachable: boolean;
|
|
51
|
+
port?: number | undefined;
|
|
52
|
+
};
|
|
53
|
+
tracking: {
|
|
54
|
+
source: "instance" | "default-env" | "missing";
|
|
55
|
+
agentIdFingerprint?: string | undefined;
|
|
56
|
+
};
|
|
57
|
+
platform?: "zhipin" | "yupao" | undefined;
|
|
58
|
+
}[] | undefined;
|
|
36
59
|
}>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { type BrowserInstanceStopResult } from "../browser-instance-pool.ts";
|
|
3
|
+
declare const BrowserStopInputSchema: z.ZodEffects<z.ZodObject<{
|
|
4
|
+
browserInstance: z.ZodOptional<z.ZodString>;
|
|
5
|
+
browserInstances: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
6
|
+
all: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
browserInstance?: string | undefined;
|
|
9
|
+
browserInstances?: string[] | undefined;
|
|
10
|
+
all?: boolean | undefined;
|
|
11
|
+
}, {
|
|
12
|
+
browserInstance?: string | undefined;
|
|
13
|
+
browserInstances?: string[] | undefined;
|
|
14
|
+
all?: boolean | undefined;
|
|
15
|
+
}>, {
|
|
16
|
+
browserInstance?: string | undefined;
|
|
17
|
+
browserInstances?: string[] | undefined;
|
|
18
|
+
all?: boolean | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
browserInstance?: string | undefined;
|
|
21
|
+
browserInstances?: string[] | undefined;
|
|
22
|
+
all?: boolean | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
declare const BrowserStopOutputSchema: z.ZodObject<{
|
|
25
|
+
ok: z.ZodBoolean;
|
|
26
|
+
stopped: z.ZodNumber;
|
|
27
|
+
results: z.ZodArray<z.ZodObject<{
|
|
28
|
+
browserInstance: z.ZodString;
|
|
29
|
+
status: z.ZodEnum<["stopped", "not_running", "not_found", "failed"]>;
|
|
30
|
+
mode: z.ZodOptional<z.ZodEnum<["managed-cdp", "remote-cdp", "existing-session"]>>;
|
|
31
|
+
message: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
status: "not_found" | "failed" | "stopped" | "not_running";
|
|
34
|
+
browserInstance: string;
|
|
35
|
+
message?: string | undefined;
|
|
36
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
37
|
+
}, {
|
|
38
|
+
status: "not_found" | "failed" | "stopped" | "not_running";
|
|
39
|
+
browserInstance: string;
|
|
40
|
+
message?: string | undefined;
|
|
41
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
42
|
+
}>, "many">;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
stopped: number;
|
|
45
|
+
ok: boolean;
|
|
46
|
+
results: {
|
|
47
|
+
status: "not_found" | "failed" | "stopped" | "not_running";
|
|
48
|
+
browserInstance: string;
|
|
49
|
+
message?: string | undefined;
|
|
50
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
51
|
+
}[];
|
|
52
|
+
}, {
|
|
53
|
+
stopped: number;
|
|
54
|
+
ok: boolean;
|
|
55
|
+
results: {
|
|
56
|
+
status: "not_found" | "failed" | "stopped" | "not_running";
|
|
57
|
+
browserInstance: string;
|
|
58
|
+
message?: string | undefined;
|
|
59
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
60
|
+
}[];
|
|
61
|
+
}>;
|
|
62
|
+
type BrowserStopInput = z.infer<typeof BrowserStopInputSchema>;
|
|
63
|
+
type BrowserStopOutput = z.infer<typeof BrowserStopOutputSchema>;
|
|
64
|
+
export declare const browserStop: import("@roll-agent/sdk").ToolDefinition<{
|
|
65
|
+
browserInstance?: string | undefined;
|
|
66
|
+
browserInstances?: string[] | undefined;
|
|
67
|
+
all?: boolean | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
stopped: number;
|
|
70
|
+
ok: boolean;
|
|
71
|
+
results: {
|
|
72
|
+
status: "not_found" | "failed" | "stopped" | "not_running";
|
|
73
|
+
browserInstance: string;
|
|
74
|
+
message?: string | undefined;
|
|
75
|
+
mode?: "managed-cdp" | "remote-cdp" | "existing-session" | undefined;
|
|
76
|
+
}[];
|
|
77
|
+
}>;
|
|
78
|
+
export declare function resolveBrowserStopTargets(input: BrowserStopInput, availableInstances: readonly string[]): readonly string[];
|
|
79
|
+
export declare function createBrowserStopOutput(results: readonly BrowserInstanceStopResult[]): BrowserStopOutput;
|
|
80
|
+
export {};
|
|
@@ -7,12 +7,12 @@ export declare const clickRef: import("@roll-agent/sdk").ToolDefinition<{
|
|
|
7
7
|
}, {
|
|
8
8
|
ref: string;
|
|
9
9
|
target: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
10
12
|
ref: string;
|
|
11
13
|
role: string;
|
|
12
14
|
name: string;
|
|
13
15
|
disabled: boolean;
|
|
14
|
-
x: number;
|
|
15
|
-
y: number;
|
|
16
16
|
resolvedBy: "backend_node_id" | "role_name_nth";
|
|
17
17
|
backendNodeId?: number | undefined;
|
|
18
18
|
frameId?: string | undefined;
|
package/dist/tools/type-ref.d.ts
CHANGED
|
@@ -9,12 +9,12 @@ export declare const typeRef: import("@roll-agent/sdk").ToolDefinition<{
|
|
|
9
9
|
}, {
|
|
10
10
|
ref: string;
|
|
11
11
|
target: {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
12
14
|
ref: string;
|
|
13
15
|
role: string;
|
|
14
16
|
name: string;
|
|
15
17
|
disabled: boolean;
|
|
16
|
-
x: number;
|
|
17
|
-
y: number;
|
|
18
18
|
resolvedBy: "backend_node_id" | "role_name_nth";
|
|
19
19
|
backendNodeId?: number | undefined;
|
|
20
20
|
frameId?: string | undefined;
|
|
@@ -11,8 +11,8 @@ export declare function setZhipinGetUsernameDepsForTests(override: Partial<Zhipi
|
|
|
11
11
|
export declare const zhipinGetUsername: import("@roll-agent/sdk").ToolDefinition<{}, {
|
|
12
12
|
success: boolean;
|
|
13
13
|
username: string;
|
|
14
|
-
error?: string | undefined;
|
|
15
14
|
source?: string | undefined;
|
|
15
|
+
error?: string | undefined;
|
|
16
16
|
usedSelector?: string | undefined;
|
|
17
17
|
usedStrategy?: string | undefined;
|
|
18
18
|
}>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/browser-use-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"zod": "^3.25.76",
|
|
48
48
|
"@roll-agent/reply-authority-client": "0.1.2",
|
|
49
49
|
"@roll-agent/sdk": "0.2.0",
|
|
50
|
-
"@roll-agent/browser": "0.
|
|
50
|
+
"@roll-agent/browser": "0.8.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^22.0.0"
|
package/references/env.yaml
CHANGED
|
@@ -9,7 +9,7 @@ required:
|
|
|
9
9
|
purpose: Reply Authority Service 公钥分发端点;`zhipin_send_prepared_reply` 启动预热和本地 Ed25519 验签都依赖它
|
|
10
10
|
example: https://reply-authority.duliday.com/.well-known/reply-authority-keys
|
|
11
11
|
- name: RECRUITMENT_EVENTS_DEFAULT_AGENT_ID
|
|
12
|
-
purpose: 单 browser-use 实例 / 单 Boss 账号部署下的默认招聘业务 Agent ID
|
|
12
|
+
purpose: 单 browser-use 实例 / 单 Boss 账号部署下的默认招聘业务 Agent ID;多 browser.instances 下仅作为实例缺少 trackingAgentId 时的 fallback;招聘事件默认启用,上报时必须有可解析归因
|
|
13
13
|
example: zhipin-shanghai-kfc-001
|
|
14
14
|
- name: RECRUITMENT_EVENTS_API_TOKEN
|
|
15
15
|
purpose: 招聘事件 Open API Bearer token;公开 npm 包不内置兜底 token,必须由部署环境提供
|
|
@@ -31,6 +31,12 @@ optional:
|
|
|
31
31
|
purpose: browser-use 工具级业务策略 JSON;可按 exact tool name 配置 log、deny、confirm
|
|
32
32
|
default: '{"approvalTtlMs":300000,"tools":{}}'
|
|
33
33
|
example: '{"approvalTtlMs":300000,"tools":{"zhipin_send_prepared_reply":{"policy":"confirm"}}}'
|
|
34
|
+
- name: BROWSER_PROFILE_COLOR
|
|
35
|
+
purpose: legacy 单浏览器运行时的 Chrome profile 颜色,格式为 `#RRGGBB`;配置了 `browser.instances` 时由每个实例的 profileColor 接管,此 env 会被忽略
|
|
36
|
+
example: "#2563EB"
|
|
37
|
+
- name: BROWSER_INSTANCES_JSON
|
|
38
|
+
purpose: Roll core 注入的多浏览器实例声明 JSON;由 `browser.instances` 派生,包含每个实例的 profile、CDP 端口、session 目录、可选 profileName/profileColor/windowBounds 和招聘事件归因 ID;orchestrator 不应手工拼接,手工配置时必须保持 cdpPort/userDataDir 唯一
|
|
39
|
+
example: '{"defaultInstance":"boss-a","instances":{"boss-a":{"platform":"zhipin","mode":"managed-cdp","cdpPort":9222,"userDataDir":"/tmp/roll-browser/profiles/boss-a","profileName":"boss-a","profileColor":"#2563EB","windowBounds":{"x":0,"y":0,"width":680,"height":1000},"trackingAgentId":"zhipin-boss-a"}}}'
|
|
34
40
|
- name: BROWSER_VISUAL_CURSOR
|
|
35
41
|
purpose: 在可见浏览器页面内显示 browser-use 的页内虚拟指针和点击波纹;默认开启,设为 `"false"` 可关闭
|
|
36
42
|
default: "true"
|