@roll-agent/browser-use-agent 0.18.0 → 0.20.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 +39 -33
- package/dist/index.js +1 -1
- package/dist/pages/zhipin/job-signals.d.ts +4 -29
- package/dist/pages/zhipin/native-page.d.ts +6 -0
- package/dist/reply-authority/prepared-reply-store.d.ts +28 -0
- package/dist/reply-authority/reply-preview-visual.d.ts +13 -1
- package/dist/tools/zhipin-generate-reply-preview.d.ts +18 -1
- package/dist/tools/zhipin-get-candidate-info.d.ts +2 -1
- package/dist/tools/zhipin-get-candidate-list.d.ts +1 -1
- package/dist/tools/zhipin-judge-prepared-reply.d.ts +21 -0
- package/dist/tools/zhipin-send-prepared-reply.d.ts +10 -0
- package/package.json +2 -2
- package/references/zhipin-workflows.md +10 -10
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type CandidateLocationSignal } from "@roll-agent/reply-authority-client";
|
|
1
|
+
import type { CandidateLocationSignal } from "@roll-agent/reply-authority-client";
|
|
3
2
|
export declare const LocationSignalAnalysisPathValues: readonly ["llm", "fallback", "profile_only", "speculative", "none"];
|
|
4
3
|
export type LocationSignalAnalysisPath = (typeof LocationSignalAnalysisPathValues)[number];
|
|
5
4
|
export declare const LocationSignalInquiryTypeValues: readonly ["location_inquiry", "non_location_inquiry"];
|
|
@@ -9,37 +8,13 @@ export type LocationSignalResolution = {
|
|
|
9
8
|
readonly analysisPath: LocationSignalAnalysisPath;
|
|
10
9
|
readonly inquiryType?: LocationSignalInquiryType;
|
|
11
10
|
};
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
readonly sender: "candidate" | "recruiter" | "system";
|
|
15
|
-
readonly content: string;
|
|
16
|
-
};
|
|
17
|
-
type LocationSignalEvidenceInput = {
|
|
18
|
-
readonly latestCandidateMessage: string;
|
|
19
|
-
readonly recentMessages: readonly LocationSignalMessage[];
|
|
20
|
-
readonly expectedLocation: string;
|
|
21
|
-
readonly communicationPosition: string;
|
|
22
|
-
};
|
|
23
|
-
type ResolveLocationSignalsInput = {
|
|
24
|
-
readonly llm: AgentLLM;
|
|
25
|
-
readonly logger?: Pick<AgentLogger, "warn"> | undefined;
|
|
26
|
-
readonly messages: readonly LocationSignalMessage[];
|
|
27
|
-
readonly expectedLocation: string;
|
|
28
|
-
readonly communicationPosition: string;
|
|
29
|
-
readonly timeoutMs?: number | undefined;
|
|
30
|
-
};
|
|
31
|
-
export declare function resolveLocationSignalsFromLlmText(input: LocationSignalEvidenceInput & {
|
|
32
|
-
readonly llmText: string;
|
|
33
|
-
}): CandidateLocationSignal[];
|
|
34
|
-
export declare function resolveLocationSignals(input: ResolveLocationSignalsInput): Promise<LocationSignalResolution>;
|
|
35
|
-
export declare function clearLocationSignalResolutionCacheForTest(): void;
|
|
36
|
-
export declare function resolveLocationSignalsWithLlm(input: ResolveLocationSignalsInput): Promise<CandidateLocationSignal[]>;
|
|
11
|
+
export declare function formatLocationSignalsVisualLabel(resolution: LocationSignalResolution | readonly CandidateLocationSignal[]): string;
|
|
12
|
+
export declare function resolvePreferredBrandId(communicationPosition: string): number | undefined;
|
|
37
13
|
export declare function resolvePreferredBrand(communicationPosition: string): string | undefined;
|
|
38
14
|
export declare function resolveExpectedSignals(expectedJobText: string): {
|
|
39
15
|
expectedLocation: string;
|
|
40
16
|
expectedPosition: string;
|
|
41
17
|
};
|
|
42
|
-
export declare function formatLocationSignalsVisualLabel(resolution: LocationSignalResolution | readonly CandidateLocationSignal[]): string;
|
|
43
18
|
export declare function resolveConversationSignals(input: {
|
|
44
19
|
communicationPosition: string;
|
|
45
20
|
expectedJobText: string;
|
|
@@ -48,5 +23,5 @@ export declare function resolveConversationSignals(input: {
|
|
|
48
23
|
expectedLocation: string;
|
|
49
24
|
expectedPosition: string;
|
|
50
25
|
preferredBrand?: string;
|
|
26
|
+
preferredBrandId?: number;
|
|
51
27
|
};
|
|
52
|
-
export {};
|
|
@@ -87,6 +87,12 @@ export type NativeCandidateChatDetails = {
|
|
|
87
87
|
readonly candidateInfo: NativeCandidateInfo;
|
|
88
88
|
readonly messages: readonly NativeChatMessage[];
|
|
89
89
|
};
|
|
90
|
+
export type NativeCandidateProfileSummary = {
|
|
91
|
+
readonly age: string;
|
|
92
|
+
readonly experience: string;
|
|
93
|
+
readonly education: string;
|
|
94
|
+
};
|
|
95
|
+
export declare function parseZhipinCandidateProfileTokens(rawTexts: readonly string[]): NativeCandidateProfileSummary;
|
|
90
96
|
export type NativeRecommendCardInspection = {
|
|
91
97
|
readonly found: boolean;
|
|
92
98
|
readonly cardSelector: string;
|
|
@@ -1,3 +1,30 @@
|
|
|
1
|
+
import type { ReplyGateAdvisoryCode, ReplyVariantKind } from "@roll-agent/reply-authority-client";
|
|
2
|
+
export declare const PreparedReplyOptionValues: readonly ["option_1", "option_2"];
|
|
3
|
+
export type PreparedReplyOption = (typeof PreparedReplyOptionValues)[number];
|
|
4
|
+
export type PreparedReplyVariantOption = {
|
|
5
|
+
readonly option: PreparedReplyOption;
|
|
6
|
+
readonly variant: ReplyVariantKind;
|
|
7
|
+
readonly suggestedReply: string;
|
|
8
|
+
readonly signedEnvelope: string;
|
|
9
|
+
readonly envelopeExp: number;
|
|
10
|
+
};
|
|
11
|
+
export type PreparedReplyVariantFinding = {
|
|
12
|
+
readonly code: ReplyGateAdvisoryCode;
|
|
13
|
+
readonly description: string;
|
|
14
|
+
};
|
|
15
|
+
export type PreparedReplyVariantGroup = {
|
|
16
|
+
readonly groupId: string;
|
|
17
|
+
readonly options: readonly PreparedReplyVariantOption[];
|
|
18
|
+
readonly findings: readonly PreparedReplyVariantFinding[];
|
|
19
|
+
readonly rubricVersion: string;
|
|
20
|
+
readonly rubricHash: string;
|
|
21
|
+
readonly target: {
|
|
22
|
+
readonly platform: "zhipin";
|
|
23
|
+
readonly tenantId: string;
|
|
24
|
+
readonly conversationId: string;
|
|
25
|
+
};
|
|
26
|
+
readonly recommendedOption: PreparedReplyOption;
|
|
27
|
+
};
|
|
1
28
|
export type PreparedReplyRecord = {
|
|
2
29
|
readonly preparedReplyId: string;
|
|
3
30
|
readonly signedEnvelope: string;
|
|
@@ -7,6 +34,7 @@ export type PreparedReplyRecord = {
|
|
|
7
34
|
readonly expiresAt: number;
|
|
8
35
|
readonly requestId?: string;
|
|
9
36
|
readonly unreadCountBeforeReply?: number;
|
|
37
|
+
readonly variantGroup?: PreparedReplyVariantGroup;
|
|
10
38
|
};
|
|
11
39
|
export type PreparedReplyConsumeResult = {
|
|
12
40
|
readonly ok: true;
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
type NativePreviewTarget = {
|
|
2
2
|
evaluateJson<T = unknown>(expression: string): Promise<T>;
|
|
3
3
|
};
|
|
4
|
+
export interface NativeReplyPreviewVariantOption {
|
|
5
|
+
readonly option: string;
|
|
6
|
+
readonly suggestedReply: string;
|
|
7
|
+
}
|
|
8
|
+
export interface NativeReplyPreviewFinding {
|
|
9
|
+
readonly code: string;
|
|
10
|
+
readonly description: string;
|
|
11
|
+
}
|
|
12
|
+
export interface NativeReplyPreviewVariantSelection {
|
|
13
|
+
readonly options: readonly NativeReplyPreviewVariantOption[];
|
|
14
|
+
readonly findings: readonly NativeReplyPreviewFinding[];
|
|
15
|
+
}
|
|
4
16
|
export declare class NativeReplyPreviewVisualSession {
|
|
5
17
|
private readonly target;
|
|
6
18
|
constructor(target: NativePreviewTarget);
|
|
7
19
|
begin(label: string, locationSummary?: string): Promise<boolean>;
|
|
8
20
|
updateStatus(label: string): Promise<boolean>;
|
|
9
21
|
updateDraft(draftText: string, provisional: boolean): Promise<boolean>;
|
|
10
|
-
complete(label: string, finalReply: string): Promise<boolean>;
|
|
22
|
+
complete(label: string, finalReply: string, variantSelection?: NativeReplyPreviewVariantSelection): Promise<boolean>;
|
|
11
23
|
fail(label: string): Promise<boolean>;
|
|
12
24
|
clear(): Promise<boolean>;
|
|
13
25
|
private render;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { streamGenerateSignedReply } from "@roll-agent/reply-authority-client";
|
|
1
|
+
import { fetchReplyFeedbackRubric, streamGenerateSignedReply } from "@roll-agent/reply-authority-client";
|
|
2
2
|
import { NativeVisualActivitySession } from "../native-visual-activity-session.ts";
|
|
3
3
|
import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
4
4
|
import type { ZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
@@ -11,7 +11,9 @@ type ZhipinGenerateReplyPreviewDeps = {
|
|
|
11
11
|
readonly createNativeVisualActivitySession: (page: ZhipinNativePagePort) => NativeVisualActivitySessionLike;
|
|
12
12
|
readonly createReplyPreviewVisualSession: (page: ZhipinNativePagePort) => ReplyPreviewVisualSessionLike;
|
|
13
13
|
readonly streamGenerateSignedReply: typeof streamGenerateSignedReply;
|
|
14
|
+
readonly fetchReplyFeedbackRubric: typeof fetchReplyFeedbackRubric;
|
|
14
15
|
readonly savePreparedReply: typeof savePreparedReply;
|
|
16
|
+
readonly random: () => number;
|
|
15
17
|
};
|
|
16
18
|
export declare function setZhipinGenerateReplyPreviewDepsForTests(override: Partial<ZhipinGenerateReplyPreviewDeps> | undefined): void;
|
|
17
19
|
export declare const zhipinGenerateReplyPreview: import("@roll-agent/sdk").ToolDefinition<{
|
|
@@ -41,5 +43,20 @@ export declare const zhipinGenerateReplyPreview: import("@roll-agent/sdk").ToolD
|
|
|
41
43
|
contextBuildingLatencyMs?: number | undefined;
|
|
42
44
|
} | undefined;
|
|
43
45
|
gateRewritten?: boolean | undefined;
|
|
46
|
+
replyVariantSelection?: {
|
|
47
|
+
options: {
|
|
48
|
+
option: "option_1" | "option_2";
|
|
49
|
+
expiresAt: number;
|
|
50
|
+
suggestedReply: string;
|
|
51
|
+
}[];
|
|
52
|
+
groupId: string;
|
|
53
|
+
findings: {
|
|
54
|
+
code: string;
|
|
55
|
+
description: string;
|
|
56
|
+
}[];
|
|
57
|
+
rubricVersion: string;
|
|
58
|
+
rubricHash: string;
|
|
59
|
+
} | undefined;
|
|
60
|
+
errorKind?: "timeout" | "rejected" | "server_error" | undefined;
|
|
44
61
|
}>;
|
|
45
62
|
export {};
|
|
@@ -22,8 +22,8 @@ export declare const zhipinGetCandidateInfo: import("@roll-agent/sdk").ToolDefin
|
|
|
22
22
|
candidateInfo: {
|
|
23
23
|
name: string;
|
|
24
24
|
age: string;
|
|
25
|
-
experience: string;
|
|
26
25
|
education: string;
|
|
26
|
+
experience: string;
|
|
27
27
|
expectedLocation: string;
|
|
28
28
|
expectedPosition: string;
|
|
29
29
|
expectedSalary: string;
|
|
@@ -53,5 +53,6 @@ export declare const zhipinGetCandidateInfo: import("@roll-agent/sdk").ToolDefin
|
|
|
53
53
|
formattedHistory: string[];
|
|
54
54
|
error?: string | undefined;
|
|
55
55
|
preferredBrand?: string | undefined;
|
|
56
|
+
preferredBrandId?: number | undefined;
|
|
56
57
|
}>;
|
|
57
58
|
export {};
|
|
@@ -18,8 +18,8 @@ export declare const zhipinGetCandidateList: import("@roll-agent/sdk").ToolDefin
|
|
|
18
18
|
index: number;
|
|
19
19
|
candidateId: string;
|
|
20
20
|
age: string;
|
|
21
|
-
experience: string;
|
|
22
21
|
education: string;
|
|
22
|
+
experience: string;
|
|
23
23
|
workStatus: string;
|
|
24
24
|
company: string;
|
|
25
25
|
currentPosition: string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { fetchReplyFeedbackRubric } from "@roll-agent/reply-authority-client";
|
|
2
|
+
type ZhipinJudgePreparedReplyDeps = {
|
|
3
|
+
readonly fetchReplyFeedbackRubric: typeof fetchReplyFeedbackRubric;
|
|
4
|
+
};
|
|
5
|
+
export declare function setZhipinJudgePreparedReplyDepsForTests(override: Partial<ZhipinJudgePreparedReplyDeps> | undefined): void;
|
|
6
|
+
export declare const zhipinJudgePreparedReply: import("@roll-agent/sdk").ToolDefinition<{
|
|
7
|
+
preparedReplyId: string;
|
|
8
|
+
judgeModel?: string | undefined;
|
|
9
|
+
}, {
|
|
10
|
+
success: boolean;
|
|
11
|
+
error?: string | undefined;
|
|
12
|
+
fallback?: boolean | undefined;
|
|
13
|
+
recommendedOption?: "option_1" | "option_2" | undefined;
|
|
14
|
+
variantDecision?: {
|
|
15
|
+
reason: string;
|
|
16
|
+
chosenOption: "option_1" | "option_2";
|
|
17
|
+
confirmedFindingCodes?: ("too_many_questions" | "audit_tone" | "reply_overpacked" | "off_axis_fact_disclosure")[] | undefined;
|
|
18
|
+
judgeModel?: string | undefined;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { postReplyFeedback } from "@roll-agent/reply-authority-client";
|
|
1
2
|
import { sendSignedZhipinReply } from "./zhipin-send-reply.ts";
|
|
2
3
|
type ZhipinSendPreparedReplyDeps = {
|
|
3
4
|
readonly sendSignedZhipinReply: typeof sendSignedZhipinReply;
|
|
5
|
+
readonly postReplyFeedback: typeof postReplyFeedback;
|
|
4
6
|
};
|
|
5
7
|
export declare function setZhipinSendPreparedReplyDepsForTests(override: Partial<ZhipinSendPreparedReplyDeps> | undefined): void;
|
|
6
8
|
export declare const zhipinSendPreparedReply: import("@roll-agent/sdk").ToolDefinition<{
|
|
@@ -8,6 +10,12 @@ export declare const zhipinSendPreparedReply: import("@roll-agent/sdk").ToolDefi
|
|
|
8
10
|
browserActionApproval?: {
|
|
9
11
|
id: string;
|
|
10
12
|
} | undefined;
|
|
13
|
+
variantDecision?: {
|
|
14
|
+
reason: string;
|
|
15
|
+
chosenOption: "option_1" | "option_2";
|
|
16
|
+
confirmedFindingCodes?: ("too_many_questions" | "audit_tone" | "reply_overpacked" | "off_axis_fact_disclosure")[] | undefined;
|
|
17
|
+
judgeModel?: string | undefined;
|
|
18
|
+
} | undefined;
|
|
11
19
|
toolActionApproval?: {
|
|
12
20
|
id: string;
|
|
13
21
|
} | undefined;
|
|
@@ -15,5 +23,7 @@ export declare const zhipinSendPreparedReply: import("@roll-agent/sdk").ToolDefi
|
|
|
15
23
|
success: boolean;
|
|
16
24
|
sentMessage: string;
|
|
17
25
|
error?: string | undefined;
|
|
26
|
+
feedbackStatus?: "failed" | "accepted" | "duplicate" | "skipped" | undefined;
|
|
27
|
+
feedbackError?: string | undefined;
|
|
18
28
|
}>;
|
|
19
29
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/browser-use-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"zod": "^3.25.76",
|
|
48
|
-
"@roll-agent/reply-authority-client": "0.
|
|
48
|
+
"@roll-agent/reply-authority-client": "0.5.0",
|
|
49
49
|
"@roll-agent/sdk": "0.2.0",
|
|
50
50
|
"@roll-agent/browser": "0.9.0"
|
|
51
51
|
},
|
|
@@ -125,20 +125,20 @@ recommend-list -> 推荐牛人列表,默认向下滚动,去重主键 candid
|
|
|
125
125
|
- `no-new-items`:连续滚动没有新去重项。
|
|
126
126
|
- `max-steps`:达到滚动步数上限。
|
|
127
127
|
|
|
128
|
-
## preferredBrand
|
|
128
|
+
## preferredBrand / preferredBrandId
|
|
129
129
|
|
|
130
|
-
`zhipin_get_candidate_info`
|
|
130
|
+
`zhipin_get_candidate_info` 会从页面信号中解析:
|
|
131
131
|
|
|
132
|
-
- `expectedLocation`
|
|
133
|
-
- `
|
|
134
|
-
- `preferredBrand`
|
|
132
|
+
- `expectedLocation` / `expectedPosition`(来自期望职位文本)
|
|
133
|
+
- `preferredBrandId` 或 `preferredBrand`(来自 `candidateInfo.communicationPosition`,互斥,最多输出一个)
|
|
135
134
|
|
|
136
|
-
|
|
135
|
+
沟通职位有两种命名格式,解析规则:
|
|
137
136
|
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
137
|
+
- 新格式 `自定义描述…[品牌ID]`(末尾方括号包数字,兼容全角 `【】` / `[]` 与括号内空白):输出 `preferredBrandId`,例如 `咖啡早班店员-接受小白-免费咖啡[10027]` -> `preferredBrandId: 10027`。此时**不输出** `preferredBrand`——新格式第一段是岗位描述,不是品牌名。
|
|
138
|
+
- 老格式 `品牌名-职位`(含连字符类分隔符 `-` / `-` / `—` / `–`,且无 ID 尾缀):取第一段输出 `preferredBrand`,例如 `肯德基-服务员` -> `preferredBrand: "肯德基"`。
|
|
139
|
+
- 两者都不满足时不输出任何品牌字段。
|
|
140
|
+
- 编排器原样透传工具输出即可,不要自行解析 `communicationPosition`;Reply Authority 服务端会以 `candidateInfo.communicationPosition` 为权威再次提取品牌 ID 并与 `preferredBrandId` 对账(不一致以服务端提取为准)。
|
|
141
|
+
- 禁止用通用岗位名或 `zhipin_get_candidate_list.company` 伪造品牌;禁止把新格式的第一段当品牌名。
|
|
142
142
|
|
|
143
143
|
## 地点证据(服务端提取)
|
|
144
144
|
|