@wanji_dsh/dsh-sales 0.11.5 → 0.11.6
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 +1 -1
- package/dist/client.js +22 -12
- package/dist/host.js +113 -46
- package/dist/types/customer-intent.d.ts +1 -1
- package/dist/types/wechat/batch.d.ts +1 -0
- package/dist/types/wechat/intent-scheduler.d.ts +6 -2
- package/dist/types/wechat/native.d.ts +1 -0
- package/dist/types/wechat/repository-client.d.ts +1 -1
- package/dist/types/wechat/service.d.ts +2 -0
- package/dist/types/wechat/transcription.d.ts +15 -0
- package/dist/types/wechat/types.d.ts +2 -0
- package/dist/types/wechat/watcher.d.ts +1 -0
- package/dist/wechat-repository-worker.js +55 -19
- package/docs/diagnostics.zh.md +1 -0
- package/package.json +1 -1
- package/runtime/wechat-manifest.json +16 -16
package/README.zh.md
CHANGED
|
@@ -34,7 +34,7 @@ DeepSeek Harness 内的销售辅助工作台。插件在左侧菜单注册“销
|
|
|
34
34
|
|
|
35
35
|
工作区自动选择并开启微信同步,回复区不显示技能工作区和刷新控件;支持页内暂停/重连、按任务确认初始化或重启、客户搜索、历史分页、图片/语音随可见消息自动加载、CRM显式绑定、独立草稿编辑与复制。语音显示播放器,由用户点击播放;未入库媒体显示中文同步状态,失败可重试。真实历史、草稿及已处理状态保存在私有消息库;新消息使旧Agent稿失效,人工编辑保留并提示复核。复制不会发送消息。
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
右键微信语音气泡并选择「转为文字」。手动转写沿用模型凭据服务,调用百炼北京地域的 `qwen3-asr-flash`。默认识别 `DASHSCOPE_API_KEY`、已有的 `WANJI_QWEN_ASR_API_KEY` 或模型设置中同一百炼服务的唯一凭据引用。也可以用 `wechatAsrApiKeyRef` 指定凭据。缺少百炼凭据时,手动转写沿用已启用的 DSH 语音识别服务。
|
|
38
38
|
|
|
39
39
|
## 日志收集
|
|
40
40
|
|
package/dist/client.js
CHANGED
|
@@ -7888,21 +7888,31 @@ function createWechatClient(rpc, snapshot, options = {}) {
|
|
|
7888
7888
|
if (e !== epoch || refreshId !== refreshEpoch) return;
|
|
7889
7889
|
if (status2.revision !== revision2) {
|
|
7890
7890
|
const contacts = [];
|
|
7891
|
-
let
|
|
7891
|
+
let page;
|
|
7892
|
+
let expectedRevision;
|
|
7893
|
+
let snapshotId = status2.stableContactPages ? "" : void 0;
|
|
7892
7894
|
do {
|
|
7893
|
-
|
|
7894
|
-
|
|
7895
|
-
|
|
7896
|
-
|
|
7897
|
-
|
|
7898
|
-
|
|
7895
|
+
const cursor = snapshotId !== void 0 ? { snapshotId } : expectedRevision === void 0 ? {} : { expectedRevision };
|
|
7896
|
+
page = await request("contacts", { limit: 200, offset: contacts.length, ...cursor });
|
|
7897
|
+
if (e !== epoch || refreshId !== refreshEpoch) return;
|
|
7898
|
+
if (expectedRevision !== void 0 && page.revision !== expectedRevision) throw Error("WECHAT_SNAPSHOT_CHANGED");
|
|
7899
|
+
if (status2.stableContactPages) {
|
|
7900
|
+
if (!page.snapshotId || snapshotId && page.snapshotId !== snapshotId) throw Error("WECHAT_CONTACT_SNAPSHOT_EXPIRED");
|
|
7901
|
+
snapshotId = page.snapshotId;
|
|
7902
|
+
}
|
|
7903
|
+
expectedRevision = page.revision;
|
|
7904
|
+
contacts.push(...page.contacts);
|
|
7905
|
+
} while (page.contacts.length === 200);
|
|
7906
|
+
if (scope !== workspace) return;
|
|
7899
7907
|
snapshot(contacts);
|
|
7900
7908
|
revision2 = expectedRevision;
|
|
7901
7909
|
}
|
|
7902
7910
|
publish({ status: status2, error: void 0 });
|
|
7903
|
-
} catch (
|
|
7904
|
-
if (
|
|
7905
|
-
|
|
7911
|
+
} catch (error) {
|
|
7912
|
+
if (scope !== workspace || disposed || e !== epoch || refreshId !== refreshEpoch) return;
|
|
7913
|
+
const code2 = error instanceof Error ? "code" in error ? error.code : error.message : void 0;
|
|
7914
|
+
if (code2 === "WECHAT_SNAPSHOT_CHANGED" || code2 === "WECHAT_CONTACT_SNAPSHOT_EXPIRED") return;
|
|
7915
|
+
publish({ error: error instanceof Error ? error.message : "\u5FAE\u4FE1\u72B6\u6001\u52A0\u8F7D\u5931\u8D25" });
|
|
7906
7916
|
}
|
|
7907
7917
|
const status = view.status;
|
|
7908
7918
|
if (options.automatic && !disposed && e === epoch && refreshId === refreshEpoch && !view.error && status?.phase === "disconnected" && !status.message && status.capabilities?.ready && !automaticAttempts.has(scope)) {
|
|
@@ -10236,7 +10246,7 @@ var zh = {
|
|
|
10236
10246
|
wxTranscribingVoice: "\u6B63\u5728\u8F6C\u5199\u8BED\u97F3\u2026",
|
|
10237
10247
|
wxTranscriptUnavailable: "\u8BED\u97F3\u8F6C\u5199\u5931\u8D25\uFF0C\u8BF7\u68C0\u67E5\u8BED\u97F3\u8BC6\u522B\u670D\u52A1\u540E\u91CD\u8BD5\u3002",
|
|
10238
10248
|
wxTranscriptVoicePending: "\u8BED\u97F3\u5C1A\u672A\u540C\u6B65\u5230\u672C\u673A\u3002\u8BF7\u540C\u6B65\u540E\u91CD\u8BD5\u3002",
|
|
10239
|
-
wxTranscriptNotConfigured: "\u8BED\u97F3\u8BC6\u522B\u672A\u914D\u7F6E\u3002\u8BF7\u5728\
|
|
10249
|
+
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",
|
|
10240
10250
|
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",
|
|
10241
10251
|
wxTranscriptTimeout: "\u8BED\u97F3\u8BC6\u522B\u8D85\u65F6\uFF0C\u8BF7\u91CD\u8BD5\u3002",
|
|
10242
10252
|
wxTranscriptEmpty: "\u8FD9\u6761\u8BED\u97F3\u6CA1\u6709\u8BC6\u522B\u51FA\u6587\u5B57\u3002",
|
|
@@ -10570,7 +10580,7 @@ var en = {
|
|
|
10570
10580
|
wxTranscribingVoice: "Transcribing\u2026",
|
|
10571
10581
|
wxTranscriptUnavailable: "Could not transcribe. Check the speech recognition service and retry.",
|
|
10572
10582
|
wxTranscriptVoicePending: "This voice message has not synced yet. Sync it and try again.",
|
|
10573
|
-
wxTranscriptNotConfigured: "
|
|
10583
|
+
wxTranscriptNotConfigured: "Configure an Alibaba Cloud Model Studio API key in model settings to transcribe voice messages.",
|
|
10574
10584
|
wxTranscriptAuthFailed: "Speech recognition was denied. Check the Alibaba Cloud Model Studio API key and model access.",
|
|
10575
10585
|
wxTranscriptTimeout: "Speech recognition timed out. Try again.",
|
|
10576
10586
|
wxTranscriptEmpty: "No speech was recognized in this message.",
|
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.6" : "0.0.0-dev";
|
|
15843
15843
|
|
|
15844
15844
|
// src/diagnostics.ts
|
|
15845
15845
|
var MAX_FILE_BYTES = 512 * 1024;
|
|
@@ -15860,6 +15860,8 @@ var safeCodes = new Set(`
|
|
|
15860
15860
|
RESPONSE_TOO_LARGE CRM_INTENT_UNAVAILABLE CRM_UNAVAILABLE CRM_NOT_FOUND CRM_AMBIGUOUS CRM_INVALID_INPUT CRM_INVALID_RESPONSE
|
|
15861
15861
|
WECHAT_COMMIT_UNCONFIRMED WECHAT_COMPONENT_UNAVAILABLE WECHAT_RECONNECT_REQUIRED
|
|
15862
15862
|
WECHAT_WORKSPACE_SCOPE WECHAT_INVALID_REQUEST WECHAT_CUA_UNAVAILABLE WECHAT_BUSY
|
|
15863
|
+
WECHAT_SNAPSHOT_CHANGED WECHAT_CONTACT_SNAPSHOT_EXPIRED INTENT_FLASH_UNAVAILABLE
|
|
15864
|
+
INVALID_INTENT_RESULT INVALID_INTENT_EVIDENCE INVALID_INTENT_STAGE
|
|
15863
15865
|
WECHAT_RUNTIME_UNSUPPORTED WECHAT_RUNTIME_MANIFEST WECHAT_RUNTIME_URL WECHAT_RUNTIME_CACHE
|
|
15864
15866
|
WECHAT_RUNTIME_NETWORK WECHAT_RUNTIME_HTTP WECHAT_RUNTIME_TIMEOUT WECHAT_RUNTIME_ABORTED
|
|
15865
15867
|
WECHAT_RUNTIME_ARCHIVE WECHAT_RUNTIME_COMPONENT WECHAT_RUNTIME_CHECKSUM WECHAT_RUNTIME_LIMIT
|
|
@@ -17846,8 +17848,8 @@ var LoopbackReceiver = class {
|
|
|
17846
17848
|
if (JSON.stringify(hint) === JSON.stringify(this.priority)) return;
|
|
17847
17849
|
this.priority = hint;
|
|
17848
17850
|
this.prioritySequence++;
|
|
17849
|
-
const
|
|
17850
|
-
if (
|
|
17851
|
+
const endpoint2 = this.endpoint;
|
|
17852
|
+
if (endpoint2 && this.connected && this.livePriority) void this.sendPriority(endpoint2.port, endpoint2.controller.signal).catch(() => {
|
|
17851
17853
|
});
|
|
17852
17854
|
}
|
|
17853
17855
|
async sendPriority(port, signal) {
|
|
@@ -17976,6 +17978,9 @@ var SourceWatcher = class {
|
|
|
17976
17978
|
deadline;
|
|
17977
17979
|
generation = 0;
|
|
17978
17980
|
roots = [];
|
|
17981
|
+
get active() {
|
|
17982
|
+
return this.roots.length > 0 && this.watches.length === this.roots.length;
|
|
17983
|
+
}
|
|
17979
17984
|
notify;
|
|
17980
17985
|
options;
|
|
17981
17986
|
constructor(notify, options = {}) {
|
|
@@ -18000,6 +18005,7 @@ var SourceWatcher = class {
|
|
|
18000
18005
|
});
|
|
18001
18006
|
this.watches.push(handle);
|
|
18002
18007
|
} catch {
|
|
18008
|
+
this.roots = [];
|
|
18003
18009
|
}
|
|
18004
18010
|
}
|
|
18005
18011
|
}
|
|
@@ -18413,6 +18419,12 @@ function createNativeBackend({ componentRoot }) {
|
|
|
18413
18419
|
};
|
|
18414
18420
|
}
|
|
18415
18421
|
|
|
18422
|
+
// src/customer-intent.ts
|
|
18423
|
+
var intentSemanticPolicyVersion = 2;
|
|
18424
|
+
var intentPolicyVersion = 4;
|
|
18425
|
+
var intentProducts = ["erp", "wanjitang"];
|
|
18426
|
+
var intentAnchors = { A: 90, B: 70, C: 50, D: 20 };
|
|
18427
|
+
|
|
18416
18428
|
// src/wechat/intent-scheduler.ts
|
|
18417
18429
|
var IntentScheduler = class {
|
|
18418
18430
|
workspaces = /* @__PURE__ */ new Set();
|
|
@@ -18421,11 +18433,33 @@ var IntentScheduler = class {
|
|
|
18421
18433
|
suspended = false;
|
|
18422
18434
|
closed = false;
|
|
18423
18435
|
cancellation;
|
|
18436
|
+
lastModelReady;
|
|
18437
|
+
reportModelState = diagnosticCallback((ready) => {
|
|
18438
|
+
diagnostic("intent.model-readiness", ready ? "ok" : "unavailable", {}, ready ? void 0 : { code: "INTENT_FLASH_UNAVAILABLE" });
|
|
18439
|
+
});
|
|
18440
|
+
assess = diagnosticCallback((workspace, input, signal) => diagnosticOperation(async () => {
|
|
18441
|
+
try {
|
|
18442
|
+
const result = await this.evaluate(workspace, input, signal);
|
|
18443
|
+
const count = Object.values(result.products).filter((product2) => product2.score !== null).length;
|
|
18444
|
+
diagnostic(
|
|
18445
|
+
"intent.evaluate",
|
|
18446
|
+
signal.aborted ? "cancelled" : result.retryAt ? "pending" : result.status === "failed" ? "failed" : "ok",
|
|
18447
|
+
{ count },
|
|
18448
|
+
result.retryAt ? { code: "MODEL_QUOTA_EXHAUSTED" } : void 0
|
|
18449
|
+
);
|
|
18450
|
+
return result;
|
|
18451
|
+
} catch (error) {
|
|
18452
|
+
diagnostic("intent.evaluate", signal.aborted ? "cancelled" : "failed", {}, error);
|
|
18453
|
+
throw error;
|
|
18454
|
+
}
|
|
18455
|
+
}));
|
|
18424
18456
|
queue;
|
|
18425
18457
|
evaluate;
|
|
18426
|
-
|
|
18458
|
+
modelReady;
|
|
18459
|
+
constructor(queue, evaluate, modelReady = () => true) {
|
|
18427
18460
|
this.queue = queue;
|
|
18428
18461
|
this.evaluate = evaluate;
|
|
18462
|
+
this.modelReady = modelReady;
|
|
18429
18463
|
}
|
|
18430
18464
|
wake(workspace) {
|
|
18431
18465
|
if (this.closed) return;
|
|
@@ -18464,13 +18498,22 @@ var IntentScheduler = class {
|
|
|
18464
18498
|
delay2 = 0;
|
|
18465
18499
|
continue;
|
|
18466
18500
|
}
|
|
18501
|
+
const ready = this.modelReady();
|
|
18502
|
+
if (this.lastModelReady !== ready) {
|
|
18503
|
+
this.lastModelReady = ready;
|
|
18504
|
+
this.reportModelState(ready);
|
|
18505
|
+
}
|
|
18506
|
+
if (!ready) {
|
|
18507
|
+
delay2 = Math.min(delay2, 5e3);
|
|
18508
|
+
continue;
|
|
18509
|
+
}
|
|
18467
18510
|
const controller = new AbortController();
|
|
18468
18511
|
this.cancellation = controller;
|
|
18469
18512
|
let result;
|
|
18470
18513
|
try {
|
|
18471
|
-
result = await this.
|
|
18514
|
+
result = await this.assess(workspace, input, controller.signal);
|
|
18472
18515
|
} catch {
|
|
18473
|
-
result = { ...input.previous, version: input.version, products: input.previous?.products ?? {}, status: "failed" };
|
|
18516
|
+
result = { ...input.previous, version: input.version, policyVersion: intentPolicyVersion, products: input.previous?.products ?? {}, status: "failed", retryAt: void 0 };
|
|
18474
18517
|
} finally {
|
|
18475
18518
|
this.cancellation = void 0;
|
|
18476
18519
|
}
|
|
@@ -18513,6 +18556,7 @@ var WechatSyncService = class {
|
|
|
18513
18556
|
lifetime = new AbortController();
|
|
18514
18557
|
task;
|
|
18515
18558
|
starting = false;
|
|
18559
|
+
fileChanged = false;
|
|
18516
18560
|
dirty = false;
|
|
18517
18561
|
failures = 0;
|
|
18518
18562
|
interval = 3e4;
|
|
@@ -18533,7 +18577,10 @@ var WechatSyncService = class {
|
|
|
18533
18577
|
constructor(options) {
|
|
18534
18578
|
this.options = options;
|
|
18535
18579
|
this.native = this.newNative();
|
|
18536
|
-
this.watcher = (options.watcherFactory ?? ((notify) => new SourceWatcher(notify)))(() =>
|
|
18580
|
+
this.watcher = (options.watcherFactory ?? ((notify) => new SourceWatcher(notify)))(() => {
|
|
18581
|
+
this.fileChanged = true;
|
|
18582
|
+
this.sourceChanged();
|
|
18583
|
+
});
|
|
18537
18584
|
if (options.intentEvaluator) this.intent = new IntentScheduler({
|
|
18538
18585
|
next: (ws2) => this.repo().call("nextIntent", ws2),
|
|
18539
18586
|
read: (ws2, job) => this.repo().call("getIntentInput", ws2, job),
|
|
@@ -18542,7 +18589,7 @@ var WechatSyncService = class {
|
|
|
18542
18589
|
if (saved) this.changed(ws2);
|
|
18543
18590
|
return saved;
|
|
18544
18591
|
}
|
|
18545
|
-
}, options.intentEvaluator);
|
|
18592
|
+
}, options.intentEvaluator, options.intentModelReady);
|
|
18546
18593
|
}
|
|
18547
18594
|
newNative() {
|
|
18548
18595
|
return this.options.nativeFactory?.() ?? this.options.runtime?.backend() ?? createNativeBackend({ componentRoot: this.options.componentRoot });
|
|
@@ -18758,6 +18805,8 @@ var WechatSyncService = class {
|
|
|
18758
18805
|
}
|
|
18759
18806
|
let retryLoginIn;
|
|
18760
18807
|
let retryCapture = false;
|
|
18808
|
+
const sourceWatch = this.state.capabilities?.platform === "windows" ? this.fileChanged ? "changed" : this.watcher.active ? "watching" : void 0 : void 0;
|
|
18809
|
+
this.fileChanged = false;
|
|
18761
18810
|
this.initialImport = fullSync;
|
|
18762
18811
|
if (fullSync) diagnostic(operation, "started");
|
|
18763
18812
|
const workspace = this.state.workspaceId;
|
|
@@ -18769,7 +18818,7 @@ var WechatSyncService = class {
|
|
|
18769
18818
|
const priorityVersion = this.priorityVersion;
|
|
18770
18819
|
const mediaPriority = this.mediaFocus || this.mediaRequest ? await this.currentMediaPriority(workspace) : void 0;
|
|
18771
18820
|
if (this.priorityVersion === priorityVersion) this.receiver?.setMediaPriority?.(mediaPriority);
|
|
18772
|
-
const result = await this.native.run({ requestId, syncAddress: this.receiver.address, fullSync, ...mediaPriority ? { mediaPriority } : {} }, (event) => {
|
|
18821
|
+
const result = await this.native.run({ requestId, syncAddress: this.receiver.address, fullSync, ...sourceWatch ? { sourceWatch } : {}, ...mediaPriority ? { mediaPriority } : {} }, (event) => {
|
|
18773
18822
|
if (this.closed || !this.state.running || this.state.requestId !== requestId || event.requestId && event.requestId !== requestId) return;
|
|
18774
18823
|
if (event.type === "bridge_ready") {
|
|
18775
18824
|
this.receiver.start(event.port);
|
|
@@ -19000,7 +19049,23 @@ async function lookupCrm(input, config, parent, fetcher2 = fetch) {
|
|
|
19000
19049
|
|
|
19001
19050
|
// src/wechat/transcription.ts
|
|
19002
19051
|
var DEFAULT_WECHAT_ASR_KEY_REF = "DASHSCOPE_API_KEY";
|
|
19003
|
-
var
|
|
19052
|
+
var dashScopeBase = "https://dashscope.aliyuncs.com/compatible-mode/v1";
|
|
19053
|
+
var credentialRef2 = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
19054
|
+
async function resolveWechatAsrKey(ref, store, settings) {
|
|
19055
|
+
if (!store) return;
|
|
19056
|
+
const resolve4 = async (id2) => (await store.resolve(id2))?.value.trim() || void 0;
|
|
19057
|
+
const configured = await resolve4(ref);
|
|
19058
|
+
if (configured || ref !== DEFAULT_WECHAT_ASR_KEY_REF) return configured;
|
|
19059
|
+
const existingAsr = await resolve4("WANJI_QWEN_ASR_API_KEY");
|
|
19060
|
+
if (existingAsr) return existingAsr;
|
|
19061
|
+
if (typeof settings?.describe !== "function") return;
|
|
19062
|
+
const value = settings.describe({ redactSecrets: true }).find((item) => item.ns === "llm-pi-ai")?.value;
|
|
19063
|
+
const refs = new Set(Object.values(value?.providers ?? {}).flatMap((provider) => {
|
|
19064
|
+
const key = provider?.apiKeyEnv, baseURL = provider?.baseURL;
|
|
19065
|
+
return typeof baseURL === "string" && baseURL.replace(/\/$/, "") === dashScopeBase && typeof key === "string" && credentialRef2.test(key) ? [key] : [];
|
|
19066
|
+
}));
|
|
19067
|
+
if (refs.size === 1) return resolve4([...refs][0]);
|
|
19068
|
+
}
|
|
19004
19069
|
var WechatTranscriptionError = class extends Error {
|
|
19005
19070
|
constructor(code4) {
|
|
19006
19071
|
super(code4);
|
|
@@ -19012,7 +19077,7 @@ async function transcribeWechatWav(audio, apiKey, signal) {
|
|
|
19012
19077
|
throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_INVALID_AUDIO");
|
|
19013
19078
|
}
|
|
19014
19079
|
signal.throwIfAborted();
|
|
19015
|
-
const response = await fetch(
|
|
19080
|
+
const response = await fetch(dashScopeBase + "/chat/completions", {
|
|
19016
19081
|
method: "POST",
|
|
19017
19082
|
redirect: "error",
|
|
19018
19083
|
signal,
|
|
@@ -19033,7 +19098,7 @@ async function transcribeWechatWav(audio, apiKey, signal) {
|
|
|
19033
19098
|
}
|
|
19034
19099
|
|
|
19035
19100
|
// src/wechat/routes.ts
|
|
19036
|
-
var fields2 = { capabilities: [], status: [], "runtime-retry": [], start: ["automatic"], pause: [], authorize: ["requestId", "approved"], contacts: ["limit", "offset", "expectedRevision"], conversation: ["contactId"], messages: ["contactId", "before", "limit"], bind: ["contactId", "binding"], "save-state": ["contactId", "state"], handled: ["contactId"], media: ["mediaId"], "media-priority": ["contactId", "focusId", "messageId"], "media-unfocus": ["focusId"], "draft-voice": ["contactId", "messageId", "version"], "transcribe-voice": ["contactId", "messageId"], "delivery-open": ["contactId", "enabled"], "delivery-touch": ["lease"], "delivery-close": ["lease"], "delivery-send": ["contactId", "lease", "version", "messageId", "text", "automatic"], "delivery-status": ["contactId"], "delivery-check": ["contactId"], "delivery-approval": ["requestId", "approved"] };
|
|
19101
|
+
var fields2 = { capabilities: [], status: [], "runtime-retry": [], start: ["automatic"], pause: [], authorize: ["requestId", "approved"], contacts: ["limit", "offset", "expectedRevision", "snapshotId"], conversation: ["contactId"], messages: ["contactId", "before", "limit"], bind: ["contactId", "binding"], "save-state": ["contactId", "state"], handled: ["contactId"], media: ["mediaId"], "media-priority": ["contactId", "focusId", "messageId"], "media-unfocus": ["focusId"], "draft-voice": ["contactId", "messageId", "version"], "transcribe-voice": ["contactId", "messageId"], "delivery-open": ["contactId", "enabled"], "delivery-touch": ["lease"], "delivery-close": ["lease"], "delivery-send": ["contactId", "lease", "version", "messageId", "text", "automatic"], "delivery-status": ["contactId"], "delivery-check": ["contactId"], "delivery-approval": ["requestId", "approved"] };
|
|
19037
19102
|
function text(value, max = 256) {
|
|
19038
19103
|
if (typeof value !== "string" || !value.trim() || value.length > max) throw Error("WECHAT_INVALID_REQUEST");
|
|
19039
19104
|
return value;
|
|
@@ -19080,7 +19145,7 @@ function registerWechatRoutes(ctx, options, injected, desktop) {
|
|
|
19080
19145
|
break;
|
|
19081
19146
|
case "status":
|
|
19082
19147
|
await service.capabilities();
|
|
19083
|
-
value = service.status(ws2);
|
|
19148
|
+
value = { ...service.status(ws2), stableContactPages: true };
|
|
19084
19149
|
break;
|
|
19085
19150
|
case "runtime-retry":
|
|
19086
19151
|
value = service.retryRuntime(ws2);
|
|
@@ -19097,9 +19162,14 @@ function registerWechatRoutes(ctx, options, injected, desktop) {
|
|
|
19097
19162
|
value = service.authorize(ws2, text(p2.requestId, 80), p2.approved);
|
|
19098
19163
|
break;
|
|
19099
19164
|
case "contacts": {
|
|
19100
|
-
const revision = service.status(ws2).revision;
|
|
19165
|
+
const revision = service.status(ws2).revision, limit = integer(p2.limit, 200, 200), offset = integer(p2.offset, 0, 1e6);
|
|
19166
|
+
if (p2.snapshotId !== void 0) {
|
|
19167
|
+
if (typeof p2.snapshotId !== "string" || (p2.snapshotId ? !/^[0-9a-f-]{36}$/.test(p2.snapshotId) : offset !== 0)) throw Error("WECHAT_INVALID_REQUEST");
|
|
19168
|
+
value = await service.data("contactsPage", ws2, p2.snapshotId, limit, offset, revision);
|
|
19169
|
+
break;
|
|
19170
|
+
}
|
|
19101
19171
|
if (p2.expectedRevision !== void 0 && integer(p2.expectedRevision, 0, Number.MAX_SAFE_INTEGER) !== revision) throw Error("WECHAT_SNAPSHOT_CHANGED");
|
|
19102
|
-
const contacts = await service.data("listContacts", ws2,
|
|
19172
|
+
const contacts = await service.data("listContacts", ws2, limit, offset);
|
|
19103
19173
|
if (service.status(ws2).revision !== revision) throw Error("WECHAT_SNAPSHOT_CHANGED");
|
|
19104
19174
|
value = { contacts, revision };
|
|
19105
19175
|
break;
|
|
@@ -40575,12 +40645,12 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40575
40645
|
throw new KnowledgeError("tool-failed");
|
|
40576
40646
|
}
|
|
40577
40647
|
}
|
|
40578
|
-
const handle = async (
|
|
40648
|
+
const handle = async (endpoint2, payload, signal, peer, sessionId) => {
|
|
40579
40649
|
signal = AbortSignal.any([signal, lifetime]);
|
|
40580
40650
|
try {
|
|
40581
40651
|
signal.throwIfAborted();
|
|
40582
40652
|
if (peer.principal.kind !== "owner") throw new KnowledgeError("forbidden");
|
|
40583
|
-
if (
|
|
40653
|
+
if (endpoint2 === "info") {
|
|
40584
40654
|
inputFields(payload, []);
|
|
40585
40655
|
const info = { ...config.evaluationDatasetId ? { evaluationDatasetId: config.evaluationDatasetId } : {}, evaluationEnabled: !!evaluation, testingEnabled: config.knowledgeTestEnabled, environment: config.environment, connected: false, toolsReady: ready(), knowledgeBaseName: config.knowledgeBaseName, knowledgeBaseIds: config.knowledgeBaseIds, toolPrefix: config.toolPrefix, maxResults: config.maxResults };
|
|
40586
40656
|
if (info.toolsReady && config.knowledgeBaseIds.length) {
|
|
@@ -40626,12 +40696,12 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40626
40696
|
);
|
|
40627
40697
|
return { ok: true, value: info };
|
|
40628
40698
|
}
|
|
40629
|
-
if (
|
|
40699
|
+
if (endpoint2 === "workspaces") {
|
|
40630
40700
|
inputFields(payload, []);
|
|
40631
40701
|
if (!workspaceList) throw new KnowledgeError("missing-tools");
|
|
40632
40702
|
return { ok: true, value: { items: workspaceList().map((w2) => ({ workspaceId: w2.id, title: w2.title, path: w2.path })) } };
|
|
40633
40703
|
}
|
|
40634
|
-
if (
|
|
40704
|
+
if (endpoint2 === "materials" && typeof payload === "object" && payload !== null && "operation" in payload) {
|
|
40635
40705
|
const p2 = inputFields(payload, ["operation", "query", "requestId", "id"]);
|
|
40636
40706
|
if (!material) return { ok: true, value: { status: "unavailable" } };
|
|
40637
40707
|
const owner = sessionId ?? peer;
|
|
@@ -40643,7 +40713,7 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40643
40713
|
}
|
|
40644
40714
|
throw new KnowledgeError("bad-request");
|
|
40645
40715
|
}
|
|
40646
|
-
if (
|
|
40716
|
+
if (endpoint2 === "context") {
|
|
40647
40717
|
const context2 = await buildSalesContext(await searchRequest(payload, signal), signal);
|
|
40648
40718
|
signal.throwIfAborted();
|
|
40649
40719
|
const contextId = randomUUID20();
|
|
@@ -40653,7 +40723,7 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40653
40723
|
contexts.set(peer, owned);
|
|
40654
40724
|
return { ok: true, value: { ...context2, contextId, generationSessionsSupported: true, catalogMaterialsAvailable: !!material, materialsAvailable: !!materials } };
|
|
40655
40725
|
}
|
|
40656
|
-
if (
|
|
40726
|
+
if (endpoint2 === "validate-context") {
|
|
40657
40727
|
const p2 = inputFields(payload, ["contextId"]);
|
|
40658
40728
|
const context2 = typeof p2.contextId === "string" ? contexts.get(peer)?.get(p2.contextId) : void 0;
|
|
40659
40729
|
if (!context2) throw new KnowledgeError("stale-context");
|
|
@@ -40661,7 +40731,7 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40661
40731
|
return { ok: true, value: { valid: true, validatedAt: (/* @__PURE__ */ new Date()).toISOString() } };
|
|
40662
40732
|
}
|
|
40663
40733
|
if (!config.knowledgeTestEnabled) throw new KnowledgeError("disabled");
|
|
40664
|
-
if (
|
|
40734
|
+
if (endpoint2 === "materials") {
|
|
40665
40735
|
if (!materials) throw new KnowledgeError("disabled");
|
|
40666
40736
|
const p2 = inputFields(payload, ["query", "kind", "edition", "sentUrls", "allowResend"]);
|
|
40667
40737
|
if (typeof p2.query !== "string" || !materialKinds.includes(p2.kind) || !materialEditions2.includes(p2.edition) || !Array.isArray(p2.sentUrls) || p2.sentUrls.length > 100 || p2.sentUrls.some((u2) => typeof u2 !== "string" || u2.length > 2048) || typeof p2.allowResend !== "boolean") throw new KnowledgeError("bad-request");
|
|
@@ -40672,18 +40742,18 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40672
40742
|
materialContexts.set(peer, owned);
|
|
40673
40743
|
return { ok: true, value: context2 };
|
|
40674
40744
|
}
|
|
40675
|
-
if (
|
|
40745
|
+
if (endpoint2 === "validate-materials") {
|
|
40676
40746
|
if (!materials) throw new KnowledgeError("disabled");
|
|
40677
40747
|
const p2 = inputFields(payload, ["contextId", "ids"]), context2 = typeof p2.contextId === "string" ? materialContexts.get(peer)?.get(p2.contextId) : void 0;
|
|
40678
40748
|
if (!context2 || Date.now() - Date.parse(context2.checkedAt) > 6e5 || !Array.isArray(p2.ids) || p2.ids.length > 2 || new Set(p2.ids).size !== p2.ids.length || p2.ids.some((id2) => typeof id2 !== "string" || !context2.items.some((m2) => m2.id === id2))) throw new KnowledgeError("stale-context");
|
|
40679
40749
|
if (!(await Promise.all(context2.items.filter((m2) => p2.ids.includes(m2.id)).map((m2) => materials.readable(m2, signal)))).every(Boolean)) throw new KnowledgeError("material-unavailable");
|
|
40680
40750
|
return { ok: true, value: { valid: true, validatedAt: (/* @__PURE__ */ new Date()).toISOString() } };
|
|
40681
40751
|
}
|
|
40682
|
-
if (
|
|
40752
|
+
if (endpoint2 === "render-reply") {
|
|
40683
40753
|
const p2 = inputFields(payload, ["context", "plan"]);
|
|
40684
40754
|
return { ok: true, value: await renderSourcePlan(p2.context, p2.plan, signal) };
|
|
40685
40755
|
}
|
|
40686
|
-
if (
|
|
40756
|
+
if (endpoint2 === "evaluation") {
|
|
40687
40757
|
const p2 = inputFields(payload, ["operation", "payload", "request_id", "run_id", "baseline_id", "candidate_id", "limit", "offset", "query", "source", "status", "from", "to", "label_status", "outcome"]);
|
|
40688
40758
|
const ops = ["list_requests", "get_request", "label", "list_datasets", "create_dataset", "list_runs", "create_run", "cancel_run", "get_run", "compare", "client_event", "import"];
|
|
40689
40759
|
if (typeof p2.operation !== "string" || !ops.includes(p2.operation) || JSON.stringify(p2).length > 5e5) throw new KnowledgeError("bad-request");
|
|
@@ -40704,11 +40774,11 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40704
40774
|
const value = await evaluate(p2, signal);
|
|
40705
40775
|
return { ok: true, value };
|
|
40706
40776
|
}
|
|
40707
|
-
if (
|
|
40777
|
+
if (endpoint2 === "cases") {
|
|
40708
40778
|
inputFields(payload, []);
|
|
40709
40779
|
return { ok: true, value: knowledgeCases.map(([key, query, expectedSourceKey]) => ({ key, query, expectedSourceKey, ...config.expectedDocuments[expectedSourceKey] ? { expectedKnowledgeId: config.expectedDocuments[expectedSourceKey] } : {} })) };
|
|
40710
40780
|
}
|
|
40711
|
-
if (
|
|
40781
|
+
if (endpoint2 === "search") {
|
|
40712
40782
|
const report = await searchRequest(payload, signal);
|
|
40713
40783
|
const allowed2 = grants.get(peer) ?? /* @__PURE__ */ new Set();
|
|
40714
40784
|
const associated = requests.get(peer) ?? /* @__PURE__ */ new Map();
|
|
@@ -40723,7 +40793,7 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40723
40793
|
grants.set(peer, allowed2);
|
|
40724
40794
|
return { ok: true, value: report };
|
|
40725
40795
|
}
|
|
40726
|
-
if (
|
|
40796
|
+
if (endpoint2 === "read") {
|
|
40727
40797
|
const p2 = inputFields(payload, ["knowledgeId", "page"]);
|
|
40728
40798
|
if (typeof p2.knowledgeId !== "string" || !grants.get(peer)?.has(p2.knowledgeId)) throw new KnowledgeError("forbidden");
|
|
40729
40799
|
const page = p2.page ?? 1;
|
|
@@ -40749,7 +40819,7 @@ function createKnowledgeHost(tools, config, lifetime = new AbortController().sig
|
|
|
40749
40819
|
throw new KnowledgeError("not-found");
|
|
40750
40820
|
} catch (error) {
|
|
40751
40821
|
const code4 = signal.aborted ? "cancelled" : errorCode(error);
|
|
40752
|
-
diagnostic("knowledge." +
|
|
40822
|
+
diagnostic("knowledge." + endpoint2, signal.aborted ? "cancelled" : "failed", {}, error);
|
|
40753
40823
|
return { ok: false, error: { code: code4, message: code4, details: error instanceof KnowledgeError ? error.details : {} } };
|
|
40754
40824
|
}
|
|
40755
40825
|
};
|
|
@@ -40761,8 +40831,8 @@ function apply2(ctx, config, agentStatus, rerank, expandQuery, recordQuestion, r
|
|
|
40761
40831
|
const outbox = resolved.knowledgeTestEnabled ? new EvaluationOutbox(join12(homedir6(), ".local", "state", "wanji-sales", `${resolved.toolPrefix}-${resolved.knowledgeBaseIds[0]}`)) : void 0;
|
|
40762
40832
|
const handler = createKnowledgeHost(ctx.tools, resolved, lifetime.signal, outbox, ctx.workspaceRegistry ? () => ctx.workspaceRegistry.list() : void 0, void 0, rerank, void 0, expandQuery, recordMaterialMetadata, directObserver);
|
|
40763
40833
|
const owner = { principal: { kind: "owner" } };
|
|
40764
|
-
for (const
|
|
40765
|
-
const method = KNOWLEDGE_ENDPOINT_PREFIX +
|
|
40834
|
+
for (const endpoint2 of ["info", "cases", "search", "read", "evaluation", "context", "validate-context", "workspaces", "render-reply", "materials", "validate-materials"]) {
|
|
40835
|
+
const method = KNOWLEDGE_ENDPOINT_PREFIX + endpoint2;
|
|
40766
40836
|
ctx.connection.fetch.register({ path: `${KNOWLEDGE_CHANNEL}/${method}`, methods: ["POST"], requestBody: "buffered", async fetch(request2) {
|
|
40767
40837
|
let envelope;
|
|
40768
40838
|
try {
|
|
@@ -40772,11 +40842,11 @@ function apply2(ctx, config, agentStatus, rerank, expandQuery, recordQuestion, r
|
|
|
40772
40842
|
}
|
|
40773
40843
|
if (envelope.type !== "client-request" || envelope.method !== method || typeof envelope.rpcId !== "string" || envelope.rpcId.length > 128 || Object.keys(envelope).some((key) => !["type", "method", "rpcId", "payload"].includes(key))) return Response.json({ error: "bad-request" }, { status: 400 });
|
|
40774
40844
|
const startedAt = Date.now();
|
|
40775
|
-
const result = await handler(
|
|
40776
|
-
if (result.ok && ["search", "read", "materials", "context", "evaluation"].includes(
|
|
40777
|
-
diagnostic("knowledge." +
|
|
40845
|
+
const result = await handler(endpoint2, envelope.payload, request2.signal, owner);
|
|
40846
|
+
if (result.ok && ["search", "read", "materials", "context", "evaluation"].includes(endpoint2)) {
|
|
40847
|
+
diagnostic("knowledge." + endpoint2, "ok", { elapsedMs: Date.now() - startedAt });
|
|
40778
40848
|
}
|
|
40779
|
-
if (recordQuestion &&
|
|
40849
|
+
if (recordQuestion && endpoint2 === "search") {
|
|
40780
40850
|
const query = envelope.payload?.query;
|
|
40781
40851
|
if (typeof query === "string" && query.trim() && query.length <= 4e3) {
|
|
40782
40852
|
const report = result.ok ? result.value : void 0;
|
|
@@ -40786,7 +40856,7 @@ function apply2(ctx, config, agentStatus, rerank, expandQuery, recordQuestion, r
|
|
|
40786
40856
|
});
|
|
40787
40857
|
}
|
|
40788
40858
|
}
|
|
40789
|
-
if (
|
|
40859
|
+
if (endpoint2 === "info" && result.ok && agentStatus) result.value.agentTracing = await agentStatus().catch(() => ({ enabled: false, pending: 0, otherPending: 0, blocked: 0, unfinished: 0, inFlight: 0, dropped: 0, errorCode: "status-unavailable" }));
|
|
40790
40860
|
return Response.json({ type: "server-response", rpcId: envelope.rpcId, result });
|
|
40791
40861
|
} });
|
|
40792
40862
|
}
|
|
@@ -41493,12 +41563,6 @@ function registerQuestionRoute(ctx, observer) {
|
|
|
41493
41563
|
// src/server/intent-host.ts
|
|
41494
41564
|
import { randomUUID as randomUUID24 } from "node:crypto";
|
|
41495
41565
|
|
|
41496
|
-
// src/customer-intent.ts
|
|
41497
|
-
var intentSemanticPolicyVersion = 2;
|
|
41498
|
-
var intentPolicyVersion = 3;
|
|
41499
|
-
var intentProducts = ["erp", "wanjitang"];
|
|
41500
|
-
var intentAnchors = { A: 90, B: 70, C: 50, D: 20 };
|
|
41501
|
-
|
|
41502
41566
|
// src/server/intent-evaluation.ts
|
|
41503
41567
|
var stages = /* @__PURE__ */ new Set(["committed", "engaged", "exploring", "paused", "declined", "service"]);
|
|
41504
41568
|
var dimensions = ["need", "action", "budget", "decision", "timing"];
|
|
@@ -41586,6 +41650,7 @@ async function evaluateCustomerIntent(input, background, infer) {
|
|
|
41586
41650
|
report.products = next.products;
|
|
41587
41651
|
}
|
|
41588
41652
|
} catch (error) {
|
|
41653
|
+
diagnostic("intent.inference", "failed", {}, error);
|
|
41589
41654
|
report.status = "failed";
|
|
41590
41655
|
if (error instanceof ProfileError && error.code === "MODEL_QUOTA_EXHAUSTED") {
|
|
41591
41656
|
report.retryAt = Date.now() + 15 * 60 * 1e3;
|
|
@@ -45221,7 +45286,7 @@ function safeView(identity, service, ready) {
|
|
|
45221
45286
|
async function readAccountPhone(account) {
|
|
45222
45287
|
if (typeof account?.getProfile !== "function") return;
|
|
45223
45288
|
const result = await account.getProfile({
|
|
45224
|
-
version: true ? "0.11.
|
|
45289
|
+
version: true ? "0.11.6" : "0.0.0",
|
|
45225
45290
|
locale: Intl.DateTimeFormat().resolvedOptions().locale,
|
|
45226
45291
|
timezoneOffsetSeconds: -(/* @__PURE__ */ new Date()).getTimezoneOffset() * 60
|
|
45227
45292
|
});
|
|
@@ -45620,11 +45685,13 @@ function activate(ctx, rawConfig) {
|
|
|
45620
45685
|
crmBaseUrl: config.crmBaseUrl,
|
|
45621
45686
|
model: salesModel
|
|
45622
45687
|
});
|
|
45623
|
-
const sync = registerWechatRoutes(child, { storageDir: config.storageDir, componentRoot, runtime: runtime2, intentEvaluator,
|
|
45688
|
+
const sync = registerWechatRoutes(child, { storageDir: config.storageDir, componentRoot, runtime: runtime2, intentEvaluator, intentModelReady: () => {
|
|
45689
|
+
const selected = salesModel();
|
|
45690
|
+
return !!selected?.provider && isSalesFlash(selected.provider, selected.model);
|
|
45691
|
+
}, async transcribeVoice(audio, signal, mode) {
|
|
45624
45692
|
if (audio.length > config.maxAudioBytes) throw new WechatTranscriptionError("WECHAT_TRANSCRIPTION_INVALID_AUDIO");
|
|
45625
45693
|
if (mode === "manual") {
|
|
45626
|
-
const
|
|
45627
|
-
const apiKey = (await credentials?.resolve(config.wechatAsrApiKeyRef))?.value.trim();
|
|
45694
|
+
const apiKey = await resolveWechatAsrKey(config.wechatAsrApiKeyRef, optional.get?.("credentials"), optional.get?.("settings"));
|
|
45628
45695
|
signal.throwIfAborted();
|
|
45629
45696
|
if (apiKey) return transcribeWechatWav(audio, apiKey, signal);
|
|
45630
45697
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const intentSemanticPolicyVersion = 2;
|
|
2
|
-
export declare const intentPolicyVersion =
|
|
2
|
+
export declare const intentPolicyVersion = 4;
|
|
3
3
|
export declare const intentProducts: readonly ["erp", "wanjitang"];
|
|
4
4
|
export type IntentProduct = typeof intentProducts[number];
|
|
5
5
|
export type IntentGrade = 'A' | 'B' | 'C' | 'D';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CustomerIntent } from '../customer-intent.ts';
|
|
2
2
|
import type { IntentInput, IntentJob } from '../server/intent-evaluation.ts';
|
|
3
3
|
export type IntentEvaluator = (workspace: string, input: IntentInput, signal: AbortSignal) => Promise<CustomerIntent>;
|
|
4
4
|
interface Queue {
|
|
@@ -13,9 +13,13 @@ export declare class IntentScheduler {
|
|
|
13
13
|
private suspended;
|
|
14
14
|
private closed;
|
|
15
15
|
private cancellation?;
|
|
16
|
+
private lastModelReady?;
|
|
17
|
+
private readonly reportModelState;
|
|
18
|
+
private readonly assess;
|
|
16
19
|
private readonly queue;
|
|
17
20
|
private readonly evaluate;
|
|
18
|
-
|
|
21
|
+
private readonly modelReady;
|
|
22
|
+
constructor(queue: Queue, evaluate: IntentEvaluator, modelReady?: () => boolean);
|
|
19
23
|
wake(workspace: string): void;
|
|
20
24
|
private schedule;
|
|
21
25
|
private run;
|
|
@@ -27,6 +27,7 @@ export interface NativeBackend {
|
|
|
27
27
|
requestId: string;
|
|
28
28
|
syncAddress: string;
|
|
29
29
|
fullSync: boolean;
|
|
30
|
+
sourceWatch?: "changed" | "watching";
|
|
30
31
|
mediaPriority?: MediaPriorityHint;
|
|
31
32
|
}, onEvent: (event: any) => void, signal: AbortSignal): Promise<NativeCompletion>;
|
|
32
33
|
authorize(requestId: string, approved: boolean): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Method = 'importBatch' | 'listContacts' | 'getContact' | 'listMessages' | 'getMedia' | 'getMediaPriority' | 'getDraftVoice' | 'getVoiceForTranscription' | 'bindCrm' | 'getState' | 'saveState' | 'markHandled' | 'getPairing' | 'getDeliverySource' | 'claimDelivery' | 'settleDelivery' | 'deliveryStatus' | 'queueIntent' | 'seedIntents' | 'nextIntent' | 'getIntentInput' | 'finishIntent';
|
|
1
|
+
type Method = 'importBatch' | 'listContacts' | 'contactsPage' | 'getContact' | 'listMessages' | 'getMedia' | 'getMediaPriority' | 'getDraftVoice' | 'getVoiceForTranscription' | 'bindCrm' | 'getState' | 'saveState' | 'markHandled' | 'getPairing' | 'getDeliverySource' | 'claimDelivery' | 'settleDelivery' | 'deliveryStatus' | 'queueIntent' | 'seedIntents' | 'nextIntent' | 'getIntentInput' | 'finishIntent';
|
|
2
2
|
/** SQLite imports execute off the Host event loop so leases/control events remain responsive. */
|
|
3
3
|
export declare class RepositoryClient {
|
|
4
4
|
private worker;
|
|
@@ -8,6 +8,7 @@ import { type IntentEvaluator } from './intent-scheduler.ts';
|
|
|
8
8
|
import type { ResumeIntent } from '../update/types.ts';
|
|
9
9
|
export type WechatSyncOptions = {
|
|
10
10
|
intentEvaluator?: IntentEvaluator;
|
|
11
|
+
intentModelReady?: () => boolean;
|
|
11
12
|
storageDir: string;
|
|
12
13
|
componentRoot: string;
|
|
13
14
|
runtime?: WechatRuntime;
|
|
@@ -26,6 +27,7 @@ export declare class WechatSyncService {
|
|
|
26
27
|
private lifetime;
|
|
27
28
|
private task?;
|
|
28
29
|
private starting;
|
|
30
|
+
private fileChanged;
|
|
29
31
|
private dirty;
|
|
30
32
|
private failures;
|
|
31
33
|
private interval;
|
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
export declare const DEFAULT_WECHAT_ASR_KEY_REF = "DASHSCOPE_API_KEY";
|
|
2
|
+
type CredentialStore = {
|
|
3
|
+
resolve(ref: string): Promise<{
|
|
4
|
+
value: string;
|
|
5
|
+
} | undefined>;
|
|
6
|
+
};
|
|
7
|
+
type ProviderSettings = {
|
|
8
|
+
describe(options: {
|
|
9
|
+
redactSecrets: true;
|
|
10
|
+
}): {
|
|
11
|
+
ns: string;
|
|
12
|
+
value: unknown;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
export declare function resolveWechatAsrKey(ref: string, store?: CredentialStore, settings?: ProviderSettings): Promise<string | undefined>;
|
|
2
16
|
export declare class WechatTranscriptionError extends Error {
|
|
3
17
|
constructor(code: 'WECHAT_TRANSCRIPTION_NOT_CONFIGURED' | 'WECHAT_TRANSCRIPTION_AUTH_FAILED' | 'WECHAT_TRANSCRIPTION_UNAVAILABLE' | 'WECHAT_TRANSCRIPTION_INVALID_AUDIO');
|
|
4
18
|
}
|
|
5
19
|
export declare function transcribeWechatWav(audio: Uint8Array, apiKey: string, signal: AbortSignal): Promise<string>;
|
|
20
|
+
export {};
|
|
@@ -3,6 +3,7 @@ import type { Contact } from '../model.ts';
|
|
|
3
3
|
import type { SalesIncrementalEnvelope } from './batch.ts';
|
|
4
4
|
export declare const WECHAT_METHOD = "wanji-sales-wechat/request";
|
|
5
5
|
export interface ImportResult {
|
|
6
|
+
confirmed_run?: string;
|
|
6
7
|
duplicate: boolean;
|
|
7
8
|
chats: number;
|
|
8
9
|
messages: number;
|
|
@@ -79,6 +80,7 @@ export interface SyncStatus {
|
|
|
79
80
|
workspaceId?: string;
|
|
80
81
|
message: string;
|
|
81
82
|
revision: number;
|
|
83
|
+
stableContactPages?: true;
|
|
82
84
|
progress?: SyncProgress;
|
|
83
85
|
runtime?: RuntimeStatus;
|
|
84
86
|
mediaImporting?: boolean;
|
|
@@ -5,7 +5,7 @@ import { parentPort, workerData } from "node:worker_threads";
|
|
|
5
5
|
import { DatabaseSync } from "node:sqlite";
|
|
6
6
|
import { mkdir, chmod } from "node:fs/promises";
|
|
7
7
|
import { join } from "node:path";
|
|
8
|
-
import { createHash, randomBytes } from "node:crypto";
|
|
8
|
+
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
9
9
|
|
|
10
10
|
// src/wechat/batch.ts
|
|
11
11
|
var SALES_BATCH_SCHEMA = "wanji.wechat.batch.v1";
|
|
@@ -56,6 +56,7 @@ function validateSalesBatch(value) {
|
|
|
56
56
|
}
|
|
57
57
|
if (!isRecord(value.stats)) throw new Error("stats must be an object");
|
|
58
58
|
if (value.history_backfill !== void 0 && typeof value.history_backfill !== "boolean") throw Error("Invalid history_backfill flag");
|
|
59
|
+
if (value.previous_run_id !== void 0 && (value.source.kind !== "wechat_windows_local" || value.delivery !== void 0 || value.sync !== void 0 || isFocusedTextBatch(value) || value.previous_run_id !== null && (typeof value.previous_run_id !== "string" || !/^[a-zA-Z0-9:-]{1,128}$/.test(value.previous_run_id)))) throw Error("Invalid Windows batch baseline");
|
|
59
60
|
const mediaPatch = value.delivery !== void 0;
|
|
60
61
|
if (mediaPatch && (!isRecord(value.delivery) || value.delivery.protocol !== "wanji.media-patch.v1" || value.delivery.phase !== "media" || value.sync !== void 0 || typeof value.source.account_wxid !== "string" || !value.source.account_wxid.trim())) {
|
|
61
62
|
throw new Error("Invalid media patch envelope");
|
|
@@ -154,6 +155,7 @@ function validateSalesBatch(value) {
|
|
|
154
155
|
|
|
155
156
|
// src/customer-intent.ts
|
|
156
157
|
var intentSemanticPolicyVersion = 2;
|
|
158
|
+
var intentPolicyVersion = 4;
|
|
157
159
|
|
|
158
160
|
// src/turn-packet.ts
|
|
159
161
|
function bindProgress(raw, packet) {
|
|
@@ -225,8 +227,12 @@ function replyInputChanged(previous, incoming) {
|
|
|
225
227
|
if (incoming.direction === "system" && (!previous || previous.direction === "system")) return false;
|
|
226
228
|
return !previous || previous.direction !== incoming.direction || previous.kind !== incoming.kind || previous.sent_at !== incoming.sent_at || previous.sort_seq !== incoming.sort_seq || previous.local_id !== incoming.local_id || replyText(previous) !== replyText(incoming);
|
|
227
229
|
}
|
|
230
|
+
var CONTACT_PAGE_TTL_MS = 12e4;
|
|
231
|
+
var MAX_CONTACT_PAGE_SESSIONS = 8;
|
|
228
232
|
var WechatRepository = class _WechatRepository {
|
|
233
|
+
importStatements = /* @__PURE__ */ new Map();
|
|
229
234
|
db;
|
|
235
|
+
contactPages = /* @__PURE__ */ new Map();
|
|
230
236
|
closed = false;
|
|
231
237
|
constructor(path) {
|
|
232
238
|
this.db = new DatabaseSync(path);
|
|
@@ -271,6 +277,14 @@ var WechatRepository = class _WechatRepository {
|
|
|
271
277
|
await chmod(path, 384);
|
|
272
278
|
return repo;
|
|
273
279
|
}
|
|
280
|
+
importStatement(sql) {
|
|
281
|
+
let statement = this.importStatements.get(sql);
|
|
282
|
+
if (!statement) {
|
|
283
|
+
statement = this.db.prepare(sql);
|
|
284
|
+
this.importStatements.set(sql, statement);
|
|
285
|
+
}
|
|
286
|
+
return statement;
|
|
287
|
+
}
|
|
274
288
|
row(sql, ...args) {
|
|
275
289
|
return this.db.prepare(sql).get(...args);
|
|
276
290
|
}
|
|
@@ -317,6 +331,7 @@ var WechatRepository = class _WechatRepository {
|
|
|
317
331
|
const receipt = batch.sync ? { protocol: batch.sync.protocol, scope: batch.sync.scope, revision: batch.sync.revision, part_index: batch.sync.part_index, part_count: batch.sync.part_count, committed: batch.sync.part_index === batch.sync.part_count - 1 } : void 0;
|
|
318
332
|
this.db.exec("BEGIN IMMEDIATE");
|
|
319
333
|
try {
|
|
334
|
+
if (batch.previous_run_id && (active !== account || !this.row("SELECT 1 FROM runs WHERE workspace=? AND run_id=? AND json_extract(result,'$.confirmed_source')=?", workspace, batch.previous_run_id, source))) throw Error("WANJI_RESYNC_REQUIRED: prior Windows batch missing");
|
|
320
335
|
const sync = batch.sync, checkpointScope = hash([source, sync?.scope]);
|
|
321
336
|
if (sync) {
|
|
322
337
|
const c = this.row("SELECT * FROM checkpoints WHERE scope=?", checkpointScope);
|
|
@@ -349,10 +364,10 @@ var WechatRepository = class _WechatRepository {
|
|
|
349
364
|
const advanceIntent = trackIntent && !preview && (!(backfill || active !== account) || !!this.row("SELECT 1 FROM customer_intents WHERE chat_id=?", chatId));
|
|
350
365
|
let intentRevision;
|
|
351
366
|
for (const m of chat.messages) {
|
|
352
|
-
const oldSource = this.
|
|
367
|
+
const oldSource = this.importStatement("SELECT * FROM sources WHERE scope=? AND chat_id=? AND message_key=?").get(source, chatId, m.message_key);
|
|
353
368
|
if (batch.delivery) {
|
|
354
369
|
if (!oldSource || oldSource.source_revision !== m.source_revision) throw Error("WANJI_RESYNC_REQUIRED: media revision mismatch");
|
|
355
|
-
const old2 = this.
|
|
370
|
+
const old2 = this.importStatement("SELECT * FROM messages WHERE id=?").get(oldSource.message_id);
|
|
356
371
|
if (old2.kind !== m.kind || old2.direction !== m.direction || old2.source_revision !== m.source_revision) throw Error("WANJI_RESYNC_REQUIRED: media identity mismatch");
|
|
357
372
|
const mediaId2 = hash([source, m.media_key]);
|
|
358
373
|
if (old2.media_id !== mediaId2) {
|
|
@@ -360,7 +375,7 @@ var WechatRepository = class _WechatRepository {
|
|
|
360
375
|
const current = this.row("SELECT json_extract(metadata,'$.width') * json_extract(metadata,'$.height') AS area FROM media WHERE id=?", old2.media_id);
|
|
361
376
|
if ((imageAreas.get(m.media_key) ?? 0) < (current?.area ?? 0)) continue;
|
|
362
377
|
}
|
|
363
|
-
this.
|
|
378
|
+
this.importStatement("UPDATE messages SET media_id=? WHERE id=?").run(mediaId2, old2.id);
|
|
364
379
|
changed.add(chatId);
|
|
365
380
|
if (old2.kind === "voice" && old2.direction === "inbound" && old2.auto_draft_arrival === 1) trackVoiceChange(chatId, old2.id);
|
|
366
381
|
}
|
|
@@ -368,27 +383,27 @@ var WechatRepository = class _WechatRepository {
|
|
|
368
383
|
}
|
|
369
384
|
const server = typeof m.server_id === "string" && /^\d+$/.test(m.server_id) && !/^0+$/.test(m.server_id) ? m.server_id : void 0;
|
|
370
385
|
const id = server ? hash([chatId, "server", server]) : hash([chatId, "local", source, m.message_key]);
|
|
371
|
-
const old = this.
|
|
386
|
+
const old = this.importStatement("SELECT * FROM messages WHERE id=?").get(id), revisionChanged = !!old && old.source_revision !== (m.source_revision ?? null), mediaId = m.media_key ? hash([source, m.media_key]) : revisionChanged ? null : old?.media_id ?? null;
|
|
372
387
|
if (preview && old) continue;
|
|
373
388
|
const newlyConfirmed = !preview && (!old || old.preview_only === 1);
|
|
374
389
|
if (!old || newlyConfirmed || old.text !== m.text || old.direction !== m.direction || old.kind !== m.kind || old.sent_at !== m.sent_at || old.media_id !== mediaId || revisionChanged || old.metadata !== JSON.stringify(m)) {
|
|
375
390
|
if (!preview && replyInputChanged(newlyConfirmed ? void 0 : old, m)) replyChanges.add(chatId);
|
|
376
391
|
if (m.kind === "voice" && m.direction === "inbound" && old?.auto_draft_arrival === 1 && old.media_id !== mediaId) trackVoiceChange(chatId, id);
|
|
377
|
-
this.
|
|
392
|
+
this.importStatement("INSERT INTO messages(id,chat_id,sent_at,sort_seq,local_id,direction,kind,text,media_id,source_revision,metadata,preview_only) VALUES(?,?,?,?,?,?,?,?,?,?,?,?) ON CONFLICT(id) DO UPDATE SET preview_only=0,sent_at=excluded.sent_at,sort_seq=excluded.sort_seq,local_id=excluded.local_id,direction=excluded.direction,kind=excluded.kind,text=excluded.text,media_id=excluded.media_id,source_revision=excluded.source_revision,metadata=excluded.metadata").run(id, chatId, m.sent_at, m.sort_seq, m.local_id, m.direction, m.kind, m.text, mediaId, m.source_revision ?? null, JSON.stringify(m), preview ? 1 : 0);
|
|
378
393
|
changed.add(chatId);
|
|
379
394
|
if (!old) messages++;
|
|
380
395
|
}
|
|
381
396
|
if (preview) continue;
|
|
382
397
|
if (newlyConfirmed && !backfill && active === account && m.direction === "inbound" && (replyText(m) || attachmentReply(m.kind))) {
|
|
383
|
-
this.
|
|
398
|
+
this.importStatement("UPDATE messages SET auto_draft_arrival=1 WHERE id=?").run(id);
|
|
384
399
|
}
|
|
385
400
|
const meaningful = (row) => row.direction !== "system" && ["text", "quote", "link"].includes(row.kind) && typeof row.text === "string" && !!row.text.trim();
|
|
386
401
|
const intentChanged = !old || newlyConfirmed ? meaningful(m) : (meaningful(m) || meaningful(old)) && (old.text !== m.text || old.direction !== m.direction || old.kind !== m.kind);
|
|
387
402
|
if (advanceIntent && intentChanged) {
|
|
388
403
|
intentRevision ??= this.queueIntentRow(chatId, Date.now() + 3500, true);
|
|
389
|
-
this.
|
|
404
|
+
this.importStatement("UPDATE messages SET intent_revision=? WHERE id=?").run(intentRevision, id);
|
|
390
405
|
}
|
|
391
|
-
this.
|
|
406
|
+
this.importStatement("INSERT INTO sources(scope,chat_id,message_key,message_id,source_revision,metadata) VALUES(?,?,?,?,?,?) ON CONFLICT(scope,chat_id,message_key) DO UPDATE SET message_id=excluded.message_id,source_revision=excluded.source_revision,metadata=excluded.metadata").run(source, chatId, m.message_key, id, m.source_revision ?? null, JSON.stringify(m));
|
|
392
407
|
}
|
|
393
408
|
}
|
|
394
409
|
for (const id of changed) {
|
|
@@ -408,7 +423,7 @@ var WechatRepository = class _WechatRepository {
|
|
|
408
423
|
}
|
|
409
424
|
if (!batch.delivery) this.db.prepare("INSERT INTO active VALUES(?,?) ON CONFLICT(workspace) DO UPDATE SET account=excluded.account").run(workspace, account);
|
|
410
425
|
if (sync) this.db.prepare("INSERT INTO checkpoints VALUES(?,?,?,?,?) ON CONFLICT(scope) DO UPDATE SET revision=excluded.revision,active_revision=excluded.active_revision,next_part=excluded.next_part,part_count=excluded.part_count").run(checkpointScope, receipt.committed ? sync.revision : this.row("SELECT revision FROM checkpoints WHERE scope=?", checkpointScope)?.revision ?? null, receipt.committed ? null : sync.revision, receipt.committed ? 0 : sync.part_index + 1, sync.part_count);
|
|
411
|
-
const result = { duplicate: false, chats: batch.chats.length, messages, mediaUpdated: batch.media.length, avatarsUpdated, changedChatIds: [...changed], accountChanged: !!active && active !== account, warnings: batch.warnings, ...receipt ? { sync_receipt: receipt } : {} };
|
|
426
|
+
const result = { duplicate: false, chats: batch.chats.length, messages, mediaUpdated: batch.media.length, avatarsUpdated, changedChatIds: [...changed], accountChanged: !!active && active !== account, warnings: batch.warnings, ...batch.previous_run_id !== void 0 ? { confirmed_run: batch.run_id, confirmed_source: source } : {}, ...receipt ? { sync_receipt: receipt } : {} };
|
|
412
427
|
this.db.prepare("INSERT INTO runs VALUES(?,?,?,?)").run(workspace, batch.run_id, digest, JSON.stringify(result));
|
|
413
428
|
this.db.exec("COMMIT");
|
|
414
429
|
return result;
|
|
@@ -429,14 +444,14 @@ var WechatRepository = class _WechatRepository {
|
|
|
429
444
|
}
|
|
430
445
|
requeueLegacyIntents(workspace, contactId) {
|
|
431
446
|
this.db.prepare(`UPDATE customer_intents SET revision=revision+1,due=?
|
|
432
|
-
WHERE assessed=revision AND (
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
${contactId === void 0 ? "" : "AND chat_id=?"}`).run(Date.now(),
|
|
447
|
+
WHERE assessed=revision AND EXISTS(SELECT 1 FROM chats c JOIN active a ON a.workspace=c.workspace AND a.account=c.account
|
|
448
|
+
WHERE c.id=customer_intents.chat_id AND c.workspace=? AND (
|
|
449
|
+
(json_extract(result,'$.status')='failed' AND COALESCE(json_extract(result,'$.policyVersion'),1)<?)
|
|
450
|
+
OR (c.crm IS NULL AND json_extract(result,'$.status')='ready'
|
|
451
|
+
AND COALESCE(json_extract(result,'$.policyVersion'),1)<?
|
|
452
|
+
AND json_extract(result,'$.products')='{}' AND json_type(result,'$.crm') IS NULL)
|
|
453
|
+
))
|
|
454
|
+
${contactId === void 0 ? "" : "AND chat_id=?"}`).run(Date.now(), workspace, intentPolicyVersion, intentSemanticPolicyVersion, ...contactId === void 0 ? [] : [contactId]);
|
|
440
455
|
}
|
|
441
456
|
seedIntents(workspace) {
|
|
442
457
|
const active = this.row("SELECT account FROM active WHERE workspace=?", workspace);
|
|
@@ -511,6 +526,26 @@ var WechatRepository = class _WechatRepository {
|
|
|
511
526
|
listContacts(workspace, limit = 200, offset = 0) {
|
|
512
527
|
return this.rows("SELECT c.* FROM chats c JOIN active a ON a.workspace=c.workspace AND a.account=c.account WHERE c.workspace=? ORDER BY (SELECT MAX(sent_at) FROM messages WHERE chat_id=c.id) DESC,c.id LIMIT ? OFFSET ?", workspace, Math.max(1, Math.min(200, limit)), Math.max(0, offset)).map((c) => this.project(c, 2));
|
|
513
528
|
}
|
|
529
|
+
/** Freeze membership and order for paging. Rows are projected with their current state. */
|
|
530
|
+
contactsPage(workspace, snapshotId, limit, offset, revision) {
|
|
531
|
+
const account = this.row("SELECT account FROM active WHERE workspace=?", workspace)?.account;
|
|
532
|
+
const now = Date.now();
|
|
533
|
+
let page = this.contactPages.get(snapshotId);
|
|
534
|
+
if (!snapshotId) {
|
|
535
|
+
snapshotId = randomUUID();
|
|
536
|
+
const ids = this.rows(`SELECT id FROM chats c WHERE workspace=? AND account=?
|
|
537
|
+
ORDER BY (SELECT MAX(sent_at) FROM messages WHERE chat_id=c.id) DESC,c.id`, workspace, account ?? null).map((row) => String(row.id));
|
|
538
|
+
page = { workspace, account, ids, revision, expiresAt: now + CONTACT_PAGE_TTL_MS };
|
|
539
|
+
}
|
|
540
|
+
if (!page || page.workspace !== workspace || page.account !== account || page.expiresAt <= now)
|
|
541
|
+
throw Error("WECHAT_CONTACT_SNAPSHOT_EXPIRED");
|
|
542
|
+
page.expiresAt = now + CONTACT_PAGE_TTL_MS;
|
|
543
|
+
this.contactPages.delete(snapshotId);
|
|
544
|
+
this.contactPages.set(snapshotId, page);
|
|
545
|
+
if (this.contactPages.size > MAX_CONTACT_PAGE_SESSIONS) this.contactPages.delete(this.contactPages.keys().next().value);
|
|
546
|
+
const contacts = page.ids.slice(offset, offset + limit).map((id) => this.project(this.scope(workspace, id), 2));
|
|
547
|
+
return { contacts, revision: page.revision, snapshotId };
|
|
548
|
+
}
|
|
514
549
|
getContact(workspace, id) {
|
|
515
550
|
return this.project(this.scope(workspace, id), 100);
|
|
516
551
|
}
|
|
@@ -669,6 +704,7 @@ var WechatRepository = class _WechatRepository {
|
|
|
669
704
|
}
|
|
670
705
|
close() {
|
|
671
706
|
if (!this.closed) {
|
|
707
|
+
this.importStatements.clear();
|
|
672
708
|
this.db.close();
|
|
673
709
|
this.closed = true;
|
|
674
710
|
}
|
|
@@ -677,7 +713,7 @@ var WechatRepository = class _WechatRepository {
|
|
|
677
713
|
|
|
678
714
|
// src/wechat/repository-worker.ts
|
|
679
715
|
var repository = await WechatRepository.open(workerData.root);
|
|
680
|
-
var allowed = /* @__PURE__ */ new Set(["importBatch", "listContacts", "getContact", "listMessages", "getMedia", "getMediaPriority", "getDraftVoice", "getVoiceForTranscription", "bindCrm", "getState", "saveState", "markHandled", "getPairing", "getDeliverySource", "claimDelivery", "settleDelivery", "deliveryStatus", "queueIntent", "seedIntents", "nextIntent", "getIntentInput", "finishIntent"]);
|
|
716
|
+
var allowed = /* @__PURE__ */ new Set(["importBatch", "listContacts", "contactsPage", "getContact", "listMessages", "getMedia", "getMediaPriority", "getDraftVoice", "getVoiceForTranscription", "bindCrm", "getState", "saveState", "markHandled", "getPairing", "getDeliverySource", "claimDelivery", "settleDelivery", "deliveryStatus", "queueIntent", "seedIntents", "nextIntent", "getIntentInput", "finishIntent"]);
|
|
681
717
|
parentPort.on("message", ({ id, method, args }) => {
|
|
682
718
|
try {
|
|
683
719
|
if (!allowed.has(method)) throw Error("WECHAT_OPERATION_INVALID");
|
package/docs/diagnostics.zh.md
CHANGED
|
@@ -35,6 +35,7 @@ if ($files.Count -gt 0) {
|
|
|
35
35
|
| `wechat.runtime`、`wechat.sync` | 组件下载、解压、校验、自检、登录等待和同步结果 |
|
|
36
36
|
| `dingtalk.http.start`、`dingtalk.oauth-challenge`、`dingtalk.status.*`、`dingtalk.model-route` | 请求登录、生成授权入口、等待确认、绑定结果和模型配置。钉钉浏览器端授权回调发生在服务端,需要按时间对照服务端记录。 |
|
|
37
37
|
| `mcp.knowledge`、`mcp.materials`、`knowledge`、`weknora.http` | 工具缺失、调用超时、HTTP 错误、响应解析、知识库范围和素材文件检查。分别核对 MCP 调用和直连 WeKnora。 |
|
|
38
|
+
| `wechat.rpc.contacts`、`intent.model-readiness`、`intent.inference`、`intent.evaluate` | 核对联系人分页冲突、评分模型是否就绪、推理失败原因和评估结果。同步可以继续。 |
|
|
38
39
|
| `crm.http`、`tool.crm_` | CRM 请求和工具执行,含网络、HTTP 状态和耗时 |
|
|
39
40
|
| `langfuse` | 配置、凭据、项目检查、上传响应、托管转发、队列待重试或已确认。测试配置可查托管转发。生产直连可通过 Host 环境变量注入 API 和脱敏密钥,Windows 使用同一方式。 |
|
|
40
41
|
|
package/package.json
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.6",
|
|
4
4
|
"targets": {
|
|
5
5
|
"win32-x64": {
|
|
6
|
-
"url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.
|
|
7
|
-
"sha256": "
|
|
8
|
-
"bytes":
|
|
9
|
-
"unpackedBytes":
|
|
10
|
-
"componentSha256": "
|
|
6
|
+
"url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.3-win32-x64-040c24ad35c875db.tgz",
|
|
7
|
+
"sha256": "040c24ad35c875db1b6d8e423935cede0a8e3150269bcfc01bf926b2e0fce55e",
|
|
8
|
+
"bytes": 22917486,
|
|
9
|
+
"unpackedBytes": 47611545,
|
|
10
|
+
"componentSha256": "b72916b0b8ee6e55e540a0ecb2cb9310248c29778289a2f06302fe40ca4e9ae9"
|
|
11
11
|
},
|
|
12
12
|
"darwin-arm64": {
|
|
13
|
-
"url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.
|
|
14
|
-
"sha256": "
|
|
15
|
-
"bytes":
|
|
16
|
-
"unpackedBytes":
|
|
17
|
-
"componentSha256": "
|
|
13
|
+
"url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.5-darwin-arm64-3942e780ff1d3877.tgz",
|
|
14
|
+
"sha256": "3942e780ff1d38770291ae64029c860ec52bf7326fe2123f32a2c0e06083c09c",
|
|
15
|
+
"bytes": 25125580,
|
|
16
|
+
"unpackedBytes": 64495137,
|
|
17
|
+
"componentSha256": "a2817efdcefd4ea78c3bc657a03bdf39b41a3468df1ba03f959f95d3adf6c025"
|
|
18
18
|
},
|
|
19
19
|
"darwin-x64": {
|
|
20
|
-
"url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.
|
|
21
|
-
"sha256": "
|
|
22
|
-
"bytes":
|
|
23
|
-
"unpackedBytes":
|
|
24
|
-
"componentSha256": "
|
|
20
|
+
"url": "https://wanjidazi.com/plugins/sales-assistant/runtimes/wanji-wechat-runtime-1.0.4-darwin-x64-3aa17267c37531a9.tgz",
|
|
21
|
+
"sha256": "3aa17267c37531a9b7a0acbcb6537f9ccb7e0430a879d16396c3a3dc604a09e7",
|
|
22
|
+
"bytes": 27838054,
|
|
23
|
+
"unpackedBytes": 66653818,
|
|
24
|
+
"componentSha256": "1d441c8f7fe2b923b96051ea74b10d60c7229ced66b6225eee52a9849afdc0b4"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|