@roll-agent/browser-use-agent 0.24.1 → 0.25.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.
@@ -4,6 +4,7 @@ import type { DynamicListCollectionStopReason, DynamicListScrollResult, ScrollDi
4
4
  import { type ChatListItem, type ChatTarget, type OpenChatResult } from "./chat-navigation.ts";
5
5
  import { type ZhipinListSurface } from "./list-surfaces.ts";
6
6
  import type { ZhipinRecommendFilterApplyResult, ZhipinRecommendFilterRequest } from "./recommend-filter.ts";
7
+ import { type ZhipinResumeCanvasRect } from "./resume-dom-contract.ts";
7
8
  import type { UsernameEvidence } from "./username.ts";
8
9
  export type ZhipinNativePagePortOptions = {
9
10
  readonly target: BrowserInspectablePage;
@@ -113,6 +114,34 @@ export type NativeRecommendCardInspection = {
113
114
  export type NativeRecommendGreetResult = NativeRecommendCardInspection & {
114
115
  readonly clicked: boolean;
115
116
  };
117
+ export type NativeResumeDialogState = {
118
+ readonly dialogVisible: boolean;
119
+ readonly iframeFound: boolean;
120
+ readonly iframeVisible: boolean;
121
+ readonly canvasReady: boolean;
122
+ };
123
+ export type NativeResumeCanvasCapture = {
124
+ readonly found: boolean;
125
+ readonly screenshotArea?: ZhipinResumeCanvasRect;
126
+ readonly canvasSize?: {
127
+ readonly width: number;
128
+ readonly height: number;
129
+ };
130
+ readonly dataUrl?: string;
131
+ readonly dataUrlError?: string;
132
+ readonly blank?: boolean;
133
+ readonly error?: string;
134
+ };
135
+ export type NativeResumeStitchProgress = {
136
+ readonly round: number;
137
+ readonly scrolledPx: number;
138
+ readonly totalPx: number;
139
+ };
140
+ export type NativeResumeCloseResult = {
141
+ readonly closed: boolean;
142
+ readonly method?: "close-button" | "escape";
143
+ readonly error?: string;
144
+ };
116
145
  export type NativeRecommendJobOption = {
117
146
  readonly index: number;
118
147
  readonly value: string;
@@ -239,6 +268,16 @@ export declare class ZhipinNativePagePort {
239
268
  readCandidateChatDetails(maxMessages: number): Promise<NativeCandidateChatDetails>;
240
269
  inspectRecommendCard(index: number): Promise<NativeRecommendCardInspection>;
241
270
  clickRecommendGreet(index: number, options?: NativeClickOptions): Promise<NativeRecommendGreetResult>;
271
+ clickRecommendCardSurface(index: number, options?: NativeClickOptions): Promise<boolean>;
272
+ waitForResumeDialog(timeoutMs?: number): Promise<NativeResumeDialogState>;
273
+ readResumeCanvasGeometry(): Promise<NativeResumeCanvasCapture>;
274
+ private buildResumeCanvasGeometryExpression;
275
+ captureResumeCanvas(onProgress?: (progress: NativeResumeStitchProgress) => void | Promise<void>): Promise<NativeResumeCanvasCapture>;
276
+ captureViewportClip(clip: ZhipinResumeCanvasRect, scale?: number): Promise<string>;
277
+ readResumeDialogClipArea(): Promise<ZhipinResumeCanvasRect | undefined>;
278
+ closeResumeDialog(options?: NativeClickOptions): Promise<NativeResumeCloseResult>;
279
+ private readResumeDialogState;
280
+ private waitForResumeDialogGone;
242
281
  exchangeWechat(options?: NativeClickOptions): Promise<NativeWechatExchangeResult>;
243
282
  sendChatReply(message: string, options?: NativeClickOptions): Promise<NativeSendReplyResult>;
244
283
  applyRecommendFilter(requested: ZhipinRecommendFilterRequest, options?: NativeClickOptions): Promise<ZhipinRecommendFilterApplyResult>;
@@ -246,7 +285,15 @@ export declare class ZhipinNativePagePort {
246
285
  readUsernameEvidence(): Promise<UsernameEvidence[]>;
247
286
  close(): void;
248
287
  private buildRecommendCardInspectionExpression;
288
+ private buildRecommendCardTargetClickExpression;
249
289
  private buildRecommendGreetClickExpression;
290
+ private buildRecommendCardOpenClickExpression;
291
+ private buildResumeDialogStateExpression;
292
+ private buildResumeStitchInitExpression;
293
+ private buildResumeStitchStepExpression;
294
+ private buildResumeStitchExportExpression;
295
+ private buildResumeDialogRectExpression;
296
+ private buildResumeCloseTargetExpression;
250
297
  private waitForWechatExchangeDialog;
251
298
  private readWechatNumber;
252
299
  private selectAllFocusedText;
@@ -7,9 +7,9 @@ export declare const ZHIPIN_RESUME_CARD_LIST_SELECTOR: ".candidate-card-wrap, [d
7
7
  export declare const ZHIPIN_RESUME_CARD_CLICK_SURFACE_SELECTOR: "[data-geek], .card-inner, .geek-item";
8
8
  export declare const ZHIPIN_RESUME_CANDIDATE_ID_SELECTOR: "[data-geek]";
9
9
  export declare const ZHIPIN_RESUME_CANDIDATE_NAME_SELECTOR: ".name";
10
- export declare const ZHIPIN_RESUME_IFRAME_CLOSE_SELECTORS: readonly [".recommendV2 .boss-popup__close", ".dialog-lib-resume .boss-popup__close", ".boss-dialog .boss-popup__close", ".boss-popup__close", ".close-btn", ".dialog-close"];
11
- export declare const ZHIPIN_RESUME_PAGE_CLOSE_SELECTORS: readonly [".boss-popup__close", ".close-btn", ".dialog-close", ".modal-close"];
12
- export declare const ZHIPIN_RESUME_DIALOG_SELECTOR: ".boss-popup__wrapper, .dialog-lib-resume, .boss-dialog";
10
+ export declare const ZHIPIN_RESUME_DIALOG_SELECTOR: ".boss-popup__wrapper, .dialog-lib-resume, .boss-dialog, [data-type=\"boss-dialog\"]";
11
+ export declare const ZHIPIN_RESUME_CLOSE_SCOPE_SELECTOR: ".boss-popup__wrapper, .dialog-lib-resume, .boss-dialog, [data-type=\"boss-dialog\"], .recommendV2";
12
+ export declare const ZHIPIN_RESUME_CLOSE_ELEMENT_SELECTORS: readonly [".boss-popup__close", ".close-btn", ".dialog-close", ".modal-close"];
13
13
  export declare const ZHIPIN_RESUME_PAGE_DIALOG_SELECTOR: ".boss-popup__wrapper";
14
14
  export declare const ZHIPIN_RESUME_IFRAME_SELECTOR: "iframe[src*=\"c-resume\"]";
15
15
  export declare const ZHIPIN_RESUME_CANVAS_SELECTOR: "canvas#resume, div#resume canvas";
@@ -0,0 +1,25 @@
1
+ import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
2
+ type ZhipinCaptureResumeDeps = {
3
+ readonly openNativePagePort: typeof openZhipinNativePagePort;
4
+ readonly writePngFile: (path: string, base64Data: string) => Promise<void>;
5
+ readonly now: () => number;
6
+ };
7
+ export declare function setZhipinCaptureResumeDepsForTests(override: Partial<ZhipinCaptureResumeDeps> | undefined): void;
8
+ export declare const zhipinCaptureResume: import("@roll-agent/sdk").ToolDefinition<{
9
+ outputPath?: string | undefined;
10
+ }, {
11
+ success: boolean;
12
+ error?: string | undefined;
13
+ mcpImages?: {
14
+ data: string;
15
+ mimeType: string;
16
+ }[] | undefined;
17
+ note?: string | undefined;
18
+ canvasSize?: {
19
+ width: number;
20
+ height: number;
21
+ } | undefined;
22
+ imagePath?: string | undefined;
23
+ captureMode?: "canvas-data-url" | "viewport-clip" | "dom-screenshot" | undefined;
24
+ }>;
25
+ export {};
@@ -1,5 +1,12 @@
1
+ import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
2
+ type ZhipinCloseResumeDeps = {
3
+ readonly openNativePagePort: typeof openZhipinNativePagePort;
4
+ };
5
+ export declare function setZhipinCloseResumeDepsForTests(override: Partial<ZhipinCloseResumeDeps> | undefined): void;
1
6
  export declare const zhipinCloseResume: import("@roll-agent/sdk").ToolDefinition<{}, {
2
7
  success: boolean;
3
8
  closed: boolean;
4
9
  error?: string | undefined;
10
+ method?: "close-button" | "escape" | undefined;
5
11
  }>;
12
+ export {};
@@ -163,14 +163,14 @@ export declare function summarizeCookie(cookie: {
163
163
  }): CookieSummary;
164
164
  export declare function diffStorageCounters(beforeEntries: ReadonlyArray<StorageEntrySummary>, afterEntries: ReadonlyArray<StorageEntrySummary>): StorageCounterDiff[];
165
165
  export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolDefinition<{
166
- phase?: "native" | "native-watch" | "native-ws-connect" | "native-page-bring-front" | "native-evaluate-url-no-runtime-enable" | "native-dom-read-no-runtime-enable" | "native-input-move-no-runtime-enable" | "native-runtime-enable" | "native-evaluate-url" | "native-dom-read" | "browser-attach" | "page-attach" | "network-watch" | "page-evaluate" | "detector-fingerprint" | "storage-summary" | undefined;
166
+ phase?: "native" | "native-watch" | "native-ws-connect" | "native-page-bring-front" | "native-evaluate-url-no-runtime-enable" | "native-dom-read-no-runtime-enable" | "native-input-move-no-runtime-enable" | "native-runtime-enable" | "native-evaluate-url" | "native-dom-read" | "resume-canvas" | "browser-attach" | "page-attach" | "network-watch" | "page-evaluate" | "detector-fingerprint" | "storage-summary" | undefined;
167
167
  targetPageId?: string | undefined;
168
168
  watchMs?: number | undefined;
169
169
  networkEventLimit?: number | undefined;
170
170
  }, {
171
171
  mode: string;
172
172
  success: boolean;
173
- requestedPhase: "native" | "native-watch" | "native-ws-connect" | "native-page-bring-front" | "native-evaluate-url-no-runtime-enable" | "native-dom-read-no-runtime-enable" | "native-input-move-no-runtime-enable" | "native-runtime-enable" | "native-evaluate-url" | "native-dom-read" | "browser-attach" | "page-attach" | "network-watch" | "page-evaluate" | "detector-fingerprint" | "storage-summary";
173
+ requestedPhase: "native" | "native-watch" | "native-ws-connect" | "native-page-bring-front" | "native-evaluate-url-no-runtime-enable" | "native-dom-read-no-runtime-enable" | "native-input-move-no-runtime-enable" | "native-runtime-enable" | "native-evaluate-url" | "native-dom-read" | "resume-canvas" | "browser-attach" | "page-attach" | "network-watch" | "page-evaluate" | "detector-fingerprint" | "storage-summary";
174
174
  nativePages: {
175
175
  pageId: string;
176
176
  url: string;
@@ -182,7 +182,7 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
182
182
  browserAttached: boolean;
183
183
  pageAttached: boolean;
184
184
  nativeTimeline: {
185
- phase: "native" | "native-watch" | "native-ws-connect" | "native-page-bring-front" | "native-evaluate-url-no-runtime-enable" | "native-dom-read-no-runtime-enable" | "native-input-move-no-runtime-enable" | "native-runtime-enable" | "native-evaluate-url" | "native-dom-read" | "browser-attach" | "page-attach" | "network-watch" | "page-evaluate" | "detector-fingerprint" | "storage-summary" | "native-ws-connect-watch" | "native-page-bring-front-watch" | "native-evaluate-url-no-runtime-enable-watch" | "native-dom-read-no-runtime-enable-watch" | "native-input-move-no-runtime-enable-watch" | "native-runtime-enable-watch" | "native-evaluate-url-watch" | "native-dom-read-watch" | "browser-attach-watch";
185
+ phase: "native" | "native-watch" | "native-ws-connect" | "native-page-bring-front" | "native-evaluate-url-no-runtime-enable" | "native-dom-read-no-runtime-enable" | "native-input-move-no-runtime-enable" | "native-runtime-enable" | "native-evaluate-url" | "native-dom-read" | "resume-canvas" | "browser-attach" | "page-attach" | "network-watch" | "page-evaluate" | "detector-fingerprint" | "storage-summary" | "native-ws-connect-watch" | "native-page-bring-front-watch" | "native-evaluate-url-no-runtime-enable-watch" | "native-dom-read-no-runtime-enable-watch" | "native-input-move-no-runtime-enable-watch" | "native-runtime-enable-watch" | "native-evaluate-url-watch" | "native-dom-read-watch" | "browser-attach-watch";
186
186
  capturedAt: string;
187
187
  targetFound: boolean;
188
188
  urlChangedFromPrevious: boolean;
@@ -203,7 +203,7 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
203
203
  phases: {
204
204
  success: boolean;
205
205
  durationMs: number;
206
- phase: "native" | "native-watch" | "native-ws-connect" | "native-page-bring-front" | "native-evaluate-url-no-runtime-enable" | "native-dom-read-no-runtime-enable" | "native-input-move-no-runtime-enable" | "native-runtime-enable" | "native-evaluate-url" | "native-dom-read" | "browser-attach" | "page-attach" | "network-watch" | "page-evaluate" | "detector-fingerprint" | "storage-summary";
206
+ phase: "native" | "native-watch" | "native-ws-connect" | "native-page-bring-front" | "native-evaluate-url-no-runtime-enable" | "native-dom-read-no-runtime-enable" | "native-input-move-no-runtime-enable" | "native-runtime-enable" | "native-evaluate-url" | "native-dom-read" | "resume-canvas" | "browser-attach" | "page-attach" | "network-watch" | "page-evaluate" | "detector-fingerprint" | "storage-summary";
207
207
  error?: string | undefined;
208
208
  }[];
209
209
  warnings: string[];
@@ -224,8 +224,8 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
224
224
  networkEvents?: {
225
225
  url: string;
226
226
  reason: "apm-action-log" | "device-action-report" | "boss-risk-report" | "zhipin-security";
227
- capturedAt: string;
228
227
  kind: "request" | "response";
228
+ capturedAt: string;
229
229
  status?: number | undefined;
230
230
  method?: string | undefined;
231
231
  resourceType?: string | undefined;
@@ -243,14 +243,14 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
243
243
  x: number;
244
244
  y: number;
245
245
  } | undefined;
246
- pageBroughtToFront?: boolean | undefined;
247
- runtimeEnabled?: boolean | undefined;
248
246
  evaluate?: {
249
247
  url: string;
250
248
  title: string;
251
249
  visibilityState: string;
252
250
  hasFocus: boolean;
253
251
  } | undefined;
252
+ pageBroughtToFront?: boolean | undefined;
253
+ runtimeEnabled?: boolean | undefined;
254
254
  dom?: {
255
255
  rootNodeId: number;
256
256
  rootNodeName: string;
@@ -259,6 +259,23 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
259
259
  elementCount?: number | undefined;
260
260
  } | undefined;
261
261
  } | undefined;
262
+ resumeCanvas?: {
263
+ dialogVisible: boolean;
264
+ iframeFound: boolean;
265
+ iframeVisible: boolean;
266
+ canvasReady: boolean;
267
+ error?: string | undefined;
268
+ canvasSize?: {
269
+ width: number;
270
+ height: number;
271
+ } | undefined;
272
+ screenshotArea?: {
273
+ x: number;
274
+ y: number;
275
+ width: number;
276
+ height: number;
277
+ } | undefined;
278
+ } | undefined;
262
279
  detectorFingerprint?: {
263
280
  userAgentContainsHeadless: boolean;
264
281
  languagesLength: number;
@@ -1,3 +1,8 @@
1
+ import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
2
+ type ZhipinOpenResumeDeps = {
3
+ readonly openNativePagePort: typeof openZhipinNativePagePort;
4
+ };
5
+ export declare function setZhipinOpenResumeDepsForTests(override: Partial<ZhipinOpenResumeDeps> | undefined): void;
1
6
  export declare const zhipinOpenResume: import("@roll-agent/sdk").ToolDefinition<{
2
7
  index?: number | undefined;
3
8
  candidateRef?: string | undefined;
@@ -7,4 +12,6 @@ export declare const zhipinOpenResume: import("@roll-agent/sdk").ToolDefinition<
7
12
  candidateName: string;
8
13
  error?: string | undefined;
9
14
  candidateRef?: string | undefined;
15
+ resumeReady?: boolean | undefined;
10
16
  }>;
17
+ export {};
@@ -15,6 +15,9 @@ export declare const zhipinScrollView: import("@roll-agent/sdk").ToolDefinition<
15
15
  settleMs?: number | undefined;
16
16
  }, {
17
17
  success: boolean;
18
+ direction: "up" | "down";
19
+ stepsRequested: number;
20
+ stepsCompleted: number;
18
21
  before: {
19
22
  containerFound: boolean;
20
23
  containerLabel: string;
@@ -35,11 +38,8 @@ export declare const zhipinScrollView: import("@roll-agent/sdk").ToolDefinition<
35
38
  atEnd: boolean;
36
39
  itemCount: number;
37
40
  };
38
- position: "unknown" | "middle" | "top" | "bottom" | "only-page";
39
- direction: "up" | "down";
40
- stepsRequested: number;
41
- stepsCompleted: number;
42
41
  reachedBoundary: boolean;
42
+ position: "unknown" | "middle" | "top" | "bottom" | "only-page";
43
43
  surface: "chat-list" | "chat-history" | "recommend-list";
44
44
  atTop: boolean;
45
45
  atBottom: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roll-agent/browser-use-agent",
3
- "version": "0.24.1",
3
+ "version": "0.25.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,8 +46,8 @@
46
46
  "dependencies": {
47
47
  "zod": "^3.25.76",
48
48
  "@roll-agent/reply-authority-client": "0.7.0",
49
- "@roll-agent/browser": "0.9.1",
50
- "@roll-agent/sdk": "0.4.0"
49
+ "@roll-agent/sdk": "0.5.0",
50
+ "@roll-agent/browser": "0.10.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^22.0.0"
@@ -1,14 +0,0 @@
1
- export declare const zhipinLocateResumeCanvas: import("@roll-agent/sdk").ToolDefinition<{}, {
2
- success: boolean;
3
- error?: string | undefined;
4
- screenshotArea?: {
5
- x: number;
6
- y: number;
7
- width: number;
8
- height: number;
9
- } | undefined;
10
- canvasInfo?: {
11
- width: number;
12
- height: number;
13
- } | undefined;
14
- }>;