@wanji_dsh/dsh-sales 0.11.4 → 0.11.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/README.md +3 -1
- package/README.zh.md +12 -2
- package/config/production.cordis.yml +2 -2
- package/cordis.patch.yml +3 -0
- package/dist/client.js +266 -154
- package/dist/host.js +1274 -937
- package/dist/types/agent-knowledge.d.ts +1 -0
- package/dist/types/agent.d.ts +4 -2
- package/dist/types/company/observations.d.ts +13 -0
- package/dist/types/generation-model-route.d.ts +5 -0
- package/dist/types/generation-progress.d.ts +5 -0
- package/dist/types/generation-runtime.d.ts +5 -2
- package/dist/types/host.d.ts +1 -0
- package/dist/types/langfuse-outbox.d.ts +1 -0
- package/dist/types/question-tracing.d.ts +9 -2
- package/dist/types/server/llm.d.ts +26 -10
- package/dist/types/wechat/routes.d.ts +1 -1
- package/dist/types/wechat/transcription.d.ts +5 -0
- package/package.json +1 -1
- package/runtime/wechat-manifest.json +6 -6
package/README.md
CHANGED
|
@@ -153,6 +153,8 @@ Independent customer materials are opt-in via materialRetrievalEnabled, material
|
|
|
153
153
|
|
|
154
154
|
The workbench observes the writer through authenticated Harness `remote.session.follow`. It displays only the draft's `wechat` field in a separate, unreviewed preview; copying, sending and persisted editable copy still use the reviewed result. Manual edits, newer messages, cancellation and failures retire stale previews. CRM context continues to load once per conversation.
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
The sales workbench calls the Harness model service for drafting and review without creating desktop conversations. Standalone evaluation scripts can still explicitly create `wanji-sales-generation` sessions.
|
|
157
157
|
|
|
158
158
|
The browser's bounded `wanji-sales-generation` performance measure contains phase, request and first-preview timings without customer identities or text. The [performance plan](../../docs/superpowers/plans/2026-11-17-sales-stream-performance.md) separates model first-token time, visible preview and verified delivery. Use `scripts/verify-stream-performance.mts` only with explicitly prepared isolated before/after profiles and synthetic contacts; it does not send WeChat messages.
|
|
159
|
+
|
|
160
|
+
Company-managed production Q&A capture needs no per-desktop Langfuse file or key. After verified DingTalk binding and an enabled server policy, future manual and automatic drafts are queued with redaction and device-scoped IDs. Set `salesQuestionTracing:false` to opt out; explicit private-file delivery remains supported. Deploy the receiver and HTTPS route from sibling `wanji_langfuse/services/company-observations` before distributing this release. This captures Q&A outcomes, not historical WeChat backfill or complete CRM/ASR/model spans.
|
package/README.zh.md
CHANGED
|
@@ -34,6 +34,8 @@ DeepSeek Harness 内的销售辅助工作台。插件在左侧菜单注册“销
|
|
|
34
34
|
|
|
35
35
|
工作区自动选择并开启微信同步,回复区不显示技能工作区和刷新控件;支持页内暂停/重连、按任务确认初始化或重启、客户搜索、历史分页、图片/语音随可见消息自动加载、CRM显式绑定、独立草稿编辑与复制。语音显示播放器,由用户点击播放;未入库媒体显示中文同步状态,失败可重试。真实历史、草稿及已处理状态保存在私有消息库;新消息使旧Agent稿失效,人工编辑保留并提示复核。复制不会发送消息。
|
|
36
36
|
|
|
37
|
+
右键微信语音气泡,选择「转为文字」,识别结果显示在气泡下方。手动转写由 Host 使用阿里云百炼北京地域的 `qwen3-asr-flash` 识别所选语音。请在万机大脑的模型凭据中保存可调用该模型的百炼 API Key,默认引用名为 `DASHSCOPE_API_KEY`。如已有其他百炼凭据引用,可在销售助手配置中设置 `wechatAsrApiKeyRef`。缺少百炼凭据时,手动转写沿用已启用的 DSH 语音识别服务。
|
|
38
|
+
|
|
37
39
|
## 日志收集
|
|
38
40
|
|
|
39
41
|
遇到安装、登录、微信同步、知识库或上传问题时,按[销售助手日志收集](docs/diagnostics.zh.md)复现并收集对应日志。
|
|
@@ -83,7 +85,7 @@ npm run build --workspace @wanji_dsh/dsh-sales
|
|
|
83
85
|
|
|
84
86
|
生产 Host 使用两个独立的检索密钥,分别从 `WANJI_SALES_WEKNORA_REPLY_API_KEY` 和 `WANJI_SALES_WEKNORA_MATERIALS_API_KEY` 读取。将生产片段合入现有 profile,避免同一工具前缀重复注册,并保留已有的 CRM 和模型设置。片段开启销售回复的过滤检索和独立素材检索,关闭知识库测试和评测。更新现有 profile 时同步替换两条 WeKnora 工具配置,保留各自的知识库范围。生产 API 基址为 `https://wanjidazi.com/sales-kb/api/v1`。[生产 profile 片段](config/production.cordis.yml)
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
桌面插件默认使用公司身份认证的生产问答托管通道,不需要本机 Langfuse 文件或密钥。需要 Host 直连 Langfuse 并追踪知识库调用时,显式设置 `langfuseConfigFile` 或通过 `WANJI_SALES_PRODUCTION_LANGFUSE_CONFIG` 指定私有 JSON 配置的绝对路径。检索记录包含调用耗时、库 ID、脱敏查询和命中摘要。Windows 和 macOS 均可通过 Host 私有环境变量 `WANJI_SALES_LANGFUSE_REDACTION_KEY` 提供至少 32 字符的独立随机脱敏密钥。macOS 也可使用配置内的 `redactionKeyFile`,文件权限为 0600,父目录权限为 0700。
|
|
87
89
|
|
|
88
90
|
项目 API 凭据由 Host 的 `WANJI_SALES_LANGFUSE_PUBLIC_KEY` 和 `WANJI_SALES_LANGFUSE_SECRET_KEY` 提供,macOS 也可使用钥匙串的 `wanji-langfuse-api-production`。项目沿用迁移配置中的 ID `wanji-sales-test`,独立生产队列只投递到当前生产目标,追踪环境标记为 `production`。[生产 Langfuse 配置示例](config/langfuse.production.example.json)
|
|
89
91
|
|
|
@@ -260,7 +262,7 @@ Independent customer materials are opt-in via materialRetrievalEnabled, material
|
|
|
260
262
|
|
|
261
263
|
工作台通过已认证的 Harness `remote.session.follow` 观察写稿,只在独立的未核对预览区展示 `wechat` 正文。复制、发送及持久化编辑框仍使用完整审核后的结果;人工编辑、新消息、取消和失败会撤下失效预览。CRM 背景继续按对话只加载一次。
|
|
262
264
|
|
|
263
|
-
|
|
265
|
+
销售工作台通过 Harness 的模型服务完成起草和核对,生成过程中不会新建桌面对话。独立评测脚本仍可以显式使用 `wanji-sales-generation` 会话。
|
|
264
266
|
|
|
265
267
|
浏览器只保留一份 `wanji-sales-generation` 性能测量,包含阶段、请求、首 token 与首正文耗时,不包含客户身份或聊天文字。[性能计划](../../docs/superpowers/plans/2026-11-17-sales-stream-performance.md)区分模型首 token、可见预览和核验交付。`scripts/verify-stream-performance.mts` 仅用于已准备的隔离前后版本和模拟联系人,不发送微信。
|
|
266
268
|
|
|
@@ -269,3 +271,11 @@ Independent customer materials are opt-in via materialRetrievalEnabled, material
|
|
|
269
271
|
微信会话顶部显示销售侧意向等级和分数,展开可看各产品的依据及评估时间。左侧可切换「最新消息」和「意向度从高到低」;已有评分优先,同分按最新消息排序。A 为 80–100 分,B 为 60–79 分,C 为 40–59 分,D 为 0–39 分,资料不足时显示待评估。
|
|
270
272
|
|
|
271
273
|
绑定 CRM 后复用首次客户、线索和通话画像,按已核实的客户身份读取初始等级。电话和微信中的实际采购信号用于按产品评分,微信同步入库后后台更新。连续消息合并处理,普通寒暄和重复同步不会加分。失败时保留上一次有效分数。评分和分级跟进策略仅用于销售工作台和内部草稿规划。
|
|
274
|
+
|
|
275
|
+
## 公司统一生产问答上报
|
|
276
|
+
|
|
277
|
+
新版默认准备公司托管上报,无需在每台电脑填写 Langfuse 地址、配置文件或 Key。完成钉钉企业身份验证,并且公司服务器已启用生产观测策略后,销售助手会采集后续手动及自动起草的客户问题、最终回复、耗时和结果状态。普通 DSH 模型和公司共享模型均可使用。显式 `salesQuestionTracing:false` 停止采集,已有私有配置文件直连方式继续兼容。
|
|
278
|
+
|
|
279
|
+
事件在本机脱敏后进入有界持久队列;服务端确认写入后才移除。绑定变更不会把旧账号事件上传给新账号;重试复用固定标识。此前未采集的微信历史不会补传。本期问答上报不等同于完整 CRM/录音/画像及模型 token 调用链观测。生产知识库测试功能仍关闭。
|
|
280
|
+
|
|
281
|
+
服务端接收服务、私有凭据和代理发布维护在同级 `wanji_langfuse/services/company-observations`,需要先部署该入口再分发新版插件;只更新本地源码不会让其他电脑立刻生效。
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
environment: production
|
|
24
24
|
knowledgeTestEnabled: false
|
|
25
25
|
draftKnowledgeEnabled: true
|
|
26
|
-
agentKnowledgeTracing:
|
|
26
|
+
agentKnowledgeTracing: true
|
|
27
27
|
knowledgeBaseIds: [3e6f197b-30a5-41bb-8c2b-228e47026762]
|
|
28
28
|
toolPrefix: weknora
|
|
29
29
|
materialRetrievalEnabled: true
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
materialKnowledgeBaseId: 1f93aee2-6d66-42d7-8b7a-b5fe5d094550
|
|
33
33
|
materialAssetBaseUrl: https://im-wanji.oss-cn-shanghai.aliyuncs.com/wanji_dazi/knowledge-assets/production/materials/
|
|
34
34
|
materialMetadata: !!js "process.env.WANJI_SALES_WEKNORA_MATERIALS_API_KEY ? { apiKey: process.env.WANJI_SALES_WEKNORA_MATERIALS_API_KEY, tenantId: '10000' } : undefined"
|
|
35
|
-
salesQuestionTracing:
|
|
35
|
+
salesQuestionTracing: true
|
|
36
36
|
langfuseConfigFile: !!js process.env.WANJI_SALES_PRODUCTION_LANGFUSE_CONFIG
|