@roll-agent/browser-use-agent 0.8.0 → 0.9.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.
@@ -76,6 +76,15 @@ export type NativeRecommendCardInspection = {
76
76
  readonly cardSelector: string;
77
77
  readonly candidateId: string;
78
78
  readonly name: string;
79
+ readonly age?: string;
80
+ readonly experience?: string;
81
+ readonly education?: string;
82
+ readonly workStatus?: string;
83
+ readonly company?: string;
84
+ readonly currentPosition?: string;
85
+ readonly expectedLocation?: string;
86
+ readonly expectedPosition?: string;
87
+ readonly expectedSalary?: string;
79
88
  readonly hasGreetButton: boolean;
80
89
  readonly error?: string;
81
90
  };
@@ -0,0 +1,41 @@
1
+ import type { AgentLogger } from "@roll-agent/sdk";
2
+ export declare const RECRUITMENT_EVENT_TYPES: readonly ["message_received", "message_sent", "candidate_contacted", "wechat_exchanged"];
3
+ type RecruitmentEventType = (typeof RECRUITMENT_EVENT_TYPES)[number];
4
+ type RecruitmentCandidate = {
5
+ readonly name: string;
6
+ readonly position: string;
7
+ readonly age?: string;
8
+ readonly gender?: string;
9
+ readonly education?: string;
10
+ readonly expectedSalary?: string;
11
+ readonly expectedLocation?: string;
12
+ };
13
+ type RecruitmentJob = {
14
+ readonly jobId?: number;
15
+ readonly jobName?: string;
16
+ };
17
+ type RecruitmentEventDetails = Readonly<Record<string, string | number | boolean | undefined>>;
18
+ export type RecruitmentEventPayload = {
19
+ readonly idempotencyKey: string;
20
+ readonly agentId: string;
21
+ readonly sourcePlatform: "zhipin";
22
+ readonly dataSource: "api_callback";
23
+ readonly eventType: RecruitmentEventType;
24
+ readonly eventTime: string;
25
+ readonly candidate: RecruitmentCandidate;
26
+ readonly job?: RecruitmentJob;
27
+ readonly details: RecruitmentEventDetails;
28
+ };
29
+ export type RecruitmentEventDraft = Omit<RecruitmentEventPayload, "agentId" | "eventTime"> & {
30
+ readonly eventTime?: string;
31
+ };
32
+ type RecruitmentEventPostDeps = {
33
+ readonly fetch: typeof fetch;
34
+ readonly env: NodeJS.ProcessEnv;
35
+ };
36
+ type RecruitmentEventRecorder = (event: RecruitmentEventDraft, logger: AgentLogger) => Promise<void> | void;
37
+ export declare function buildRecruitmentIdempotencyKey(prefix: string, parts: ReadonlyArray<string | number | boolean | undefined>): string;
38
+ export declare function recordRecruitmentEventAsync(event: RecruitmentEventDraft, logger: AgentLogger): void;
39
+ export declare function setRecruitmentEventRecorderForTests(recorder: RecruitmentEventRecorder | undefined): void;
40
+ export declare function setRecruitmentEventPostDepsForTests(deps: Partial<RecruitmentEventPostDeps> | undefined): void;
41
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { AgentLogger } from "@roll-agent/sdk";
2
+ import type { NativeCandidateChatDetails, NativeRecommendGreetResult } from "../pages/zhipin/native-page.ts";
3
+ type ZhipinUnreadCandidate = {
4
+ readonly conversationId: string;
5
+ readonly candidateId: string;
6
+ readonly name: string;
7
+ readonly position: string;
8
+ readonly preview: string;
9
+ readonly unreadCount: number;
10
+ readonly hasUnread: boolean;
11
+ };
12
+ type ZhipinMessageSentInput = {
13
+ readonly conversationId: string;
14
+ readonly candidateId: string;
15
+ readonly replyId: string;
16
+ readonly candidateName: string;
17
+ readonly message: string;
18
+ readonly unreadCountBeforeReply: number;
19
+ readonly candidateDetails?: NativeCandidateChatDetails;
20
+ };
21
+ type ZhipinWechatRequestedInput = {
22
+ readonly conversationId: string;
23
+ readonly candidateId: string;
24
+ readonly candidateName: string;
25
+ readonly exchangeType?: "requested" | "accepted";
26
+ readonly wechatNumber?: string;
27
+ readonly candidateDetails?: NativeCandidateChatDetails;
28
+ };
29
+ export declare function recordZhipinMessageReceivedEvents(candidates: ReadonlyArray<ZhipinUnreadCandidate>, logger: AgentLogger): void;
30
+ export declare function recordZhipinMessageSentEvent(input: ZhipinMessageSentInput, logger: AgentLogger): void;
31
+ export declare function recordZhipinCandidateContactedEvent(result: NativeRecommendGreetResult, logger: AgentLogger): void;
32
+ export declare function recordZhipinWechatRequestedEvent(input: ZhipinWechatRequestedInput, logger: AgentLogger): void;
33
+ export declare function recordZhipinWechatCompletedEvents(details: NativeCandidateChatDetails, conversationId: string, candidateId: string, logger: AgentLogger): void;
34
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roll-agent/browser-use-agent",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -2,7 +2,21 @@ required:
2
2
  - name: REPLY_AUTHORITY_KEYS_URL
3
3
  purpose: Reply Authority Service 公钥分发端点;`zhipin_send_reply` 启动预热和本地 Ed25519 验签都依赖它
4
4
  example: https://reply-authority.duliday.com/.well-known/reply-authority-keys
5
+ - name: RECRUITMENT_EVENTS_DEFAULT_AGENT_ID
6
+ purpose: 单 browser-use 实例 / 单 Boss 账号部署下的默认招聘业务 Agent ID;招聘事件默认启用,上报时必须用它做归因
7
+ example: zhipin-shanghai-kfc-001
8
+ - name: RECRUITMENT_EVENTS_API_TOKEN
9
+ purpose: 招聘事件 Open API Bearer token;公开 npm 包不内置兜底 token,必须由部署环境提供
10
+ example: token_xxx
5
11
  optional:
12
+ - name: RECRUITMENT_EVENTS_ENABLED
13
+ purpose: 是否启用招聘事件埋点上报;未设置时默认启用,设为 `"false"` 可关闭
14
+ default: "true"
15
+ example: "false"
16
+ - name: RECRUITMENT_EVENTS_API_BASE_URL
17
+ purpose: 招聘事件 Open API base URL;工具成功后会调用 `/api/v1/recruitment-events`
18
+ default: https://huajune.duliday.com
19
+ example: https://example.com
6
20
  - name: BROWSER_VISUAL_CURSOR
7
21
  purpose: 在可见浏览器页面内显示 browser-use 的页内虚拟指针和点击波纹;默认开启,设为 `"false"` 可关闭
8
22
  default: "true"