@roll-agent/smart-reply-agent 1.0.0 → 1.1.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 CHANGED
@@ -31,14 +31,16 @@ npm 包名:`@roll-agent/smart-reply-agent`
31
31
  ## Tools
32
32
 
33
33
  - `generate_reply(candidateMessage, conversationHistory?, candidateInfo?, preferredBrand?, channelType?, defaultWechatId?, industryVoiceId?, turnIndex?, modelConfig?, target)`
34
- 调用 Reply Authority Service 的 `POST /generate-signed-reply`,返回 `suggestedReply`、`signedEnvelope`、`envelopeExp`、`confidence`、`stage` 和可选 `diagnostics`。`target` 为必填,至少包含 `platform=zhipin`、`tenantId`、`conversationId`、`candidateId`。
34
+ 调用 Reply Authority Service 的 `POST /generate-signed-reply`,返回 `suggestedReply`、`signedEnvelope`、`envelopeExp`、`confidence`、`stage` 和可选 `diagnostics`。`target` 为必填,至少包含 `platform=zhipin`、`conversationId`、`candidateId`,以及以下两种 recruiter 绑定方式之一:
35
+ 1. 直接传完整绑定:`tenantId + recruiterBinding`
36
+ 2. 便利代理模式:`recruiterUsername`(smart-reply 会先调用 `POST /resolve-recruiter-binding` 解析出 `tenantId + recruiterBinding`)
35
37
 
36
38
  ## Reply Authority 集成说明
37
39
 
38
40
  - `generate_reply` 不再保留本地 pipeline fallback
39
41
  - 若缺少 `REPLY_AUTHORITY_URL` 或 `REPLY_AUTHORITY_BEARER_TOKEN`,tool 会直接报错
40
42
  - 实际回复生成、reply-policy、FactGate、ReplyGate、年龄校验都在云端执行
41
- - 返回的 `signedEnvelope` 已绑定 `tenantId + conversationId + candidateId`,供 `browser-use-agent.zhipin_send_reply` 本地验签后发送
43
+ - 返回的 `signedEnvelope` v2 信封,已绑定 `tenantId + recruiterBinding + conversationId + candidateId`,供 `browser-use-agent.zhipin_send_reply` 本地验签后发送
42
44
 
43
45
  ## Environment Variables
44
46
 
@@ -49,11 +51,13 @@ npm 包名:`@roll-agent/smart-reply-agent`
49
51
 
50
52
  ## 典型跨 Agent 工作流
51
53
 
52
- 1. `browser-use-agent` 读取候选人资料、聊天记录或当前页面上下文
53
- 2. 调用方整理出 `candidateMessage`、`conversationHistory`、`candidateInfo`,并从 `zhipin_read_messages` / `zhipin_get_candidate_info` 获取 `conversationId + candidateId`
54
- 3. 调用方补上 `target.tenantId`
54
+ 1. `browser-use-agent.zhipin_get_username()` → 获取当前 BOSS 账号 `username`
55
+ 2. `browser-use-agent` 读取候选人资料、聊天记录或当前页面上下文,并从 `zhipin_read_messages` / `zhipin_get_candidate_info` 获取 `conversationId + candidateId`
56
+ 3. 调用 `smart-reply-agent.generate_reply(..., target)`:
57
+ - 直接模式:传 `target.tenantId + target.recruiterBinding`
58
+ - 代理模式:只传 `target.recruiterUsername=username`,由 smart-reply 代调用 `POST /resolve-recruiter-binding`
55
59
  4. `smart-reply-agent.generate_reply(..., target)` 获取 `suggestedReply + signedEnvelope`
56
- 5. `browser-use-agent.zhipin_send_reply(signedEnvelope)` 本地验签后发送
60
+ 5. `browser-use-agent.zhipin_send_reply(signedEnvelope)` 本地验签并校验 recruiter 绑定后发送
57
61
 
58
62
  ## Recommended roll.config.yaml
59
63
 
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{defineAgent as e}from"@roll-agent/sdk";import{defineTool as t}from"@roll-agent/sdk";import{z as n}from"zod";import{z as r}from"zod";var o=r.object({name:r.string(),baseURL:r.string(),description:r.string()}),i=r.record(r.string(),o),a=r.object({chatModel:r.string().optional(),classifyModel:r.string().optional(),replyModel:r.string().optional(),providerConfigs:i.optional()});import{z as s}from"zod";var l=["trust_building","private_channel","qualify_candidate","job_consultation","interview_scheduling","onboard_followup"],c=s.enum(l);import{z as p}from"zod";var d=p.object({name:p.string().optional(),position:p.string().optional(),expectedPosition:p.string().optional(),communicationPosition:p.string().optional(),age:p.string().optional(),gender:p.string().optional(),experience:p.string().optional(),education:p.string().optional(),expectedSalary:p.string().optional(),expectedLocation:p.string().optional(),jobAddress:p.string().optional(),height:p.string().optional(),weight:p.string().optional(),healthCertificate:p.boolean().optional(),activeTime:p.string().optional(),info:p.array(p.string()).optional(),fullText:p.string().optional()}),g=n.object({platform:n.literal("zhipin"),tenantId:n.string().min(1),conversationId:n.string().min(1),candidateId:n.string().min(1)}),u=n.object({candidateMessage:n.string().describe("候选人发送的消息"),conversationHistory:n.array(n.string()).optional().describe("对话历史(最近几轮)"),candidateInfo:d.optional().describe("候选人基本信息"),preferredBrand:n.string().optional().describe("偏好品牌"),channelType:n.enum(["public","private"]).optional().describe("渠道类型: public(BOSS直聘) 或 private(微信)"),defaultWechatId:n.string().optional().describe("默认微信号"),industryVoiceId:n.string().optional().describe("行业语调ID"),turnIndex:n.number().int().min(1).optional().describe("当前会话回复轮次"),modelConfig:a.optional().describe("模型配置覆盖"),target:g.describe("签名绑定目标:租户、会话和候选人标识")}),m=u.extend({requestId:n.string().optional()}),f=n.object({suggestedReply:n.string(),signedEnvelope:n.string(),envelopeExp:n.number().int(),confidence:n.number(),stage:c,replyPolicySource:n.enum(["file","default"]),latencyMs:n.number().optional(),shouldExchangeWechat:n.boolean().optional(),error:n.string().optional(),diagnostics:n.record(n.unknown()).optional()}),b=n.object({statusCode:n.number().int(),error:n.string(),message:n.string()}),y=2e4;function h(e){const t=process.env[e]?.trim();if(!t)throw new Error(`${e} 未配置,smart-reply-agent 无法调用 Reply Authority Service。`);return t}function v(){return{baseUrl:h("REPLY_AUTHORITY_URL"),bearerToken:h("REPLY_AUTHORITY_BEARER_TOKEN")}}function w(e,t){const n=e.endsWith("/")?e:`${e}/`;return new URL(t,n).toString()}function S(e,t){const n=b.safeParse(t);return n.success?`Reply Authority Service 请求失败 (${e}): ${n.data.message}`:`Reply Authority Service 请求失败 (${e})`}async function R(e){const t=await e.text();if(0===t.trim().length)return null;try{return JSON.parse(t)}catch{throw new Error("Reply Authority Service 返回了非 JSON 响应。")}}async function E(e){const t=m.parse(e),n=v(),r=new AbortController,o=setTimeout(()=>r.abort(),y);try{const e=await fetch(w(n.baseUrl,"generate-signed-reply"),{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n.bearerToken}`},body:JSON.stringify(t),signal:r.signal}),o=await R(e);if(!e.ok)throw new Error(S(e.status,o));return f.parse(o)}catch(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("Reply Authority Service 请求超时。");throw e}finally{clearTimeout(o)}}var I=t({name:"generate_reply",description:"根据候选人消息生成智能招聘回复,并向 Reply Authority Service 请求签名信封;调用方必须显式提供 target 以绑定 tenantId/conversationId/candidateId。",input:u,output:f,execute:async(e,t)=>{t.logger.info(`Processing message: ${e.candidateMessage.slice(0,50)}...`);const n=await E(e);return t.logger.info(`Signed reply generated. Stage: ${n.stage}, Confidence: ${n.confidence}`),n}}),T=e({name:"smart-reply-agent",tools:[I]});T.listen().catch(e=>{console.error("Fatal error:",e),process.exit(1)});
1
+ import{defineAgent as e}from"@roll-agent/sdk";import{defineTool as t}from"@roll-agent/sdk";import{z as r}from"zod";import{z as n}from"zod";var i=n.object({name:n.string(),baseURL:n.string(),description:n.string()}),o=n.record(n.string(),i),a=n.object({chatModel:n.string().optional(),classifyModel:n.string().optional(),replyModel:n.string().optional(),providerConfigs:o.optional()});import{z as s}from"zod";var c=["trust_building","private_channel","qualify_candidate","job_consultation","interview_scheduling","onboard_followup"],d=s.enum(c);import{z as g}from"zod";var l=g.object({name:g.string().optional(),position:g.string().optional(),expectedPosition:g.string().optional(),communicationPosition:g.string().optional(),age:g.string().optional(),gender:g.string().optional(),experience:g.string().optional(),education:g.string().optional(),expectedSalary:g.string().optional(),expectedLocation:g.string().optional(),jobAddress:g.string().optional(),height:g.string().optional(),weight:g.string().optional(),healthCertificate:g.boolean().optional(),activeTime:g.string().optional(),info:g.array(g.string()).optional(),fullText:g.string().optional()}),u=r.object({platform:r.literal("zhipin"),username:r.string().min(1),accountId:r.string().min(1).optional()}),p=r.object({platform:r.literal("zhipin"),tenantId:r.string().min(1).optional(),conversationId:r.string().min(1),candidateId:r.string().min(1)}),m=p.extend({recruiterBinding:u.optional(),recruiterUsername:r.string().min(1).optional()}).superRefine((e,t)=>{const n=void 0!==e.recruiterBinding,i=void 0!==e.recruiterUsername;n||i||t.addIssue({code:r.ZodIssueCode.custom,message:"target.recruiterBinding 或 target.recruiterUsername 至少需要提供一个。",path:["recruiterBinding"]}),n&&!i&&void 0===e.tenantId&&t.addIssue({code:r.ZodIssueCode.custom,message:"直接传 target.recruiterBinding 时,target.tenantId 也必须显式提供。",path:["tenantId"]}),n&&i&&void 0!==e.recruiterBinding&&e.recruiterBinding.username!==e.recruiterUsername&&t.addIssue({code:r.ZodIssueCode.custom,message:"target.recruiterUsername 必须与 target.recruiterBinding.username 一致。",path:["recruiterUsername"]})}),f=p.extend({tenantId:r.string().min(1),recruiterBinding:u}),y=r.object({candidateMessage:r.string().describe("候选人发送的消息"),conversationHistory:r.array(r.string()).optional().describe("对话历史(最近几轮)"),candidateInfo:l.optional().describe("候选人基本信息"),preferredBrand:r.string().optional().describe("偏好品牌"),channelType:r.enum(["public","private"]).optional().describe("渠道类型: public(BOSS直聘) 或 private(微信)"),defaultWechatId:r.string().optional().describe("默认微信号"),industryVoiceId:r.string().optional().describe("行业语调ID"),turnIndex:r.number().int().min(1).optional().describe("当前会话回复轮次"),modelConfig:a.optional().describe("模型配置覆盖"),target:m.describe("签名绑定目标:租户、会话和候选人标识")}),I=y.omit({target:!0}).extend({target:f,requestId:r.string().optional()}),b=r.object({suggestedReply:r.string(),signedEnvelope:r.string().describe("Reply Authority Service v2 紧凑签名信封"),envelopeExp:r.number().int(),confidence:r.number(),stage:d,replyPolicySource:r.enum(["file","default"]),latencyMs:r.number().optional(),shouldExchangeWechat:r.boolean().optional(),error:r.string().optional(),diagnostics:r.record(r.unknown()).optional()}),h=r.object({platform:r.literal("zhipin"),username:r.string().min(1),accountId:r.string().min(1).optional()}),v=r.object({tenantId:r.string().min(1),recruiterBinding:u}),w=r.object({statusCode:r.number().int(),error:r.string(),message:r.string()}),B=2e4;function R(e){const t=process.env[e]?.trim();if(!t)throw new Error(`${e} 未配置,smart-reply-agent 无法调用 Reply Authority Service。`);return t}function S(){return{baseUrl:R("REPLY_AUTHORITY_URL"),bearerToken:R("REPLY_AUTHORITY_BEARER_TOKEN")}}function A(e,t){const r=e.endsWith("/")?e:`${e}/`;return new URL(t,r).toString()}function E(e){return{"Content-Type":"application/json",Authorization:`Bearer ${e.bearerToken}`}}function U(e,t){const r=w.safeParse(t);return r.success?`Reply Authority Service 请求失败 (${e}): ${r.data.message}`:`Reply Authority Service 请求失败 (${e})`}async function x(e){const t=await e.text();if(0===t.trim().length)return null;try{return JSON.parse(t)}catch{throw new Error("Reply Authority Service 返回了非 JSON 响应。")}}async function T(e,t,r,n){const i=await fetch(A(e.baseUrl,t),{method:"POST",headers:E(e),body:JSON.stringify(r),signal:n}),o=await x(i);if(!i.ok)throw new Error(U(i.status,o));return o}function j(e){return h.parse({platform:e.platform,username:e.recruiterUsername})}async function _(e,t,r){const n=j(t),i=await T(e,"resolve-recruiter-binding",n,r);return v.parse(i)}function z(e,t){if(void 0!==t.tenantId&&t.tenantId!==e.tenantId)throw new Error(`Reply Authority Service recruiter 解析结果与 target.tenantId 不一致:${e.tenantId}`);return{tenantId:e.tenantId,recruiterBinding:e.recruiterBinding}}async function C(e,t,r){if(void 0!==e.target.recruiterBinding&&void 0!==e.target.tenantId)return I.parse({...e,target:{platform:e.target.platform,tenantId:e.target.tenantId,conversationId:e.target.conversationId,candidateId:e.target.candidateId,recruiterBinding:e.target.recruiterBinding}});const n=z(await _(t,e.target,r),e.target);return I.parse({...e,target:{platform:e.target.platform,tenantId:n.tenantId,conversationId:e.target.conversationId,candidateId:e.target.candidateId,recruiterBinding:n.recruiterBinding}})}async function $(e){const t=y.parse(e),r=I.safeParse(t),n=S(),i=new AbortController,o=setTimeout(()=>i.abort(),B);try{const e=r.success?r.data:await C(t,n,i.signal),o=await T(n,"generate-signed-reply",e,i.signal);return b.parse(o)}catch(e){if(e instanceof Error&&"AbortError"===e.name)throw new Error("Reply Authority Service 请求超时。");throw e}finally{clearTimeout(o)}}var P=t({name:"generate_reply",description:"根据候选人消息生成智能招聘回复,并向 Reply Authority Service 请求签名信封;调用方必须提供 target 以绑定会话和招聘者身份,可直接传 tenantId+recruiterBinding,或只传 recruiterUsername 交给 smart-reply 代理解析。",input:y,output:b,execute:async(e,t)=>{t.logger.info(`Processing message: ${e.candidateMessage.slice(0,50)}...`);const r=await $(e);return t.logger.info(`Signed reply generated. Stage: ${r.stage}, Confidence: ${r.confidence}`),r}}),O=e({name:"smart-reply-agent",tools:[P]});O.listen().catch(e=>{console.error("Fatal error:",e),process.exit(1)});
@@ -1,2 +1,2 @@
1
- import { type GenerateSignedReplyRequest, type GenerateSignedReplyResponse } from "../types/reply-authority.ts";
2
- export declare function generateSignedReply(input: GenerateSignedReplyRequest): Promise<GenerateSignedReplyResponse>;
1
+ import { type GenerateReplyToolInput, type GenerateSignedReplyResponse } from "../types/reply-authority.ts";
2
+ export declare function generateSignedReply(input: GenerateReplyToolInput): Promise<GenerateSignedReplyResponse>;
@@ -2,9 +2,15 @@ export declare const generateReply: import("@roll-agent/sdk").ToolDefinition<{
2
2
  candidateMessage: string;
3
3
  target: {
4
4
  platform: "zhipin";
5
- tenantId: string;
6
5
  conversationId: string;
7
6
  candidateId: string;
7
+ tenantId?: string | undefined;
8
+ recruiterBinding?: {
9
+ platform: "zhipin";
10
+ username: string;
11
+ accountId?: string | undefined;
12
+ } | undefined;
13
+ recruiterUsername?: string | undefined;
8
14
  };
9
15
  conversationHistory?: string[] | undefined;
10
16
  candidateInfo?: {
@@ -1,19 +1,121 @@
1
1
  import { z } from "zod";
2
- export declare const ReplyAuthorityTargetSchema: z.ZodObject<{
2
+ export declare const RecruiterBindingSchema: z.ZodObject<{
3
+ platform: z.ZodLiteral<"zhipin">;
4
+ username: z.ZodString;
5
+ accountId: z.ZodOptional<z.ZodString>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ platform: "zhipin";
8
+ username: string;
9
+ accountId?: string | undefined;
10
+ }, {
11
+ platform: "zhipin";
12
+ username: string;
13
+ accountId?: string | undefined;
14
+ }>;
15
+ export declare const ReplyAuthorityTargetSchema: z.ZodEffects<z.ZodObject<{
16
+ platform: z.ZodLiteral<"zhipin">;
17
+ tenantId: z.ZodOptional<z.ZodString>;
18
+ conversationId: z.ZodString;
19
+ candidateId: z.ZodString;
20
+ } & {
21
+ recruiterBinding: z.ZodOptional<z.ZodObject<{
22
+ platform: z.ZodLiteral<"zhipin">;
23
+ username: z.ZodString;
24
+ accountId: z.ZodOptional<z.ZodString>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ platform: "zhipin";
27
+ username: string;
28
+ accountId?: string | undefined;
29
+ }, {
30
+ platform: "zhipin";
31
+ username: string;
32
+ accountId?: string | undefined;
33
+ }>>;
34
+ recruiterUsername: z.ZodOptional<z.ZodString>;
35
+ }, "strip", z.ZodTypeAny, {
36
+ platform: "zhipin";
37
+ conversationId: string;
38
+ candidateId: string;
39
+ tenantId?: string | undefined;
40
+ recruiterBinding?: {
41
+ platform: "zhipin";
42
+ username: string;
43
+ accountId?: string | undefined;
44
+ } | undefined;
45
+ recruiterUsername?: string | undefined;
46
+ }, {
47
+ platform: "zhipin";
48
+ conversationId: string;
49
+ candidateId: string;
50
+ tenantId?: string | undefined;
51
+ recruiterBinding?: {
52
+ platform: "zhipin";
53
+ username: string;
54
+ accountId?: string | undefined;
55
+ } | undefined;
56
+ recruiterUsername?: string | undefined;
57
+ }>, {
58
+ platform: "zhipin";
59
+ conversationId: string;
60
+ candidateId: string;
61
+ tenantId?: string | undefined;
62
+ recruiterBinding?: {
63
+ platform: "zhipin";
64
+ username: string;
65
+ accountId?: string | undefined;
66
+ } | undefined;
67
+ recruiterUsername?: string | undefined;
68
+ }, {
69
+ platform: "zhipin";
70
+ conversationId: string;
71
+ candidateId: string;
72
+ tenantId?: string | undefined;
73
+ recruiterBinding?: {
74
+ platform: "zhipin";
75
+ username: string;
76
+ accountId?: string | undefined;
77
+ } | undefined;
78
+ recruiterUsername?: string | undefined;
79
+ }>;
80
+ export declare const ResolvedReplyAuthorityTargetSchema: z.ZodObject<{
3
81
  platform: z.ZodLiteral<"zhipin">;
4
- tenantId: z.ZodString;
5
82
  conversationId: z.ZodString;
6
83
  candidateId: z.ZodString;
84
+ } & {
85
+ tenantId: z.ZodString;
86
+ recruiterBinding: z.ZodObject<{
87
+ platform: z.ZodLiteral<"zhipin">;
88
+ username: z.ZodString;
89
+ accountId: z.ZodOptional<z.ZodString>;
90
+ }, "strip", z.ZodTypeAny, {
91
+ platform: "zhipin";
92
+ username: string;
93
+ accountId?: string | undefined;
94
+ }, {
95
+ platform: "zhipin";
96
+ username: string;
97
+ accountId?: string | undefined;
98
+ }>;
7
99
  }, "strip", z.ZodTypeAny, {
8
100
  platform: "zhipin";
9
101
  tenantId: string;
10
102
  conversationId: string;
11
103
  candidateId: string;
104
+ recruiterBinding: {
105
+ platform: "zhipin";
106
+ username: string;
107
+ accountId?: string | undefined;
108
+ };
12
109
  }, {
13
110
  platform: "zhipin";
14
111
  tenantId: string;
15
112
  conversationId: string;
16
113
  candidateId: string;
114
+ recruiterBinding: {
115
+ platform: "zhipin";
116
+ username: string;
117
+ accountId?: string | undefined;
118
+ };
17
119
  }>;
18
120
  export declare const GenerateReplyToolInputSchema: z.ZodObject<{
19
121
  candidateMessage: z.ZodString;
@@ -114,29 +216,84 @@ export declare const GenerateReplyToolInputSchema: z.ZodObject<{
114
216
  baseURL: string;
115
217
  }> | undefined;
116
218
  }>>;
117
- target: z.ZodObject<{
219
+ target: z.ZodEffects<z.ZodObject<{
118
220
  platform: z.ZodLiteral<"zhipin">;
119
- tenantId: z.ZodString;
221
+ tenantId: z.ZodOptional<z.ZodString>;
120
222
  conversationId: z.ZodString;
121
223
  candidateId: z.ZodString;
224
+ } & {
225
+ recruiterBinding: z.ZodOptional<z.ZodObject<{
226
+ platform: z.ZodLiteral<"zhipin">;
227
+ username: z.ZodString;
228
+ accountId: z.ZodOptional<z.ZodString>;
229
+ }, "strip", z.ZodTypeAny, {
230
+ platform: "zhipin";
231
+ username: string;
232
+ accountId?: string | undefined;
233
+ }, {
234
+ platform: "zhipin";
235
+ username: string;
236
+ accountId?: string | undefined;
237
+ }>>;
238
+ recruiterUsername: z.ZodOptional<z.ZodString>;
122
239
  }, "strip", z.ZodTypeAny, {
123
240
  platform: "zhipin";
124
- tenantId: string;
125
241
  conversationId: string;
126
242
  candidateId: string;
243
+ tenantId?: string | undefined;
244
+ recruiterBinding?: {
245
+ platform: "zhipin";
246
+ username: string;
247
+ accountId?: string | undefined;
248
+ } | undefined;
249
+ recruiterUsername?: string | undefined;
250
+ }, {
251
+ platform: "zhipin";
252
+ conversationId: string;
253
+ candidateId: string;
254
+ tenantId?: string | undefined;
255
+ recruiterBinding?: {
256
+ platform: "zhipin";
257
+ username: string;
258
+ accountId?: string | undefined;
259
+ } | undefined;
260
+ recruiterUsername?: string | undefined;
261
+ }>, {
262
+ platform: "zhipin";
263
+ conversationId: string;
264
+ candidateId: string;
265
+ tenantId?: string | undefined;
266
+ recruiterBinding?: {
267
+ platform: "zhipin";
268
+ username: string;
269
+ accountId?: string | undefined;
270
+ } | undefined;
271
+ recruiterUsername?: string | undefined;
127
272
  }, {
128
273
  platform: "zhipin";
129
- tenantId: string;
130
274
  conversationId: string;
131
275
  candidateId: string;
276
+ tenantId?: string | undefined;
277
+ recruiterBinding?: {
278
+ platform: "zhipin";
279
+ username: string;
280
+ accountId?: string | undefined;
281
+ } | undefined;
282
+ recruiterUsername?: string | undefined;
132
283
  }>;
133
284
  }, "strip", z.ZodTypeAny, {
134
285
  candidateMessage: string;
135
286
  target: {
136
287
  platform: "zhipin";
137
- tenantId: string;
138
288
  conversationId: string;
139
289
  candidateId: string;
290
+ tenantId?: string | undefined;
291
+ recruiterBinding?: {
292
+ platform: "zhipin";
293
+ username: string;
294
+ accountId?: string | undefined;
295
+ } | undefined;
296
+ recruiterUsername?: string | undefined;
140
297
  };
141
298
  conversationHistory?: string[] | undefined;
142
299
  candidateInfo?: {
@@ -177,9 +334,15 @@ export declare const GenerateReplyToolInputSchema: z.ZodObject<{
177
334
  candidateMessage: string;
178
335
  target: {
179
336
  platform: "zhipin";
180
- tenantId: string;
181
337
  conversationId: string;
182
338
  candidateId: string;
339
+ tenantId?: string | undefined;
340
+ recruiterBinding?: {
341
+ platform: "zhipin";
342
+ username: string;
343
+ accountId?: string | undefined;
344
+ } | undefined;
345
+ recruiterUsername?: string | undefined;
183
346
  };
184
347
  conversationHistory?: string[] | undefined;
185
348
  candidateInfo?: {
@@ -217,7 +380,7 @@ export declare const GenerateReplyToolInputSchema: z.ZodObject<{
217
380
  }> | undefined;
218
381
  } | undefined;
219
382
  }>;
220
- export declare const GenerateSignedReplyRequestSchema: z.ZodObject<{
383
+ export declare const GenerateSignedReplyRequestSchema: z.ZodObject<Omit<{
221
384
  candidateMessage: z.ZodString;
222
385
  conversationHistory: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
223
386
  candidateInfo: z.ZodOptional<z.ZodObject<{
@@ -316,23 +479,112 @@ export declare const GenerateSignedReplyRequestSchema: z.ZodObject<{
316
479
  baseURL: string;
317
480
  }> | undefined;
318
481
  }>>;
482
+ target: z.ZodEffects<z.ZodObject<{
483
+ platform: z.ZodLiteral<"zhipin">;
484
+ tenantId: z.ZodOptional<z.ZodString>;
485
+ conversationId: z.ZodString;
486
+ candidateId: z.ZodString;
487
+ } & {
488
+ recruiterBinding: z.ZodOptional<z.ZodObject<{
489
+ platform: z.ZodLiteral<"zhipin">;
490
+ username: z.ZodString;
491
+ accountId: z.ZodOptional<z.ZodString>;
492
+ }, "strip", z.ZodTypeAny, {
493
+ platform: "zhipin";
494
+ username: string;
495
+ accountId?: string | undefined;
496
+ }, {
497
+ platform: "zhipin";
498
+ username: string;
499
+ accountId?: string | undefined;
500
+ }>>;
501
+ recruiterUsername: z.ZodOptional<z.ZodString>;
502
+ }, "strip", z.ZodTypeAny, {
503
+ platform: "zhipin";
504
+ conversationId: string;
505
+ candidateId: string;
506
+ tenantId?: string | undefined;
507
+ recruiterBinding?: {
508
+ platform: "zhipin";
509
+ username: string;
510
+ accountId?: string | undefined;
511
+ } | undefined;
512
+ recruiterUsername?: string | undefined;
513
+ }, {
514
+ platform: "zhipin";
515
+ conversationId: string;
516
+ candidateId: string;
517
+ tenantId?: string | undefined;
518
+ recruiterBinding?: {
519
+ platform: "zhipin";
520
+ username: string;
521
+ accountId?: string | undefined;
522
+ } | undefined;
523
+ recruiterUsername?: string | undefined;
524
+ }>, {
525
+ platform: "zhipin";
526
+ conversationId: string;
527
+ candidateId: string;
528
+ tenantId?: string | undefined;
529
+ recruiterBinding?: {
530
+ platform: "zhipin";
531
+ username: string;
532
+ accountId?: string | undefined;
533
+ } | undefined;
534
+ recruiterUsername?: string | undefined;
535
+ }, {
536
+ platform: "zhipin";
537
+ conversationId: string;
538
+ candidateId: string;
539
+ tenantId?: string | undefined;
540
+ recruiterBinding?: {
541
+ platform: "zhipin";
542
+ username: string;
543
+ accountId?: string | undefined;
544
+ } | undefined;
545
+ recruiterUsername?: string | undefined;
546
+ }>;
547
+ }, "target"> & {
319
548
  target: z.ZodObject<{
320
549
  platform: z.ZodLiteral<"zhipin">;
321
- tenantId: z.ZodString;
322
550
  conversationId: z.ZodString;
323
551
  candidateId: z.ZodString;
552
+ } & {
553
+ tenantId: z.ZodString;
554
+ recruiterBinding: z.ZodObject<{
555
+ platform: z.ZodLiteral<"zhipin">;
556
+ username: z.ZodString;
557
+ accountId: z.ZodOptional<z.ZodString>;
558
+ }, "strip", z.ZodTypeAny, {
559
+ platform: "zhipin";
560
+ username: string;
561
+ accountId?: string | undefined;
562
+ }, {
563
+ platform: "zhipin";
564
+ username: string;
565
+ accountId?: string | undefined;
566
+ }>;
324
567
  }, "strip", z.ZodTypeAny, {
325
568
  platform: "zhipin";
326
569
  tenantId: string;
327
570
  conversationId: string;
328
571
  candidateId: string;
572
+ recruiterBinding: {
573
+ platform: "zhipin";
574
+ username: string;
575
+ accountId?: string | undefined;
576
+ };
329
577
  }, {
330
578
  platform: "zhipin";
331
579
  tenantId: string;
332
580
  conversationId: string;
333
581
  candidateId: string;
582
+ recruiterBinding: {
583
+ platform: "zhipin";
584
+ username: string;
585
+ accountId?: string | undefined;
586
+ };
334
587
  }>;
335
- } & {
336
588
  requestId: z.ZodOptional<z.ZodString>;
337
589
  }, "strip", z.ZodTypeAny, {
338
590
  candidateMessage: string;
@@ -341,6 +593,11 @@ export declare const GenerateSignedReplyRequestSchema: z.ZodObject<{
341
593
  tenantId: string;
342
594
  conversationId: string;
343
595
  candidateId: string;
596
+ recruiterBinding: {
597
+ platform: "zhipin";
598
+ username: string;
599
+ accountId?: string | undefined;
600
+ };
344
601
  };
345
602
  conversationHistory?: string[] | undefined;
346
603
  candidateInfo?: {
@@ -385,6 +642,11 @@ export declare const GenerateSignedReplyRequestSchema: z.ZodObject<{
385
642
  tenantId: string;
386
643
  conversationId: string;
387
644
  candidateId: string;
645
+ recruiterBinding: {
646
+ platform: "zhipin";
647
+ username: string;
648
+ accountId?: string | undefined;
649
+ };
388
650
  };
389
651
  conversationHistory?: string[] | undefined;
390
652
  candidateInfo?: {
@@ -457,6 +719,49 @@ export declare const GenerateSignedReplyResponseSchema: z.ZodObject<{
457
719
  shouldExchangeWechat?: boolean | undefined;
458
720
  diagnostics?: Record<string, unknown> | undefined;
459
721
  }>;
722
+ export declare const ResolveRecruiterBindingRequestSchema: z.ZodObject<{
723
+ platform: z.ZodLiteral<"zhipin">;
724
+ username: z.ZodString;
725
+ accountId: z.ZodOptional<z.ZodString>;
726
+ }, "strip", z.ZodTypeAny, {
727
+ platform: "zhipin";
728
+ username: string;
729
+ accountId?: string | undefined;
730
+ }, {
731
+ platform: "zhipin";
732
+ username: string;
733
+ accountId?: string | undefined;
734
+ }>;
735
+ export declare const ResolveRecruiterBindingResponseSchema: z.ZodObject<{
736
+ tenantId: z.ZodString;
737
+ recruiterBinding: z.ZodObject<{
738
+ platform: z.ZodLiteral<"zhipin">;
739
+ username: z.ZodString;
740
+ accountId: z.ZodOptional<z.ZodString>;
741
+ }, "strip", z.ZodTypeAny, {
742
+ platform: "zhipin";
743
+ username: string;
744
+ accountId?: string | undefined;
745
+ }, {
746
+ platform: "zhipin";
747
+ username: string;
748
+ accountId?: string | undefined;
749
+ }>;
750
+ }, "strip", z.ZodTypeAny, {
751
+ tenantId: string;
752
+ recruiterBinding: {
753
+ platform: "zhipin";
754
+ username: string;
755
+ accountId?: string | undefined;
756
+ };
757
+ }, {
758
+ tenantId: string;
759
+ recruiterBinding: {
760
+ platform: "zhipin";
761
+ username: string;
762
+ accountId?: string | undefined;
763
+ };
764
+ }>;
460
765
  export declare const ReplyAuthorityErrorResponseSchema: z.ZodObject<{
461
766
  statusCode: z.ZodNumber;
462
767
  error: z.ZodString;
@@ -470,7 +775,11 @@ export declare const ReplyAuthorityErrorResponseSchema: z.ZodObject<{
470
775
  message: string;
471
776
  statusCode: number;
472
777
  }>;
778
+ export type RecruiterBinding = z.infer<typeof RecruiterBindingSchema>;
473
779
  export type ReplyAuthorityTarget = z.infer<typeof ReplyAuthorityTargetSchema>;
780
+ export type ResolvedReplyAuthorityTarget = z.infer<typeof ResolvedReplyAuthorityTargetSchema>;
474
781
  export type GenerateReplyToolInput = z.infer<typeof GenerateReplyToolInputSchema>;
475
782
  export type GenerateSignedReplyRequest = z.infer<typeof GenerateSignedReplyRequestSchema>;
476
783
  export type GenerateSignedReplyResponse = z.infer<typeof GenerateSignedReplyResponseSchema>;
784
+ export type ResolveRecruiterBindingRequest = z.infer<typeof ResolveRecruiterBindingRequestSchema>;
785
+ export type ResolveRecruiterBindingResponse = z.infer<typeof ResolveRecruiterBindingResponseSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roll-agent/smart-reply-agent",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",