@roll-agent/smart-reply-agent 1.2.4 → 1.2.5
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
CHANGED
|
@@ -37,6 +37,13 @@ npm 包名:`@roll-agent/smart-reply-agent`
|
|
|
37
37
|
1. 直接传完整绑定:`tenantId + recruiterBinding`
|
|
38
38
|
2. 便利代理模式:`recruiterUsername`(smart-reply 会先调用 `POST /resolve-recruiter-binding` 解析出 `tenantId + recruiterBinding`)
|
|
39
39
|
|
|
40
|
+
`modelConfig.reasoning` 为可选 thinking/reasoning 控制:
|
|
41
|
+
|
|
42
|
+
- `enabled`:`true` 表示请求 Reply Authority Service 使用模型 reasoning/thinking;`false` 表示显式请求关闭
|
|
43
|
+
- `effort`:可选,`"low"` / `"medium"` / `"high"`,不传由服务端使用默认值
|
|
44
|
+
- `scope`:可选,`"reply"` 只影响回复生成与 gate rewrite,`"all"` 也影响 turn planning
|
|
45
|
+
- 不传 `modelConfig.reasoning` 时,沿用 Reply Authority Service 的 provider 默认策略
|
|
46
|
+
|
|
40
47
|
`target.conversationId` / `target.candidateId` 的来源约束:
|
|
41
48
|
|
|
42
49
|
- 应直接复用 `browser-use-agent.zhipin_read_messages`、`browser-use-agent.zhipin_open_chat` 或 `browser-use-agent.zhipin_get_candidate_info` 的真实输出
|
|
@@ -64,6 +71,27 @@ npm 包名:`@roll-agent/smart-reply-agent`
|
|
|
64
71
|
}
|
|
65
72
|
```
|
|
66
73
|
|
|
74
|
+
启用 reasoning 示例:
|
|
75
|
+
|
|
76
|
+
```json
|
|
77
|
+
{
|
|
78
|
+
"candidateMessage": "你好,我想了解一下这个岗位",
|
|
79
|
+
"modelConfig": {
|
|
80
|
+
"reasoning": {
|
|
81
|
+
"enabled": true,
|
|
82
|
+
"effort": "medium",
|
|
83
|
+
"scope": "reply"
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"target": {
|
|
87
|
+
"platform": "zhipin",
|
|
88
|
+
"conversationId": "642438677-0",
|
|
89
|
+
"candidateId": "642438677-0",
|
|
90
|
+
"recruiterUsername": "郭晓阳"
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
67
95
|
Minimal valid input 示例(直接模式):
|
|
68
96
|
|
|
69
97
|
```json
|
|
@@ -86,7 +114,8 @@ npm 包名:`@roll-agent/smart-reply-agent`
|
|
|
86
114
|
- `generate_reply` 不再保留本地 pipeline fallback
|
|
87
115
|
- 若缺少 `REPLY_AUTHORITY_URL` 或 `REPLY_AUTHORITY_BEARER_TOKEN`,tool 会直接报错
|
|
88
116
|
- 实际回复生成、reply-policy、FactGate、ReplyGate、年龄校验都在云端执行
|
|
89
|
-
-
|
|
117
|
+
- `modelConfig.reasoning` 会透传给 Reply Authority Service;raw reasoning/thinking 文本不会作为业务输出返回
|
|
118
|
+
- 返回的 `signedEnvelope` 为 v2 信封,已绑定 `tenantId + recruiterBinding + conversationId + candidateId`;浏览器发送主链路应优先使用 `browser-use-agent.zhipin_generate_reply_preview(...) -> zhipin_send_prepared_reply(preparedReplyId)`
|
|
90
119
|
- 调用失败时抛 `ReplyAuthorityRequestError`,携带 `meta: {url, timeoutMs, requestId}` 与 `Error.cause` 链。通过 `roll run` 运行时 stderr 会展开 `cause: ...` 行用于定位;透传的 `x-request-id` 可跨服务端追踪
|
|
91
120
|
- `diagnostics.brandResolutionSource="none"`、`diagnostics.resolvedBrand=""`、`diagnostics.ageGate.status="unknown"` 都是合法服务端结果,不代表 tool 调用失败。是否补问用户或转人工,是 orch 层策略,不是本 Agent 的重试条件
|
|
92
121
|
|
|
@@ -113,7 +142,7 @@ npm 包名:`@roll-agent/smart-reply-agent`
|
|
|
113
142
|
- 直接模式:传 `target.tenantId + target.recruiterBinding`
|
|
114
143
|
- 代理模式:只传 `target.recruiterUsername=username`,由 smart-reply 代调用 `POST /resolve-recruiter-binding`
|
|
115
144
|
5. `smart-reply-agent.generate_reply(..., target)` 获取 `suggestedReply + signedEnvelope`
|
|
116
|
-
6. `browser-use-agent.
|
|
145
|
+
6. 若需要在 BOSS 浏览器中展示生成过程并发送,优先改用 `browser-use-agent.zhipin_generate_reply_preview(...) -> zhipin_send_prepared_reply(preparedReplyId)`,不要把 `signedEnvelope` 作为跨 Agent 编排参数传递
|
|
117
146
|
|
|
118
147
|
## Recommended roll.config.yaml
|
|
119
148
|
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{defineAgent as e}from"@roll-agent/sdk";import{defineTool as r}from"@roll-agent/sdk";import{z as t}from"zod";import{createHash as o}from"node:crypto";import{z as n}from"zod";var i=["REPLY_AUTHORITY_URL","REPLY_AUTHORITY_BEARER_TOKEN","REPLY_AUTHORITY_TIMEOUT_MS"],a=/^[0-9a-f]{8}$/,s=n.object({present:n.boolean(),fingerprint:n.string().regex(a).optional()}),c=n.record(s);function p(e,r=process.env){return Object.fromEntries(e.map(e=>{const t=r[e];return"string"==typeof t&&t.length>0?[e,{present:!0,fingerprint:l(t)}]:[e,{present:!1}]}))}function l(e){return o("sha256").update(e).digest("hex").slice(0,8)}var g=t.object({effectiveEnvSources:c}),m=r({name:"diagnostic_status",description:"返回 smart-reply 运行态进程中已声明环境变量的存在状态与短指纹",input:t.object({}),output:g,execute:async(e,r)=>(r.logger.info("Querying smart-reply diagnostic status"),{effectiveEnvSources:p(i)})});import{defineTool as f}from"@roll-agent/sdk";import{generateSignedReply as u,ReplyAuthorityRequestError as d}from"@roll-agent/reply-authority-client";import{CandidateInfoSchema as y,FunnelStageSchema as E,FunnelStageValues as R,GenerateReplyToolInputSchema as T,GenerateSignedReplyRequestSchema as _,GenerateSignedReplyResponseSchema as v,ModelConfigSchema as h,ProviderConfigSchema as O,ProviderConfigsSchema as S,
|
|
1
|
+
import{defineAgent as e}from"@roll-agent/sdk";import{defineTool as r}from"@roll-agent/sdk";import{z as t}from"zod";import{createHash as o}from"node:crypto";import{z as n}from"zod";var i=["REPLY_AUTHORITY_URL","REPLY_AUTHORITY_BEARER_TOKEN","REPLY_AUTHORITY_TIMEOUT_MS"],a=/^[0-9a-f]{8}$/,s=n.object({present:n.boolean(),fingerprint:n.string().regex(a).optional()}),c=n.record(s);function p(e,r=process.env){return Object.fromEntries(e.map(e=>{const t=r[e];return"string"==typeof t&&t.length>0?[e,{present:!0,fingerprint:l(t)}]:[e,{present:!1}]}))}function l(e){return o("sha256").update(e).digest("hex").slice(0,8)}var g=t.object({effectiveEnvSources:c}),m=r({name:"diagnostic_status",description:"返回 smart-reply 运行态进程中已声明环境变量的存在状态与短指纹",input:t.object({}),output:g,execute:async(e,r)=>(r.logger.info("Querying smart-reply diagnostic status"),{effectiveEnvSources:p(i)})});import{defineTool as f}from"@roll-agent/sdk";import{generateSignedReply as u,ReplyAuthorityRequestError as d}from"@roll-agent/reply-authority-client";import{CandidateInfoSchema as y,FunnelStageSchema as E,FunnelStageValues as R,GenerateReplyToolInputSchema as T,GenerateSignedReplyRequestSchema as _,GenerateSignedReplyResponseSchema as v,ModelConfigSchema as h,ProviderConfigSchema as O,ProviderConfigsSchema as S,ReasoningConfigSchema as U,RecruiterBindingSchema as Y,ReplyAuthorityErrorResponseSchema as b,ReplyAuthorityTargetSchema as x,ResolvedReplyAuthorityTargetSchema as A,ResolveRecruiterBindingRequestSchema as I,ResolveRecruiterBindingResponseSchema as j}from"@roll-agent/reply-authority-client";var L=f({name:"generate_reply",description:"根据候选人消息生成智能招聘回复,并向 Reply Authority Service 请求签名信封;调用方必须提供 target 以绑定会话和招聘者身份,可直接传 tenantId+recruiterBinding,或只传 recruiterUsername 交给 smart-reply 代理解析。",input:T,output:v,execute:async(e,r)=>{r.logger.info(`Processing message: ${e.candidateMessage.slice(0,50)}...`);const t=await u(e);return r.logger.info(`Signed reply generated. Stage: ${t.stage}, Confidence: ${t.confidence}`),t}}),P=e({name:"smart-reply-agent",tools:[L,m]});P.listen().catch(e=>{console.error("Fatal error:",e),process.exit(1)});
|
|
@@ -41,6 +41,11 @@ export declare const generateReply: import("@roll-agent/sdk").ToolDefinition<{
|
|
|
41
41
|
chatModel?: string | undefined;
|
|
42
42
|
classifyModel?: string | undefined;
|
|
43
43
|
replyModel?: string | undefined;
|
|
44
|
+
reasoning?: {
|
|
45
|
+
enabled: boolean;
|
|
46
|
+
effort?: "low" | "medium" | "high" | undefined;
|
|
47
|
+
scope?: "reply" | "all" | undefined;
|
|
48
|
+
} | undefined;
|
|
44
49
|
providerConfigs?: Record<string, {
|
|
45
50
|
description: string;
|
|
46
51
|
name: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ModelConfigSchema, ProviderConfigSchema, ProviderConfigsSchema, } from "@roll-agent/reply-authority-client";
|
|
2
|
-
export type { ModelConfig, ProviderConfig, ProviderConfigs, } from "@roll-agent/reply-authority-client";
|
|
1
|
+
export { ModelConfigSchema, ProviderConfigSchema, ProviderConfigsSchema, ReasoningConfigSchema, } from "@roll-agent/reply-authority-client";
|
|
2
|
+
export type { ModelConfig, ProviderConfig, ProviderConfigs, ReasoningConfig, } from "@roll-agent/reply-authority-client";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { CandidateInfoSchema, FunnelStageSchema, FunnelStageValues, GenerateReplyToolInputSchema, GenerateSignedReplyRequestSchema, GenerateSignedReplyResponseSchema, ModelConfigSchema, ProviderConfigSchema, ProviderConfigsSchema, RecruiterBindingSchema, ReplyAuthorityErrorResponseSchema, ReplyAuthorityTargetSchema, ResolvedReplyAuthorityTargetSchema, ResolveRecruiterBindingRequestSchema, ResolveRecruiterBindingResponseSchema, } from "@roll-agent/reply-authority-client";
|
|
2
|
-
export type { CandidateInfo, FunnelStage, GenerateReplyToolInput, GenerateSignedReplyRequest, GenerateSignedReplyResponse, ModelConfig, ProviderConfig, ProviderConfigs, RecruiterBinding, ReplyAuthorityTarget, ResolvedReplyAuthorityTarget, ResolveRecruiterBindingRequest, ResolveRecruiterBindingResponse, } from "@roll-agent/reply-authority-client";
|
|
1
|
+
export { CandidateInfoSchema, FunnelStageSchema, FunnelStageValues, GenerateReplyToolInputSchema, GenerateSignedReplyRequestSchema, GenerateSignedReplyResponseSchema, ModelConfigSchema, ProviderConfigSchema, ProviderConfigsSchema, ReasoningConfigSchema, RecruiterBindingSchema, ReplyAuthorityErrorResponseSchema, ReplyAuthorityTargetSchema, ResolvedReplyAuthorityTargetSchema, ResolveRecruiterBindingRequestSchema, ResolveRecruiterBindingResponseSchema, } from "@roll-agent/reply-authority-client";
|
|
2
|
+
export type { CandidateInfo, FunnelStage, GenerateReplyToolInput, GenerateSignedReplyRequest, GenerateSignedReplyResponse, ModelConfig, ProviderConfig, ProviderConfigs, ReasoningConfig, RecruiterBinding, ReplyAuthorityTarget, ResolvedReplyAuthorityTarget, ResolveRecruiterBindingRequest, ResolveRecruiterBindingResponse, } from "@roll-agent/reply-authority-client";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@roll-agent/smart-reply-agent",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"zod": "^3.25.76",
|
|
44
|
-
"@roll-agent/reply-authority-client": "0.1.
|
|
45
|
-
"@roll-agent/sdk": "0.
|
|
44
|
+
"@roll-agent/reply-authority-client": "0.1.2",
|
|
45
|
+
"@roll-agent/sdk": "0.2.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.0.0"
|