@roll-agent/browser-use-agent 0.10.0 → 0.12.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.
Files changed (36) hide show
  1. package/SKILL.md +75 -25
  2. package/dist/browser-action-approval.d.ts +14 -0
  3. package/dist/browser-security.d.ts +20 -0
  4. package/dist/browser-use-policy.d.ts +56 -0
  5. package/dist/diagnostics/effective-env.d.ts +1 -1
  6. package/dist/element-ref-store.d.ts +2 -0
  7. package/dist/index.js +1 -1
  8. package/dist/pages/platform-page.d.ts +2 -2
  9. package/dist/pages/yupao/chat.d.ts +2 -2
  10. package/dist/pages/yupao/navigation.d.ts +4 -4
  11. package/dist/reply-authority/prepared-reply-store.d.ts +2 -0
  12. package/dist/reply-authority/schemas.d.ts +2 -2
  13. package/dist/runtime-config.d.ts +2 -0
  14. package/dist/tool-action-approval.d.ts +35 -0
  15. package/dist/tools/browser-dom-action-candidates.d.ts +8 -0
  16. package/dist/tools/browser-native-page.d.ts +6 -0
  17. package/dist/tools/browser-ref-schemas.d.ts +99 -0
  18. package/dist/tools/browser-ref-visual.d.ts +5 -0
  19. package/dist/tools/browser-snapshot.d.ts +33 -0
  20. package/dist/tools/browser-status.d.ts +19 -3
  21. package/dist/tools/click-ref.d.ts +22 -0
  22. package/dist/tools/list-pages.d.ts +1 -1
  23. package/dist/tools/navigate-active-tab.d.ts +4 -1
  24. package/dist/tools/open-platform.d.ts +4 -1
  25. package/dist/tools/select-page.d.ts +1 -1
  26. package/dist/tools/type-ref.d.ts +24 -0
  27. package/dist/tools/yupao-send-reply.d.ts +3 -0
  28. package/dist/tools/zhipin-diagnose-browser-state.d.ts +7 -7
  29. package/dist/tools/zhipin-generate-reply-preview.d.ts +5 -0
  30. package/dist/tools/zhipin-get-candidate-info.d.ts +2 -2
  31. package/dist/tools/zhipin-open-chat-page.d.ts +1 -1
  32. package/dist/tools/zhipin-open-recommend-page.d.ts +1 -1
  33. package/dist/tools/zhipin-send-prepared-reply.d.ts +12 -0
  34. package/package.json +4 -4
  35. package/references/env.yaml +8 -0
  36. package/references/generic-browser-refs.md +151 -0
@@ -1,7 +1,7 @@
1
- import type { BrowserContextManager, BrowserInspectablePage, BrowserRuntime, Page, Platform } from "@roll-agent/browser";
1
+ import type { BrowserContextManager, BrowserInspectablePage, BrowserRuntime, BrowserActionPolicyOptions, Page, Platform } from "@roll-agent/browser";
2
2
  export declare function findTrackedPlatformPage(ctxManager: BrowserContextManager, platform: Platform): Promise<Page | undefined>;
3
3
  export declare function findOpenPlatformTarget(runtime: BrowserRuntime, platform: Platform): Promise<BrowserInspectablePage | undefined>;
4
- export declare function openPlatformHomeTarget(runtime: BrowserRuntime, platform: Platform): Promise<{
4
+ export declare function openPlatformHomeTarget(runtime: BrowserRuntime, platform: Platform, options?: BrowserActionPolicyOptions): Promise<{
5
5
  page: BrowserInspectablePage;
6
6
  reusedExistingPage: boolean;
7
7
  }>;
@@ -1,6 +1,6 @@
1
- import type { Page } from "@roll-agent/browser";
1
+ import { type BrowserActionPolicyOptions, type Page } from "@roll-agent/browser";
2
2
  /** 在指定对话中发送回复消息 */
3
- export declare function sendReply(page: Page, conversationId: string, message: string): Promise<{
3
+ export declare function sendReply(page: Page, conversationId: string, message: string, options?: BrowserActionPolicyOptions): Promise<{
4
4
  success: boolean;
5
5
  error?: string;
6
6
  }>;
@@ -1,9 +1,9 @@
1
- import type { Page } from "@roll-agent/browser";
1
+ import { type BrowserActionPolicyOptions, type Page } from "@roll-agent/browser";
2
2
  /** 导航到消息列表页 */
3
- export declare function ensureOnMessageList(page: Page): Promise<void>;
3
+ export declare function ensureOnMessageList(page: Page, options?: BrowserActionPolicyOptions): Promise<void>;
4
4
  /** 导航到登录页 */
5
- export declare function goToLoginPage(page: Page): Promise<void>;
5
+ export declare function goToLoginPage(page: Page, options?: BrowserActionPolicyOptions): Promise<void>;
6
6
  /** 导航到指定对话 */
7
- export declare function goToConversation(page: Page, conversationId: string): Promise<void>;
7
+ export declare function goToConversation(page: Page, conversationId: string, options?: BrowserActionPolicyOptions): Promise<void>;
8
8
  /** 检测是否已登录 */
9
9
  export declare function isLoggedIn(page: Page): Promise<boolean>;
@@ -14,6 +14,8 @@ export type PreparedReplyConsumeResult = {
14
14
  readonly ok: false;
15
15
  readonly reason: "not_found" | "expired" | "consumed";
16
16
  };
17
+ export type PreparedReplyInspectResult = PreparedReplyConsumeResult;
17
18
  export declare function savePreparedReply(input: Omit<PreparedReplyRecord, "preparedReplyId">, nowSeconds?: number): PreparedReplyRecord;
18
19
  export declare function consumePreparedReply(preparedReplyId: string, nowSeconds?: number): PreparedReplyConsumeResult;
20
+ export declare function inspectPreparedReply(preparedReplyId: string, nowSeconds?: number): PreparedReplyInspectResult;
19
21
  export declare function resetPreparedReplyStoreForTests(): void;
@@ -47,6 +47,7 @@ export declare const ReplyAuthorityEnvelopePayloadSchema: z.ZodObject<{
47
47
  platform: "zhipin";
48
48
  conversationId: string;
49
49
  candidateId: string;
50
+ reply: string;
50
51
  tenantId: string;
51
52
  recruiterBinding: {
52
53
  platform: "zhipin";
@@ -60,12 +61,12 @@ export declare const ReplyAuthorityEnvelopePayloadSchema: z.ZodObject<{
60
61
  iat: number;
61
62
  exp: number;
62
63
  aud: "browser-use-agent/zhipin_send_reply";
63
- reply: string;
64
64
  policyVersion: string;
65
65
  }, {
66
66
  platform: "zhipin";
67
67
  conversationId: string;
68
68
  candidateId: string;
69
+ reply: string;
69
70
  tenantId: string;
70
71
  recruiterBinding: {
71
72
  platform: "zhipin";
@@ -79,7 +80,6 @@ export declare const ReplyAuthorityEnvelopePayloadSchema: z.ZodObject<{
79
80
  iat: number;
80
81
  exp: number;
81
82
  aud: "browser-use-agent/zhipin_send_reply";
82
- reply: string;
83
83
  policyVersion: string;
84
84
  }>;
85
85
  export declare const ReplyAuthorityPublicKeySchema: z.ZodObject<{
@@ -0,0 +1,2 @@
1
+ import type { BrowserRuntimeConfig } from "@roll-agent/browser";
2
+ export declare function loadRuntimeConfigFromEnv(env?: NodeJS.ProcessEnv): BrowserRuntimeConfig;
@@ -0,0 +1,35 @@
1
+ import { z } from "zod";
2
+ export declare const ToolActionApprovalSchema: z.ZodObject<{
3
+ id: z.ZodString;
4
+ }, "strip", z.ZodTypeAny, {
5
+ id: string;
6
+ }, {
7
+ id: string;
8
+ }>;
9
+ export type ToolActionApproval = z.infer<typeof ToolActionApprovalSchema>;
10
+ export type ToolActionApprovalSubject = {
11
+ readonly tool: string;
12
+ readonly target: string;
13
+ readonly digest: string;
14
+ readonly summary?: string;
15
+ };
16
+ export type ToolActionApprovalRequest = {
17
+ readonly id: string;
18
+ readonly expiresAt: string;
19
+ readonly tool: string;
20
+ readonly target: string;
21
+ readonly summary?: string;
22
+ readonly retryInput: {
23
+ readonly toolActionApproval: ToolActionApproval;
24
+ };
25
+ };
26
+ export declare function createToolActionApprovalRequest(subject: ToolActionApprovalSubject, ttlMs: number, nowMs?: number): ToolActionApprovalRequest;
27
+ export declare function approveToolAction(input: {
28
+ readonly approval: ToolActionApproval;
29
+ readonly subject: ToolActionApprovalSubject;
30
+ }): boolean;
31
+ export declare function isToolActionApprovalValid(input: {
32
+ readonly approval: ToolActionApproval;
33
+ readonly subject: ToolActionApprovalSubject;
34
+ }): boolean;
35
+ export declare function resetToolActionApprovalsForTests(): void;
@@ -0,0 +1,8 @@
1
+ import type { BrowserDomActionHint, NativeCdpController } from "@roll-agent/browser";
2
+ type DomActionCandidateController = Pick<NativeCdpController, "createIsolatedWorld" | "describeNode" | "evaluateJson" | "getDocument" | "querySelectorAllByNodeId">;
3
+ type DomActionCandidateOptions = {
4
+ readonly frameId?: string;
5
+ readonly maxCandidates?: number;
6
+ };
7
+ export declare function collectDomActionHints(controller: DomActionCandidateController, optionsOrMaxCandidates?: DomActionCandidateOptions | number): Promise<readonly BrowserDomActionHint[]>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { BrowserContextManager, BrowserInspectablePage, BrowserRuntime } from "@roll-agent/browser";
2
+ export declare function resolveNativePageForBrowserTool(input: {
3
+ readonly ctxManager: BrowserContextManager;
4
+ readonly runtime: BrowserRuntime;
5
+ readonly pageId?: string;
6
+ }): Promise<BrowserInspectablePage>;
@@ -0,0 +1,99 @@
1
+ import { z } from "zod";
2
+ export declare const BrowserElementRefResolveStrategySchema: z.ZodEnum<["backend_node_id", "role_name_nth"]>;
3
+ export declare const BrowserElementRefTargetSchema: z.ZodObject<{
4
+ ref: z.ZodString;
5
+ role: z.ZodString;
6
+ name: z.ZodString;
7
+ x: z.ZodNumber;
8
+ y: z.ZodNumber;
9
+ resolvedBy: z.ZodEnum<["backend_node_id", "role_name_nth"]>;
10
+ backendNodeId: z.ZodOptional<z.ZodNumber>;
11
+ frameId: z.ZodOptional<z.ZodString>;
12
+ disabled: z.ZodBoolean;
13
+ }, "strip", z.ZodTypeAny, {
14
+ ref: string;
15
+ role: string;
16
+ name: string;
17
+ disabled: boolean;
18
+ x: number;
19
+ y: number;
20
+ resolvedBy: "backend_node_id" | "role_name_nth";
21
+ backendNodeId?: number | undefined;
22
+ frameId?: string | undefined;
23
+ }, {
24
+ ref: string;
25
+ role: string;
26
+ name: string;
27
+ disabled: boolean;
28
+ x: number;
29
+ y: number;
30
+ resolvedBy: "backend_node_id" | "role_name_nth";
31
+ backendNodeId?: number | undefined;
32
+ frameId?: string | undefined;
33
+ }>;
34
+ export declare const BrowserElementRefActionOutputSchema: z.ZodObject<{
35
+ success: z.ZodLiteral<true>;
36
+ ref: z.ZodString;
37
+ resolvedBy: z.ZodEnum<["backend_node_id", "role_name_nth"]>;
38
+ target: z.ZodObject<{
39
+ ref: z.ZodString;
40
+ role: z.ZodString;
41
+ name: z.ZodString;
42
+ x: z.ZodNumber;
43
+ y: z.ZodNumber;
44
+ resolvedBy: z.ZodEnum<["backend_node_id", "role_name_nth"]>;
45
+ backendNodeId: z.ZodOptional<z.ZodNumber>;
46
+ frameId: z.ZodOptional<z.ZodString>;
47
+ disabled: z.ZodBoolean;
48
+ }, "strip", z.ZodTypeAny, {
49
+ ref: string;
50
+ role: string;
51
+ name: string;
52
+ disabled: boolean;
53
+ x: number;
54
+ y: number;
55
+ resolvedBy: "backend_node_id" | "role_name_nth";
56
+ backendNodeId?: number | undefined;
57
+ frameId?: string | undefined;
58
+ }, {
59
+ ref: string;
60
+ role: string;
61
+ name: string;
62
+ disabled: boolean;
63
+ x: number;
64
+ y: number;
65
+ resolvedBy: "backend_node_id" | "role_name_nth";
66
+ backendNodeId?: number | undefined;
67
+ frameId?: string | undefined;
68
+ }>;
69
+ }, "strip", z.ZodTypeAny, {
70
+ ref: string;
71
+ target: {
72
+ ref: string;
73
+ role: string;
74
+ name: string;
75
+ disabled: boolean;
76
+ x: number;
77
+ y: number;
78
+ resolvedBy: "backend_node_id" | "role_name_nth";
79
+ backendNodeId?: number | undefined;
80
+ frameId?: string | undefined;
81
+ };
82
+ success: true;
83
+ resolvedBy: "backend_node_id" | "role_name_nth";
84
+ }, {
85
+ ref: string;
86
+ target: {
87
+ ref: string;
88
+ role: string;
89
+ name: string;
90
+ disabled: boolean;
91
+ x: number;
92
+ y: number;
93
+ resolvedBy: "backend_node_id" | "role_name_nth";
94
+ backendNodeId?: number | undefined;
95
+ frameId?: string | undefined;
96
+ };
97
+ success: true;
98
+ resolvedBy: "backend_node_id" | "role_name_nth";
99
+ }>;
@@ -0,0 +1,5 @@
1
+ import type { BrowserElementRefTarget, NativeCdpController } from "@roll-agent/browser";
2
+ import { NativeVisualActivitySession } from "../native-visual-activity-session.ts";
3
+ export type BrowserRefVisualSession = Pick<NativeVisualActivitySession, "begin" | "succeed" | "fail" | "previewMouseMotion" | "previewMouseClick">;
4
+ export declare function createBrowserRefVisualSession(controller: Pick<NativeCdpController, "evaluateJson">): BrowserRefVisualSession;
5
+ export declare function clickBrowserRefVisualTarget(controller: Pick<NativeCdpController, "dispatchMouseEvent">, session: BrowserRefVisualSession, target: BrowserElementRefTarget): Promise<void>;
@@ -0,0 +1,33 @@
1
+ import { type BrowserAxNode } from "@roll-agent/browser";
2
+ export declare const browserSnapshot: import("@roll-agent/sdk").ToolDefinition<{
3
+ pageId?: string | undefined;
4
+ maxNodes?: number | undefined;
5
+ interactiveOnly?: boolean | undefined;
6
+ maxDepth?: number | undefined;
7
+ }, {
8
+ page: {
9
+ pageId: string;
10
+ url: string;
11
+ title: string;
12
+ boundPlatform: "zhipin" | "yupao" | null;
13
+ detectedPlatform: "zhipin" | "yupao" | null;
14
+ isSelectedForPlatform: boolean;
15
+ };
16
+ snapshot: {
17
+ truncated: boolean;
18
+ nodes: BrowserAxNode[];
19
+ refs: {
20
+ ref: string;
21
+ role: string;
22
+ name: string;
23
+ nth: number;
24
+ disabled: boolean;
25
+ backendNodeId?: number | undefined;
26
+ frameId?: string | undefined;
27
+ }[];
28
+ nodeCount: number;
29
+ maxNodes: number;
30
+ interactiveOnly: boolean;
31
+ maxDepth?: number | undefined;
32
+ };
33
+ }>;
@@ -1,17 +1,33 @@
1
1
  export declare const browserStatus: import("@roll-agent/sdk").ToolDefinition<{}, {
2
- running: boolean;
3
- headless: boolean;
4
2
  mode: "managed-cdp" | "remote-cdp" | "existing-session";
3
+ headless: boolean;
4
+ security: {
5
+ domainAllowlist?: string[] | undefined;
6
+ maxPageContentBytes?: number | undefined;
7
+ maxSnapshotNodes?: number | undefined;
8
+ actionPolicy?: "log" | "deny" | "confirm" | undefined;
9
+ };
10
+ running: boolean;
5
11
  activeSessions: {
6
12
  platform: "zhipin" | "yupao";
7
13
  pagesOpen: number;
8
14
  hasLoginState: boolean | null;
9
- loginStateSource: "none" | "unknown" | "snapshot" | "profile";
15
+ loginStateSource: "snapshot" | "profile" | "none" | "unknown";
10
16
  currentUrl?: string | undefined;
11
17
  }[];
12
18
  replyAuthorityKeysLoaded: boolean;
13
19
  visualCursorEnabled: boolean;
14
20
  visualActivityEnabled: boolean;
21
+ toolPolicy: {
22
+ tools?: Record<string, {
23
+ policy: "log" | "deny" | "confirm";
24
+ }> | undefined;
25
+ approvalTtlMs?: number | undefined;
26
+ };
27
+ policyWarnings: {
28
+ code: "unknown_tool_policy" | "double_confirmation" | "browser_action_policy_not_recommended";
29
+ message: string;
30
+ }[];
15
31
  effectiveEnvSources: Record<string, {
16
32
  present: boolean;
17
33
  fingerprint?: string | undefined;
@@ -0,0 +1,22 @@
1
+ export declare const clickRef: import("@roll-agent/sdk").ToolDefinition<{
2
+ ref: string;
3
+ pageId?: string | undefined;
4
+ browserActionApproval?: {
5
+ id: string;
6
+ } | undefined;
7
+ }, {
8
+ ref: string;
9
+ target: {
10
+ ref: string;
11
+ role: string;
12
+ name: string;
13
+ disabled: boolean;
14
+ x: number;
15
+ y: number;
16
+ resolvedBy: "backend_node_id" | "role_name_nth";
17
+ backendNodeId?: number | undefined;
18
+ frameId?: string | undefined;
19
+ };
20
+ success: true;
21
+ resolvedBy: "backend_node_id" | "role_name_nth";
22
+ }>;
@@ -2,9 +2,9 @@ export declare const listPages: import("@roll-agent/sdk").ToolDefinition<{
2
2
  platform?: "zhipin" | "yupao" | undefined;
3
3
  }, {
4
4
  pages: {
5
+ pageId: string;
5
6
  url: string;
6
7
  title: string;
7
- pageId: string;
8
8
  boundPlatform: "zhipin" | "yupao" | null;
9
9
  detectedPlatform: "zhipin" | "yupao" | null;
10
10
  isSelectedForPlatform: boolean;
@@ -13,12 +13,15 @@ type NavigateActiveTabDeps = {
13
13
  export declare function setNavigateActiveTabDepsForTests(override: Partial<NavigateActiveTabDeps> | undefined): void;
14
14
  export declare const navigateActiveTab: import("@roll-agent/sdk").ToolDefinition<{
15
15
  url: string;
16
+ browserActionApproval?: {
17
+ id: string;
18
+ } | undefined;
16
19
  }, {
17
20
  success: boolean;
18
21
  page: {
22
+ pageId: string;
19
23
  url: string;
20
24
  title: string;
21
- pageId: string;
22
25
  boundPlatform: "zhipin" | "yupao" | null;
23
26
  detectedPlatform: "zhipin" | "yupao" | null;
24
27
  isSelectedForPlatform: boolean;
@@ -1,11 +1,14 @@
1
1
  export declare const openPlatform: import("@roll-agent/sdk").ToolDefinition<{
2
2
  platform: "zhipin" | "yupao";
3
+ browserActionApproval?: {
4
+ id: string;
5
+ } | undefined;
3
6
  }, {
4
7
  success: boolean;
5
8
  page: {
9
+ pageId: string;
6
10
  url: string;
7
11
  title: string;
8
- pageId: string;
9
12
  boundPlatform: "zhipin" | "yupao" | null;
10
13
  detectedPlatform: "zhipin" | "yupao" | null;
11
14
  isSelectedForPlatform: boolean;
@@ -4,9 +4,9 @@ export declare const selectPage: import("@roll-agent/sdk").ToolDefinition<{
4
4
  }, {
5
5
  success: boolean;
6
6
  page: {
7
+ pageId: string;
7
8
  url: string;
8
9
  title: string;
9
- pageId: string;
10
10
  boundPlatform: "zhipin" | "yupao" | null;
11
11
  detectedPlatform: "zhipin" | "yupao" | null;
12
12
  isSelectedForPlatform: boolean;
@@ -0,0 +1,24 @@
1
+ export declare const typeRef: import("@roll-agent/sdk").ToolDefinition<{
2
+ ref: string;
3
+ text: string;
4
+ pageId?: string | undefined;
5
+ clear?: boolean | undefined;
6
+ browserActionApproval?: {
7
+ id: string;
8
+ } | undefined;
9
+ }, {
10
+ ref: string;
11
+ target: {
12
+ ref: string;
13
+ role: string;
14
+ name: string;
15
+ disabled: boolean;
16
+ x: number;
17
+ y: number;
18
+ resolvedBy: "backend_node_id" | "role_name_nth";
19
+ backendNodeId?: number | undefined;
20
+ frameId?: string | undefined;
21
+ };
22
+ success: true;
23
+ resolvedBy: "backend_node_id" | "role_name_nth";
24
+ }>;
@@ -1,6 +1,9 @@
1
1
  export declare const yupaoSendReply: import("@roll-agent/sdk").ToolDefinition<{
2
2
  message: string;
3
3
  conversationId: string;
4
+ browserActionApproval?: {
5
+ id: string;
6
+ } | undefined;
4
7
  }, {
5
8
  success: boolean;
6
9
  conversationId: string;
@@ -16,7 +16,7 @@ declare const StorageEntrySummarySchema: z.ZodObject<{
16
16
  area: "localStorage" | "sessionStorage";
17
17
  valueLength: number;
18
18
  valueKind: "string" | "empty" | "json";
19
- jsonKind?: "string" | "number" | "boolean" | "object" | "array" | "null" | undefined;
19
+ jsonKind?: "string" | "number" | "boolean" | "object" | "null" | "array" | undefined;
20
20
  jsonTopLevelKeys?: string[] | undefined;
21
21
  jsonArrayLength?: number | undefined;
22
22
  numericFields?: Record<string, number> | undefined;
@@ -27,7 +27,7 @@ declare const StorageEntrySummarySchema: z.ZodObject<{
27
27
  area: "localStorage" | "sessionStorage";
28
28
  valueLength: number;
29
29
  valueKind: "string" | "empty" | "json";
30
- jsonKind?: "string" | "number" | "boolean" | "object" | "array" | "null" | undefined;
30
+ jsonKind?: "string" | "number" | "boolean" | "object" | "null" | "array" | undefined;
31
31
  jsonTopLevelKeys?: string[] | undefined;
32
32
  jsonArrayLength?: number | undefined;
33
33
  numericFields?: Record<string, number> | undefined;
@@ -172,9 +172,9 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
172
172
  success: boolean;
173
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
174
  nativePages: {
175
+ pageId: string;
175
176
  url: string;
176
177
  title: string;
177
- pageId: string;
178
178
  boundPlatform: "zhipin" | "yupao" | null;
179
179
  detectedPlatform: "zhipin" | "yupao" | null;
180
180
  isSelectedForPlatform: boolean;
@@ -189,9 +189,9 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
189
189
  titleChangedFromPrevious: boolean;
190
190
  currentUrl?: string | undefined;
191
191
  page?: {
192
+ pageId: string;
192
193
  url: string;
193
194
  title: string;
194
- pageId: string;
195
195
  boundPlatform: "zhipin" | "yupao" | null;
196
196
  detectedPlatform: "zhipin" | "yupao" | null;
197
197
  isSelectedForPlatform: boolean;
@@ -214,9 +214,9 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
214
214
  hasFocus: boolean;
215
215
  } | undefined;
216
216
  targetPage?: {
217
+ pageId: string;
217
218
  url: string;
218
219
  title: string;
219
- pageId: string;
220
220
  boundPlatform: "zhipin" | "yupao" | null;
221
221
  detectedPlatform: "zhipin" | "yupao" | null;
222
222
  isSelectedForPlatform: boolean;
@@ -288,7 +288,7 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
288
288
  area: "localStorage" | "sessionStorage";
289
289
  valueLength: number;
290
290
  valueKind: "string" | "empty" | "json";
291
- jsonKind?: "string" | "number" | "boolean" | "object" | "array" | "null" | undefined;
291
+ jsonKind?: "string" | "number" | "boolean" | "object" | "null" | "array" | undefined;
292
292
  jsonTopLevelKeys?: string[] | undefined;
293
293
  jsonArrayLength?: number | undefined;
294
294
  numericFields?: Record<string, number> | undefined;
@@ -300,7 +300,7 @@ export declare const zhipinDiagnoseBrowserState: import("@roll-agent/sdk").ToolD
300
300
  area: "localStorage" | "sessionStorage";
301
301
  valueLength: number;
302
302
  valueKind: "string" | "empty" | "json";
303
- jsonKind?: "string" | "number" | "boolean" | "object" | "array" | "null" | undefined;
303
+ jsonKind?: "string" | "number" | "boolean" | "object" | "null" | "array" | undefined;
304
304
  jsonTopLevelKeys?: string[] | undefined;
305
305
  jsonArrayLength?: number | undefined;
306
306
  numericFields?: Record<string, number> | undefined;
@@ -19,6 +19,11 @@ export declare const zhipinGenerateReplyPreview: import("@roll-agent/sdk").ToolD
19
19
  conversationId?: string | undefined;
20
20
  candidateName?: string | undefined;
21
21
  maxMessages?: number | undefined;
22
+ reasoning?: {
23
+ enabled: boolean;
24
+ effort?: "high" | "low" | "medium" | undefined;
25
+ scope?: "all" | "reply" | undefined;
26
+ } | undefined;
22
27
  }, {
23
28
  success: boolean;
24
29
  error?: string | undefined;
@@ -34,9 +34,9 @@ export declare const zhipinGetCandidateInfo: import("@roll-agent/sdk").ToolDefin
34
34
  systemMessages: number;
35
35
  };
36
36
  chatMessages: {
37
- time: string;
38
- content: string;
39
37
  index: number;
38
+ content: string;
39
+ time: string;
40
40
  sender: "candidate" | "recruiter" | "system";
41
41
  messageType: "text" | "resume" | "system" | "wechat-exchange";
42
42
  }[];
@@ -16,9 +16,9 @@ export declare const zhipinOpenChatPage: import("@roll-agent/sdk").ToolDefinitio
16
16
  chatReady: boolean;
17
17
  error?: string | undefined;
18
18
  page?: {
19
+ pageId: string;
19
20
  url: string;
20
21
  title: string;
21
- pageId: string;
22
22
  boundPlatform: "zhipin" | "yupao" | null;
23
23
  detectedPlatform: "zhipin" | "yupao" | null;
24
24
  isSelectedForPlatform: boolean;
@@ -16,9 +16,9 @@ export declare const zhipinOpenRecommendPage: import("@roll-agent/sdk").ToolDefi
16
16
  recommendReady: boolean;
17
17
  error?: string | undefined;
18
18
  page?: {
19
+ pageId: string;
19
20
  url: string;
20
21
  title: string;
21
- pageId: string;
22
22
  boundPlatform: "zhipin" | "yupao" | null;
23
23
  detectedPlatform: "zhipin" | "yupao" | null;
24
24
  isSelectedForPlatform: boolean;
@@ -1,7 +1,19 @@
1
+ import { sendSignedZhipinReply } from "./zhipin-send-reply.ts";
2
+ type ZhipinSendPreparedReplyDeps = {
3
+ readonly sendSignedZhipinReply: typeof sendSignedZhipinReply;
4
+ };
5
+ export declare function setZhipinSendPreparedReplyDepsForTests(override: Partial<ZhipinSendPreparedReplyDeps> | undefined): void;
1
6
  export declare const zhipinSendPreparedReply: import("@roll-agent/sdk").ToolDefinition<{
2
7
  preparedReplyId: string;
8
+ browserActionApproval?: {
9
+ id: string;
10
+ } | undefined;
11
+ toolActionApproval?: {
12
+ id: string;
13
+ } | undefined;
3
14
  }, {
4
15
  success: boolean;
5
16
  sentMessage: string;
6
17
  error?: string | undefined;
7
18
  }>;
19
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roll-agent/browser-use-agent",
3
- "version": "0.10.0",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -45,9 +45,9 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "zod": "^3.25.76",
48
- "@roll-agent/reply-authority-client": "0.1.1",
49
- "@roll-agent/sdk": "0.1.6",
50
- "@roll-agent/browser": "0.3.1"
48
+ "@roll-agent/reply-authority-client": "0.1.2",
49
+ "@roll-agent/sdk": "0.2.0",
50
+ "@roll-agent/browser": "0.5.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/node": "^22.0.0"
@@ -23,6 +23,14 @@ optional:
23
23
  purpose: 招聘事件 Open API base URL;工具成功后会调用 `/api/v1/recruitment-events`
24
24
  default: https://huajune.duliday.com
25
25
  example: https://example.com
26
+ - name: BROWSER_SECURITY_JSON
27
+ purpose: 浏览器安全策略 JSON;可配置 domainAllowlist、maxPageContentBytes、maxSnapshotNodes、actionPolicy
28
+ default: '{"domainAllowlist":[],"maxPageContentBytes":102400,"maxSnapshotNodes":500,"actionPolicy":"log"}'
29
+ example: '{"domainAllowlist":["zhipin.com"],"maxPageContentBytes":102400,"maxSnapshotNodes":500,"actionPolicy":"log"}'
30
+ - name: BROWSER_USE_POLICY_JSON
31
+ purpose: browser-use 工具级业务策略 JSON;可按 exact tool name 配置 log、deny、confirm
32
+ default: '{"approvalTtlMs":300000,"tools":{}}'
33
+ example: '{"approvalTtlMs":300000,"tools":{"zhipin_send_prepared_reply":{"policy":"confirm"}}}'
26
34
  - name: BROWSER_VISUAL_CURSOR
27
35
  purpose: 在可见浏览器页面内显示 browser-use 的页内虚拟指针和点击波纹;默认开启,设为 `"false"` 可关闭
28
36
  default: "true"