@roll-agent/browser-use-agent 0.7.4 → 0.7.6

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.
@@ -0,0 +1,24 @@
1
+ import type { VisualActivityTone } from "./visual-activity.ts";
2
+ type NativeVisualTarget = {
3
+ evaluateJson<T = unknown>(expression: string): Promise<T>;
4
+ };
5
+ type NativeVisualHighlightOptions = {
6
+ readonly label?: string;
7
+ readonly padding?: number;
8
+ readonly tone?: VisualActivityTone;
9
+ };
10
+ type NativeVisualPointOptions = {
11
+ readonly durationMs?: number;
12
+ };
13
+ export declare class NativeVisualActivitySession {
14
+ private readonly target;
15
+ constructor(target: NativeVisualTarget);
16
+ begin(label: string, tone?: VisualActivityTone): Promise<boolean>;
17
+ highlightSelector(selector: string, options?: NativeVisualHighlightOptions): Promise<boolean>;
18
+ highlightPoint(x: number, y: number, options?: NativeVisualPointOptions): Promise<boolean>;
19
+ succeed(label: string, lingerMs?: number): Promise<boolean>;
20
+ fail(label: string, lingerMs?: number): Promise<boolean>;
21
+ clear(): Promise<boolean>;
22
+ private render;
23
+ }
24
+ export {};
@@ -0,0 +1,196 @@
1
+ import type { BrowserContextManager, BrowserInspectablePage, BrowserRuntime, NativeCdpController } from "@roll-agent/browser";
2
+ import type { DynamicListCollectionStopReason, DynamicListScrollResult, ScrollDirection } from "../shared/dynamic-list-scroller.ts";
3
+ import { type ChatListItem, type ChatTarget, type OpenChatResult } from "./chat-navigation.ts";
4
+ import { type ZhipinListSurface } from "./list-surfaces.ts";
5
+ import type { ZhipinRecommendFilterApplyResult, ZhipinRecommendFilterRequest } from "./recommend-filter.ts";
6
+ import type { UsernameEvidence } from "./username.ts";
7
+ export type ZhipinNativePagePortOptions = {
8
+ readonly target: BrowserInspectablePage;
9
+ readonly controller: NativeCdpController;
10
+ };
11
+ export type ReadNativeChatCandidatesOptions = {
12
+ readonly targetCount?: number;
13
+ readonly autoScroll?: boolean;
14
+ readonly maxScrolls?: number;
15
+ };
16
+ export type NativeRecommendCandidateCard = {
17
+ readonly index: number;
18
+ readonly candidateId: string;
19
+ readonly name: string;
20
+ readonly age: string;
21
+ readonly experience: string;
22
+ readonly education: string;
23
+ readonly workStatus: string;
24
+ readonly company: string;
25
+ readonly currentPosition: string;
26
+ readonly expectedLocation: string;
27
+ readonly expectedPosition: string;
28
+ readonly expectedSalary: string;
29
+ readonly tags: string[];
30
+ readonly buttonText: string;
31
+ };
32
+ export type ReadNativeRecommendCandidatesOptions = {
33
+ readonly targetCount?: number;
34
+ readonly autoScroll?: boolean;
35
+ readonly maxScrolls?: number;
36
+ };
37
+ export type OpenNativeChatOptions = ChatTarget & {
38
+ readonly preferUnread?: boolean;
39
+ readonly maxScrolls?: number;
40
+ };
41
+ export type NativeChatMessage = {
42
+ readonly index: number;
43
+ readonly sender: "candidate" | "recruiter" | "system";
44
+ readonly messageType: "text" | "system" | "resume" | "wechat-exchange";
45
+ readonly content: string;
46
+ readonly time: string;
47
+ };
48
+ export type NativeChatPanelInfo = {
49
+ readonly candidateName: string;
50
+ };
51
+ export type NativeSelectedChatTarget = {
52
+ readonly conversationId: string;
53
+ readonly candidateId: string;
54
+ readonly candidateName: string;
55
+ };
56
+ export type NativeCandidateInfo = {
57
+ readonly name: string;
58
+ readonly age: string;
59
+ readonly experience: string;
60
+ readonly education: string;
61
+ readonly communicationPosition: string;
62
+ readonly expectedJobText: string;
63
+ readonly expectedSalary: string;
64
+ readonly tags: readonly string[];
65
+ };
66
+ export type NativeCandidateChatDetails = {
67
+ readonly selectedTarget: NativeSelectedChatTarget | null;
68
+ readonly activePanel: NativeChatPanelInfo | null;
69
+ readonly candidateInfo: NativeCandidateInfo;
70
+ readonly messages: readonly NativeChatMessage[];
71
+ };
72
+ export type NativeRecommendCardInspection = {
73
+ readonly found: boolean;
74
+ readonly cardSelector: string;
75
+ readonly candidateId: string;
76
+ readonly name: string;
77
+ readonly hasGreetButton: boolean;
78
+ readonly error?: string;
79
+ };
80
+ export type NativeRecommendGreetResult = NativeRecommendCardInspection & {
81
+ readonly clicked: boolean;
82
+ };
83
+ export type NativeWechatExchangeResult = {
84
+ readonly success: boolean;
85
+ readonly exchanged: boolean;
86
+ readonly wechatNumber?: string;
87
+ readonly error?: string;
88
+ };
89
+ export type NativeSendReplyResult = {
90
+ readonly success: boolean;
91
+ readonly error?: string;
92
+ };
93
+ export type NativeDynamicListCollectionResult<TItem> = DynamicListScrollResult & {
94
+ readonly items: readonly TItem[];
95
+ readonly uniqueCount: number;
96
+ readonly duplicateCount: number;
97
+ readonly noNewRounds: number;
98
+ readonly stopReason: DynamicListCollectionStopReason;
99
+ };
100
+ type NativeClickTarget = {
101
+ readonly found: boolean;
102
+ readonly x: number;
103
+ readonly y: number;
104
+ };
105
+ type NativeClickOptions = {
106
+ readonly onTargetResolved?: (target: NativeClickTarget) => Promise<void>;
107
+ readonly preClickDelayMs?: number;
108
+ readonly pressDurationMs?: number;
109
+ readonly settleMs?: number;
110
+ };
111
+ type NativePageResolutionOptions = {
112
+ readonly requireChatPage?: boolean;
113
+ };
114
+ export declare function openZhipinNativePagePort(options?: NativePageResolutionOptions, deps?: {
115
+ readonly ctxManager?: BrowserContextManager;
116
+ readonly runtime?: BrowserRuntime;
117
+ }): Promise<ZhipinNativePagePort>;
118
+ export declare class ZhipinNativePagePort {
119
+ private readonly target;
120
+ private readonly controller;
121
+ private recommendFrameContextId;
122
+ private recommendFrameContextFrameId;
123
+ constructor(options: ZhipinNativePagePortOptions);
124
+ get targetId(): string;
125
+ inspectPage(): Promise<BrowserInspectablePage>;
126
+ url(): Promise<string>;
127
+ title(): Promise<string>;
128
+ waitForSelector(selector: string, timeoutMs?: number): Promise<boolean>;
129
+ evaluateJson<T = unknown>(expression: string): Promise<T>;
130
+ bringToFront(): Promise<void>;
131
+ isChatSurfaceOpen(): Promise<boolean>;
132
+ waitForChatSurface(timeoutMs?: number): Promise<boolean>;
133
+ isRecommendSurfaceOpen(): Promise<boolean>;
134
+ waitForRecommendSurface(timeoutMs?: number): Promise<boolean>;
135
+ private resolveRecommendFrameContextId;
136
+ private evaluateRecommendFrameJson;
137
+ private readRecommendFrameOffset;
138
+ private resolveRecommendClickTarget;
139
+ private dispatchNativeClick;
140
+ hasRecommendList(): Promise<boolean>;
141
+ waitForRecommendList(timeoutMs?: number): Promise<boolean>;
142
+ clickSidebarSection(section: "chat" | "recommend", options?: NativeClickOptions): Promise<boolean>;
143
+ scrollSurface(surface: ZhipinListSurface, options?: {
144
+ readonly direction?: ScrollDirection;
145
+ readonly steps?: number;
146
+ readonly distance?: number;
147
+ readonly settleMs?: number;
148
+ }): Promise<DynamicListScrollResult>;
149
+ readChatCandidates(options?: ReadNativeChatCandidatesOptions): Promise<ChatListItem[]>;
150
+ openChat(options: OpenNativeChatOptions): Promise<OpenChatResult>;
151
+ readSelectedChatTarget(): Promise<NativeSelectedChatTarget | null>;
152
+ readActiveChatPanel(): Promise<NativeChatPanelInfo | null>;
153
+ waitForChatMessages(timeoutMs?: number): Promise<boolean>;
154
+ readCandidateChatDetails(maxMessages: number): Promise<NativeCandidateChatDetails>;
155
+ inspectRecommendCard(index: number): Promise<NativeRecommendCardInspection>;
156
+ clickRecommendGreet(index: number, options?: NativeClickOptions): Promise<NativeRecommendGreetResult>;
157
+ exchangeWechat(options?: NativeClickOptions): Promise<NativeWechatExchangeResult>;
158
+ sendChatReply(message: string, options?: NativeClickOptions): Promise<NativeSendReplyResult>;
159
+ applyRecommendFilter(requested: ZhipinRecommendFilterRequest, options?: NativeClickOptions): Promise<ZhipinRecommendFilterApplyResult>;
160
+ readRecommendCandidates(options?: ReadNativeRecommendCandidatesOptions): Promise<NativeDynamicListCollectionResult<NativeRecommendCandidateCard>>;
161
+ readUsernameEvidence(): Promise<UsernameEvidence[]>;
162
+ close(): void;
163
+ private buildRecommendCardInspectionExpression;
164
+ private buildRecommendGreetClickExpression;
165
+ private waitForWechatExchangeDialog;
166
+ private readWechatNumber;
167
+ private selectAllFocusedText;
168
+ private waitForRecommendFilterSurface;
169
+ private isRecommendFilterPanelVisible;
170
+ private openRecommendFilterPanel;
171
+ private dismissPreviousFilterPrompt;
172
+ private clickRecommendFilterOption;
173
+ private detectVipModal;
174
+ private readNativeAgeState;
175
+ private resolveNativeAgeSlider;
176
+ private dispatchNativeDrag;
177
+ private dragAgeHandleToRatio;
178
+ private estimateAgeRatio;
179
+ private clampRatio;
180
+ private setAgeHandleToNumber;
181
+ private isDesiredAgeState;
182
+ private setRecommendAgeRange;
183
+ private readSelectedRecommendOptionText;
184
+ private readNativeAppliedFilterState;
185
+ private clickRecommendFilterSubmit;
186
+ private readRecommendFilterButtonText;
187
+ private readVisibleChatCandidates;
188
+ private waitForNativeChatReady;
189
+ private clickChatCandidate;
190
+ private readVisibleRecommendCandidates;
191
+ private inspectSurface;
192
+ private scrollSurfaceWithWheel;
193
+ private scrollSurfaceOnce;
194
+ private scrollChatList;
195
+ }
196
+ export {};
@@ -0,0 +1,43 @@
1
+ export declare const ZHIPIN_RESUME_RECOMMEND_FRAME_NAME: "recommendFrame";
2
+ export declare const ZHIPIN_RESUME_RECOMMEND_FRAME_URL_MARKER: "recommend";
3
+ export declare const ZHIPIN_RESUME_RECOMMEND_FRAME_SELECTOR: "#recommendFrame";
4
+ export declare const ZHIPIN_RESUME_CARD_PRIMARY_SELECTOR: ".candidate-card-wrap";
5
+ export declare const ZHIPIN_RESUME_CARD_FALLBACK_SELECTOR: "[data-geek], .geek-item";
6
+ export declare const ZHIPIN_RESUME_CARD_LIST_SELECTOR: ".candidate-card-wrap, [data-geek], .geek-item";
7
+ export declare const ZHIPIN_RESUME_CARD_CLICK_SURFACE_SELECTOR: "[data-geek], .card-inner, .geek-item";
8
+ export declare const ZHIPIN_RESUME_CANDIDATE_ID_SELECTOR: "[data-geek]";
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";
13
+ export declare const ZHIPIN_RESUME_PAGE_DIALOG_SELECTOR: ".boss-popup__wrapper";
14
+ export declare const ZHIPIN_RESUME_IFRAME_SELECTOR: "iframe[src*=\"c-resume\"]";
15
+ export declare const ZHIPIN_RESUME_CANVAS_SELECTOR: "canvas#resume, div#resume canvas";
16
+ export declare const ZHIPIN_RESUME_RECOMMEND_TARGET_KINDS: readonly ["named-frame", "recommend-url-frame", "main-page"];
17
+ export type ZhipinResumeRecommendTargetKind = (typeof ZHIPIN_RESUME_RECOMMEND_TARGET_KINDS)[number];
18
+ export type ZhipinResumeCandidateIdentityInput = {
19
+ readonly ownDataGeek?: string | null;
20
+ readonly childDataGeek?: string | null;
21
+ readonly nameText?: string | null;
22
+ };
23
+ export type ZhipinResumeCandidateIdentity = {
24
+ readonly candidateId: string;
25
+ readonly name: string;
26
+ };
27
+ export type ZhipinResumeCanvasRect = {
28
+ readonly x: number;
29
+ readonly y: number;
30
+ readonly width: number;
31
+ readonly height: number;
32
+ };
33
+ export declare function resolveRecommendTargetKind(input: {
34
+ readonly hasNamedRecommendFrame: boolean;
35
+ readonly hasRecommendUrlFrame: boolean;
36
+ }): ZhipinResumeRecommendTargetKind;
37
+ export declare function resolveResumeCardSelector(primaryCardCount: number): string;
38
+ export declare function resolveResumeCandidateIdentity(input: ZhipinResumeCandidateIdentityInput): ZhipinResumeCandidateIdentity;
39
+ export declare function composeResumeCanvasArea(input: {
40
+ readonly recommendFrameRect?: Pick<ZhipinResumeCanvasRect, "x" | "y"> | null;
41
+ readonly resumeFrameRect?: Pick<ZhipinResumeCanvasRect, "x" | "y"> | null;
42
+ readonly canvasRect: ZhipinResumeCanvasRect;
43
+ }): ZhipinResumeCanvasRect;
@@ -90,7 +90,7 @@ export declare const ZHIPIN_SELECTORS: {
90
90
  readonly nav: {
91
91
  readonly sidebar: ".side-wrap.side-wrap-v2";
92
92
  readonly chatLink: ".side-wrap.side-wrap-v2 a[href*=\"/web/chat/index\"]";
93
- readonly recommendLink: ".side-wrap.side-wrap-v2 a[href*=\"/web/geek/recommend\"]";
93
+ readonly recommendLink: ".side-wrap.side-wrap-v2 a[href*=\"/web/chat/recommend\"]";
94
94
  };
95
95
  readonly recommend: {
96
96
  readonly iframe: "#recommendFrame";
@@ -0,0 +1,332 @@
1
+ import { z } from "zod";
2
+ declare const StorageAreaSchema: z.ZodEnum<["localStorage", "sessionStorage"]>;
3
+ declare const StorageEntrySummarySchema: z.ZodObject<{
4
+ area: z.ZodEnum<["localStorage", "sessionStorage"]>;
5
+ key: z.ZodString;
6
+ valueLength: z.ZodNumber;
7
+ valueKind: z.ZodEnum<["empty", "json", "string"]>;
8
+ jsonKind: z.ZodOptional<z.ZodEnum<["array", "object", "string", "number", "boolean", "null"]>>;
9
+ jsonTopLevelKeys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
10
+ jsonArrayLength: z.ZodOptional<z.ZodNumber>;
11
+ numericFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
12
+ booleanFields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
13
+ arrayLengths: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ key: string;
16
+ area: "localStorage" | "sessionStorage";
17
+ valueLength: number;
18
+ valueKind: "string" | "empty" | "json";
19
+ jsonKind?: "string" | "number" | "boolean" | "object" | "array" | "null" | undefined;
20
+ jsonTopLevelKeys?: string[] | undefined;
21
+ jsonArrayLength?: number | undefined;
22
+ numericFields?: Record<string, number> | undefined;
23
+ booleanFields?: Record<string, boolean> | undefined;
24
+ arrayLengths?: Record<string, number> | undefined;
25
+ }, {
26
+ key: string;
27
+ area: "localStorage" | "sessionStorage";
28
+ valueLength: number;
29
+ valueKind: "string" | "empty" | "json";
30
+ jsonKind?: "string" | "number" | "boolean" | "object" | "array" | "null" | undefined;
31
+ jsonTopLevelKeys?: string[] | undefined;
32
+ jsonArrayLength?: number | undefined;
33
+ numericFields?: Record<string, number> | undefined;
34
+ booleanFields?: Record<string, boolean> | undefined;
35
+ arrayLengths?: Record<string, number> | undefined;
36
+ }>;
37
+ declare const CookieSummarySchema: z.ZodObject<{
38
+ name: z.ZodString;
39
+ domain: z.ZodString;
40
+ path: z.ZodString;
41
+ expires: z.ZodString;
42
+ valueLength: z.ZodNumber;
43
+ httpOnly: z.ZodBoolean;
44
+ secure: z.ZodBoolean;
45
+ sameSite: z.ZodOptional<z.ZodString>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ path: string;
48
+ name: string;
49
+ valueLength: number;
50
+ domain: string;
51
+ expires: string;
52
+ httpOnly: boolean;
53
+ secure: boolean;
54
+ sameSite?: string | undefined;
55
+ }, {
56
+ path: string;
57
+ name: string;
58
+ valueLength: number;
59
+ domain: string;
60
+ expires: string;
61
+ httpOnly: boolean;
62
+ secure: boolean;
63
+ sameSite?: string | undefined;
64
+ }>;
65
+ declare const StorageCounterDiffSchema: z.ZodObject<{
66
+ area: z.ZodEnum<["localStorage", "sessionStorage"]>;
67
+ key: z.ZodString;
68
+ beforePresent: z.ZodBoolean;
69
+ afterPresent: z.ZodBoolean;
70
+ numericDeltas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
71
+ before: z.ZodOptional<z.ZodNumber>;
72
+ after: z.ZodOptional<z.ZodNumber>;
73
+ delta: z.ZodOptional<z.ZodNumber>;
74
+ }, "strip", z.ZodTypeAny, {
75
+ before?: number | undefined;
76
+ after?: number | undefined;
77
+ delta?: number | undefined;
78
+ }, {
79
+ before?: number | undefined;
80
+ after?: number | undefined;
81
+ delta?: number | undefined;
82
+ }>>>;
83
+ booleanChanges: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
84
+ before: z.ZodOptional<z.ZodBoolean>;
85
+ after: z.ZodOptional<z.ZodBoolean>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ before?: boolean | undefined;
88
+ after?: boolean | undefined;
89
+ }, {
90
+ before?: boolean | undefined;
91
+ after?: boolean | undefined;
92
+ }>>>;
93
+ arrayLengthDeltas: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
94
+ before: z.ZodOptional<z.ZodNumber>;
95
+ after: z.ZodOptional<z.ZodNumber>;
96
+ delta: z.ZodOptional<z.ZodNumber>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ before?: number | undefined;
99
+ after?: number | undefined;
100
+ delta?: number | undefined;
101
+ }, {
102
+ before?: number | undefined;
103
+ after?: number | undefined;
104
+ delta?: number | undefined;
105
+ }>>>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ key: string;
108
+ area: "localStorage" | "sessionStorage";
109
+ beforePresent: boolean;
110
+ afterPresent: boolean;
111
+ numericDeltas?: Record<string, {
112
+ before?: number | undefined;
113
+ after?: number | undefined;
114
+ delta?: number | undefined;
115
+ }> | undefined;
116
+ booleanChanges?: Record<string, {
117
+ before?: boolean | undefined;
118
+ after?: boolean | undefined;
119
+ }> | undefined;
120
+ arrayLengthDeltas?: Record<string, {
121
+ before?: number | undefined;
122
+ after?: number | undefined;
123
+ delta?: number | undefined;
124
+ }> | undefined;
125
+ }, {
126
+ key: string;
127
+ area: "localStorage" | "sessionStorage";
128
+ beforePresent: boolean;
129
+ afterPresent: boolean;
130
+ numericDeltas?: Record<string, {
131
+ before?: number | undefined;
132
+ after?: number | undefined;
133
+ delta?: number | undefined;
134
+ }> | undefined;
135
+ booleanChanges?: Record<string, {
136
+ before?: boolean | undefined;
137
+ after?: boolean | undefined;
138
+ }> | undefined;
139
+ arrayLengthDeltas?: Record<string, {
140
+ before?: number | undefined;
141
+ after?: number | undefined;
142
+ delta?: number | undefined;
143
+ }> | undefined;
144
+ }>;
145
+ type StorageArea = z.infer<typeof StorageAreaSchema>;
146
+ type StorageEntrySummary = z.infer<typeof StorageEntrySummarySchema>;
147
+ type CookieSummary = z.infer<typeof CookieSummarySchema>;
148
+ type StorageCounterDiff = z.infer<typeof StorageCounterDiffSchema>;
149
+ type RawStorageEntry = {
150
+ readonly key: string;
151
+ readonly value: string;
152
+ };
153
+ export declare function summarizeStorageEntry(area: StorageArea, entry: RawStorageEntry): StorageEntrySummary;
154
+ export declare function summarizeCookie(cookie: {
155
+ readonly name: string;
156
+ readonly value: string;
157
+ readonly domain: string;
158
+ readonly path: string;
159
+ readonly expires: number;
160
+ readonly httpOnly: boolean;
161
+ readonly secure: boolean;
162
+ readonly sameSite?: string;
163
+ }): CookieSummary;
164
+ export declare function diffStorageCounters(beforeEntries: ReadonlyArray<StorageEntrySummary>, afterEntries: ReadonlyArray<StorageEntrySummary>): StorageCounterDiff[];
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;
167
+ targetPageId?: string | undefined;
168
+ watchMs?: number | undefined;
169
+ networkEventLimit?: number | undefined;
170
+ }, {
171
+ mode: string;
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";
174
+ nativePages: {
175
+ url: string;
176
+ title: string;
177
+ pageId: string;
178
+ boundPlatform: "zhipin" | "yupao" | null;
179
+ detectedPlatform: "zhipin" | "yupao" | null;
180
+ isSelectedForPlatform: boolean;
181
+ }[];
182
+ browserAttached: boolean;
183
+ pageAttached: boolean;
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";
186
+ capturedAt: string;
187
+ targetFound: boolean;
188
+ urlChangedFromPrevious: boolean;
189
+ titleChangedFromPrevious: boolean;
190
+ currentUrl?: string | undefined;
191
+ page?: {
192
+ url: string;
193
+ title: string;
194
+ pageId: string;
195
+ boundPlatform: "zhipin" | "yupao" | null;
196
+ detectedPlatform: "zhipin" | "yupao" | null;
197
+ isSelectedForPlatform: boolean;
198
+ } | undefined;
199
+ previousUrl?: string | undefined;
200
+ previousTitle?: string | undefined;
201
+ currentTitle?: string | undefined;
202
+ }[];
203
+ phases: {
204
+ success: boolean;
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";
207
+ error?: string | undefined;
208
+ }[];
209
+ warnings: string[];
210
+ evaluate?: {
211
+ url: string;
212
+ title: string;
213
+ visibilityState: string;
214
+ hasFocus: boolean;
215
+ } | undefined;
216
+ targetPage?: {
217
+ url: string;
218
+ title: string;
219
+ pageId: string;
220
+ boundPlatform: "zhipin" | "yupao" | null;
221
+ detectedPlatform: "zhipin" | "yupao" | null;
222
+ isSelectedForPlatform: boolean;
223
+ } | undefined;
224
+ networkEvents?: {
225
+ url: string;
226
+ reason: "apm-action-log" | "device-action-report" | "boss-risk-report" | "zhipin-security";
227
+ capturedAt: string;
228
+ kind: "request" | "response";
229
+ status?: number | undefined;
230
+ method?: string | undefined;
231
+ resourceType?: string | undefined;
232
+ }[] | undefined;
233
+ navigationEvents?: {
234
+ url: string;
235
+ capturedAt: string;
236
+ }[] | undefined;
237
+ nativeCdp?: {
238
+ targetId: string;
239
+ connected: boolean;
240
+ websocketUrlAvailable: boolean;
241
+ input?: {
242
+ type: "mouseMoved";
243
+ x: number;
244
+ y: number;
245
+ } | undefined;
246
+ pageBroughtToFront?: boolean | undefined;
247
+ runtimeEnabled?: boolean | undefined;
248
+ evaluate?: {
249
+ url: string;
250
+ title: string;
251
+ visibilityState: string;
252
+ hasFocus: boolean;
253
+ } | undefined;
254
+ dom?: {
255
+ rootNodeId: number;
256
+ rootNodeName: string;
257
+ childNodeCount?: number | undefined;
258
+ bodyTextLength?: number | undefined;
259
+ elementCount?: number | undefined;
260
+ } | undefined;
261
+ } | undefined;
262
+ detectorFingerprint?: {
263
+ userAgentContainsHeadless: boolean;
264
+ languagesLength: number;
265
+ pluginsLength: number;
266
+ hasChromeRuntime: boolean;
267
+ hasPlaywrightBinding: boolean;
268
+ hasPwInitScripts: boolean;
269
+ cdcKeys: string[];
270
+ webdriverKeys: string[];
271
+ automationLikeWindowKeys: string[];
272
+ navigatorWebdriver?: boolean | undefined;
273
+ permissionQueryIsNative?: boolean | undefined;
274
+ } | undefined;
275
+ storage?: {
276
+ cookies: {
277
+ path: string;
278
+ name: string;
279
+ valueLength: number;
280
+ domain: string;
281
+ expires: string;
282
+ httpOnly: boolean;
283
+ secure: boolean;
284
+ sameSite?: string | undefined;
285
+ }[];
286
+ localStorage: {
287
+ key: string;
288
+ area: "localStorage" | "sessionStorage";
289
+ valueLength: number;
290
+ valueKind: "string" | "empty" | "json";
291
+ jsonKind?: "string" | "number" | "boolean" | "object" | "array" | "null" | undefined;
292
+ jsonTopLevelKeys?: string[] | undefined;
293
+ jsonArrayLength?: number | undefined;
294
+ numericFields?: Record<string, number> | undefined;
295
+ booleanFields?: Record<string, boolean> | undefined;
296
+ arrayLengths?: Record<string, number> | undefined;
297
+ }[];
298
+ sessionStorage: {
299
+ key: string;
300
+ area: "localStorage" | "sessionStorage";
301
+ valueLength: number;
302
+ valueKind: "string" | "empty" | "json";
303
+ jsonKind?: "string" | "number" | "boolean" | "object" | "array" | "null" | undefined;
304
+ jsonTopLevelKeys?: string[] | undefined;
305
+ jsonArrayLength?: number | undefined;
306
+ numericFields?: Record<string, number> | undefined;
307
+ booleanFields?: Record<string, boolean> | undefined;
308
+ arrayLengths?: Record<string, number> | undefined;
309
+ }[];
310
+ counterDiffs: {
311
+ key: string;
312
+ area: "localStorage" | "sessionStorage";
313
+ beforePresent: boolean;
314
+ afterPresent: boolean;
315
+ numericDeltas?: Record<string, {
316
+ before?: number | undefined;
317
+ after?: number | undefined;
318
+ delta?: number | undefined;
319
+ }> | undefined;
320
+ booleanChanges?: Record<string, {
321
+ before?: boolean | undefined;
322
+ after?: boolean | undefined;
323
+ }> | undefined;
324
+ arrayLengthDeltas?: Record<string, {
325
+ before?: number | undefined;
326
+ after?: number | undefined;
327
+ delta?: number | undefined;
328
+ }> | undefined;
329
+ }[];
330
+ } | undefined;
331
+ }>;
332
+ export {};
@@ -1,14 +1,20 @@
1
+ import { NativeVisualActivitySession } from "../native-visual-activity-session.ts";
2
+ import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
3
+ import type { ZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
4
+ type NativeVisualActivitySessionLike = Pick<NativeVisualActivitySession, "begin" | "highlightPoint" | "succeed" | "fail">;
5
+ type ZhipinExchangeWechatDeps = {
6
+ readonly openNativePagePort: typeof openZhipinNativePagePort;
7
+ readonly createNativeVisualActivitySession: (page: ZhipinNativePagePort) => NativeVisualActivitySessionLike;
8
+ };
9
+ export declare function setZhipinExchangeWechatDepsForTests(override: Partial<ZhipinExchangeWechatDeps> | undefined): void;
1
10
  export declare const zhipinExchangeWechat: import("@roll-agent/sdk").ToolDefinition<{
11
+ index?: number | undefined;
2
12
  conversationId?: string | undefined;
3
13
  candidateName?: string | undefined;
4
- index?: number | undefined;
5
14
  }, {
6
15
  success: boolean;
7
16
  exchanged: boolean;
8
- error: string | undefined;
9
- } | {
10
- wechatNumber?: string;
11
- success: boolean;
12
- exchanged: boolean;
13
- error?: never;
17
+ error?: string | undefined;
18
+ wechatNumber?: string | undefined;
14
19
  }>;
20
+ export {};
@@ -1,17 +1,10 @@
1
- import { getContextManager } from "../runtime-holder.ts";
2
- import { applyRecommendFilter, waitForRecommendFilterSurface, type RecommendTarget } from "../pages/zhipin/recommend-filter.ts";
3
- import { getRecommendTarget } from "../pages/zhipin/recommend-list.ts";
4
- import { VisualActivitySession } from "../visual-activity-session.ts";
5
- import { moveVisualCursorToLocator, showVisualClickOnLocator } from "../visual-cursor.ts";
6
- type VisualActivitySessionLike = Pick<VisualActivitySession, "begin" | "highlightSelector" | "retarget" | "succeed" | "fail">;
1
+ import { NativeVisualActivitySession } from "../native-visual-activity-session.ts";
2
+ import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
3
+ import type { ZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
4
+ type NativeVisualActivitySessionLike = Pick<NativeVisualActivitySession, "begin" | "highlightSelector" | "highlightPoint" | "succeed" | "fail">;
7
5
  type ZhipinFilterRecommendCandidatesDeps = {
8
- readonly getContextManager: typeof getContextManager;
9
- readonly getRecommendTarget: typeof getRecommendTarget;
10
- readonly waitForRecommendFilterSurface: typeof waitForRecommendFilterSurface;
11
- readonly applyRecommendFilter: typeof applyRecommendFilter;
12
- readonly moveVisualCursorToLocator: typeof moveVisualCursorToLocator;
13
- readonly showVisualClickOnLocator: typeof showVisualClickOnLocator;
14
- readonly createVisualActivitySession: (target: RecommendTarget) => VisualActivitySessionLike;
6
+ readonly openNativePagePort: typeof openZhipinNativePagePort;
7
+ readonly createNativeVisualActivitySession: (page: ZhipinNativePagePort) => NativeVisualActivitySessionLike;
15
8
  };
16
9
  export declare function setZhipinFilterRecommendCandidatesDepsForTests(override: Partial<ZhipinFilterRecommendCandidatesDeps> | undefined): void;
17
10
  export declare const zhipinFilterRecommendCandidates: import("@roll-agent/sdk").ToolDefinition<{