@wanji_dsh/dsh-sales 0.11.7 → 0.11.8
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.zh.md
CHANGED
|
@@ -34,7 +34,7 @@ DeepSeek Harness 内的销售辅助工作台。插件在左侧菜单注册“销
|
|
|
34
34
|
|
|
35
35
|
工作区自动选择并开启微信同步,回复区不显示技能工作区和刷新控件;支持页内暂停/重连、按任务确认初始化或重启、客户搜索、历史分页、图片/语音随可见消息自动加载、CRM显式绑定、独立草稿编辑与复制。语音显示播放器,由用户点击播放;未入库媒体显示中文同步状态,失败可重试。真实历史、草稿及已处理状态保存在私有消息库;新消息使旧Agent稿失效,人工编辑保留并提示复核。复制不会发送消息。
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
右键微信语音气泡并选择「转为文字」。已绑定钉钉的企业成员优先通过企业网关转写,百炼 API Key 由服务器持有。未绑定时,转写使用本机模型凭据服务。两种方式均调用百炼北京地域的 `qwen3-asr-flash`。默认识别 `DASHSCOPE_API_KEY`、已有的 `WANJI_QWEN_ASR_API_KEY` 或模型设置中同一百炼服务的唯一凭据引用。也可以用 `wechatAsrApiKeyRef` 指定凭据。缺少百炼凭据时,手动转写沿用已启用的 DSH 语音识别服务。
|
|
38
38
|
|
|
39
39
|
## 日志收集
|
|
40
40
|
|
package/dist/client.js
CHANGED
|
@@ -8232,6 +8232,8 @@ function VoiceAttachment({ src, t, onError, voiceMenu }) {
|
|
|
8232
8232
|
var transcriptionErrors = {
|
|
8233
8233
|
WECHAT_VOICE_NOT_AVAILABLE: "wxTranscriptVoicePending",
|
|
8234
8234
|
WECHAT_TRANSCRIPTION_NOT_CONFIGURED: "wxTranscriptNotConfigured",
|
|
8235
|
+
WECHAT_TRANSCRIPTION_COMPANY_DENIED: "wxTranscriptCompanyDenied",
|
|
8236
|
+
WECHAT_TRANSCRIPTION_COMPANY_UNAVAILABLE: "wxTranscriptCompanyUnavailable",
|
|
8235
8237
|
WECHAT_TRANSCRIPTION_AUTH_FAILED: "wxTranscriptAuthFailed",
|
|
8236
8238
|
WECHAT_TRANSCRIPTION_TIMEOUT: "wxTranscriptTimeout",
|
|
8237
8239
|
WECHAT_TRANSCRIPTION_EMPTY: "wxTranscriptEmpty",
|
|
@@ -10245,6 +10247,8 @@ var zh = {
|
|
|
10245
10247
|
wxTranscribeVoice: "\u8F6C\u4E3A\u6587\u5B57",
|
|
10246
10248
|
wxTranscribingVoice: "\u6B63\u5728\u8F6C\u5199\u8BED\u97F3\u2026",
|
|
10247
10249
|
wxTranscriptUnavailable: "\u8BED\u97F3\u8F6C\u5199\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8BED\u97F3\u8BC6\u522B\u670D\u52A1\u540E\u91CD\u8BD5\u3002",
|
|
10250
|
+
wxTranscriptCompanyDenied: "\u4F01\u4E1A\u8BED\u97F3\u6388\u6743\u672A\u901A\u8FC7\u3002\u8BF7\u68C0\u67E5\u9489\u9489\u7ED1\u5B9A\u540E\u91CD\u8BD5\u3002",
|
|
10251
|
+
wxTranscriptCompanyUnavailable: "\u4F01\u4E1A\u8BED\u97F3\u670D\u52A1\u6682\u65F6\u4E0D\u53EF\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002",
|
|
10248
10252
|
wxTranscriptVoicePending: "\u8BED\u97F3\u5C1A\u672A\u540C\u6B65\u5230\u672C\u673A\u3002\u8BF7\u540C\u6B65\u540E\u91CD\u8BD5\u3002",
|
|
10249
10253
|
wxTranscriptNotConfigured: "\u8BED\u97F3\u8BC6\u522B\u672A\u914D\u7F6E\u3002\u8BF7\u5728\u6A21\u578B\u8BBE\u7F6E\u4E2D\u914D\u7F6E\u963F\u91CC\u4E91\u767E\u70BC API Key\u3002",
|
|
10250
10254
|
wxTranscriptAuthFailed: "\u8BED\u97F3\u8BC6\u522B\u9274\u6743\u5931\u8D25\u3002\u8BF7\u68C0\u67E5\u963F\u91CC\u4E91\u767E\u70BC API Key \u548C\u6A21\u578B\u6743\u9650\u3002",
|
|
@@ -10579,6 +10583,8 @@ var en = {
|
|
|
10579
10583
|
wxTranscribeVoice: "Transcribe",
|
|
10580
10584
|
wxTranscribingVoice: "Transcribing\u2026",
|
|
10581
10585
|
wxTranscriptUnavailable: "Could not transcribe. Check the speech recognition service and retry.",
|
|
10586
|
+
wxTranscriptCompanyDenied: "Company speech access was denied. Check your DingTalk binding and try again.",
|
|
10587
|
+
wxTranscriptCompanyUnavailable: "Company speech recognition is unavailable. Try again later.",
|
|
10582
10588
|
wxTranscriptVoicePending: "This voice message has not synced yet. Sync it and try again.",
|
|
10583
10589
|
wxTranscriptNotConfigured: "Configure an Alibaba Cloud Model Studio API key in model settings to transcribe voice messages.",
|
|
10584
10590
|
wxTranscriptAuthFailed: "Speech recognition was denied. Check the Alibaba Cloud Model Studio API key and model access.",
|
package/dist/host.js
CHANGED
|
@@ -15839,7 +15839,7 @@ import { homedir, release } from "node:os";
|
|
|
15839
15839
|
import { isAbsolute, join } from "node:path";
|
|
15840
15840
|
|
|
15841
15841
|
// src/update/version.ts
|
|
15842
|
-
var RUNNING_VERSION = true ? "0.11.
|
|
15842
|
+
var RUNNING_VERSION = true ? "0.11.8" : "0.0.0-dev";
|
|
15843
15843
|
|
|
15844
15844
|
// src/diagnostics.ts
|
|
15845
15845
|
var MAX_FILE_BYTES = 512 * 1024;
|
|
@@ -19091,6 +19091,9 @@ async function transcribeWechatWav(audio, apiKey, signal) {
|
|
|
19091
19091
|
await response.body?.cancel();
|
|
19092
19092
|
throw new WechatTranscriptionError(response.status === 401 || response.status === 403 ? "WECHAT_TRANSCRIPTION_AUTH_FAILED" : "WECHAT_TRANSCRIPTION_UNAVAILABLE");
|
|
19093
19093
|
}
|
|
19094
|
+
return readWechatTranscript(response, signal);
|
|
19095
|
+
}
|
|
19096
|
+
async function readWechatTranscript(response, signal) {
|
|
19094
19097
|
const result = await readJson(response, 256 * 1024, signal);
|
|
19095
19098
|
const choice2 = result?.choices?.[0], content = choice2?.message?.content;
|
|
19096
19099
|
if (choice2?.finish_reason !== "stop" || typeof content !== "string") throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_UNAVAILABLE");
|
|
@@ -45207,6 +45210,29 @@ function createCompanyConnection({ credentials, settings, fetch: request2 = fetc
|
|
|
45207
45210
|
...typeof value.position === "string" ? { position: value.position } : {}
|
|
45208
45211
|
};
|
|
45209
45212
|
}),
|
|
45213
|
+
async transcribeVoice(audio, signal) {
|
|
45214
|
+
if (!verified && (await identity.refresh(signal)).status !== "bound") return;
|
|
45215
|
+
const secret = await token();
|
|
45216
|
+
if (!secret) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_COMPANY_DENIED");
|
|
45217
|
+
const response = await request2(COMPANY_ORIGIN + ROOT + "/voice/transcribe", {
|
|
45218
|
+
method: "POST",
|
|
45219
|
+
redirect: "error",
|
|
45220
|
+
credentials: "omit",
|
|
45221
|
+
signal,
|
|
45222
|
+
headers: { "Content-Type": "audio/wav", Authorization: "Bearer " + secret },
|
|
45223
|
+
body: Buffer.from(audio)
|
|
45224
|
+
});
|
|
45225
|
+
if (!response.ok) {
|
|
45226
|
+
await response.body?.cancel();
|
|
45227
|
+
if (response.status === 401 || response.status === 403) {
|
|
45228
|
+
verified = false;
|
|
45229
|
+
throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_COMPANY_DENIED");
|
|
45230
|
+
}
|
|
45231
|
+
if (response.status === 413 || response.status === 400) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_INVALID_AUDIO");
|
|
45232
|
+
throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_COMPANY_UNAVAILABLE");
|
|
45233
|
+
}
|
|
45234
|
+
return readWechatTranscript(response, signal);
|
|
45235
|
+
},
|
|
45210
45236
|
begin: (hint, signal) => ordered(signal, async () => {
|
|
45211
45237
|
const previous = await token();
|
|
45212
45238
|
if (previous) await revoke(previous, signal);
|
|
@@ -45286,7 +45312,7 @@ function safeView(identity, service, ready) {
|
|
|
45286
45312
|
async function readAccountPhone(account) {
|
|
45287
45313
|
if (typeof account?.getProfile !== "function") return;
|
|
45288
45314
|
const result = await account.getProfile({
|
|
45289
|
-
version: true ? "0.11.
|
|
45315
|
+
version: true ? "0.11.8" : "0.0.0",
|
|
45290
45316
|
locale: Intl.DateTimeFormat().resolvedOptions().locale,
|
|
45291
45317
|
timezoneOffsetSeconds: -(/* @__PURE__ */ new Date()).getTimezoneOffset() * 60
|
|
45292
45318
|
});
|
|
@@ -45691,6 +45717,10 @@ function activate(ctx, rawConfig) {
|
|
|
45691
45717
|
}, async transcribeVoice(audio, signal, mode) {
|
|
45692
45718
|
if (audio.length > config.maxAudioBytes) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_INVALID_AUDIO");
|
|
45693
45719
|
if (mode === "manual") {
|
|
45720
|
+
const identity = companyIdentity();
|
|
45721
|
+
const companyText = await identity?.transcribeVoice?.(audio, signal);
|
|
45722
|
+
if (companyText !== void 0) return companyText;
|
|
45723
|
+
if (identity?.canUseSharedModel()) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_COMPANY_UNAVAILABLE");
|
|
45694
45724
|
const apiKey = await resolveWechatAsrKey(config.wechatAsrApiKeyRef, optional.get?.("credentials"), optional.get?.("settings"));
|
|
45695
45725
|
signal.throwIfAborted();
|
|
45696
45726
|
if (apiKey) return transcribeWechatWav(audio, apiKey, signal);
|
|
@@ -22,6 +22,7 @@ export interface SalesCompanyIdentity {
|
|
|
22
22
|
refresh(signal: AbortSignal): Promise<VerifiedIdentity>;
|
|
23
23
|
begin(hint: CompanyBindingHint, signal: AbortSignal): Promise<VerifiedIdentity>;
|
|
24
24
|
unbind(signal: AbortSignal): Promise<void>;
|
|
25
|
+
transcribeVoice?(audio: Uint8Array, signal: AbortSignal): Promise<string | undefined>;
|
|
25
26
|
canUseSharedModel(): boolean;
|
|
26
27
|
}
|
|
27
28
|
type ModelSelection = {
|
|
@@ -14,7 +14,8 @@ type ProviderSettings = {
|
|
|
14
14
|
};
|
|
15
15
|
export declare function resolveWechatAsrKey(ref: string, store?: CredentialStore, settings?: ProviderSettings): Promise<string | undefined>;
|
|
16
16
|
export declare class WechatTranscriptionError extends Error {
|
|
17
|
-
constructor(code: 'WECHAT_TRANSCRIPTION_NOT_CONFIGURED' | 'WECHAT_TRANSCRIPTION_AUTH_FAILED' | 'WECHAT_TRANSCRIPTION_UNAVAILABLE' | 'WECHAT_TRANSCRIPTION_INVALID_AUDIO');
|
|
17
|
+
constructor(code: 'WECHAT_TRANSCRIPTION_COMPANY_DENIED' | 'WECHAT_TRANSCRIPTION_COMPANY_UNAVAILABLE' | 'WECHAT_TRANSCRIPTION_NOT_CONFIGURED' | 'WECHAT_TRANSCRIPTION_AUTH_FAILED' | 'WECHAT_TRANSCRIPTION_UNAVAILABLE' | 'WECHAT_TRANSCRIPTION_INVALID_AUDIO');
|
|
18
18
|
}
|
|
19
19
|
export declare function transcribeWechatWav(audio: Uint8Array, apiKey: string, signal: AbortSignal): Promise<string>;
|
|
20
|
+
export declare function readWechatTranscript(response: Response, signal: AbortSignal): Promise<string>;
|
|
20
21
|
export {};
|
package/package.json
CHANGED