@roll-agent/smart-reply-agent 1.2.5 → 1.3.1
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/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,
|
|
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,CandidateLocationSignalIntentValues as E,CandidateLocationSignalSchema as R,CandidateLocationSignalSourceValues as T,FunnelStageSchema as _,FunnelStageValues as v,GenerateReplyToolInputSchema as h,GenerateSignedReplyRequestSchema as O,GenerateSignedReplyResponseSchema as S,ModelConfigSchema as U,ProviderConfigSchema as Y,ProviderConfigsSchema as b,ReasoningConfigSchema as x,RecruiterBindingSchema as A,ReplyAuthorityErrorResponseSchema as I,ReplyAuthorityTargetSchema as j,ResolvedReplyAuthorityTargetSchema as L,ResolveRecruiterBindingRequestSchema as P,ResolveRecruiterBindingResponseSchema as $}from"@roll-agent/reply-authority-client";var k=f({name:"generate_reply",description:"根据候选人消息生成智能招聘回复,并向 Reply Authority Service 请求签名信封;调用方必须提供 target 以绑定会话和招聘者身份,可直接传 tenantId+recruiterBinding,或只传 recruiterUsername 交给 smart-reply 代理解析。",input:h,output:S,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}}),z=e({name:"smart-reply-agent",tools:[k,m]});z.listen().catch(e=>{console.error("Fatal error:",e),process.exit(1)});
|
|
@@ -32,6 +32,13 @@ export declare const generateReply: import("@roll-agent/sdk").ToolDefinition<{
|
|
|
32
32
|
activeTime?: string | undefined;
|
|
33
33
|
fullText?: string | undefined;
|
|
34
34
|
} | undefined;
|
|
35
|
+
locationSignals?: {
|
|
36
|
+
text: string;
|
|
37
|
+
source: "candidate_message" | "conversation_history" | "candidate_expected_location" | "communication_position";
|
|
38
|
+
confidence: number;
|
|
39
|
+
city?: string | undefined;
|
|
40
|
+
intent?: "nearby_store" | "store_address" | "expected_area" | undefined;
|
|
41
|
+
}[] | undefined;
|
|
35
42
|
preferredBrand?: string | undefined;
|
|
36
43
|
channelType?: "public" | "private" | undefined;
|
|
37
44
|
defaultWechatId?: string | undefined;
|
|
@@ -53,10 +60,10 @@ export declare const generateReply: import("@roll-agent/sdk").ToolDefinition<{
|
|
|
53
60
|
}> | undefined;
|
|
54
61
|
} | undefined;
|
|
55
62
|
}, {
|
|
63
|
+
confidence: number;
|
|
56
64
|
suggestedReply: string;
|
|
57
65
|
signedEnvelope: string;
|
|
58
66
|
envelopeExp: number;
|
|
59
|
-
confidence: number;
|
|
60
67
|
stage: "trust_building" | "private_channel" | "qualify_candidate" | "job_consultation" | "interview_scheduling" | "onboard_followup";
|
|
61
68
|
replyPolicySource: "default" | "file";
|
|
62
69
|
error?: string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
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";
|
|
1
|
+
export { CandidateInfoSchema, CandidateLocationSignalIntentValues, CandidateLocationSignalSchema, CandidateLocationSignalSourceValues, 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, CandidateLocationSignal, 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.
|
|
3
|
+
"version": "1.3.1",
|
|
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/
|
|
45
|
-
"@roll-agent/
|
|
44
|
+
"@roll-agent/sdk": "0.2.0",
|
|
45
|
+
"@roll-agent/reply-authority-client": "0.3.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.0.0"
|