@roll-agent/browser-use-agent 0.17.0 → 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.
@@ -1,6 +1,6 @@
1
1
  import type { AgentLLM, AgentLogger } from "@roll-agent/sdk";
2
2
  import { type CandidateLocationSignal } from "@roll-agent/reply-authority-client";
3
- export declare const LocationSignalAnalysisPathValues: readonly ["llm", "fallback", "profile_only"];
3
+ export declare const LocationSignalAnalysisPathValues: readonly ["llm", "fallback", "profile_only", "speculative", "none"];
4
4
  export type LocationSignalAnalysisPath = (typeof LocationSignalAnalysisPathValues)[number];
5
5
  export declare const LocationSignalInquiryTypeValues: readonly ["location_inquiry", "non_location_inquiry"];
6
6
  export type LocationSignalInquiryType = (typeof LocationSignalInquiryTypeValues)[number];
@@ -29,9 +29,17 @@ export declare const zhipinGenerateReplyPreview: import("@roll-agent/sdk").ToolD
29
29
  error?: string | undefined;
30
30
  confidence?: number | undefined;
31
31
  requestId?: string | undefined;
32
+ expiresAt?: number | undefined;
32
33
  suggestedReply?: string | undefined;
33
34
  stage?: string | undefined;
34
35
  preparedReplyId?: string | undefined;
35
- expiresAt?: number | undefined;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roll-agent/browser-use-agent",
3
- "version": "0.17.0",
3
+ "version": "0.18.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.2.0",
48
+ "@roll-agent/reply-authority-client": "0.3.0",
49
49
  "@roll-agent/sdk": "0.2.0",
50
50
  "@roll-agent/browser": "0.9.0"
51
51
  },
@@ -140,23 +140,30 @@ recommend-list -> 推荐牛人列表,默认向下滚动,去重主键 candid
140
140
  - 没有分隔符时不输出。
141
141
  - 禁止用通用岗位名或 `zhipin_get_candidate_list.company` 伪造品牌。
142
142
 
143
- ## locationSignals
143
+ ## 地点证据(服务端提取)
144
144
 
145
- `zhipin_get_candidate_info` `zhipin_generate_reply_preview` 会在读取聊天记录后输出/透传结构化地点证据 `locationSignals`,供下游 Reply Authority geocode 与门店/岗位距离匹配。
145
+ 地点证据提取已收编进 Reply Authority 服务端的 turn_planning 阶段(RFC pipeline-latency-restructure M1):browser-use 只上送原始对话与候选人资料,服务端 `planTurn` 合并提取地点信号并做逐字证据校验,再交给 geocode 与门店/岗位距离匹配。
146
146
 
147
- 字段形状(与 `@roll-agent/reply-authority-client` 契约一致):
147
+ `zhipin_generate_reply_preview` 通过 SSE `location.resolved` 事件回显服务端提取结果:
148
148
 
149
149
  ```json
150
150
  {
151
- "text": "人民广场",
152
- "source": "candidate_message",
153
- "city": "上海",
154
- "intent": "nearby_store",
155
- "confidence": 0.93
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
+ ]
156
163
  }
157
164
  ```
158
165
 
159
- `source` 取值:
166
+ `source` 取值(与 `@roll-agent/reply-authority-client` 契约一致):
160
167
 
161
168
  | `source` | 含义 |
162
169
  | --- | --- |
@@ -165,23 +172,16 @@ recommend-list -> 推荐牛人列表,默认向下滚动,去重主键 candid
165
172
  | `candidate_expected_location` | 候选人资料里的期望城市/区域(弱信号) |
166
173
  | `communication_position` | 沟通岗位文本中可确认的城市/门店片段 |
167
174
 
168
- `intent` 常见取值:`nearby_store`(附近门店/岗位)、`store_address`(门店地址)、`expected_area`(期望区域)。
175
+ `intent` 常见取值:`nearby_store`(附近门店/岗位)、`store_address`(门店地址)、`expected_area`(期望区域)。`analysisPath` 取值:`llm`(planTurn 合并提取)、`speculative`(词典投机命中)、`none`(无地点信号)。
169
176
 
170
- 抽取规则:
177
+ 规则与边界:
171
178
 
172
- 1. browser-use 通过指挥官 LLM 抽取,并在超时或失败时回退到规则匹配;`text` 必须来自输入原文,不改写成下游门店名。
173
- 2. 多轮对话会扫描全部候选人消息(去重),避免「历史问过地点、最新一句非地点」时丢失证据。
174
- 3. `candidateInfo.expectedLocation` 只作城市边界弱信号(confidence 通常 ≤ 0.6),不能替代候选人本轮追问的具体 POI。
175
- 4. 问候/职位介绍类消息可能跳过 LLM 抽取,仅保留 `expectedLocation` 弱信号。
176
- 5. orchestrator 不要自行构造或改写 `locationSignals`;需要地点证据时调用 `zhipin_get_candidate_info` 或 `zhipin_generate_reply_preview`,由工具自动填充。
177
-
178
- 边界:
179
-
180
- - browser-use **不**调用外部地图、**不**做 geocode、**不**计算门店距离。
181
- - 岗位/门店事实源仍是下游同步的岗位配置;外部地图 POI 不能当作门店或岗位事实。
182
- - `smart-reply-agent.generate_reply` 只校验 schema 并原样转发 `locationSignals`,不做地点推断。
183
-
184
- `zhipin_generate_reply_preview` 会把非空 `locationSignals` 写入 Reply Authority stream input;`zhipin_get_candidate_info` 在 output 中返回同结构数组,便于编排器先读证据再决定是否生成回复。
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
185
 
186
186
  ## Reply Authority
187
187