@roll-agent/browser-use-agent 0.16.2 → 0.18.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 +26 -24
- package/dist/index.js +1 -1
- package/dist/pages/zhipin/job-signals.d.ts +38 -0
- package/dist/reply-authority/reply-preview-visual.d.ts +1 -1
- package/dist/tools/zhipin-generate-reply-preview.d.ts +12 -4
- package/dist/tools/zhipin-get-candidate-info.d.ts +10 -0
- package/package.json +4 -4
- package/references/zhipin-workflows.md +43 -0
|
@@ -1,8 +1,45 @@
|
|
|
1
|
+
import type { AgentLLM, AgentLogger } from "@roll-agent/sdk";
|
|
2
|
+
import { type CandidateLocationSignal } from "@roll-agent/reply-authority-client";
|
|
3
|
+
export declare const LocationSignalAnalysisPathValues: readonly ["llm", "fallback", "profile_only", "speculative", "none"];
|
|
4
|
+
export type LocationSignalAnalysisPath = (typeof LocationSignalAnalysisPathValues)[number];
|
|
5
|
+
export declare const LocationSignalInquiryTypeValues: readonly ["location_inquiry", "non_location_inquiry"];
|
|
6
|
+
export type LocationSignalInquiryType = (typeof LocationSignalInquiryTypeValues)[number];
|
|
7
|
+
export type LocationSignalResolution = {
|
|
8
|
+
readonly signals: readonly CandidateLocationSignal[];
|
|
9
|
+
readonly analysisPath: LocationSignalAnalysisPath;
|
|
10
|
+
readonly inquiryType?: LocationSignalInquiryType;
|
|
11
|
+
};
|
|
12
|
+
export type LocationSignalMessage = {
|
|
13
|
+
readonly index: number;
|
|
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[]>;
|
|
1
37
|
export declare function resolvePreferredBrand(communicationPosition: string): string | undefined;
|
|
2
38
|
export declare function resolveExpectedSignals(expectedJobText: string): {
|
|
3
39
|
expectedLocation: string;
|
|
4
40
|
expectedPosition: string;
|
|
5
41
|
};
|
|
42
|
+
export declare function formatLocationSignalsVisualLabel(resolution: LocationSignalResolution | readonly CandidateLocationSignal[]): string;
|
|
6
43
|
export declare function resolveConversationSignals(input: {
|
|
7
44
|
communicationPosition: string;
|
|
8
45
|
expectedJobText: string;
|
|
@@ -12,3 +49,4 @@ export declare function resolveConversationSignals(input: {
|
|
|
12
49
|
expectedPosition: string;
|
|
13
50
|
preferredBrand?: string;
|
|
14
51
|
};
|
|
52
|
+
export {};
|
|
@@ -4,7 +4,7 @@ type NativePreviewTarget = {
|
|
|
4
4
|
export declare class NativeReplyPreviewVisualSession {
|
|
5
5
|
private readonly target;
|
|
6
6
|
constructor(target: NativePreviewTarget);
|
|
7
|
-
begin(label: string): Promise<boolean>;
|
|
7
|
+
begin(label: string, locationSummary?: string): Promise<boolean>;
|
|
8
8
|
updateStatus(label: string): Promise<boolean>;
|
|
9
9
|
updateDraft(draftText: string, provisional: boolean): Promise<boolean>;
|
|
10
10
|
complete(label: string, finalReply: string): Promise<boolean>;
|
|
@@ -4,7 +4,7 @@ import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
|
4
4
|
import type { ZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
5
5
|
import { savePreparedReply } from "../reply-authority/prepared-reply-store.ts";
|
|
6
6
|
import { NativeReplyPreviewVisualSession } from "../reply-authority/reply-preview-visual.ts";
|
|
7
|
-
type NativeVisualActivitySessionLike = Pick<NativeVisualActivitySession, "begin" | "highlightSelector" | "succeed" | "fail">;
|
|
7
|
+
type NativeVisualActivitySessionLike = Pick<NativeVisualActivitySession, "begin" | "highlightSelector" | "succeed" | "fail" | "clear">;
|
|
8
8
|
type ReplyPreviewVisualSessionLike = Pick<NativeReplyPreviewVisualSession, "begin" | "updateStatus" | "updateDraft" | "complete" | "fail">;
|
|
9
9
|
type ZhipinGenerateReplyPreviewDeps = {
|
|
10
10
|
readonly openNativePagePort: typeof openZhipinNativePagePort;
|
|
@@ -18,20 +18,28 @@ export declare const zhipinGenerateReplyPreview: import("@roll-agent/sdk").ToolD
|
|
|
18
18
|
index?: number | undefined;
|
|
19
19
|
conversationId?: string | undefined;
|
|
20
20
|
candidateName?: string | undefined;
|
|
21
|
-
maxMessages?: number | undefined;
|
|
22
21
|
reasoning?: {
|
|
23
22
|
enabled: boolean;
|
|
24
23
|
effort?: "high" | "low" | "medium" | undefined;
|
|
25
24
|
scope?: "all" | "reply" | undefined;
|
|
26
25
|
} | undefined;
|
|
26
|
+
maxMessages?: number | undefined;
|
|
27
27
|
}, {
|
|
28
28
|
success: boolean;
|
|
29
29
|
error?: string | undefined;
|
|
30
|
+
confidence?: number | undefined;
|
|
30
31
|
requestId?: string | undefined;
|
|
32
|
+
expiresAt?: number | undefined;
|
|
31
33
|
suggestedReply?: string | undefined;
|
|
32
|
-
confidence?: number | undefined;
|
|
33
34
|
stage?: string | undefined;
|
|
34
35
|
preparedReplyId?: string | undefined;
|
|
35
|
-
|
|
36
|
+
timing?: {
|
|
37
|
+
totalLatencyMs: number;
|
|
38
|
+
preparedContextHit: boolean;
|
|
39
|
+
replyLatencyMs?: number | undefined;
|
|
40
|
+
turnPlanningLatencyMs?: number | undefined;
|
|
41
|
+
contextBuildingLatencyMs?: number | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
gateRewritten?: boolean | undefined;
|
|
36
44
|
}>;
|
|
37
45
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { prepareReplyContext } from "@roll-agent/reply-authority-client";
|
|
1
2
|
import { NativeVisualActivitySession } from "../native-visual-activity-session.ts";
|
|
2
3
|
import { openZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
3
4
|
import type { ZhipinNativePagePort } from "../pages/zhipin/native-page.ts";
|
|
@@ -5,7 +6,9 @@ type NativeVisualActivitySessionLike = Pick<NativeVisualActivitySession, "begin"
|
|
|
5
6
|
type ZhipinGetCandidateInfoDeps = {
|
|
6
7
|
readonly openNativePagePort: typeof openZhipinNativePagePort;
|
|
7
8
|
readonly createNativeVisualActivitySession: (page: ZhipinNativePagePort) => NativeVisualActivitySessionLike;
|
|
9
|
+
readonly prepareReplyContext: typeof prepareReplyContext;
|
|
8
10
|
};
|
|
11
|
+
export declare function resetPrepareReplyContextCooldownForTests(): void;
|
|
9
12
|
export declare function setZhipinGetCandidateInfoDepsForTests(override: Partial<ZhipinGetCandidateInfoDeps> | undefined): void;
|
|
10
13
|
export declare const zhipinGetCandidateInfo: import("@roll-agent/sdk").ToolDefinition<{
|
|
11
14
|
index?: number | undefined;
|
|
@@ -33,6 +36,13 @@ export declare const zhipinGetCandidateInfo: import("@roll-agent/sdk").ToolDefin
|
|
|
33
36
|
recruiterMessages: number;
|
|
34
37
|
systemMessages: number;
|
|
35
38
|
};
|
|
39
|
+
locationSignals: {
|
|
40
|
+
source: "candidate_message" | "conversation_history" | "candidate_expected_location" | "communication_position";
|
|
41
|
+
text: string;
|
|
42
|
+
confidence: number;
|
|
43
|
+
city?: string | undefined;
|
|
44
|
+
intent?: "nearby_store" | "store_address" | "expected_area" | undefined;
|
|
45
|
+
}[];
|
|
36
46
|
chatMessages: {
|
|
37
47
|
index: number;
|
|
38
48
|
content: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/browser-use-agent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.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.
|
|
49
|
-
"@roll-agent/
|
|
50
|
-
"@roll-agent/
|
|
48
|
+
"@roll-agent/reply-authority-client": "0.3.0",
|
|
49
|
+
"@roll-agent/sdk": "0.2.0",
|
|
50
|
+
"@roll-agent/browser": "0.9.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^22.0.0"
|
|
@@ -140,6 +140,49 @@ recommend-list -> 推荐牛人列表,默认向下滚动,去重主键 candid
|
|
|
140
140
|
- 没有分隔符时不输出。
|
|
141
141
|
- 禁止用通用岗位名或 `zhipin_get_candidate_list.company` 伪造品牌。
|
|
142
142
|
|
|
143
|
+
## 地点证据(服务端提取)
|
|
144
|
+
|
|
145
|
+
地点证据提取已收编进 Reply Authority 服务端的 turn_planning 阶段(RFC pipeline-latency-restructure M1):browser-use 只上送原始对话与候选人资料,服务端 `planTurn` 合并提取地点信号并做逐字证据校验,再交给 geocode 与门店/岗位距离匹配。
|
|
146
|
+
|
|
147
|
+
`zhipin_generate_reply_preview` 通过 SSE `location.resolved` 事件回显服务端提取结果:
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"type": "location.resolved",
|
|
152
|
+
"inquiryType": "location_inquiry",
|
|
153
|
+
"analysisPath": "llm",
|
|
154
|
+
"signals": [
|
|
155
|
+
{
|
|
156
|
+
"text": "人民广场",
|
|
157
|
+
"source": "candidate_message",
|
|
158
|
+
"city": "上海",
|
|
159
|
+
"intent": "nearby_store",
|
|
160
|
+
"confidence": 0.93
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
`source` 取值(与 `@roll-agent/reply-authority-client` 契约一致):
|
|
167
|
+
|
|
168
|
+
| `source` | 含义 |
|
|
169
|
+
| --- | --- |
|
|
170
|
+
| `candidate_message` | 候选人消息中的地点片段(最高优先级) |
|
|
171
|
+
| `conversation_history` | 近几轮对话中的地点引用 |
|
|
172
|
+
| `candidate_expected_location` | 候选人资料里的期望城市/区域(弱信号) |
|
|
173
|
+
| `communication_position` | 沟通岗位文本中可确认的城市/门店片段 |
|
|
174
|
+
|
|
175
|
+
`intent` 常见取值:`nearby_store`(附近门店/岗位)、`store_address`(门店地址)、`expected_area`(期望区域)。`analysisPath` 取值:`llm`(planTurn 合并提取)、`speculative`(词典投机命中)、`none`(无地点信号)。
|
|
176
|
+
|
|
177
|
+
规则与边界:
|
|
178
|
+
|
|
179
|
+
1. browser-use 不抽取地点、不调用外部地图、不做 geocode、不计算门店距离;上送的对话原文是服务端提取的唯一证据源。
|
|
180
|
+
2. `candidateInfo.expectedLocation` 只作城市边界弱信号(服务端 confidence 封顶 0.6),不能替代候选人本轮追问的具体 POI。
|
|
181
|
+
3. orchestrator 不要自行构造或改写地点信号:`generate_reply` 请求中的 `locationSignals` 字段已废弃,服务端过渡期内会逐字校验后合并,两个版本周期后忽略。
|
|
182
|
+
4. `zhipin_get_candidate_info` 输出中的 `locationSignals` 恒为空数组,仅为输出契约兼容保留,不要依赖。
|
|
183
|
+
5. 岗位/门店事实源仍是下游同步的岗位配置;外部地图 POI 不能当作门店或岗位事实。
|
|
184
|
+
6. `smart-reply-agent.generate_reply` 只校验 schema 并原样转发(deprecated 字段同样适用),不做地点推断。
|
|
185
|
+
|
|
143
186
|
## Reply Authority
|
|
144
187
|
|
|
145
188
|
`zhipin_send_prepared_reply` 只接受 `zhipin_generate_reply_preview` 生成的 `preparedReplyId`,内部再取回 Reply Authority Service 签发的 envelope 并完成验签。
|