@wanji_dsh/dsh-sales 0.10.2 → 0.10.3
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/client.js +216 -92
- package/dist/host.js +16 -9
- package/dist/types/agent.d.ts +1 -0
- package/dist/types/open-review.d.ts +2 -0
- package/dist/types/turn-packet.d.ts +1 -0
- package/dist/types/turn-plan.d.ts +2 -1
- package/dist/types/wechat/batch.d.ts +2 -2
- package/dist/wechat-repository-worker.js +22 -11
- package/docs/auto-update.md +1 -1
- package/docs/wechat-sync.md +2 -0
- package/package.json +1 -1
- package/runtime/wechat-manifest.json +1 -1
package/dist/client.js
CHANGED
|
@@ -91,13 +91,65 @@ function IntentBadge({ intent, t }) {
|
|
|
91
91
|
return /* @__PURE__ */ React.createElement("span", { className: "ws-intent-badge", "data-grade": rank?.grade, title: t("intentLabel") }, rank ? rank.grade + " \xB7 " + rank.score : t("intentUnknown"));
|
|
92
92
|
}
|
|
93
93
|
function IntentDetails({ intent, t }) {
|
|
94
|
+
const [mode, setMode] = React.useState("closed");
|
|
95
|
+
const container = React.useRef(null);
|
|
96
|
+
const trigger = React.useRef(null);
|
|
97
|
+
const panelId = React.useId();
|
|
98
|
+
const open = mode !== "closed";
|
|
94
99
|
const rank = rankedIntent(intent);
|
|
95
100
|
const status = intent?.retryAt ? t("intentWaitingForQuota") : intent?.status === "pending" ? t("intentPending") : intent?.status === "failed" ? t("intentFailed") : void 0;
|
|
96
101
|
const product = rank && "product" in rank ? rank.product : void 0;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
React.useEffect(() => {
|
|
103
|
+
if (!open) return;
|
|
104
|
+
const closeOutside = (event) => {
|
|
105
|
+
if (event.target instanceof Node && !container.current?.contains(event.target)) setMode("closed");
|
|
106
|
+
};
|
|
107
|
+
const closeOnEscape = (event) => {
|
|
108
|
+
if (event.key !== "Escape") return;
|
|
109
|
+
if (container.current?.contains(document.activeElement)) trigger.current?.focus();
|
|
110
|
+
setMode("closed");
|
|
111
|
+
};
|
|
112
|
+
document.addEventListener("pointerdown", closeOutside);
|
|
113
|
+
document.addEventListener("keydown", closeOnEscape);
|
|
114
|
+
return () => {
|
|
115
|
+
document.removeEventListener("pointerdown", closeOutside);
|
|
116
|
+
document.removeEventListener("keydown", closeOnEscape);
|
|
117
|
+
};
|
|
118
|
+
}, [open]);
|
|
119
|
+
return /* @__PURE__ */ React.createElement(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
className: "ws-intent-details",
|
|
123
|
+
ref: container,
|
|
124
|
+
onPointerEnter: (event) => {
|
|
125
|
+
if (event.pointerType === "mouse") setMode((current) => current === "closed" ? "hover" : current);
|
|
126
|
+
},
|
|
127
|
+
onPointerLeave: (event) => {
|
|
128
|
+
if (event.pointerType === "mouse") setMode((current) => current === "hover" ? "closed" : current);
|
|
129
|
+
},
|
|
130
|
+
onBlur: (event) => {
|
|
131
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setMode("closed");
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
/* @__PURE__ */ React.createElement(
|
|
135
|
+
"button",
|
|
136
|
+
{
|
|
137
|
+
className: "ws-intent-trigger",
|
|
138
|
+
type: "button",
|
|
139
|
+
ref: trigger,
|
|
140
|
+
"aria-controls": panelId,
|
|
141
|
+
"aria-expanded": open,
|
|
142
|
+
onClick: () => setMode((current) => current === "pinned" ? "closed" : "pinned")
|
|
143
|
+
},
|
|
144
|
+
/* @__PURE__ */ React.createElement("span", null, t("intentLabel")),
|
|
145
|
+
/* @__PURE__ */ React.createElement("span", { "aria-hidden": "true" }, "\xB7"),
|
|
146
|
+
/* @__PURE__ */ React.createElement("span", { className: "ws-intent-value" }, rank ? rank.grade + " \xB7 " + rank.score + " " + t("intentPoints") : t("intentUnknown"))
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ React.createElement("div", { className: "ws-intent-popover", hidden: !open }, /* @__PURE__ */ React.createElement("div", { className: "ws-intent-panel", id: panelId, role: "region", "aria-label": t("intentLabel"), tabIndex: 0 }, status && /* @__PURE__ */ React.createElement("p", { role: "status" }, status), intent?.updatedAt && /* @__PURE__ */ React.createElement("p", null, t("intentUpdated"), " ", /* @__PURE__ */ React.createElement("time", { dateTime: intent.updatedAt }, new Date(intent.updatedAt).toLocaleString())), intent?.crm && /* @__PURE__ */ React.createElement("p", null, t("intentCrm"), " ", intent.crm.grade, " \xB7 ", intent.crm.score, " ", t("intentPoints")), intent?.crmUnavailable && /* @__PURE__ */ React.createElement("p", null, t("intentCrmUnavailable")), !rank && !status && /* @__PURE__ */ React.createElement("p", null, t("intentUnknownReason")), /* @__PURE__ */ React.createElement("dl", null, intentProducts.map((key) => {
|
|
149
|
+
const item = intent?.products[key];
|
|
150
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, { key }, /* @__PURE__ */ React.createElement("dt", null, productIntentNames[key], product === key ? " \xB7 " + t("intentTopProduct") : ""), /* @__PURE__ */ React.createElement("dd", null, item?.score == null ? item?.stage === "service" ? t("intentService") : t("intentUnknown") : gradeOf(item.score) + " \xB7 " + item.score + " " + t("intentPoints"), item && /* @__PURE__ */ React.createElement("blockquote", null, t(item.evidence.source === "call" ? "intentCallEvidence" : "intentWechatEvidence"), " \xB7 ", /* @__PURE__ */ React.createElement("q", null, item.evidence.quote))));
|
|
151
|
+
}))))
|
|
152
|
+
);
|
|
101
153
|
}
|
|
102
154
|
|
|
103
155
|
// src/reply-editor.tsx
|
|
@@ -7143,25 +7195,21 @@ var import_react = __toESM(require("react"), 1);
|
|
|
7143
7195
|
// src/wechat/image-preview-geometry.ts
|
|
7144
7196
|
function fitImageScale(width, height, availableWidth, availableHeight) {
|
|
7145
7197
|
if (![width, height, availableWidth, availableHeight].every((v) => Number.isFinite(v) && v > 0)) return 1;
|
|
7146
|
-
return Math.min(
|
|
7198
|
+
return Math.min(availableWidth / width, availableHeight / height);
|
|
7199
|
+
}
|
|
7200
|
+
function imageZoomRange(fit) {
|
|
7201
|
+
return { min: Math.min(0.1, fit), max: Math.max(4, fit) };
|
|
7147
7202
|
}
|
|
7148
7203
|
function clampImageScale(value, fit) {
|
|
7149
|
-
|
|
7204
|
+
const { min, max } = imageZoomRange(fit);
|
|
7205
|
+
return Number.isFinite(value) ? Math.max(min, Math.min(max, value)) : fit;
|
|
7150
7206
|
}
|
|
7151
7207
|
|
|
7152
7208
|
// src/wechat/image-preview.tsx
|
|
7153
7209
|
function ImagePreview({ src, t, onClose, onError, returnFocus }) {
|
|
7154
|
-
const dialog = (0, import_react.useRef)(null), canvas = (0, import_react.useRef)(null)
|
|
7155
|
-
const [
|
|
7156
|
-
const
|
|
7157
|
-
const el = canvas.current;
|
|
7158
|
-
if (!el || !natural.width) return;
|
|
7159
|
-
fit.current = fitImageScale(natural.width, natural.height, Math.max(1, el.clientWidth - 32), Math.max(1, el.clientHeight - 32));
|
|
7160
|
-
if (fitted.current) {
|
|
7161
|
-
setScale(fit.current);
|
|
7162
|
-
el.scrollTo(0, 0);
|
|
7163
|
-
}
|
|
7164
|
-
};
|
|
7210
|
+
const dialog = (0, import_react.useRef)(null), canvas = (0, import_react.useRef)(null);
|
|
7211
|
+
const [{ width, height }, setNatural] = (0, import_react.useState)({ width: 0, height: 0 }), [fit, setFit] = (0, import_react.useState)(1);
|
|
7212
|
+
const [manualScale, setManualScale] = (0, import_react.useState)();
|
|
7165
7213
|
(0, import_react.useLayoutEffect)(() => {
|
|
7166
7214
|
const el = dialog.current;
|
|
7167
7215
|
el?.showModal();
|
|
@@ -7171,19 +7219,25 @@ function ImagePreview({ src, t, onClose, onError, returnFocus }) {
|
|
|
7171
7219
|
};
|
|
7172
7220
|
}, []);
|
|
7173
7221
|
(0, import_react.useLayoutEffect)(() => {
|
|
7174
|
-
|
|
7175
|
-
if (!
|
|
7176
|
-
const
|
|
7177
|
-
|
|
7222
|
+
const el = canvas.current;
|
|
7223
|
+
if (!el || !width) return;
|
|
7224
|
+
const measure = () => setFit(fitImageScale(width, height, Math.max(1, el.clientWidth - 32), Math.max(1, el.clientHeight - 32)));
|
|
7225
|
+
measure();
|
|
7226
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
7227
|
+
const observer = new ResizeObserver(measure);
|
|
7228
|
+
observer.observe(el);
|
|
7178
7229
|
return () => observer.disconnect();
|
|
7179
|
-
}, [
|
|
7230
|
+
}, [width, height]);
|
|
7231
|
+
const scale = manualScale === void 0 ? fit : clampImageScale(manualScale, fit);
|
|
7232
|
+
const { min, max } = imageZoomRange(fit);
|
|
7180
7233
|
const zoom = (factor) => {
|
|
7181
|
-
|
|
7182
|
-
|
|
7234
|
+
if (!width) return;
|
|
7235
|
+
const next = clampImageScale(scale * factor, fit);
|
|
7236
|
+
if (next !== scale) setManualScale(next);
|
|
7183
7237
|
};
|
|
7184
7238
|
const reset = () => {
|
|
7185
|
-
|
|
7186
|
-
|
|
7239
|
+
setManualScale(void 0);
|
|
7240
|
+
canvas.current?.scrollTo(0, 0);
|
|
7187
7241
|
};
|
|
7188
7242
|
return /* @__PURE__ */ import_react.default.createElement("dialog", { ref: dialog, className: "ws-image-dialog", "aria-label": t("wxImagePreview"), onCancel: (event) => {
|
|
7189
7243
|
event.preventDefault();
|
|
@@ -7193,12 +7247,14 @@ function ImagePreview({ src, t, onClose, onError, returnFocus }) {
|
|
|
7193
7247
|
const r = event.currentTarget.getBoundingClientRect();
|
|
7194
7248
|
if (event.clientX < r.left || event.clientX > r.right || event.clientY < r.top || event.clientY > r.bottom) onClose();
|
|
7195
7249
|
}, onKeyDown: (event) => {
|
|
7196
|
-
if (["+", "=", "-", "0"].includes(event.key)) {
|
|
7250
|
+
if (["+", "=", "-", "0", "1"].includes(event.key)) {
|
|
7197
7251
|
event.preventDefault();
|
|
7198
7252
|
if (event.key === "0") reset();
|
|
7199
|
-
else
|
|
7253
|
+
else if (event.key === "1") {
|
|
7254
|
+
if (width) setManualScale(1);
|
|
7255
|
+
} else zoom(event.key === "-" ? 1 / 1.25 : 1.25);
|
|
7200
7256
|
}
|
|
7201
|
-
} }, /* @__PURE__ */ import_react.default.createElement("header", { className: "ws-image-toolbar" }, /* @__PURE__ */ import_react.default.createElement("strong", null, t("wxImagePreview")), /* @__PURE__ */ import_react.default.createElement("div", { className: "ws-image-tools" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button", disabled: !
|
|
7257
|
+
} }, /* @__PURE__ */ import_react.default.createElement("header", { className: "ws-image-toolbar" }, /* @__PURE__ */ import_react.default.createElement("strong", null, t("wxImagePreview")), /* @__PURE__ */ import_react.default.createElement("div", { className: "ws-image-tools" }, /* @__PURE__ */ import_react.default.createElement("button", { type: "button", disabled: !width || scale <= min, "aria-label": t("wxImageZoomOut"), title: t("wxImageZoomOut"), onClick: () => zoom(1 / 1.25) }, "\u2212"), /* @__PURE__ */ import_react.default.createElement("button", { type: "button", className: "ws-image-scale", disabled: !width, "aria-label": t("wxImageActualSize"), title: t("wxImageActualSize"), onClick: () => setManualScale(1) }, /* @__PURE__ */ import_react.default.createElement("span", { "aria-live": "polite" }, Math.round(scale * 100), "%")), /* @__PURE__ */ import_react.default.createElement("button", { type: "button", disabled: !width || scale >= max, "aria-label": t("wxImageZoomIn"), title: t("wxImageZoomIn"), onClick: () => zoom(1.25) }, "+"), /* @__PURE__ */ import_react.default.createElement("button", { type: "button", className: "ws-image-fit", disabled: !width, onClick: reset }, t("wxImageFit")), /* @__PURE__ */ import_react.default.createElement("button", { type: "button", className: "ws-image-close", autoFocus: true, "aria-label": t("wxClosePreview"), title: t("wxClosePreview"), onClick: onClose }, "\xD7"))), /* @__PURE__ */ import_react.default.createElement("div", { className: "ws-image-canvas", ref: canvas }, /* @__PURE__ */ import_react.default.createElement("div", { className: "ws-image-stage" }, /* @__PURE__ */ import_react.default.createElement("img", { src, alt: t("wxImageAlt"), draggable: false, style: { width: width * scale, height: height * scale }, onLoad: (event) => setNatural({ width: event.currentTarget.naturalWidth, height: event.currentTarget.naturalHeight }), onError }))));
|
|
7202
7258
|
}
|
|
7203
7259
|
|
|
7204
7260
|
// src/reply-content.tsx
|
|
@@ -7502,7 +7558,7 @@ function wechatPresentation(view) {
|
|
|
7502
7558
|
if (s?.message === "WECHAT_OTHER_WORKSPACE") return { statusKey: "wxOtherWorkspace", emptyKey, hintKey: "wxOtherWorkspaceHint", blocked: true };
|
|
7503
7559
|
if (s?.phase === "error") return { statusKey: "wxConnectionFailed", emptyKey, hintKey: "wxConnectionFailedHint", blocked: false };
|
|
7504
7560
|
if (s?.phase === "authorizing") return { statusKey: "wxAwaitConsent", emptyKey, hintKey: "wxAwaitConsentHint", blocked: false };
|
|
7505
|
-
if (s?.phase === "paused") return { statusKey: "wxPaused", emptyKey,
|
|
7561
|
+
if (s?.phase === "paused") return { statusKey: "wxPaused", emptyKey, blocked: false };
|
|
7506
7562
|
if (s?.phase === "waiting") return { statusKey: "wxLive", emptyKey, blocked: false };
|
|
7507
7563
|
if (s?.phase === "ready") return { statusKey: "wxReady", emptyKey, blocked: false };
|
|
7508
7564
|
if (s) return { statusKey: "wxDisconnected", emptyKey, hintKey: "wxDisconnectedHint", blocked: false };
|
|
@@ -7721,7 +7777,7 @@ function createWechatClient(rpc, snapshot, options = {}) {
|
|
|
7721
7777
|
},
|
|
7722
7778
|
async media(mediaId) {
|
|
7723
7779
|
const result = await request("media", { mediaId });
|
|
7724
|
-
if (!/^(image\/(png|jpeg|gif|webp)|audio\/[a-z0-9.+-]
|
|
7780
|
+
if (!/^(image\/(png|jpeg|gif|webp)|audio\/[a-z0-9.+-]+|video\/mp4)$/i.test(result.mimeType)) throw Error("\u4E0D\u652F\u6301\u6B64\u5A92\u4F53\u7C7B\u578B");
|
|
7725
7781
|
return `data:${result.mimeType};base64,${result.data}`;
|
|
7726
7782
|
},
|
|
7727
7783
|
dispose() {
|
|
@@ -7803,18 +7859,19 @@ var voicePlayback = new VoicePlaybackCoordinator();
|
|
|
7803
7859
|
|
|
7804
7860
|
// src/wechat/message-media.tsx
|
|
7805
7861
|
function WechatMessageBody({ message, client, revision: revision2, t }) {
|
|
7806
|
-
const attachment = message.kind === "image" || message.kind === "voice" || message.kind === "audio";
|
|
7807
|
-
const text4 = attachment ? /^\[(?:image|图片|(?:voice|audio|语音)(?:\s*\d+(?:\.\d+)?\s*(?:秒|s|["″”]))?)\]$/i.test(message.text?.trim() ?? "") ? "" : message.text : message.text || `[${message.kind}]`;
|
|
7808
|
-
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, text4 && /* @__PURE__ */ import_react7.default.createElement("div", null, text4), message.mediaId ? /* @__PURE__ */ import_react7.default.createElement(NativeMedia, { client, mediaId: message.mediaId, kind: message.kind, revision: revision2, t }) : attachment && (message.kind === "image" ? /* @__PURE__ */ import_react7.default.createElement("span", { className: "ws-media-placeholder" }, t("wxImagePending")) : /* @__PURE__ */ import_react7.default.createElement(VoicePlaceholder, { state: "pending", t })));
|
|
7862
|
+
const attachment = message.kind === "image" || message.kind === "voice" || message.kind === "audio" || message.kind === "video";
|
|
7863
|
+
const text4 = attachment ? /^\[(?:image|图片|video|视频|(?:voice|audio|语音)(?:\s*\d+(?:\.\d+)?\s*(?:秒|s|["″”]))?)\]$/i.test(message.text?.trim() ?? "") ? "" : message.text : message.text || `[${message.kind}]`;
|
|
7864
|
+
return /* @__PURE__ */ import_react7.default.createElement(import_react7.default.Fragment, null, text4 && /* @__PURE__ */ import_react7.default.createElement("div", null, text4), message.mediaId ? /* @__PURE__ */ import_react7.default.createElement(NativeMedia, { client, mediaId: message.mediaId, kind: message.kind, revision: revision2, t }) : attachment && (message.kind === "image" || message.kind === "video" ? /* @__PURE__ */ import_react7.default.createElement("span", { className: "ws-media-placeholder" }, t(message.kind === "video" ? "wxVideoPending" : "wxImagePending")) : /* @__PURE__ */ import_react7.default.createElement(VoicePlaceholder, { state: "pending", t })));
|
|
7809
7865
|
}
|
|
7810
7866
|
function NativeMedia(props) {
|
|
7811
7867
|
return /* @__PURE__ */ import_react7.default.createElement(MediaAttachment, { key: props.mediaId, ...props });
|
|
7812
7868
|
}
|
|
7813
7869
|
function MediaAttachment({ client, mediaId, kind, revision: revision2, t }) {
|
|
7814
7870
|
const [result, setResult] = (0, import_react7.useState)({ mediaId });
|
|
7871
|
+
const [requested, setRequested] = (0, import_react7.useState)(kind !== "video");
|
|
7815
7872
|
const [retry, setRetry] = (0, import_react7.useState)(0), element2 = (0, import_react7.useRef)(null), loaded = (0, import_react7.useRef)(false);
|
|
7816
7873
|
(0, import_react7.useEffect)(() => {
|
|
7817
|
-
if (loaded.current) return;
|
|
7874
|
+
if (!requested || loaded.current) return;
|
|
7818
7875
|
let cancel, started = false;
|
|
7819
7876
|
const load = () => {
|
|
7820
7877
|
if (started) return;
|
|
@@ -7837,11 +7894,14 @@ function MediaAttachment({ client, mediaId, kind, revision: revision2, t }) {
|
|
|
7837
7894
|
observer?.disconnect();
|
|
7838
7895
|
cancel?.();
|
|
7839
7896
|
};
|
|
7840
|
-
}, [client, mediaId, revision2, retry]);
|
|
7897
|
+
}, [client, mediaId, revision2, retry, requested]);
|
|
7841
7898
|
const failed = () => {
|
|
7842
7899
|
loaded.current = false;
|
|
7843
7900
|
setResult({ mediaId, error: "decode" });
|
|
7844
7901
|
};
|
|
7902
|
+
if (kind === "video") {
|
|
7903
|
+
return /* @__PURE__ */ import_react7.default.createElement("div", { ref: element2, className: "ws-native-media" }, result.url ? /* @__PURE__ */ import_react7.default.createElement("video", { src: result.url, controls: true, playsInline: true, preload: "metadata", "aria-label": t("wxVideoMessage"), onError: failed }) : result.error ? /* @__PURE__ */ import_react7.default.createElement("span", { role: "status" }, t("wxVideoUnavailable"), " ", /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", className: "ws-text-button", onClick: () => setRetry((value) => value + 1) }, t("wxMediaRetry"))) : requested ? /* @__PURE__ */ import_react7.default.createElement("span", { className: "ws-media-placeholder", role: "status" }, t("wxVideoLoading")) : /* @__PURE__ */ import_react7.default.createElement("button", { type: "button", className: "ws-button ws-video-load", onClick: () => setRequested(true) }, t("wxVideoLoad")));
|
|
7904
|
+
}
|
|
7845
7905
|
return /* @__PURE__ */ import_react7.default.createElement("div", { ref: element2, className: "ws-native-media" }, result.url ? result.url.startsWith("data:image/") ? /* @__PURE__ */ import_react7.default.createElement(ImageAttachment, { src: result.url, t, onError: failed }) : /* @__PURE__ */ import_react7.default.createElement(VoiceAttachment, { key: result.url, src: result.url, t, onError: failed }) : result.error ? kind === "voice" || kind === "audio" ? /* @__PURE__ */ import_react7.default.createElement(VoicePlaceholder, { state: "error", t, retry: () => setRetry((value) => value + 1) }) : /* @__PURE__ */ import_react7.default.createElement("span", { role: "status" }, t(kind === "image" ? "wxImageUnavailable" : "wxAudioUnavailable"), " ", /* @__PURE__ */ import_react7.default.createElement("button", { className: "ws-text-button", onClick: () => setRetry((value) => value + 1) }, t("wxMediaRetry"))) : kind === "voice" || kind === "audio" ? /* @__PURE__ */ import_react7.default.createElement(VoicePlaceholder, { state: "loading", t }) : /* @__PURE__ */ import_react7.default.createElement("span", { className: "ws-media-placeholder", role: "status" }, t("wxImageLoading")));
|
|
7846
7906
|
}
|
|
7847
7907
|
function ImageAttachment({ src, t, onError }) {
|
|
@@ -7899,7 +7959,8 @@ function SyncPanel({ client, view, workspaceId, t }) {
|
|
|
7899
7959
|
void client.control("authorize", { requestId: consent.requestId, approved });
|
|
7900
7960
|
};
|
|
7901
7961
|
if (s?.runtime && s.runtime.phase !== "ready") return /* @__PURE__ */ import_react8.default.createElement(RuntimePanel, { runtime: s.runtime, t, retry: () => void client.control("runtime-retry"), disabled: !workspaceId });
|
|
7902
|
-
const presentation = wechatPresentation(view), statusText = t(presentation.statusKey)
|
|
7962
|
+
const presentation = wechatPresentation(view), statusText = t(presentation.statusKey);
|
|
7963
|
+
const message = view.error || (isWechatSyncActive(s, view.error) ? void 0 : s?.message);
|
|
7903
7964
|
const detail = message && !/^WECHAT_/.test(message) ? message : presentation.hintKey ? t(presentation.hintKey) : void 0;
|
|
7904
7965
|
return /* @__PURE__ */ import_react8.default.createElement("div", { className: "ws-sync-status" }, /* @__PURE__ */ import_react8.default.createElement("div", { className: "ws-sync-line" }, /* @__PURE__ */ import_react8.default.createElement("span", { className: "ws-dot" }), /* @__PURE__ */ import_react8.default.createElement("span", { role: "status" }, statusText), s?.lastSyncedAt && /* @__PURE__ */ import_react8.default.createElement("time", null, new Date(s.lastSyncedAt).toLocaleTimeString()), canPauseWechat(s) && /* @__PURE__ */ import_react8.default.createElement("button", { className: "ws-text-button", onClick: () => void client.control("pause") }, t("wxPause")), c && !c.ready ? /* @__PURE__ */ import_react8.default.createElement("button", { className: "ws-text-button", disabled: !workspaceId, onClick: () => void client.refresh() }, t("wxCheckConnection")) : !canPauseWechat(s) && (s?.phase === "paused" || s?.phase === "error" || !!view.error || s?.phase === "disconnected" && !presentation.blocked) && /* @__PURE__ */ import_react8.default.createElement("button", { className: "ws-text-button", disabled: !workspaceId || !c?.ready || s?.running, onClick: () => void client.control("start", { automatic: true }) }, t("wxRetry"))), detail && /* @__PURE__ */ import_react8.default.createElement("p", { role: "status" }, detail), !!s?.warnings?.length && /* @__PURE__ */ import_react8.default.createElement("details", null, /* @__PURE__ */ import_react8.default.createElement("summary", null, t("wxPartial")), s.warnings.map((warning, i) => /* @__PURE__ */ import_react8.default.createElement("p", { key: i }, warning))), consent && !answered.includes(key) && /* @__PURE__ */ import_react8.default.createElement("div", { className: "ws-sync-consent", role: "alert" }, /* @__PURE__ */ import_react8.default.createElement("strong", null, t(consent.kind === "restart" ? "wxRestart" : "wxInitialize")), /* @__PURE__ */ import_react8.default.createElement("p", null, consent.message), /* @__PURE__ */ import_react8.default.createElement("button", { className: "ws-button ws-primary", onClick: () => authorize(true) }, t("wxApprove")), /* @__PURE__ */ import_react8.default.createElement("button", { className: "ws-button", onClick: () => authorize(false) }, t("wxCancel"))));
|
|
7905
7966
|
}
|
|
@@ -9497,6 +9558,12 @@ var knowledgeEn = {
|
|
|
9497
9558
|
|
|
9498
9559
|
// src/locales.ts
|
|
9499
9560
|
var zh = {
|
|
9561
|
+
wxImageActualSize: "\u5B9E\u9645\u5927\u5C0F",
|
|
9562
|
+
wxVideoMessage: "\u5FAE\u4FE1\u89C6\u9891",
|
|
9563
|
+
wxVideoLoad: "\u52A0\u8F7D\u89C6\u9891",
|
|
9564
|
+
wxVideoLoading: "\u89C6\u9891\u52A0\u8F7D\u4E2D\u2026",
|
|
9565
|
+
wxVideoPending: "\u89C6\u9891\u5C1A\u672A\u540C\u6B65\u5230\u672C\u673A",
|
|
9566
|
+
wxVideoUnavailable: "\u89C6\u9891\u6682\u4E0D\u53EF\u64AD\u653E",
|
|
9500
9567
|
intentLabel: "\u610F\u5411",
|
|
9501
9568
|
intentSort: "\u4F1A\u8BDD\u6392\u5E8F",
|
|
9502
9569
|
intentSortRecent: "\u6700\u65B0\u6D88\u606F",
|
|
@@ -9574,7 +9641,6 @@ var zh = {
|
|
|
9574
9641
|
wxNoHistory: "\u6682\u65E0\u5DF2\u540C\u6B65\u7684\u5FAE\u4FE1\u4F1A\u8BDD",
|
|
9575
9642
|
wxAwaitConsent: "\u5FAE\u4FE1\u540C\u6B65\u7B49\u5F85\u6388\u6743",
|
|
9576
9643
|
wxAwaitConsentHint: "\u8BF7\u5148\u67E5\u770B\u5E76\u5904\u7406\u4E0A\u65B9\u7684\u6388\u6743\u8BF7\u6C42\u3002\u53D6\u6D88\u540E\u4E0D\u4F1A\u7EE7\u7EED\u521D\u59CB\u5316\u3002",
|
|
9577
|
-
wxPausedHint: "\u540C\u6B65\u5DF2\u6682\u505C\u3002\u5DF2\u6709\u8BB0\u5F55\u4ECD\u53EF\u67E5\u770B\uFF0C\u9700\u8981\u7EE7\u7EED\u65F6\u70B9\u51FB\u201C\u91CD\u65B0\u540C\u6B65\u201D\u3002",
|
|
9578
9644
|
wxOtherWorkspace: "\u5FAE\u4FE1\u6B63\u5728\u5176\u4ED6\u5DE5\u4F5C\u533A\u540C\u6B65",
|
|
9579
9645
|
wxOtherWorkspaceHint: "\u8BF7\u5148\u5728\u539F\u5DE5\u4F5C\u533A\u6682\u505C\u540C\u6B65\uFF0C\u518D\u8FDE\u63A5\u5F53\u524D\u5DE5\u4F5C\u533A\u3002",
|
|
9580
9646
|
wxCheckConnection: "\u91CD\u65B0\u68C0\u67E5",
|
|
@@ -9633,7 +9699,8 @@ var zh = {
|
|
|
9633
9699
|
wxImageUnavailable: "\u56FE\u7247\u6682\u4E0D\u53EF\u7528",
|
|
9634
9700
|
wxAudioUnavailable: "\u8BED\u97F3\u6682\u4E0D\u53EF\u7528",
|
|
9635
9701
|
wxMediaRetry: "\u91CD\u8BD5",
|
|
9636
|
-
|
|
9702
|
+
wxImageListPreview: "[\u56FE\u7247]",
|
|
9703
|
+
wxLive: "\u5FAE\u4FE1\u5DF2\u8FDE\u63A5\uFF0C\u81EA\u52A8\u540C\u6B65\u5DF2\u5F00\u542F",
|
|
9637
9704
|
wxPaused: "\u5FAE\u4FE1\u540C\u6B65\u5DF2\u6682\u505C",
|
|
9638
9705
|
wxSyncing: "\u6B63\u5728\u540C\u6B65\u5FAE\u4FE1",
|
|
9639
9706
|
wxLoading: "\u6B63\u5728\u8FDE\u63A5\u5FAE\u4FE1",
|
|
@@ -9706,7 +9773,6 @@ var zh = {
|
|
|
9706
9773
|
sync: "\u540C\u6B65\u5FAE\u4FE1",
|
|
9707
9774
|
unavailable: "\u6B64\u529F\u80FD\u5C1A\u672A\u63A5\u5165",
|
|
9708
9775
|
settings: "\u8FDE\u63A5\u8BBE\u7F6E",
|
|
9709
|
-
back: "\u8FD4\u56DE\u4F1A\u8BDD",
|
|
9710
9776
|
customers: "\u5BA2\u6237\u4F1A\u8BDD",
|
|
9711
9777
|
search: "\u641C\u7D22\u5BA2\u6237\u3001\u673A\u578B\u6216\u5173\u952E\u8BCD",
|
|
9712
9778
|
all: "\u5168\u90E8",
|
|
@@ -9779,6 +9845,12 @@ var zh = {
|
|
|
9779
9845
|
contextHint: "\u57FA\u4E8E\u5F53\u524D\u793A\u4F8B\u804A\u5929\u6574\u7406"
|
|
9780
9846
|
};
|
|
9781
9847
|
var en = {
|
|
9848
|
+
wxImageActualSize: "Actual size",
|
|
9849
|
+
wxVideoMessage: "WeChat video",
|
|
9850
|
+
wxVideoLoad: "Load video",
|
|
9851
|
+
wxVideoLoading: "Loading video\u2026",
|
|
9852
|
+
wxVideoPending: "Video has not synced to this computer",
|
|
9853
|
+
wxVideoUnavailable: "Video unavailable",
|
|
9782
9854
|
intentLabel: "Intent",
|
|
9783
9855
|
intentSort: "Sort conversations",
|
|
9784
9856
|
intentSortRecent: "Latest message",
|
|
@@ -9856,7 +9928,6 @@ var en = {
|
|
|
9856
9928
|
wxNoHistory: "No synced WeChat conversations yet",
|
|
9857
9929
|
wxAwaitConsent: "WeChat sync is awaiting consent",
|
|
9858
9930
|
wxAwaitConsentHint: "Review the consent request above. Cancelling will stop initialization.",
|
|
9859
|
-
wxPausedHint: "Sync is paused. Existing history remains available. Reconnect when ready.",
|
|
9860
9931
|
wxOtherWorkspace: "WeChat is syncing in another workspace",
|
|
9861
9932
|
wxOtherWorkspaceHint: "Pause sync in the original workspace before connecting this one.",
|
|
9862
9933
|
wxCheckConnection: "Check again",
|
|
@@ -9915,7 +9986,8 @@ var en = {
|
|
|
9915
9986
|
wxImageUnavailable: "Image unavailable",
|
|
9916
9987
|
wxAudioUnavailable: "Voice message unavailable",
|
|
9917
9988
|
wxMediaRetry: "Retry",
|
|
9918
|
-
|
|
9989
|
+
wxImageListPreview: "[image]",
|
|
9990
|
+
wxLive: "WeChat connected \xB7 Auto-sync enabled",
|
|
9919
9991
|
wxPaused: "WeChat sync paused",
|
|
9920
9992
|
wxSyncing: "Syncing WeChat",
|
|
9921
9993
|
wxLoading: "Connecting to WeChat",
|
|
@@ -9988,7 +10060,6 @@ var en = {
|
|
|
9988
10060
|
sync: "Sync WeChat",
|
|
9989
10061
|
unavailable: "This integration is not connected yet",
|
|
9990
10062
|
settings: "Connections",
|
|
9991
|
-
back: "Back to chat",
|
|
9992
10063
|
customers: "Conversations",
|
|
9993
10064
|
search: "Search customers, devices or keywords",
|
|
9994
10065
|
all: "All",
|
|
@@ -10287,6 +10358,10 @@ function currentCompanyFacts(contact, now = Date.now()) {
|
|
|
10287
10358
|
}
|
|
10288
10359
|
function buildTurnPacket(contact, latest, knowledge) {
|
|
10289
10360
|
const sources = /* @__PURE__ */ Object.create(null), current = contact.wechat ? contact.messages.filter((m) => m.direction === "in").at(-1)?.text ?? "" : latest.trim() || contact.preview;
|
|
10361
|
+
const lastInbound = contact.messages.map((m) => m.direction).lastIndexOf("in");
|
|
10362
|
+
const throughInbound = lastInbound >= 0 ? contact.messages.slice(0, lastInbound + 1) : [];
|
|
10363
|
+
const lastOutbound = throughInbound.map((m) => m.direction).lastIndexOf("out");
|
|
10364
|
+
const currentTurn = contact.wechat ? throughInbound.slice(lastOutbound + 1).slice(-8).map((m) => m.text) : [current].filter(Boolean);
|
|
10290
10365
|
if (current) sources.C0 = { text: current, authority: "customer" };
|
|
10291
10366
|
contact.messages.filter((m) => m.direction === "in").forEach((m, i) => sources["C" + (i + 1)] = { text: m.text, authority: "customer" });
|
|
10292
10367
|
contact.messages.filter((m) => m.direction === "out").forEach((m, i) => sources["S" + (i + 1)] = { text: m.text, authority: "historical_sales" });
|
|
@@ -10354,6 +10429,7 @@ function buildTurnPacket(contact, latest, knowledge) {
|
|
|
10354
10429
|
product: contact.product,
|
|
10355
10430
|
participant_roles: { our_sales: "\u4E07\u673A\u9500\u552E\uFF0C\u5356\u8F6F\u4EF6/\u63A8\u5E7F\u5E73\u53F0", merchant: "\u5F53\u524D\u5546\u5BB6", merchant_counterparty: "\u5546\u5BB6\u81EA\u5DF1\u7684\u4E70\u5BB6\u6216\u540C\u884C\uFF1B\u5176\u6210\u4EA4/\u4EA4\u8D27/\u6536\u6B3E\u4E0D\u662F\u5546\u5BB6\u8D2D\u4E70\u4E07\u673A\u8F6F\u4EF6" },
|
|
10356
10431
|
latest_customer_message: current,
|
|
10432
|
+
current_customer_turn: currentTurn,
|
|
10357
10433
|
sources,
|
|
10358
10434
|
selection_rule: "\u6570\u91CF\u610F\u613F\u4E0D\u7B49\u4E8E\u5BF9\u8C61\u9009\u62E9\u3002\u6279\u6B21\u5B58\u5728\u4E0D\u540C\u673A\u51B5\u3001\u5F52\u5C5E\u6216\u8303\u56F4\u65F6\uFF0C\u5BA2\u6237\u53EA\u8BF4\u8981\u5176\u4E2D\u51E0\u53F0/\u51E0\u9879\uFF0C\u5C1A\u672A\u6307\u660E\u9009\u4E2D\u5BF9\u8C61\uFF1B\u5148\u786E\u8BA4\u54EA\u7EC4\u3001\u54EA\u51E0\u9879\uFF0C\u6216\u6309\u4E0D\u540C\u9009\u62E9\u5206\u60C5\u51B5\u8BF4\u660E\uFF0C\u4E0D\u4ECE\u6570\u91CF\u81EA\u52A8\u9009\u51FA\u4E00\u7EC4\u3002\u540E\u7EED\u4EF7\u683C\u3001\u8D23\u4EFB\u548C\u5269\u4F59\u5BF9\u8C61\u53EA\u7ED1\u5B9A\u5DF2\u660E\u786E\u7684\u9009\u62E9\u3002\u5BA2\u6237\u5DF2\u660E\u786E\u9009\u5B9A\u65F6\u4FDD\u7559\uFF0C\u4E0D\u518D\u91CD\u95EE\u3002",
|
|
10359
10435
|
current_company_facts: company.facts.map((f, i) => ({ source_id: "V" + (i + 1), ...f })),
|
|
@@ -10828,36 +10904,52 @@ function selectedMaterialIds(wechat, materials) {
|
|
|
10828
10904
|
// src/turn-plan.ts
|
|
10829
10905
|
var planFields = ["goal", "customer_decisions", "need_to_answer", "not_needed_now", "next_action", "action", "progress"];
|
|
10830
10906
|
function buildTurnPlanCorrection(error) {
|
|
10831
|
-
return "\n\u4E0A\u6761\u7B56\u7565\u672A\u901A\u8FC7\uFF1A" + (error instanceof Error ? error.message : "\u7ED3\u6784\u4E0D\u5B8C\u6574") + "\u3002\u4FEE\u6B63\u540E\u8FD4\u56DE\u5B8C\u6574JSON\uFF0C" + planFields.length + "\u4E2A\u5B57\u6BB5\u5FC5\u987B\u9F50\u5168\uFF1A" + planFields.join("\u3001") + "\u3002\u4FDD\u7559\u5176\u4ED6\u6B63\u786E\u5185\u5BB9\uFF1B\u6CA1\u6709\u5BA2\u6237\u51B3\u5B9A\u65F6customer_decisions\u4E5F\u5FC5\u987B\u7ED9\u7A7A\u6570\u7EC4\uFF0C\u4E0D\u7701\u7565\u4EFB\u4F55\u5B57\u6BB5\u3002\u53EA\u8F93\u51FA\u4E00\u4E2A\u5408\u6CD5JSON\u5BF9\u8C61\uFF1B\u6570\u7EC4\u6BCF\u4E2A\u5143\u7D20\u90FD\u662F\u5B8C\u6574\u53CC\u5F15\u53F7\u5B57\u7B26\u4E32\uFF0C\u9664\u4E86\u9017\u53F7\u4E0D\u5939\u5E26\u6CE8\u91CA\u6216\u591A\u4F59\u7B26\u53F7\u3002";
|
|
10907
|
+
return "\n\u4E0A\u6761\u7B56\u7565\u672A\u901A\u8FC7\uFF1A" + (error instanceof Error ? error.message : "\u7ED3\u6784\u4E0D\u5B8C\u6574") + "\u3002\u4FEE\u6B63\u540E\u8FD4\u56DE\u5B8C\u6574JSON\uFF0C" + planFields.length + "\u4E2A\u5B57\u6BB5\u5FC5\u987B\u9F50\u5168\uFF1A" + planFields.join("\u3001") + "\u3002\u4FDD\u7559\u5176\u4ED6\u6B63\u786E\u5185\u5BB9\uFF1B\u6CA1\u6709\u5BA2\u6237\u51B3\u5B9A\u65F6customer_decisions\u4E5F\u5FC5\u987B\u7ED9\u7A7A\u6570\u7EC4\uFF0C\u4E0D\u7701\u7565\u4EFB\u4F55\u9876\u5C42\u5B57\u6BB5\u3002progress.decisions\u6BCF\u9879\u5FC5\u987B\u542Btopic\u3001source_id\u3001meaning\uFF0C\u540C\u4E00\u4E3B\u9898\u53EA\u5199\u4E00\u9879\uFF0C\u6700\u65B0\u4E00\u53E5\u53EF\u76F4\u63A5\u7528C0\u3002\u4E0D\u80FD\u786E\u8BA4\u4E3B\u9898\u65F6\uFF0Cprogress.decisions\u586B[]\u3002\u53EA\u8F93\u51FA\u4E00\u4E2A\u5408\u6CD5JSON\u5BF9\u8C61\uFF1B\u6570\u7EC4\u6BCF\u4E2A\u5143\u7D20\u90FD\u662F\u5B8C\u6574\u53CC\u5F15\u53F7\u5B57\u7B26\u4E32\uFF0C\u9664\u4E86\u9017\u53F7\u4E0D\u5939\u5E26\u6CE8\u91CA\u6216\u591A\u4F59\u7B26\u53F7\u3002";
|
|
10832
10908
|
}
|
|
10833
10909
|
function decisionSources(contact, latest) {
|
|
10834
10910
|
return Object.fromEntries([...Object.entries(customerEvidenceSources(contact)).filter(([, v]) => JSON.parse(v).speaker === "customer"), ["C0", latest.trim() || contact.preview], ...contact.messages.filter((m) => m.direction === "in").map((m, i) => ["C" + (i + 1), m.text]), ...contact.facts.map((f, i) => ["F" + (i + 1), f.value])]);
|
|
10835
10911
|
}
|
|
10836
|
-
function
|
|
10912
|
+
function bindTurnProgress(progress, packet) {
|
|
10913
|
+
const currentAliases = packet.history.filter((message) => message.speaker === "customer").length;
|
|
10914
|
+
const latestAlias = "C" + currentAliases;
|
|
10915
|
+
if (!progress || typeof progress !== "object" || !("decisions" in progress) || !Array.isArray(progress.decisions) || progress.decisions.length > 10) return bindProgress(progress, packet);
|
|
10916
|
+
const equivalent = packet.sources[latestAlias]?.authority === "customer" && packet.sources[latestAlias]?.text === packet.latest_customer_message;
|
|
10917
|
+
const groups = /* @__PURE__ */ new Map();
|
|
10918
|
+
for (const decision of progress.decisions) {
|
|
10919
|
+
const item = equivalent && decision?.source_id === latestAlias ? { ...decision, source_id: "C0" } : decision;
|
|
10920
|
+
const checked = bindProgress({ ...progress, decisions: [item] }, packet).decisions[0];
|
|
10921
|
+
const group = groups.get(checked.topic) ?? [];
|
|
10922
|
+
group.push(item);
|
|
10923
|
+
groups.set(checked.topic, group);
|
|
10924
|
+
}
|
|
10925
|
+
const decisions = [...groups.values()].flatMap((group) => {
|
|
10926
|
+
const current = group.filter((item) => item.source_id === "C0");
|
|
10927
|
+
return group.length > 1 && current.length === 1 && group.every((item) => packet.sources[item.source_id]?.authority === "customer") ? current : group;
|
|
10928
|
+
});
|
|
10929
|
+
return bindProgress({ ...progress, decisions }, packet);
|
|
10930
|
+
}
|
|
10931
|
+
function parseTurnPlan(text4, contact, latest, packet, recoverProgress = false) {
|
|
10837
10932
|
if (packet) {
|
|
10838
10933
|
const parsed = JSON.parse(text4.trim().replace(/^```(?:json)?\s*\n([\s\S]*?)\n```$/, "$1"));
|
|
10839
10934
|
const { material_need, ...wire } = parsed ?? {};
|
|
10840
10935
|
if (!wire || Object.keys(wire).sort().join(",") !== [...planFields].sort().join(",") || !salesActions.includes(wire.action)) throw Error("\u7B56\u7565\u5FC5\u987B\u9009\u62E9\u5141\u8BB8\u7684action\u5E76\u66F4\u65B0\u5E26\u6765\u6E90\u7684progress\u3002");
|
|
10841
10936
|
const { action, progress, ...base } = wire;
|
|
10842
|
-
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
10847
|
-
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
10851
|
-
|
|
10852
|
-
}
|
|
10853
|
-
let bound = bindProgress(projected, packet);
|
|
10937
|
+
const sources = Object.fromEntries(Object.entries(packet.sources).filter(([, s]) => s.authority === "customer" || s.authority === "deal").map(([id, s]) => [id, s.text]));
|
|
10938
|
+
const basePlan = parseBasePlan(JSON.stringify(base), sources);
|
|
10939
|
+
let bound, reused = false;
|
|
10940
|
+
try {
|
|
10941
|
+
bound = bindTurnProgress(progress, packet);
|
|
10942
|
+
} catch (error) {
|
|
10943
|
+
if (!recoverProgress || !contact.wechat || !packet.sources.C0?.text?.trim()) throw error;
|
|
10944
|
+
bound = packet.previous_progress ?? { stage: "exploring", source_id: "C0", quote: packet.sources.C0.text, decisions: [], artifacts: [] };
|
|
10945
|
+
reused = true;
|
|
10946
|
+
}
|
|
10854
10947
|
const stop = isExplicitStop(packet.latest_customer_message);
|
|
10855
10948
|
if (stop) bound = { ...bound, stage: "declined", source_id: "C0", quote: packet.latest_customer_message };
|
|
10856
|
-
let safeAction = stop ? "stop" : action === "stop" ? "answer" : action === "prepare_confirmation" && bound.stage !== "confirming" ? "provide_material" : action;
|
|
10949
|
+
let safeAction = stop ? "stop" : reused || action === "stop" ? "answer" : action === "prepare_confirmation" && bound.stage !== "confirming" ? "provide_material" : action;
|
|
10857
10950
|
if (safeAction === "prepare_confirmation" && bound.artifacts.some((a) => a.kind === "confirmation" && a.status !== "requested") || safeAction === "provide_material" && bound.artifacts.length > 0 && bound.artifacts.every((a) => a.status !== "requested")) safeAction = "answer";
|
|
10858
|
-
const sources = Object.fromEntries(Object.entries(packet.sources).filter(([, s]) => s.authority === "customer" || s.authority === "deal").map(([id, s]) => [id, s.text]));
|
|
10859
10951
|
const material = safeAction === "stop" ? void 0 : parseMaterialNeed(material_need, packet);
|
|
10860
|
-
return { ...
|
|
10952
|
+
return { ...basePlan, action: safeAction, progress: bound, ...material ? { material_need: material } : {} };
|
|
10861
10953
|
}
|
|
10862
10954
|
return parseBasePlan(text4, decisionSources(contact, latest));
|
|
10863
10955
|
}
|
|
@@ -10877,7 +10969,7 @@ function parseBasePlan(text4, sources) {
|
|
|
10877
10969
|
return { ...v, customer_decisions: decisions };
|
|
10878
10970
|
}
|
|
10879
10971
|
function buildTurnPlanPrompt(contact, latest, contextId, packet = buildTurnPacket(contact, latest)) {
|
|
10880
|
-
return "/wanji-sales-assistant\nhost_checks=true\u3002\u672C\u8F6E\u5148\u89C4\u5212\uFF0C\u4E0D\u5199\u5FAE\u4FE1\u3001\u4E0D\u8C03\u7528\u5DE5\u5177\u3002\u6240\u6709\u9636\u6BB5\u5171\u7528turn_packet\uFF1B\u53EA\u6839\u636E\u5F53\u524D\u8BC1\u636E\u66F4\u65B0\u8FDB\u5C55\uFF0C\u4E0D\u6279\u51C6\u516C\u53F8\u6761\u4EF6\u6216\u6267\u884C\u52A8\u4F5C\u3002\n" + intentGuidance(contact.intent) + wechatVoice + "\n" + operationProofRules + "\n\u672C\u8F6E\u53EA\u662F\u5410\u69FD\u3001\u5F00\u73A9\u7B11\u6216\u7B80\u5355\u786E\u8BA4\u4E14\u6CA1\u6709\u5B9E\u9645\u8BF7\u6C42\u65F6\uFF0Cneed_to_answer\u53EF\u4E3A\u7A7A\uFF0Caction\u9009answer\u6216\u6709\u7EA6\u5B9A\u65F6wait\uFF1B\u4FDD\u7559\u91C7\u8D2D\u9636\u6BB5\uFF0C\u4E0D\u5347\u7EA7\u6210\u552E\u540E\u6838\u67E5/\u91C7\u8D2D\u3002\u4E0D\u56E0\u4E3A\u67D0\u9879\u89C4\u5219\u5C1A\u672A\u77E5\u5C31\u51ED\u7A7A\u5B89\u6392\u53BB\u95EE\uFF0C\u4E0D\u628A\u5BD2\u6684\u53D8\u6210\u65B0\u4EFB\u52A1\u3002\n\u5148\u7EE7\u627Fprevious_progress\uFF0C\u518D\u4EE5\u65B0\u7684\u5BA2\u6237\u539F\u8BDD\u66F4\u6B63\u5BF9\u5E94\u4E3B\u9898\uFF1B\u5BA2\u6237\u3001\u516C\u53F8\u548C\u65E7\u9500\u552E\u8BDD\u4E0D\u53EF\u4E92\u76F8\u66FF\u4EE3\u3002\u5DF2\u6709\u62A5\u4EF7\u8303\u56F4\u4FDD\u7559\uFF0C\u660E\u786E\u53EA\u770B\u4E0D\u4E70\u4E0D\u6539\u6210\u91C7\u8D2D\u3002\u6750\u6599\u7684requested/received/reviewed\u53EA\u5F15\u7528\u5BA2\u6237\u8BC1\u636E\uFF1B\u201C\u8FD9\u4EFD\u6211\u8F6C\u7ED9\u5408\u4F19\u4EBA/\u5DF2\u7167\u7740\u505A/\u770B\u5B8C\u4E86\u201D\u4E5F\u80FD\u652F\u6301\u6536\u5230\u6216\u770B\u8FC7\uFF0C\u4E0D\u5FC5\u5BA2\u6237\u9010\u5B57\u8BF4\u201C\u6536\u5230\u201D\uFF1B\u5F15\u7528\u5B9E\u9645\u5BA2\u6237\u539F\u8BDD\uFF0C\u4E0D\u4EE5\u9500\u552E\u7684\u51C6\u5907\u8BA1\u5212\u63A8\u65AD\u3002\u5BA2\u6237\u8981\u6C42\u91CD\u505A\u6216\u66F4\u65B0\u4E00\u4EFD\u65F6\u624D\u91CD\u65B0requested\u3002\u9500\u552E\u8BF4\u51C6\u5907\u53D1\u4E0D\u80FD\u8BC1\u660E\u5BA2\u6237\u6536\u5230\u4E86\uFF0C\u6CA1\u56DE\u6267\u4E5F\u4E0D\u8BC1\u660E\u8FD8\u6CA1\u505A\u3002\u65E0\u6CD5\u5224\u65AD\u7684\u6750\u6599\u7559\u7A7A\uFF0C\u4E0D\u8865\u9020\u72B6\u6001\u3002\n\u53EA\u9009\u62E9\u4E00\u4E2Aaction\uFF1Aanswer\u76F4\u63A5\u89E3\u7B54\uFF1Bprovide_material\u63D0\u4F9B\u6240\u9700\u5185\u5BB9\uFF1Bprepare_confirmation\u51C6\u5907\u5DF2\u5B9A\u8303\u56F4\u7684\u786E\u8BA4\uFF1Bclarify\u53EA\u95EE\u5FC5\u8981\u7F3A\u53E3\uFF1Bverify_company\u6838\u67D0\u9879\u516C\u53F8\u6761\u4EF6\uFF1Bcoordinate_demo\u534F\u8C03\u5DF2\u5141\u8BB8\u7684\u6F14\u793A\uFF1Bwait\u7B49\u5F85\u5BA2\u6237\u660E\u786E\u7EA6\u5B9A\u7684\u53CD\u9988\uFF1Bstop\u4EC5\u7528\u4E8E\u660E\u786E\u505C\u8054\u4E14\u65E0\u65B0\u95EE\u9898\u3002\u52A8\u4F5C\u4E0D\u4EE3\u8868\u5DF2\u6267\u884C\u3002\u5BA2\u6237\u51C6\u5907\u786E\u8BA4\u65F6\u4E0D\u8981\u9000\u56DE\u6F14\u793A\uFF0C\u6750\u6599\u5DF2\u6536\u5230\u540E\u4E0D\u8981\u91CD\u505A\uFF0C\u672A\u77E5\u95EE\u9898\u4E0D\u6263\u4F4F\u5DF2\u77E5\u6750\u6599\u3002\nprevious_progress.pending\u662F\u5BBF\u4E3B\u8BB0\u5F55\u7684\u5916\u90E8\u5F85\u6838\u95EE\u9898\uFF0C\u4E0D\u662F\u6279\u51C6\u6216\u5DF2\u6267\u884C\u3002\u516C\u53F8\u4F9D\u636E\u672A\u53D8\u65F6\uFF0C\u4E0D\u628A\u5DF2\u7ECF\u8BF4\u8FC7\u53BB\u6838\u7684\u540C\u4E00\u4EF6\u4E8B\u518D\u5F53\u65B0\u7684\u63A8\u8FDB\uFF1B\u5BA2\u6237\u53EA\u8868\u793A\u7B49\u5F85\u65F6\u9009wait\uFF0C\u6709\u65B0\u95EE\u9898\u5148\u7B54\u65B0\u95EE\u9898\u3002response_contract\u89C4\u5B9A\u8FD9\u8F6E\u8981\u5B9E\u9645\u7ED9\u51FA\u7684\u5185\u5BB9\u3002pending\u7531\u5BBF\u4E3B\u7EF4\u62A4\uFF0C\u4E0D\u6284\u8FDB\u8F93\u51FAprogress\u3002\ngoal\u672C\u8F6E\u76EE\u6807\uFF1Bneed_to_answer\u7528\u7B80\u77ED\u6761\u76EE\u5217\u5F53\u524D\u95EE\u9898\uFF0C\u6BCF\u9879\u53EA\u5199\u4E00\u4E2A\u95EE\u9898\uFF0C\u4E0D\u66FF\u4F5C\u8005\u5199\u7B54\u6848\u548C\u80CC\u666F\uFF1Bnot_needed_now\u5199\u4E0D\u5E94\u91CD\u8BB2\u7684\u5185\u5BB9\uFF1Bnext_action\u662F\u5185\u90E8\u5B57\u6BB5\uFF0C\u76F4\u63A5\u7B54\u6E05\u5C31\u5199\u201C\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u201D\uFF0C\u65E0\u9700\u989D\u5916\u63A8\u8FDB\u3002customer_decisions\u9009\u6700\u591A3\u9879\u73B0\u6709C/F/P\u6765\u6E90\uFF0C\u4E0D\u9009\u65E7\u9500\u552ES\uFF1Bmeaning\u662F\u63A8\u65AD\uFF0C\u4E0D\u80FD\u5347\u7EA7\u4E3A\u6279\u51C6\u3002\nneed_to_answer\u5217\u5F85\u7B54\u95EE\u9898\uFF0C\u4E0D\u8981\u9884\u5148\u5199\u5165\u672A\u7ECF\u6765\u6E90\u652F\u6301\u7684\u7B54\u6848\u3002\u4F8B\u5982\u5BA2\u6237\u95EE\u4F1A\u4E0D\u4F1A\u81EA\u52A8\u6263\u6B3E\uFF0C\u53EA\u5217\u201C\u5F53\u524D\u6536\u8D39\u4E0E\u6388\u6743\u6263\u6B3E\u89C4\u5219\u80FD\u5426\u786E\u8BA4\uFF0C\u7F3A\u4EC0\u4E48\u4F9D\u636E\u201D\uFF0C\u4E0D\u80FD\u51ED\u5E38\u8BC6\u5148\u5199\u201C\u5FC5\u987B\u56DE\u7B54\u4E0D\u4F1A\u6263\u6B3E\u201D\uFF1B\u95EE\u8BB0\u5F55\u4FDD\u7559\u3001\u5E76\u53D1\u8986\u76D6\u3001\u8DE8\u6708\u5229\u6DA6\u65F6\u540C\u7406\u3002\u5DF2\u77E5\u7684\u6570\u5B57\u548C\u516C\u53F8\u6761\u4EF6\u53EF\u4FDD\u7559\u5176\u6765\u6E90\u8303\u56F4\uFF0C\u672A\u77E5\u5C31\u5217\u5F85\u6838\u9879\uFF0C\u4E0D\u8981\u6C42\u5199\u4F5C\u8005\u53D1\u660E\u627F\u8BFA\u3002\u5408\u7406\u4EBA\u5DE5\u53EA\u8BFB\u6838\u5BF9\u5EFA\u8BAE\u4E0E\u8F6F\u4EF6\u529F\u80FD\u5206\u5F00\u3002\n\u590D\u5408\u95EE\u9898\u9010\u9879\u5217\u51FA\uFF0C\u4F8B\u5982\u5165\u53E3\u3001\u64CD\u4F5C\u6B65\u9AA4\u3001\u600E\u6837\u786E\u8BA4\u7ED3\u679C\u3001\u6559\u5B66\u7D20\u6750\u3002\u8D44\u6599\u652F\u6301\u5176\u4E2D\u51E0\u9879\u5C31\u5B89\u6392\u5148\u56DE\u7B54\u8FD9\u51E0\u9879\uFF1B\u7F3A\u5177\u4F53\u7248\u672C\u65F6\u5C06\u9002\u7528\u6761\u4EF6\u653E\u5728\u8BE5\u6B65\u9AA4\u524D\uFF0C\u672A\u77E5\u5B57\u6BB5\u6216\u6743\u9650\u5355\u72EC\u5F85\u6838\u3002\nprogress\u662F\u5BA2\u6237\u4FA7\u8FDB\u5C55\u6295\u5F71\uFF0C\u4E0D\u662F\u516C\u53F8\u6388\u6743\u3002\u6240\u6709progress\u6765\u6E90\u53EA\u9009C/F/P\u4E2D\u7684\u5BA2\u6237\u8BC1\u636E\uFF0CQ/V/O\u516C\u53F8\u6761\u4EF6\u72EC\u7ACB\u4FDD\u7559\uFF0C\u4E0D\u80FD\u590D\u5236\u5230progress\uFF1Bscope/budget\u53EA\u8BB0\u5F55\u5BA2\u6237\u9009\u62E9\u3002stage\u53EA\u80FDexploring/evaluating/confirming/paused/declined\u5E76\u9644source_id\u3002decisions\u6BCF\u4E3B\u9898\u4FDD\u7559\u5F53\u524D\u7ED3\u8BBA\uFF0Ctopic\u53EA\u80FDproduct/purchase/scope/privacy/materials/timing/budget/role/followup\uFF1B\u6BCF\u9879\u542Btopic\u3001source_id\u3001meaning\u3002artifacts\u6BCF\u7C7B\u6700\u591A\u4E00\u9879\uFF0Ckind\u53EA\u80FDsample/intro/confirmation\uFF1Bstatus\u53EA\u80FDrequested/received/reviewed\uFF0Csource_id\u5FC5\u987B\u662F\u5BA2\u6237\u8BC1\u636E\u3002\u6CA1\u6709\u8BC1\u636E\u5C31\u7559\u7A7A\u3002\u5DF2\u6709\u7ED3\u8BBA\u82E5\u88AB\u65B0\u6D88\u606F\u7EA0\u6B63\uFF0C\u4F7F\u7528\u65B0\u6765\u6E90\u66FF\u6362\uFF1B\u4ECD\u6709\u6548\u7684\u4FDD\u7559\u3002\n" + (packet.knowledge.materials_available ? '\u72EC\u7ACB\u7D20\u6750\u5E93\u5DF2\u914D\u7F6E\u3002\u5F53\u524D\u64CD\u4F5C\u95EE\u9898\u53EF\u7528\u89C6\u9891/\u6587\u6863\u8F85\u52A9\uFF0C\u6216\u5DF2\u52A0\u8F7D\u7535\u8BDD\u4E2D\u7684\u5BA2\u6237\u660E\u786E\u63D0\u51FA\u76F8\u5173\u9700\u6C42\u4E14\u540E\u7EED\u672A\u64A4\u56DE\u65F6\uFF0C\u53EF\u53E6\u5916\u8FD4\u56DEmaterial_need={"query":"\u53EA\u542B\u4EA7\u54C1\u4E0E\u64CD\u4F5C\u4E3B\u9898\u7684\u81EA\u7136\u8BED\u8A00\u67E5\u8BE2","kind":"video\u6216document\u6216image\u6216any","edition":"\u95E8\u5E97\u7248\u6216\u4E13\u4E1A\u7248\u6216\u6807\u51C6\u7248\u6216unknown","source_id":"\u5B9E\u9645\u5BA2\u6237\u6765\u6E90\u7F16\u53F7"}\uFF1B\u5176\u4ED6\u65F6\u5019\u4E0D\u8FD4\u56DE\u6B64\u5B57\u6BB5\u3002\u7535\u8BDD\u91CC\u7684\u9500\u552E\u4ECB\u7ECD\u4E0D\u7B97\u5BA2\u6237\u9700\u6C42\u3002\u5148\u770B\u6700\u65B0\u5FAE\u4FE1\u7684\u62D2\u53D1\u3001\u6536\u5230/\u4E0D\u91CD\u53D1\u3001\u65B0\u95EE\u9898\u4E0E\u7248\u672C\u7EA0\u6B63\uFF1B\u4E0D\u8981\u7528\u65E7\u7535\u8BDD\u9700\u6C42\u8986\u76D6\u3002\u6CA1\u6709\u786E\u5B9A\u4EA7\u54C1\u7248\u672C\u65F6\u586Bunknown\uFF0C\u4F01\u4E1A\u7248\u4E0D\u81EA\u52A8\u7B49\u4E8E\u4E13\u4E1A\u7248\u3002\u4E0D\u8981\u628A\u5BA2\u6237\u624B\u673A\u53F7\u3001\u59D3\u540D\u3001\u8D26\u53F7\u6216\u5355\u636E\u53F7\u585E\u8FDB\u67E5\u8BE2\u3002\u4E0D\u56E0\u666E\u901A\u5BD2\u6684\u5C31\u627E\u7D20\u6750\uFF1B\u7D20\u6750\u4E0D\u4EE3\u8868\u91C7\u8D2D\u6216\u5F00\u901A\u3002\n' : "") + (packet.knowledge.materials_available ? "\u5BBF\u4E3B\u7684material_request_constraints\u53EA\u7EA6\u675F\u5BA2\u6237\u5DF2\u660E\u786E\u7684\u7D20\u6750\u5F62\u6001\u548C\u7248\u672C\u3002required=true\u65F6\uFF0C\u672C\u6B21\u5FC5\u987B\u8F93\u51FAmaterial_need\u4E14kind\u4E25\u683C\u53D6\u7EA6\u675Fkind\uFF0C\u4E0D\u53EF\u7701\u7565\u3001null\u6216\u6539\u6210any\uFF1Bquery\u7531\u4F60\u63D0\u70BC\u672C\u8F6E\u64CD\u4F5C\u4E3B\u9898\uFF0C\u4E0D\u8981\u9020\u9644\u4EF6\uFF0C\u4E0D\u628A\u6587\u6863\u6539\u6210\u89C6\u9891\u3002required=false\u4E0D\u6392\u9664\u7535\u8BDD\u5BA2\u6237\u5DF2\u6709\u9700\u6C42\uFF0C\u6309\u6765\u6E90\u5224\u65AD\u3002\n" : "") + 'material_need.kind\u8868\u793A\u6587\u4EF6\u5F62\u6001\uFF0Cprogress.artifacts.kind\u8868\u793A\u6750\u6599\u7528\u9014\uFF0C\u4E24\u8005\u4E0D\u53EF\u6DF7\u7528\u3002\u6587\u6863\u3001\u89C6\u9891\u3001\u56FE\u7247\u64CD\u4F5C\u8D44\u6599\u5728artifacts.kind\u7EDF\u4E00\u7528intro\uFF0C\u4E0D\u5199document/video/image\uFF1B\u8BF7\u6C42\u3001\u6536\u5230\u3001\u770B\u8FC7\u4ECD\u53EA\u80FD\u6309\u5BA2\u6237\u539F\u8BDD\u5206\u522B\u8BB0\u5F55\u3002\n\u53EA\u8FD4\u56DEJSON\uFF1A{"goal":"...","customer_decisions":[{"source_id":"C0","meaning":"..."}],"need_to_answer":["..."],"not_needed_now":["..."],"next_action":"...","action":"answer","progress":{"stage":"evaluating","source_id":"C0","decisions":[],"artifacts":[]}' + (packet.knowledge.materials_available ? ',"material_need":null' : "") + "}\u3002\u4E0D\u6284quote\uFF0C\u7A0B\u5E8F\u7ED1\u5B9A\u539F\u6587\u3002" + (packet.knowledge.materials_available ? "\u5B58\u5728\u7D20\u6750\u9700\u6C42\u65F6\u5C06material_need\u66FF\u6362\u4E3A\u542Bquery\u3001kind\u3001edition\u3001source_id\u7684\u5BF9\u8C61\uFF0C\u4E0D\u80FD\u53EA\u5199\u5728next_action\u4E2D\u3002" : "") + "\nDATA\n" + JSON.stringify({ turn_packet: packet, contextId, ...packet.knowledge.materials_available ? { material_request_constraints: materialRequestConstraints(packet) } : {} });
|
|
10972
|
+
return "/wanji-sales-assistant\nhost_checks=true\u3002\u672C\u8F6E\u5148\u89C4\u5212\uFF0C\u4E0D\u5199\u5FAE\u4FE1\u3001\u4E0D\u8C03\u7528\u5DE5\u5177\u3002\u8FDE\u7EED\u5BA2\u6237\u6D88\u606F\u770Bcurrent_customer_turn\uFF0C\u672B\u53E5\u662F\u611F\u60F3\u6216\u8865\u5145\u65F6\uFF0C\u4ECD\u56DE\u5E94\u8FD9\u8F6E\u524D\u9762\u63D0\u51FA\u7684\u5177\u4F53\u95EE\u9898\u3002\u6240\u6709\u9636\u6BB5\u5171\u7528turn_packet\uFF1B\u53EA\u6839\u636E\u5F53\u524D\u8BC1\u636E\u66F4\u65B0\u8FDB\u5C55\uFF0C\u4E0D\u6279\u51C6\u516C\u53F8\u6761\u4EF6\u6216\u6267\u884C\u52A8\u4F5C\u3002\n" + intentGuidance(contact.intent) + wechatVoice + "\n" + operationProofRules + "\n\u672C\u8F6E\u53EA\u662F\u5410\u69FD\u3001\u5F00\u73A9\u7B11\u6216\u7B80\u5355\u786E\u8BA4\u4E14\u6CA1\u6709\u5B9E\u9645\u8BF7\u6C42\u65F6\uFF0Cneed_to_answer\u53EF\u4E3A\u7A7A\uFF0Caction\u9009answer\u6216\u6709\u7EA6\u5B9A\u65F6wait\uFF1B\u4FDD\u7559\u91C7\u8D2D\u9636\u6BB5\uFF0C\u4E0D\u5347\u7EA7\u6210\u552E\u540E\u6838\u67E5/\u91C7\u8D2D\u3002\u4E0D\u56E0\u4E3A\u67D0\u9879\u89C4\u5219\u5C1A\u672A\u77E5\u5C31\u51ED\u7A7A\u5B89\u6392\u53BB\u95EE\uFF0C\u4E0D\u628A\u5BD2\u6684\u53D8\u6210\u65B0\u4EFB\u52A1\u3002\n\u5148\u7EE7\u627Fprevious_progress\uFF0C\u518D\u4EE5\u65B0\u7684\u5BA2\u6237\u539F\u8BDD\u66F4\u6B63\u5BF9\u5E94\u4E3B\u9898\uFF1B\u5BA2\u6237\u3001\u516C\u53F8\u548C\u65E7\u9500\u552E\u8BDD\u4E0D\u53EF\u4E92\u76F8\u66FF\u4EE3\u3002\u5DF2\u6709\u62A5\u4EF7\u8303\u56F4\u4FDD\u7559\uFF0C\u660E\u786E\u53EA\u770B\u4E0D\u4E70\u4E0D\u6539\u6210\u91C7\u8D2D\u3002\u6750\u6599\u7684requested/received/reviewed\u53EA\u5F15\u7528\u5BA2\u6237\u8BC1\u636E\uFF1B\u201C\u8FD9\u4EFD\u6211\u8F6C\u7ED9\u5408\u4F19\u4EBA/\u5DF2\u7167\u7740\u505A/\u770B\u5B8C\u4E86\u201D\u4E5F\u80FD\u652F\u6301\u6536\u5230\u6216\u770B\u8FC7\uFF0C\u4E0D\u5FC5\u5BA2\u6237\u9010\u5B57\u8BF4\u201C\u6536\u5230\u201D\uFF1B\u5F15\u7528\u5B9E\u9645\u5BA2\u6237\u539F\u8BDD\uFF0C\u4E0D\u4EE5\u9500\u552E\u7684\u51C6\u5907\u8BA1\u5212\u63A8\u65AD\u3002\u5BA2\u6237\u8981\u6C42\u91CD\u505A\u6216\u66F4\u65B0\u4E00\u4EFD\u65F6\u624D\u91CD\u65B0requested\u3002\u9500\u552E\u8BF4\u51C6\u5907\u53D1\u4E0D\u80FD\u8BC1\u660E\u5BA2\u6237\u6536\u5230\u4E86\uFF0C\u6CA1\u56DE\u6267\u4E5F\u4E0D\u8BC1\u660E\u8FD8\u6CA1\u505A\u3002\u65E0\u6CD5\u5224\u65AD\u7684\u6750\u6599\u7559\u7A7A\uFF0C\u4E0D\u8865\u9020\u72B6\u6001\u3002\n\u53EA\u9009\u62E9\u4E00\u4E2Aaction\uFF1Aanswer\u76F4\u63A5\u89E3\u7B54\uFF1Bprovide_material\u63D0\u4F9B\u6240\u9700\u5185\u5BB9\uFF1Bprepare_confirmation\u51C6\u5907\u5DF2\u5B9A\u8303\u56F4\u7684\u786E\u8BA4\uFF1Bclarify\u53EA\u95EE\u5FC5\u8981\u7F3A\u53E3\uFF1Bverify_company\u6838\u67D0\u9879\u516C\u53F8\u6761\u4EF6\uFF1Bcoordinate_demo\u534F\u8C03\u5DF2\u5141\u8BB8\u7684\u6F14\u793A\uFF1Bwait\u7B49\u5F85\u5BA2\u6237\u660E\u786E\u7EA6\u5B9A\u7684\u53CD\u9988\uFF1Bstop\u4EC5\u7528\u4E8E\u660E\u786E\u505C\u8054\u4E14\u65E0\u65B0\u95EE\u9898\u3002\u52A8\u4F5C\u4E0D\u4EE3\u8868\u5DF2\u6267\u884C\u3002\u5BA2\u6237\u51C6\u5907\u786E\u8BA4\u65F6\u4E0D\u8981\u9000\u56DE\u6F14\u793A\uFF0C\u6750\u6599\u5DF2\u6536\u5230\u540E\u4E0D\u8981\u91CD\u505A\uFF0C\u672A\u77E5\u95EE\u9898\u4E0D\u6263\u4F4F\u5DF2\u77E5\u6750\u6599\u3002\nprevious_progress.pending\u662F\u5BBF\u4E3B\u8BB0\u5F55\u7684\u5916\u90E8\u5F85\u6838\u95EE\u9898\uFF0C\u4E0D\u662F\u6279\u51C6\u6216\u5DF2\u6267\u884C\u3002\u516C\u53F8\u4F9D\u636E\u672A\u53D8\u65F6\uFF0C\u4E0D\u628A\u5DF2\u7ECF\u8BF4\u8FC7\u53BB\u6838\u7684\u540C\u4E00\u4EF6\u4E8B\u518D\u5F53\u65B0\u7684\u63A8\u8FDB\uFF1B\u5BA2\u6237\u53EA\u8868\u793A\u7B49\u5F85\u65F6\u9009wait\uFF0C\u6709\u65B0\u95EE\u9898\u5148\u7B54\u65B0\u95EE\u9898\u3002response_contract\u89C4\u5B9A\u8FD9\u8F6E\u8981\u5B9E\u9645\u7ED9\u51FA\u7684\u5185\u5BB9\u3002pending\u7531\u5BBF\u4E3B\u7EF4\u62A4\uFF0C\u4E0D\u6284\u8FDB\u8F93\u51FAprogress\u3002\ngoal\u672C\u8F6E\u76EE\u6807\uFF1Bneed_to_answer\u7528\u7B80\u77ED\u6761\u76EE\u5217\u5F53\u524D\u95EE\u9898\uFF0C\u6BCF\u9879\u53EA\u5199\u4E00\u4E2A\u95EE\u9898\uFF0C\u4E0D\u66FF\u4F5C\u8005\u5199\u7B54\u6848\u548C\u80CC\u666F\uFF1Bnot_needed_now\u5199\u4E0D\u5E94\u91CD\u8BB2\u7684\u5185\u5BB9\uFF1Bnext_action\u662F\u5185\u90E8\u5B57\u6BB5\uFF0C\u76F4\u63A5\u7B54\u6E05\u5C31\u5199\u201C\u56DE\u7B54\u5F53\u524D\u95EE\u9898\u201D\uFF0C\u65E0\u9700\u989D\u5916\u63A8\u8FDB\u3002customer_decisions\u9009\u6700\u591A3\u9879\u73B0\u6709C/F/P\u6765\u6E90\uFF0C\u4E0D\u9009\u65E7\u9500\u552ES\uFF1Bmeaning\u662F\u63A8\u65AD\uFF0C\u4E0D\u80FD\u5347\u7EA7\u4E3A\u6279\u51C6\u3002\nneed_to_answer\u5217\u5F85\u7B54\u95EE\u9898\uFF0C\u4E0D\u8981\u9884\u5148\u5199\u5165\u672A\u7ECF\u6765\u6E90\u652F\u6301\u7684\u7B54\u6848\u3002\u4F8B\u5982\u5BA2\u6237\u95EE\u4F1A\u4E0D\u4F1A\u81EA\u52A8\u6263\u6B3E\uFF0C\u53EA\u5217\u201C\u5F53\u524D\u6536\u8D39\u4E0E\u6388\u6743\u6263\u6B3E\u89C4\u5219\u80FD\u5426\u786E\u8BA4\uFF0C\u7F3A\u4EC0\u4E48\u4F9D\u636E\u201D\uFF0C\u4E0D\u80FD\u51ED\u5E38\u8BC6\u5148\u5199\u201C\u5FC5\u987B\u56DE\u7B54\u4E0D\u4F1A\u6263\u6B3E\u201D\uFF1B\u95EE\u8BB0\u5F55\u4FDD\u7559\u3001\u5E76\u53D1\u8986\u76D6\u3001\u8DE8\u6708\u5229\u6DA6\u65F6\u540C\u7406\u3002\u5DF2\u77E5\u7684\u6570\u5B57\u548C\u516C\u53F8\u6761\u4EF6\u53EF\u4FDD\u7559\u5176\u6765\u6E90\u8303\u56F4\uFF0C\u672A\u77E5\u5C31\u5217\u5F85\u6838\u9879\uFF0C\u4E0D\u8981\u6C42\u5199\u4F5C\u8005\u53D1\u660E\u627F\u8BFA\u3002\u5408\u7406\u4EBA\u5DE5\u53EA\u8BFB\u6838\u5BF9\u5EFA\u8BAE\u4E0E\u8F6F\u4EF6\u529F\u80FD\u5206\u5F00\u3002\n\u590D\u5408\u95EE\u9898\u9010\u9879\u5217\u51FA\uFF0C\u4F8B\u5982\u5165\u53E3\u3001\u64CD\u4F5C\u6B65\u9AA4\u3001\u600E\u6837\u786E\u8BA4\u7ED3\u679C\u3001\u6559\u5B66\u7D20\u6750\u3002\u8D44\u6599\u652F\u6301\u5176\u4E2D\u51E0\u9879\u5C31\u5B89\u6392\u5148\u56DE\u7B54\u8FD9\u51E0\u9879\uFF1B\u7F3A\u5177\u4F53\u7248\u672C\u65F6\u5C06\u9002\u7528\u6761\u4EF6\u653E\u5728\u8BE5\u6B65\u9AA4\u524D\uFF0C\u672A\u77E5\u5B57\u6BB5\u6216\u6743\u9650\u5355\u72EC\u5F85\u6838\u3002\nprogress\u662F\u5BA2\u6237\u4FA7\u8FDB\u5C55\u6295\u5F71\uFF0C\u4E0D\u662F\u516C\u53F8\u6388\u6743\u3002\u6240\u6709progress\u6765\u6E90\u53EA\u9009C/F/P\u4E2D\u7684\u5BA2\u6237\u8BC1\u636E\uFF0CQ/V/O\u516C\u53F8\u6761\u4EF6\u72EC\u7ACB\u4FDD\u7559\uFF0C\u4E0D\u80FD\u590D\u5236\u5230progress\uFF1Bscope/budget\u53EA\u8BB0\u5F55\u5BA2\u6237\u9009\u62E9\u3002stage\u53EA\u80FDexploring/evaluating/confirming/paused/declined\u5E76\u9644source_id\u3002decisions\u6BCF\u4E3B\u9898\u4FDD\u7559\u5F53\u524D\u7ED3\u8BBA\uFF0Ctopic\u53EA\u80FDproduct/purchase/scope/privacy/materials/timing/budget/role/followup\uFF1B\u6BCF\u9879\u542Btopic\u3001source_id\u3001meaning\u3002artifacts\u6BCF\u7C7B\u6700\u591A\u4E00\u9879\uFF0Ckind\u53EA\u80FDsample/intro/confirmation\uFF1Bstatus\u53EA\u80FDrequested/received/reviewed\uFF0Csource_id\u5FC5\u987B\u662F\u5BA2\u6237\u8BC1\u636E\u3002\u6CA1\u6709\u8BC1\u636E\u5C31\u7559\u7A7A\u3002\u5DF2\u6709\u7ED3\u8BBA\u82E5\u88AB\u65B0\u6D88\u606F\u7EA0\u6B63\uFF0C\u4F7F\u7528\u65B0\u6765\u6E90\u66FF\u6362\uFF1B\u4ECD\u6709\u6548\u7684\u4FDD\u7559\u3002\n" + (packet.knowledge.materials_available ? '\u72EC\u7ACB\u7D20\u6750\u5E93\u5DF2\u914D\u7F6E\u3002\u5F53\u524D\u64CD\u4F5C\u95EE\u9898\u53EF\u7528\u89C6\u9891/\u6587\u6863\u8F85\u52A9\uFF0C\u6216\u5DF2\u52A0\u8F7D\u7535\u8BDD\u4E2D\u7684\u5BA2\u6237\u660E\u786E\u63D0\u51FA\u76F8\u5173\u9700\u6C42\u4E14\u540E\u7EED\u672A\u64A4\u56DE\u65F6\uFF0C\u53EF\u53E6\u5916\u8FD4\u56DEmaterial_need={"query":"\u53EA\u542B\u4EA7\u54C1\u4E0E\u64CD\u4F5C\u4E3B\u9898\u7684\u81EA\u7136\u8BED\u8A00\u67E5\u8BE2","kind":"video\u6216document\u6216image\u6216any","edition":"\u95E8\u5E97\u7248\u6216\u4E13\u4E1A\u7248\u6216\u6807\u51C6\u7248\u6216unknown","source_id":"\u5B9E\u9645\u5BA2\u6237\u6765\u6E90\u7F16\u53F7"}\uFF1B\u5176\u4ED6\u65F6\u5019\u4E0D\u8FD4\u56DE\u6B64\u5B57\u6BB5\u3002\u7535\u8BDD\u91CC\u7684\u9500\u552E\u4ECB\u7ECD\u4E0D\u7B97\u5BA2\u6237\u9700\u6C42\u3002\u5148\u770B\u6700\u65B0\u5FAE\u4FE1\u7684\u62D2\u53D1\u3001\u6536\u5230/\u4E0D\u91CD\u53D1\u3001\u65B0\u95EE\u9898\u4E0E\u7248\u672C\u7EA0\u6B63\uFF1B\u4E0D\u8981\u7528\u65E7\u7535\u8BDD\u9700\u6C42\u8986\u76D6\u3002\u6CA1\u6709\u786E\u5B9A\u4EA7\u54C1\u7248\u672C\u65F6\u586Bunknown\uFF0C\u4F01\u4E1A\u7248\u4E0D\u81EA\u52A8\u7B49\u4E8E\u4E13\u4E1A\u7248\u3002\u4E0D\u8981\u628A\u5BA2\u6237\u624B\u673A\u53F7\u3001\u59D3\u540D\u3001\u8D26\u53F7\u6216\u5355\u636E\u53F7\u585E\u8FDB\u67E5\u8BE2\u3002\u4E0D\u56E0\u666E\u901A\u5BD2\u6684\u5C31\u627E\u7D20\u6750\uFF1B\u7D20\u6750\u4E0D\u4EE3\u8868\u91C7\u8D2D\u6216\u5F00\u901A\u3002\n' : "") + (packet.knowledge.materials_available ? "\u5BBF\u4E3B\u7684material_request_constraints\u53EA\u7EA6\u675F\u5BA2\u6237\u5DF2\u660E\u786E\u7684\u7D20\u6750\u5F62\u6001\u548C\u7248\u672C\u3002required=true\u65F6\uFF0C\u672C\u6B21\u5FC5\u987B\u8F93\u51FAmaterial_need\u4E14kind\u4E25\u683C\u53D6\u7EA6\u675Fkind\uFF0C\u4E0D\u53EF\u7701\u7565\u3001null\u6216\u6539\u6210any\uFF1Bquery\u7531\u4F60\u63D0\u70BC\u672C\u8F6E\u64CD\u4F5C\u4E3B\u9898\uFF0C\u4E0D\u8981\u9020\u9644\u4EF6\uFF0C\u4E0D\u628A\u6587\u6863\u6539\u6210\u89C6\u9891\u3002required=false\u4E0D\u6392\u9664\u7535\u8BDD\u5BA2\u6237\u5DF2\u6709\u9700\u6C42\uFF0C\u6309\u6765\u6E90\u5224\u65AD\u3002\n" : "") + 'material_need.kind\u8868\u793A\u6587\u4EF6\u5F62\u6001\uFF0Cprogress.artifacts.kind\u8868\u793A\u6750\u6599\u7528\u9014\uFF0C\u4E24\u8005\u4E0D\u53EF\u6DF7\u7528\u3002\u6587\u6863\u3001\u89C6\u9891\u3001\u56FE\u7247\u64CD\u4F5C\u8D44\u6599\u5728artifacts.kind\u7EDF\u4E00\u7528intro\uFF0C\u4E0D\u5199document/video/image\uFF1B\u8BF7\u6C42\u3001\u6536\u5230\u3001\u770B\u8FC7\u4ECD\u53EA\u80FD\u6309\u5BA2\u6237\u539F\u8BDD\u5206\u522B\u8BB0\u5F55\u3002\n\u53EA\u8FD4\u56DEJSON\uFF1A{"goal":"...","customer_decisions":[{"source_id":"C0","meaning":"..."}],"need_to_answer":["..."],"not_needed_now":["..."],"next_action":"...","action":"answer","progress":{"stage":"evaluating","source_id":"C0","decisions":[],"artifacts":[]}' + (packet.knowledge.materials_available ? ',"material_need":null' : "") + "}\u3002\u4E0D\u6284quote\uFF0C\u7A0B\u5E8F\u7ED1\u5B9A\u539F\u6587\u3002" + (packet.knowledge.materials_available ? "\u5B58\u5728\u7D20\u6750\u9700\u6C42\u65F6\u5C06material_need\u66FF\u6362\u4E3A\u542Bquery\u3001kind\u3001edition\u3001source_id\u7684\u5BF9\u8C61\uFF0C\u4E0D\u80FD\u53EA\u5199\u5728next_action\u4E2D\u3002" : "") + "\nDATA\n" + JSON.stringify({ turn_packet: packet, contextId, ...packet.knowledge.materials_available ? { material_request_constraints: materialRequestConstraints(packet) } : {} });
|
|
10881
10973
|
}
|
|
10882
10974
|
|
|
10883
10975
|
// src/data-scope.ts
|
|
@@ -11669,7 +11761,7 @@ function parseReply(text4, allowedMoney, customerMoney = []) {
|
|
|
11669
11761
|
return { judgment: value.judgment, wechat: value.wechat, next_step: value.next_step, no_send: value.no_send };
|
|
11670
11762
|
}
|
|
11671
11763
|
function buildPrompt(contact, latest, knowledge, packet = buildTurnPacket(contact, latest, knowledge)) {
|
|
11672
|
-
return "/wanji-sales-assistant\nhost_checks=true\u3002\u4E3A\u4E07\u673A\u9500\u552E\u8D77\u8349\u7ED9\u5546\u5BB6\u7684\u5FAE\u4FE1\uFF0C\u4E0D\u6267\u884C\u4EFB\u4F55\u5BF9\u5916\u52A8\u4F5C\u3002\u4F7F\u7528\u5F53\u524D\u6280\u80FD\u7684\u65B9\u6CD5\uFF0C\u6700\u7EC8\u53EA\u8FD4\u56DEJSON\u56DB\u5B57\u6BB5judgment\u3001wechat\u3001next_step\u3001no_send\u3002\n" + intentGuidance(contact.intent) + wechatVoice + "\n\u672C\u8F6E\u5199\u6CD5\uFF1A\u50CF\u5FAE\u4FE1\u91CC\u63A5\u7740\u4E00\u4E2A\u5177\u4F53\u5546\u5BB6\u7684\u8BDD\u5F80\u4E0B\u804A\u3002\u5E38\u7528\u8BCD\u3001\u81EA\u7136\u505C\u987F\u90FD\u53EF\u4EE5\uFF0C\u76F4\u63A5\u63A5\u8FD9\u6B21\u6700\u5728\u610F\u7684\u4E8B\uFF1B\u89E3\u91CA\u5230\u5BF9\u65B9\u80FD\u660E\u767D\u5C31\u6536\u4F4F\u3002\u4E0D\u8981\u4E3A\u663E\u5F97\u70ED\u60C5\u518D\u52A0\u4E00\u8F6E\u603B\u7ED3\u3001\u8C28\u614E\u58F0\u660E\u6216\u63D0\u95EE\u3002\u7D20\u6750\u5360\u4F4D\u524D\u4E0D\u518D\u6284\u7D20\u6750\u5168\u540D\uFF0C\u6807\u9898\u548C\u94FE\u63A5\u7531\u7A0B\u5E8F\u7ED9\u51FA\u3002\n" + voiceExamplePrompt(latest) + "\n\u6240\u6709\u9636\u6BB5\u5171\u7528turn_packet\u3002sources\u6709\u6765\u6E90\u89D2\u8272\uFF1A\u5BA2\u6237\u539F\u8BDD\u53EA\u8BC1\u660E\u5BA2\u6237\u60C5\u51B5\u4E0E\u9009\u62E9\uFF0Chistorical_sales\u53EA\u7528\u4E8E\u907F\u514D\u91CD\u8BB2\uFF0C\u4E0D\u6279\u51C6\u516C\u53F8\u6761\u6B3E\u3002deal\u4E0Ecompany\u8BC1\u636E\u53EA\u6309\u539F\u6587\u8303\u56F4\u4F7F\u7528\uFF1Bmethods\u662F\u57F9\u8BAD\u65B9\u6CD5\uFF0Cpolicy_candidates\u5C1A\u975E\u672C\u5355\u6388\u6743\u3002\u4E0D\u80FD\u628A\u672A\u77E5\u8BF4\u6210\u514D\u8D39\u3001\u4E0D\u652F\u6301\u3001\u5DF2\u5B8C\u6210\u6216\u4FDD\u8BC1\u7ED3\u679C\u3002\nsources\u4E2DR\u7F16\u53F7\u7684product_reference\u662F\u7ECF\u6765\u6E90\u6838\u5BF9\u7684\u4EA7\u54C1\u4ECB\u7ECD\u8D44\u6599\uFF1A\u53EF\u4EE5\u4ECB\u7ECD\u539F\u6587\u660E\u5217\u7684\u4EA7\u54C1\u65B9\u5411\uFF0C\u5E76\u4E0E\u5BA2\u6237\u5F53\u524D\u505A\u6CD5\u4F5C\u4E1A\u52A1\u5C42\u9762\u7684\u5BF9\u7167\u3002\u5FC5\u987B\u4FDD\u7559\u5176\u8FB9\u754C\uFF1B\u6CA1\u6709\u5177\u4F53\u5B57\u6BB5/\u7248\u672C\u4F9D\u636E\u65F6\u4E0D\u8865\u9020\u3002\u4E0D\u8981\u5148\u627F\u8BFA\u80FD\u529B\u518D\u52A0\u514D\u8D23\u58F0\u660E\uFF0C\u4E5F\u4E0D\u8981\u6574\u6BB5\u9000\u56DE\u6838\u5B9E\uFF1A\u628A\u8D44\u6599\u5DF2\u77E5\u7684\u65B9\u5411\u8BF4\u6E05\uFF0C\u518D\u53EA\u6709\u7F3A\u9879\u4F1A\u6539\u53D8\u7B54\u6848\u65F6\uFF0C\u624D\u95EE\u8FD9\u4E2A\u5177\u4F53\u7F3A\u9879\u3002\nsources\u4E2DU\u7F16\u53F7\u662F\u7ECF\u6838\u5BF9\u7684\u8D44\u6599\u8303\u56F4\u5185\u7684\u64CD\u4F5C\u4F9D\u636E\u3002\u6709\u5BF9\u5E94\u8D44\u6599\u5C31\u5148\u56DE\u7B54\u5BA2\u6237\u95EE\u5230\u7684\u5165\u53E3\u3001\u6B65\u9AA4\u6216\u9A8C\u8BC1\u70B9\u3002\u672A\u786E\u5B9A\u5BA2\u6237\u7248\u672C\u65F6\u5199\u201C\u5982\u679C\u60A8\u7528\u7684\u662F\u2026\uFF0C\u6309\u8BE5\u7248\u672C\u8D44\u6599\u53EF\u4EE5\u5148\u2026\u201D\uFF0C\u4E0D\u80FD\u56E0\u6B64\u628A\u6574\u9898\u7559\u5F85\u786E\u8BA4\uFF1B\u6BD4\u8F83\u7248\u672C\u8981\u5206\u5F00\u5199\u3002\u5BF9\u4E8E\u8D44\u6599\u672A\u8BC1\u660E\u7684\u5B57\u6BB5\u3001\u8BBE\u5907\u517C\u5BB9\u3001\u662F\u5426\u5F00\u901A\u3001\u771F\u5B9E\u6267\u884C\u7ED3\u679C\u548C\u73B0\u884C\u4EF7\u683C\uFF0C\u53EA\u628A\u90A3\u4E00\u9879\u5217\u4E3A\u5F85\u6838\u3002\u660E\u786E\u7248\u672C\u7684\u8D44\u6599\u4E0D\u5957\u5230\u5176\u4ED6\u7248\u672C\u3002\nmaterial_context\u6765\u81EA\u72EC\u7ACB\u5BA2\u6237\u7D20\u6750\u5E93\u3002M\u7F16\u53F7\u662F\u5DF2\u6838\u5BF9\u7684\u7D20\u6750\uFF0C\u4E0D\u662F\u516C\u53F8\u6388\u6743\uFF1B\u53EA\u9009\u4E0E\u672C\u8F6E\u4E3B\u9898\u53CA\u7248\u672C\u786E\u5B9E\u5BF9\u5E94\u7684\u6700\u591A\u4E24\u4EFD\uFF0C\u7528{{MATERIAL_1}}\u7B49\u5360\u4F4D\uFF0C\u7A0B\u5E8F\u63D0\u4F9B\u771F\u5B9E\u6807\u9898\u548C\u94FE\u63A5\u3002\u6587\u6863\u6CE8\u660E\u9875\u7801\uFF0C\u89C6\u9891\u8BF4\u660E\u4E0B\u8F7D\u67E5\u770B\u5373\u53EF\uFF1B\u4E0D\u80FD\u8BF4\u9644\u4EF6\u5DF2\u7ECF\u53D1\u5230\u5FAE\u4FE1\u3002\u6587\u672C\u8D44\u6599\u91CC\u7684\u89C6\u9891/\u6587\u6863\u5730\u5740\u53EA\u662F\u68C0\u7D22\u7EBF\u7D22\uFF0C\u4E0D\u4EE3\u66FF\u72EC\u7ACB\u7D20\u6750\u53EC\u56DE\u3002\u65E0\u5339\u914D\u3001\u7248\u672C\u4E0D\u660E\u6216\u94FE\u63A5\u4E0D\u53EF\u7528\u65F6\u8BF4\u660E\u5177\u4F53\u7F3A\u9879\uFF0C\u5148\u56DE\u7B54\u53EF\u77E5\u5185\u5BB9\uFF0C\u4E0D\u9020\u94FE\u63A5\uFF0C\u4E0D\u628A\u201C\u6211\u53D1\u4F60\u201D\u5F53\u5DF2\u7ED9\u51FA\u6750\u6599\uFF1B\u4E0D\u91CD\u590D\u53D1\u5BA2\u6237\u5DF2\u7ECF\u6536\u5230\u4E14\u6CA1\u8981\u6C42\u91CD\u53D1\u7684\u5185\u5BB9\u3002\n" + operationProofRules + "\n\u5148\u4FDD\u8BC1\u4E8B\u5B9E\u4E0E\u653F\u7B56\u51C6\u786E\uFF0C\u8D34\u7740\u5BA2\u6237\u60C5\u5883\u76F4\u63A5\u56DE\u7B54\u5F53\u524D\u95EE\u9898\uFF0C\u518D\u6309\u786E\u6709\u7684\u54A8\u8BE2\u3001\u987E\u8651\u6216\u8D2D\u4E70\u9700\u6C42\u9009\u62E9\u5408\u9002\u7684\u8BF4\u6CD5\u3002\u5BA2\u6237\u6307\u5B9A\u65E5\u671F/\u4ED8\u6B3E\u6E20\u9053\u53EA\u662F\u5BA2\u6237\u8981\u6C42\uFF1B\u516C\u53F8\u672A\u786E\u8BA4\u65F6\uFF0C\u8BF4\u6E05\u5F85\u6838\u5E76\u4FDD\u7559\u8BC9\u6C42\u5373\u53EF\uFF0C\u4E0D\u80FD\u4E3A\u4E86\u7ED9\u5B8C\u6574\u786E\u8BA4\u5355\u8865\u9020\u6761\u6B3E\u3002\u5DF2\u6536\u5230\u7684\u6750\u6599\u53EA\u8865\u672C\u8F6E\u53D8\u5316\uFF0C\u5BA2\u6237\u8981\u6C42\u6838\u6E05\u540E\u518D\u53D1\u5219\u7B49\u4F9D\u636E\uFF0C\u4E0D\u6BCF\u8F6E\u91CD\u5217\u6574\u4EFD\u3002\n\u63A5\u6700\u65B0\u8FD9\u53E5\u8BDD\uFF0C\u7EE7\u627F\u4ECD\u6709\u6548\u7684\u5BA2\u6237\u51B3\u5B9A\u548C\u6750\u6599\u72B6\u6001\uFF1B\u5BA2\u6237\u5DF2\u7ECF\u6536\u5230\u6216\u8F6C\u4EA4\u7684\u6750\u6599\u4E0D\u91CD\u65B0\u51C6\u5907\uFF0C\u9664\u975E\u660E\u786E\u8981\u6539\u3002\u672C\u8F6E\u786E\u6709\u4E1A\u52A1\u95EE\u9898\u5C31\u76F4\u63A5\u7B54\u5E76\u8BF4\u6E05\u5FC5\u8981\u6761\u4EF6\uFF1B\u5410\u69FD\u3001\u73A9\u7B11\u3001\u7B80\u5355\u786E\u8BA4\u53EF\u81EA\u7136\u6536\u4F4F\uFF0C\u4E0D\u5957\u9500\u552E\u4E09\u6BB5\u5F0F\u3002\u5DF2\u786E\u8BA4\u7684\u62A5\u4EF7\u548C\u8303\u56F4\u4E0D\u9000\u56DE\u672A\u77E5\uFF0C\u672A\u77E5\u9879\u53EA\u5F71\u54CD\u5BF9\u5E94\u90E8\u5206\u3002\u4E0D\u8981\u4E3A\u4E86\u63A8\u8FDB\u589E\u52A0\u514D\u8D39\u3001\u65F6\u95F4\u3001\u6548\u679C\u3001\u6743\u9650\u6216\u6267\u884C\u627F\u8BFA\u3002\n\u8FD9\u662F\u7ED9\u9500\u552E\u4EBA\u5DE5\u5BA1\u6838\u7684\u8349\u7A3F\u3002\u5148\u6309response_contract\u56DE\u7B54\u80FD\u786E\u8BA4\u7684\u90E8\u5206\uFF1B\u4E0D\u6E05\u695A\u7684\u5177\u4F53\u7EC6\u8282\u76F4\u63A5\u8BF4\u6682\u4E0D\u80FD\u786E\u8BA4\u3002\u53EF\u7ED9\u660E\u786E\u6807\u4E3A\u5EFA\u8BAE\u7684\u9009\u578B\u601D\u8DEF\u3001\u5BF9\u7167\u7EF4\u5EA6\u6216\u53EA\u8BFB\u6838\u9A8C\u65B9\u6CD5\uFF0C\u4E0D\u9700\u8981\u8F6F\u4EF6\u5165\u53E3\u6216\u4EA7\u54C1\u80FD\u529B\u624D\u80FD\u6210\u7ACB\u3002\u6CA1\u6709\u53EF\u9760\u5EFA\u8BAE\uFF0C\u7B80\u77ED\u8BF4\u660E\u8FD8\u7F3A\u4EC0\u4E48\u4FE1\u606F\u4E5F\u53EF\u4EA4\u7A3F\u3002\u4E0D\u80FD\u628A\u6709\u5F85\u786E\u8BA4\u7684\u80FD\u529B\u6539\u6210\u201C\u5982\u679C\u53EF\u4EE5\u201D\u518D\u7ED9\u5177\u4F53\u865A\u6784\u6B65\u9AA4\u3002\n\u5BA2\u6237\u63D0\u51FA\u987E\u8651\u65F6\uFF0C\u56DE\u7B54\u8981\u843D\u5230\u8FD9\u4E2A\u987E\u8651\u7684\u5224\u65AD\u4F9D\u636E\uFF1A\u4F8B\u5982\u62C5\u5FC3\u91CD\u590D\u8BB0\u5F55\u5C31\u8BF4\u660E\u5F53\u524D\u8D44\u6599\u80FD\u786E\u8BA4\u7684\u8BB0\u5F55\u4E0E\u6838\u5BF9\u5173\u7CFB\uFF0C\u62C5\u5FC3\u8868\u683C\u5207\u6362\u5C31\u6309\u5176\u5DF2\u77E5\u4E1A\u52A1\u6BD4\u8F83\uFF0C\u62C5\u5FC3\u5458\u5DE5\u80FD\u770B\u5230\u4EC0\u4E48\u5C31\u533A\u5206\u6240\u9700\u804C\u8D23\u4E0E\u5C1A\u672A\u6838\u5B9E\u7684\u6743\u9650\u3002\u4E0D\u80FD\u62FF\u4E00\u4EFD\u901A\u7528\u529F\u80FD\u4ECB\u7ECD\u4EE3\u66FF\u5F53\u524D\u95EE\u9898\uFF1B\u4E0D\u628A\u5BA2\u6237\u4E3B\u89C2\u8BC4\u4EF7\u6539\u5199\u4E3A\u5176\u4E60\u60EF\u3001\u5DF2\u53D1\u751F\u635F\u5931\u6216\u5176\u4ED6\u4EBA\u7684\u8BA4\u53EF\u3002\n\u6B63\u6587\u7B2C\u4E00\u53E5\u5C31\u63A5\u5177\u4F53\u95EE\u9898\u3002\u6709\u4E24\u4E09\u4E2A\u64CD\u4F5C\u70B9\u65F6\uFF0C\u6309\u5B9E\u9645\u987A\u5E8F\u9010\u70B9\u7ED9\u5165\u53E3\u3001\u52A8\u4F5C\u548C\u600E\u4E48\u6838\u5BF9\uFF0C\u4E0D\u5148\u590D\u8FF0\u9700\u6C42\u3002\u80FD\u7528\u4E00\u53E5\u8BF4\u6E05\u5C31\u4E00\u53E5\uFF0C\u591A\u4E2A\u72EC\u7ACB\u95EE\u9898\u53EF\u5206\u884C\u3002\u53EA\u6709\u7F3A\u7684\u90A3\u9879\u8BF4\u6682\u4E0D\u80FD\u786E\u8BA4\uFF1B\u4F8B\u5982\u8D44\u6599\u53EA\u8BC1\u660E\u67D0\u4E00\u7248\u672C\u65F6\uFF0C\u76F4\u63A5\u4EE5\u201C\u5982\u679C\u4F60\u7528\u7684\u662F\u8BE5\u7248\u672C\u201D\u7ED9\u8BE5\u7248\u6B65\u9AA4\u3002\n\u5BA2\u6237\u6CA1\u6709\u8981\u6C42\u4E0B\u4E00\u6B65\u65F6\uFF0C\u4E0D\u7528\u5728\u5FAE\u4FE1\u672B\u5C3E\u8865\u8FFD\u95EE\u3001\u9080\u7EA6\u3001\u518D\u603B\u7ED3\u6216\u201C\u6709\u95EE\u9898\u968F\u65F6\u627E\u6211\u201D\u3002\u5982\u679C\u95EE\u7684\u662F\u600E\u4E48\u505A\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BF4\u8981\u5BF9\u7167\u7684\u5B57\u6BB5\u6216\u770B\u54EA\u9875\u3002\u5DF2\u6709\u6750\u6599\u73B0\u5728\u7ED9\uFF1B\u53EA\u6709\u7F3A\u5931\u6761\u4EF6\u4F1A\u6539\u53D8\u7B54\u6848\u65F6\u624D\u8865\u95EE\uFF0C\u522B\u91CD\u95EE\u5BA2\u6237\u5DF2\u7ED9\u7684\u4FE1\u606F\u3002\n\u8D44\u6599\u4E0D\u8DB3\u65F6\u4ECD\u53EF\u7ED9\u4EBA\u5DE5\u53EA\u8BFB\u6838\u5BF9\u601D\u8DEF\uFF0C\u660E\u786E\u662F\u7BA1\u7406\u5EFA\u8BAE\uFF1A\u6309\u5BA2\u6237\u624B\u5934\u80FD\u53D6\u5F97\u7684\u673A\u5668\u552F\u4E00\u6807\u8BC6\u3001\u539F\u59CB\u51ED\u636E\uFF0C\u5206\u6E05\u8D27\u7269\u6D41\u5411\u3001\u7EA6\u5B9A\u91D1\u989D\u4E0E\u5B9E\u9645\u6536\u4ED8\uFF1B\u7F3A\u9879\u5148\u7559\u7A7A\u3002\u4E0D\u628A\u5EFA\u8BAE\u5199\u6210\u8F6F\u4EF6\u5177\u5907\u67D0\u5B57\u6BB5\u3001\u53EF\u6539\u5355\u3001\u81EA\u52A8\u53BB\u91CD\u6216\u786E\u5B9A\u7684\u4F1A\u8BA1\u5904\u7406\u89C4\u5219\u3002\u4E0D\u58F0\u79F0\u5BA2\u6237\u5DF2\u7ECF\u6709\u8FD9\u4E9B\u8BB0\u5F55\u3002\u672A\u77E5\u8F6F\u4EF6\u7EC6\u8282\u53EA\u6838\u5BF9\u5E94\u9879\uFF0C\u4E0D\u8BA9\u6574\u4EFD\u7B54\u590D\u53D8\u6210\u5F85\u6838\u3002\n\u5F53\u524D\u6D88\u606F\u6216\u8D44\u6599\u6CA1\u5217\u5177\u4F53\u6570\u5B57\u3001\u6743\u9650\u3001\u8BB0\u5F55\uFF0C\u53EA\u8BF4\u660E\u5F53\u524D\u63D0\u4F9B\u8303\u56F4\u6CA1\u6709\u8BE5\u7EC6\u8282\uFF0C\u4E0D\u80FD\u5199\u201C\u4ECE\u672A\u8C08\u8FC7\u3001\u5C1A\u672A\u5F00\u901A\u3001\u672A\u53D1\u751F\u4ED8\u6B3E\u3001\u4E0D\u7B97\u8BD5\u7528\u201D\u7B49\u4E1A\u52A1\u72B6\u6001\u5426\u5B9A\u3002\u5BA2\u6237\u8BF4\u53D1\u8FC7\u6587\u4EF6\uFF0C\u4E0D\u7B49\u4E8E\u672C\u8F6E\u8F93\u5165\u5DF2\u5305\u542B\u6587\u4EF6\u6B63\u6587\uFF1B\u53EA\u6709\u4E00\u53E5\u201C\u53D1\u8FC7\u4E86\u201D\u65F6\uFF0C\u522B\u8BF4\u201C\u6211\u8FD9\u91CC\u6709\u4E86/\u5DF2\u770B\u8FC7\u201D\uFF0C\u4E5F\u4E0D\u7F16\u5177\u4F53\u7F3A\u9879\u3002\u53EF\u4EE5\u63A5\u201C\u4E0D\u7528\u91CD\u586B\uFF0C\u5149\u51ED\u8FD9\u53E5\u8FD8\u770B\u4E0D\u51FA\u5355\u5B50\u54EA\u513F\u5BF9\u4E0D\u4E0A\u201D\uFF0C\u8BF4\u660E\u5F53\u524D\u771F\u6B63\u7F3A\u7684\u662F\u6750\u6599\u5185\u5BB9\uFF0C\u4E0D\u8BA9\u5BA2\u6237\u91CD\u65B0\u9010\u9879\u53E3\u8FF0\uFF1B\u5DF2\u6709\u6750\u6599\u5185\u5BB9\u65F6\u5219\u76F4\u63A5\u636E\u6B64\u6838\u5BF9\u3002\u5F53\u524D\u53EA\u662F\u54A8\u8BE2\u4E0D\u7B49\u4E8E\u4EE5\u524D\u6CA1\u6709\u8BD5\u7528\uFF1B\u5BA2\u6237\u5DF2\u8BF4\u8C08\u5B9A\u53EF\u627F\u63A5\u786E\u8BA4\u5355\uFF0C\u7F3A\u7684\u5177\u4F53\u6761\u6B3E\u8BF7\u5176\u8865\u5145\u6216\u5411\u516C\u53F8\u6838\u5B9E\u3002\nprevious_progress.pending\u4ECD\u672A\u53D6\u5F97\u65B0\u4F9D\u636E\u65F6\uFF0C\u4E0D\u518D\u6362\u53E5\u8BDD\u627F\u8BFA\u6838\u5B9E\uFF1B\u5BA2\u6237\u8BF4\u7B49\u5F85\u5C31\u786E\u8BA4\u7B49\u7ED3\u679C\uFF0C\u6709\u65B0\u7684\u95EE\u9898\u76F4\u63A5\u63A5\u3002calculation\u662F\u7A0B\u5E8F\u6838\u7B97\uFF0C\u5148\u770Bmode\u548C\u8303\u56F4\uFF0C\u4E0D\u80FD\u628A\u670D\u52A1\u8D39\u5C0F\u8BA1\u6216\u5047\u8BBE\u7B97\u5F0F\u8BB2\u6210\u771F\u5B9E\u7ED3\u6E05\u3002\u5BA2\u6237\u63D0\u8BAE\u3001\u53CC\u65B9\u786E\u8BA4\u3001\u5B9E\u9645\u6267\u884C\u5206\u5F00\u3002\n\u672C\u8F6E\u53EA\u8BFB\u6240\u7ED9\u6280\u80FD\u4E0E\u8BC1\u636E\uFF0C\u4E0D\u8C03\u7528\u5DE5\u5177\u3001\u4E0D\u91CD\u65B0\u53D6CRM\u3002\u6570\u636E\u8303\u56F4\u4E3Aanonymized-only\u65F6\uFF0C\u53EA\u7528\u516C\u53F8\u6216\u5BA2\u6237\u81EA\u613F\u63D0\u4F9B\u7684\u8131\u654F\u6750\u6599\uFF0C\u4E0D\u7D22\u771F\u8D26\u6216\u5BA2\u6237\u8D26\u53F7\u3002\u5DF2\u6709calculation\u65F6\u7528{{QUOTE}}\u5360\u4F4D\u4E00\u6B21\uFF0C\u4E0D\u53E6\u7B97\u3002{{QUOTE}}\u4EE3\u8868\u5B8C\u6574\u6838\u7B97\u6BB5\u843D\uFF0C\u4E0D\u662F\u4E00\u4E2A\u91D1\u989D\uFF0C\u5FC5\u987B\u72EC\u7ACB\u6210\u6BB5\uFF1B\u4E0D\u8981\u5199\u6210\u201C\u6302\u724C\u81F3\u5C11{{QUOTE}}\u201D\u6216\u5728\u5360\u4F4D\u524D\u540E\u91CD\u590D\u91D1\u989D\u3001\u7B97\u5F0F\u3001\u8D39\u7528\u6761\u4EF6\u3002numericBinding\u4E3Aquote_only\u65F6\uFF0C\u6240\u6709\u672C\u6B21\u6838\u7B97\u6570\u5B57\u53EA\u5728\u8BE5\u6BB5\uFF0C\u7531\u7A0B\u5E8F\u5199\u5165\u3002no_send\u4E25\u683C\u6309\u5BBF\u4E3B\u5DF2\u9A8C\u8BC1\u7684action\uFF1A\u53EA\u6709stop\u624Dtrue\u4E14wechat\u7559\u7A7A\uFF1B\u5176\u4ED6action\u5747false\u5E76\u5199\u6709\u6548\u6B63\u6587\u3002paused\u662F\u6682\u505C\u91C7\u8D2D\uFF0C\u4E0D\u7B49\u4E8E\u7981\u6B62\u56DE\u5E94\uFF1B\u672C\u8F6Eplan\u9009answer\u65F6\uFF0C\u7B80\u5355\u63A5\u4F4F\u5373\u53EF\uFF0C\u4E0D\u7528\u91CD\u8BB2\u65E7\u6761\u4EF6\u3002\nDATA\n" + JSON.stringify({ turn_packet: packet });
|
|
11764
|
+
return "/wanji-sales-assistant\nhost_checks=true\u3002\u4E3A\u4E07\u673A\u9500\u552E\u8D77\u8349\u7ED9\u5546\u5BB6\u7684\u5FAE\u4FE1\uFF0C\u4E0D\u6267\u884C\u4EFB\u4F55\u5BF9\u5916\u52A8\u4F5C\u3002\u4F7F\u7528\u5F53\u524D\u6280\u80FD\u7684\u65B9\u6CD5\uFF0C\u6700\u7EC8\u53EA\u8FD4\u56DEJSON\u56DB\u5B57\u6BB5judgment\u3001wechat\u3001next_step\u3001no_send\u3002\n" + intentGuidance(contact.intent) + wechatVoice + "\n\u672C\u8F6E\u5199\u6CD5\uFF1A\u50CF\u5FAE\u4FE1\u91CC\u63A5\u7740\u4E00\u4E2A\u5177\u4F53\u5546\u5BB6\u7684\u8BDD\u5F80\u4E0B\u804A\u3002\u5E38\u7528\u8BCD\u3001\u81EA\u7136\u505C\u987F\u90FD\u53EF\u4EE5\uFF0C\u76F4\u63A5\u63A5\u8FD9\u6B21\u6700\u5728\u610F\u7684\u4E8B\uFF1B\u89E3\u91CA\u5230\u5BF9\u65B9\u80FD\u660E\u767D\u5C31\u6536\u4F4F\u3002\u4E0D\u8981\u4E3A\u663E\u5F97\u70ED\u60C5\u518D\u52A0\u4E00\u8F6E\u603B\u7ED3\u3001\u8C28\u614E\u58F0\u660E\u6216\u63D0\u95EE\u3002\u7D20\u6750\u5360\u4F4D\u524D\u4E0D\u518D\u6284\u7D20\u6750\u5168\u540D\uFF0C\u6807\u9898\u548C\u94FE\u63A5\u7531\u7A0B\u5E8F\u7ED9\u51FA\u3002\n" + voiceExamplePrompt(latest) + "\n\u6240\u6709\u9636\u6BB5\u5171\u7528turn_packet\u3002sources\u6709\u6765\u6E90\u89D2\u8272\uFF1A\u5BA2\u6237\u539F\u8BDD\u53EA\u8BC1\u660E\u5BA2\u6237\u60C5\u51B5\u4E0E\u9009\u62E9\uFF0Chistorical_sales\u53EA\u7528\u4E8E\u907F\u514D\u91CD\u8BB2\uFF0C\u4E0D\u6279\u51C6\u516C\u53F8\u6761\u6B3E\u3002deal\u4E0Ecompany\u8BC1\u636E\u53EA\u6309\u539F\u6587\u8303\u56F4\u4F7F\u7528\uFF1Bmethods\u662F\u57F9\u8BAD\u65B9\u6CD5\uFF0Cpolicy_candidates\u5C1A\u975E\u672C\u5355\u6388\u6743\u3002\u4E0D\u80FD\u628A\u672A\u77E5\u8BF4\u6210\u514D\u8D39\u3001\u4E0D\u652F\u6301\u3001\u5DF2\u5B8C\u6210\u6216\u4FDD\u8BC1\u7ED3\u679C\u3002\nsources\u4E2DR\u7F16\u53F7\u7684product_reference\u662F\u7ECF\u6765\u6E90\u6838\u5BF9\u7684\u4EA7\u54C1\u4ECB\u7ECD\u8D44\u6599\uFF1A\u53EF\u4EE5\u4ECB\u7ECD\u539F\u6587\u660E\u5217\u7684\u4EA7\u54C1\u65B9\u5411\uFF0C\u5E76\u4E0E\u5BA2\u6237\u5F53\u524D\u505A\u6CD5\u4F5C\u4E1A\u52A1\u5C42\u9762\u7684\u5BF9\u7167\u3002\u5FC5\u987B\u4FDD\u7559\u5176\u8FB9\u754C\uFF1B\u6CA1\u6709\u5177\u4F53\u5B57\u6BB5/\u7248\u672C\u4F9D\u636E\u65F6\u4E0D\u8865\u9020\u3002\u4E0D\u8981\u5148\u627F\u8BFA\u80FD\u529B\u518D\u52A0\u514D\u8D23\u58F0\u660E\uFF0C\u4E5F\u4E0D\u8981\u6574\u6BB5\u9000\u56DE\u6838\u5B9E\uFF1A\u628A\u8D44\u6599\u5DF2\u77E5\u7684\u65B9\u5411\u8BF4\u6E05\uFF0C\u518D\u53EA\u6709\u7F3A\u9879\u4F1A\u6539\u53D8\u7B54\u6848\u65F6\uFF0C\u624D\u95EE\u8FD9\u4E2A\u5177\u4F53\u7F3A\u9879\u3002\nsources\u4E2DU\u7F16\u53F7\u662F\u7ECF\u6838\u5BF9\u7684\u8D44\u6599\u8303\u56F4\u5185\u7684\u64CD\u4F5C\u4F9D\u636E\u3002\u6709\u5BF9\u5E94\u8D44\u6599\u5C31\u5148\u56DE\u7B54\u5BA2\u6237\u95EE\u5230\u7684\u5165\u53E3\u3001\u6B65\u9AA4\u6216\u9A8C\u8BC1\u70B9\u3002\u672A\u786E\u5B9A\u5BA2\u6237\u7248\u672C\u65F6\u5199\u201C\u5982\u679C\u60A8\u7528\u7684\u662F\u2026\uFF0C\u6309\u8BE5\u7248\u672C\u8D44\u6599\u53EF\u4EE5\u5148\u2026\u201D\uFF0C\u4E0D\u80FD\u56E0\u6B64\u628A\u6574\u9898\u7559\u5F85\u786E\u8BA4\uFF1B\u6BD4\u8F83\u7248\u672C\u8981\u5206\u5F00\u5199\u3002\u5BF9\u4E8E\u8D44\u6599\u672A\u8BC1\u660E\u7684\u5B57\u6BB5\u3001\u8BBE\u5907\u517C\u5BB9\u3001\u662F\u5426\u5F00\u901A\u3001\u771F\u5B9E\u6267\u884C\u7ED3\u679C\u548C\u73B0\u884C\u4EF7\u683C\uFF0C\u53EA\u628A\u90A3\u4E00\u9879\u5217\u4E3A\u5F85\u6838\u3002\u660E\u786E\u7248\u672C\u7684\u8D44\u6599\u4E0D\u5957\u5230\u5176\u4ED6\u7248\u672C\u3002\nmaterial_context\u6765\u81EA\u72EC\u7ACB\u5BA2\u6237\u7D20\u6750\u5E93\u3002M\u7F16\u53F7\u662F\u5DF2\u6838\u5BF9\u7684\u7D20\u6750\uFF0C\u4E0D\u662F\u516C\u53F8\u6388\u6743\uFF1B\u53EA\u9009\u4E0E\u672C\u8F6E\u4E3B\u9898\u53CA\u7248\u672C\u786E\u5B9E\u5BF9\u5E94\u7684\u6700\u591A\u4E24\u4EFD\uFF0C\u7528{{MATERIAL_1}}\u7B49\u5360\u4F4D\uFF0C\u7A0B\u5E8F\u63D0\u4F9B\u771F\u5B9E\u6807\u9898\u548C\u94FE\u63A5\u3002\u6587\u6863\u6CE8\u660E\u9875\u7801\uFF0C\u89C6\u9891\u8BF4\u660E\u4E0B\u8F7D\u67E5\u770B\u5373\u53EF\uFF1B\u4E0D\u80FD\u8BF4\u9644\u4EF6\u5DF2\u7ECF\u53D1\u5230\u5FAE\u4FE1\u3002\u6587\u672C\u8D44\u6599\u91CC\u7684\u89C6\u9891/\u6587\u6863\u5730\u5740\u53EA\u662F\u68C0\u7D22\u7EBF\u7D22\uFF0C\u4E0D\u4EE3\u66FF\u72EC\u7ACB\u7D20\u6750\u53EC\u56DE\u3002\u65E0\u5339\u914D\u3001\u7248\u672C\u4E0D\u660E\u6216\u94FE\u63A5\u4E0D\u53EF\u7528\u65F6\u8BF4\u660E\u5177\u4F53\u7F3A\u9879\uFF0C\u5148\u56DE\u7B54\u53EF\u77E5\u5185\u5BB9\uFF0C\u4E0D\u9020\u94FE\u63A5\uFF0C\u4E0D\u628A\u201C\u6211\u53D1\u4F60\u201D\u5F53\u5DF2\u7ED9\u51FA\u6750\u6599\uFF1B\u4E0D\u91CD\u590D\u53D1\u5BA2\u6237\u5DF2\u7ECF\u6536\u5230\u4E14\u6CA1\u8981\u6C42\u91CD\u53D1\u7684\u5185\u5BB9\u3002\n" + operationProofRules + "\n\u5148\u4FDD\u8BC1\u4E8B\u5B9E\u4E0E\u653F\u7B56\u51C6\u786E\uFF0C\u8D34\u7740\u5BA2\u6237\u60C5\u5883\u76F4\u63A5\u56DE\u7B54\u5F53\u524D\u95EE\u9898\uFF0C\u518D\u6309\u786E\u6709\u7684\u54A8\u8BE2\u3001\u987E\u8651\u6216\u8D2D\u4E70\u9700\u6C42\u9009\u62E9\u5408\u9002\u7684\u8BF4\u6CD5\u3002\u5BA2\u6237\u6307\u5B9A\u65E5\u671F/\u4ED8\u6B3E\u6E20\u9053\u53EA\u662F\u5BA2\u6237\u8981\u6C42\uFF1B\u516C\u53F8\u672A\u786E\u8BA4\u65F6\uFF0C\u8BF4\u6E05\u5F85\u6838\u5E76\u4FDD\u7559\u8BC9\u6C42\u5373\u53EF\uFF0C\u4E0D\u80FD\u4E3A\u4E86\u7ED9\u5B8C\u6574\u786E\u8BA4\u5355\u8865\u9020\u6761\u6B3E\u3002\u5DF2\u6536\u5230\u7684\u6750\u6599\u53EA\u8865\u672C\u8F6E\u53D8\u5316\uFF0C\u5BA2\u6237\u8981\u6C42\u6838\u6E05\u540E\u518D\u53D1\u5219\u7B49\u4F9D\u636E\uFF0C\u4E0D\u6BCF\u8F6E\u91CD\u5217\u6574\u4EFD\u3002\n\u7528current_customer_turn\u63A5\u4F4F\u5BA2\u6237\u8FDE\u7EED\u53D1\u6765\u7684\u8FD9\u8F6E\u8BDD\u3002\u6700\u540E\u4E00\u53E5\u53EA\u662F\u8865\u5145\u8BED\u6C14\u65F6\uFF0C\u56DE\u5E94\u524D\u9762\u5C1A\u672A\u56DE\u7B54\u7684\u987E\u8651\u3002\u7EE7\u627F\u4ECD\u6709\u6548\u7684\u5BA2\u6237\u51B3\u5B9A\u548C\u6750\u6599\u72B6\u6001\uFF1B\u5BA2\u6237\u5DF2\u7ECF\u6536\u5230\u6216\u8F6C\u4EA4\u7684\u6750\u6599\u4E0D\u91CD\u65B0\u51C6\u5907\uFF0C\u9664\u975E\u660E\u786E\u8981\u6539\u3002\u672C\u8F6E\u786E\u6709\u4E1A\u52A1\u95EE\u9898\u5C31\u76F4\u63A5\u7B54\u5E76\u8BF4\u6E05\u5FC5\u8981\u6761\u4EF6\uFF1B\u5410\u69FD\u3001\u73A9\u7B11\u3001\u7B80\u5355\u786E\u8BA4\u53EF\u81EA\u7136\u6536\u4F4F\uFF0C\u4E0D\u5957\u9500\u552E\u4E09\u6BB5\u5F0F\u3002\u5DF2\u786E\u8BA4\u7684\u62A5\u4EF7\u548C\u8303\u56F4\u4E0D\u9000\u56DE\u672A\u77E5\uFF0C\u672A\u77E5\u9879\u53EA\u5F71\u54CD\u5BF9\u5E94\u90E8\u5206\u3002\u4E0D\u8981\u4E3A\u4E86\u63A8\u8FDB\u589E\u52A0\u514D\u8D39\u3001\u65F6\u95F4\u3001\u6548\u679C\u3001\u6743\u9650\u6216\u6267\u884C\u627F\u8BFA\u3002\n\u8FD9\u662F\u7ED9\u9500\u552E\u4EBA\u5DE5\u5BA1\u6838\u7684\u8349\u7A3F\u3002\u5148\u6309response_contract\u56DE\u7B54\u80FD\u786E\u8BA4\u7684\u90E8\u5206\uFF1B\u4E0D\u6E05\u695A\u7684\u5177\u4F53\u7EC6\u8282\u76F4\u63A5\u8BF4\u6682\u4E0D\u80FD\u786E\u8BA4\u3002\u53EF\u7ED9\u660E\u786E\u6807\u4E3A\u5EFA\u8BAE\u7684\u9009\u578B\u601D\u8DEF\u3001\u5BF9\u7167\u7EF4\u5EA6\u6216\u53EA\u8BFB\u6838\u9A8C\u65B9\u6CD5\uFF0C\u4E0D\u9700\u8981\u8F6F\u4EF6\u5165\u53E3\u6216\u4EA7\u54C1\u80FD\u529B\u624D\u80FD\u6210\u7ACB\u3002\u6CA1\u6709\u53EF\u9760\u5EFA\u8BAE\uFF0C\u7B80\u77ED\u8BF4\u660E\u8FD8\u7F3A\u4EC0\u4E48\u4FE1\u606F\u4E5F\u53EF\u4EA4\u7A3F\u3002\u4E0D\u80FD\u628A\u6709\u5F85\u786E\u8BA4\u7684\u80FD\u529B\u6539\u6210\u201C\u5982\u679C\u53EF\u4EE5\u201D\u518D\u7ED9\u5177\u4F53\u865A\u6784\u6B65\u9AA4\u3002\n\u5BA2\u6237\u63D0\u51FA\u987E\u8651\u65F6\uFF0C\u56DE\u7B54\u8981\u843D\u5230\u8FD9\u4E2A\u987E\u8651\u7684\u5224\u65AD\u4F9D\u636E\uFF1A\u4F8B\u5982\u62C5\u5FC3\u91CD\u590D\u8BB0\u5F55\u5C31\u8BF4\u660E\u5F53\u524D\u8D44\u6599\u80FD\u786E\u8BA4\u7684\u8BB0\u5F55\u4E0E\u6838\u5BF9\u5173\u7CFB\uFF0C\u62C5\u5FC3\u8868\u683C\u5207\u6362\u5C31\u6309\u5176\u5DF2\u77E5\u4E1A\u52A1\u6BD4\u8F83\uFF0C\u62C5\u5FC3\u5458\u5DE5\u80FD\u770B\u5230\u4EC0\u4E48\u5C31\u533A\u5206\u6240\u9700\u804C\u8D23\u4E0E\u5C1A\u672A\u6838\u5B9E\u7684\u6743\u9650\u3002\u4E0D\u80FD\u62FF\u4E00\u4EFD\u901A\u7528\u529F\u80FD\u4ECB\u7ECD\u4EE3\u66FF\u5F53\u524D\u95EE\u9898\uFF1B\u4E0D\u628A\u5BA2\u6237\u4E3B\u89C2\u8BC4\u4EF7\u6539\u5199\u4E3A\u5176\u4E60\u60EF\u3001\u5DF2\u53D1\u751F\u635F\u5931\u6216\u5176\u4ED6\u4EBA\u7684\u8BA4\u53EF\u3002\n\u6B63\u6587\u7B2C\u4E00\u53E5\u5C31\u63A5\u5177\u4F53\u95EE\u9898\u3002\u6709\u4E24\u4E09\u4E2A\u64CD\u4F5C\u70B9\u65F6\uFF0C\u6309\u5B9E\u9645\u987A\u5E8F\u9010\u70B9\u7ED9\u5165\u53E3\u3001\u52A8\u4F5C\u548C\u600E\u4E48\u6838\u5BF9\uFF0C\u4E0D\u5148\u590D\u8FF0\u9700\u6C42\u3002\u80FD\u7528\u4E00\u53E5\u8BF4\u6E05\u5C31\u4E00\u53E5\uFF0C\u591A\u4E2A\u72EC\u7ACB\u95EE\u9898\u53EF\u5206\u884C\u3002\u53EA\u6709\u7F3A\u7684\u90A3\u9879\u8BF4\u6682\u4E0D\u80FD\u786E\u8BA4\uFF1B\u4F8B\u5982\u8D44\u6599\u53EA\u8BC1\u660E\u67D0\u4E00\u7248\u672C\u65F6\uFF0C\u76F4\u63A5\u4EE5\u201C\u5982\u679C\u4F60\u7528\u7684\u662F\u8BE5\u7248\u672C\u201D\u7ED9\u8BE5\u7248\u6B65\u9AA4\u3002\n\u5BA2\u6237\u6CA1\u6709\u8981\u6C42\u4E0B\u4E00\u6B65\u65F6\uFF0C\u4E0D\u7528\u5728\u5FAE\u4FE1\u672B\u5C3E\u8865\u8FFD\u95EE\u3001\u9080\u7EA6\u3001\u518D\u603B\u7ED3\u6216\u201C\u6709\u95EE\u9898\u968F\u65F6\u627E\u6211\u201D\u3002\u5982\u679C\u95EE\u7684\u662F\u600E\u4E48\u505A\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BF4\u8981\u5BF9\u7167\u7684\u5B57\u6BB5\u6216\u770B\u54EA\u9875\u3002\u5DF2\u6709\u6750\u6599\u73B0\u5728\u7ED9\uFF1B\u53EA\u6709\u7F3A\u5931\u6761\u4EF6\u4F1A\u6539\u53D8\u7B54\u6848\u65F6\u624D\u8865\u95EE\uFF0C\u522B\u91CD\u95EE\u5BA2\u6237\u5DF2\u7ED9\u7684\u4FE1\u606F\u3002\n\u8D44\u6599\u4E0D\u8DB3\u65F6\u4ECD\u53EF\u7ED9\u4EBA\u5DE5\u53EA\u8BFB\u6838\u5BF9\u601D\u8DEF\uFF0C\u660E\u786E\u662F\u7BA1\u7406\u5EFA\u8BAE\uFF1A\u6309\u5BA2\u6237\u624B\u5934\u80FD\u53D6\u5F97\u7684\u673A\u5668\u552F\u4E00\u6807\u8BC6\u3001\u539F\u59CB\u51ED\u636E\uFF0C\u5206\u6E05\u8D27\u7269\u6D41\u5411\u3001\u7EA6\u5B9A\u91D1\u989D\u4E0E\u5B9E\u9645\u6536\u4ED8\uFF1B\u7F3A\u9879\u5148\u7559\u7A7A\u3002\u4E0D\u628A\u5EFA\u8BAE\u5199\u6210\u8F6F\u4EF6\u5177\u5907\u67D0\u5B57\u6BB5\u3001\u53EF\u6539\u5355\u3001\u81EA\u52A8\u53BB\u91CD\u6216\u786E\u5B9A\u7684\u4F1A\u8BA1\u5904\u7406\u89C4\u5219\u3002\u4E0D\u58F0\u79F0\u5BA2\u6237\u5DF2\u7ECF\u6709\u8FD9\u4E9B\u8BB0\u5F55\u3002\u672A\u77E5\u8F6F\u4EF6\u7EC6\u8282\u53EA\u6838\u5BF9\u5E94\u9879\uFF0C\u4E0D\u8BA9\u6574\u4EFD\u7B54\u590D\u53D8\u6210\u5F85\u6838\u3002\n\u5F53\u524D\u6D88\u606F\u6216\u8D44\u6599\u6CA1\u5217\u5177\u4F53\u6570\u5B57\u3001\u6743\u9650\u3001\u8BB0\u5F55\uFF0C\u53EA\u8BF4\u660E\u5F53\u524D\u63D0\u4F9B\u8303\u56F4\u6CA1\u6709\u8BE5\u7EC6\u8282\uFF0C\u4E0D\u80FD\u5199\u201C\u4ECE\u672A\u8C08\u8FC7\u3001\u5C1A\u672A\u5F00\u901A\u3001\u672A\u53D1\u751F\u4ED8\u6B3E\u3001\u4E0D\u7B97\u8BD5\u7528\u201D\u7B49\u4E1A\u52A1\u72B6\u6001\u5426\u5B9A\u3002\u5BA2\u6237\u8BF4\u53D1\u8FC7\u6587\u4EF6\uFF0C\u4E0D\u7B49\u4E8E\u672C\u8F6E\u8F93\u5165\u5DF2\u5305\u542B\u6587\u4EF6\u6B63\u6587\uFF1B\u53EA\u6709\u4E00\u53E5\u201C\u53D1\u8FC7\u4E86\u201D\u65F6\uFF0C\u522B\u8BF4\u201C\u6211\u8FD9\u91CC\u6709\u4E86/\u5DF2\u770B\u8FC7\u201D\uFF0C\u4E5F\u4E0D\u7F16\u5177\u4F53\u7F3A\u9879\u3002\u53EF\u4EE5\u63A5\u201C\u4E0D\u7528\u91CD\u586B\uFF0C\u5149\u51ED\u8FD9\u53E5\u8FD8\u770B\u4E0D\u51FA\u5355\u5B50\u54EA\u513F\u5BF9\u4E0D\u4E0A\u201D\uFF0C\u8BF4\u660E\u5F53\u524D\u771F\u6B63\u7F3A\u7684\u662F\u6750\u6599\u5185\u5BB9\uFF0C\u4E0D\u8BA9\u5BA2\u6237\u91CD\u65B0\u9010\u9879\u53E3\u8FF0\uFF1B\u5DF2\u6709\u6750\u6599\u5185\u5BB9\u65F6\u5219\u76F4\u63A5\u636E\u6B64\u6838\u5BF9\u3002\u5F53\u524D\u53EA\u662F\u54A8\u8BE2\u4E0D\u7B49\u4E8E\u4EE5\u524D\u6CA1\u6709\u8BD5\u7528\uFF1B\u5BA2\u6237\u5DF2\u8BF4\u8C08\u5B9A\u53EF\u627F\u63A5\u786E\u8BA4\u5355\uFF0C\u7F3A\u7684\u5177\u4F53\u6761\u6B3E\u8BF7\u5176\u8865\u5145\u6216\u5411\u516C\u53F8\u6838\u5B9E\u3002\nprevious_progress.pending\u4ECD\u672A\u53D6\u5F97\u65B0\u4F9D\u636E\u65F6\uFF0C\u4E0D\u518D\u6362\u53E5\u8BDD\u627F\u8BFA\u6838\u5B9E\uFF1B\u5BA2\u6237\u8BF4\u7B49\u5F85\u5C31\u786E\u8BA4\u7B49\u7ED3\u679C\uFF0C\u6709\u65B0\u7684\u95EE\u9898\u76F4\u63A5\u63A5\u3002calculation\u662F\u7A0B\u5E8F\u6838\u7B97\uFF0C\u5148\u770Bmode\u548C\u8303\u56F4\uFF0C\u4E0D\u80FD\u628A\u670D\u52A1\u8D39\u5C0F\u8BA1\u6216\u5047\u8BBE\u7B97\u5F0F\u8BB2\u6210\u771F\u5B9E\u7ED3\u6E05\u3002\u5BA2\u6237\u63D0\u8BAE\u3001\u53CC\u65B9\u786E\u8BA4\u3001\u5B9E\u9645\u6267\u884C\u5206\u5F00\u3002\n\u672C\u8F6E\u53EA\u8BFB\u6240\u7ED9\u6280\u80FD\u4E0E\u8BC1\u636E\uFF0C\u4E0D\u8C03\u7528\u5DE5\u5177\u3001\u4E0D\u91CD\u65B0\u53D6CRM\u3002\u6570\u636E\u8303\u56F4\u4E3Aanonymized-only\u65F6\uFF0C\u53EA\u7528\u516C\u53F8\u6216\u5BA2\u6237\u81EA\u613F\u63D0\u4F9B\u7684\u8131\u654F\u6750\u6599\uFF0C\u4E0D\u7D22\u771F\u8D26\u6216\u5BA2\u6237\u8D26\u53F7\u3002\u5DF2\u6709calculation\u65F6\u7528{{QUOTE}}\u5360\u4F4D\u4E00\u6B21\uFF0C\u4E0D\u53E6\u7B97\u3002{{QUOTE}}\u4EE3\u8868\u5B8C\u6574\u6838\u7B97\u6BB5\u843D\uFF0C\u4E0D\u662F\u4E00\u4E2A\u91D1\u989D\uFF0C\u5FC5\u987B\u72EC\u7ACB\u6210\u6BB5\uFF1B\u4E0D\u8981\u5199\u6210\u201C\u6302\u724C\u81F3\u5C11{{QUOTE}}\u201D\u6216\u5728\u5360\u4F4D\u524D\u540E\u91CD\u590D\u91D1\u989D\u3001\u7B97\u5F0F\u3001\u8D39\u7528\u6761\u4EF6\u3002numericBinding\u4E3Aquote_only\u65F6\uFF0C\u6240\u6709\u672C\u6B21\u6838\u7B97\u6570\u5B57\u53EA\u5728\u8BE5\u6BB5\uFF0C\u7531\u7A0B\u5E8F\u5199\u5165\u3002no_send\u4E25\u683C\u6309\u5BBF\u4E3B\u5DF2\u9A8C\u8BC1\u7684action\uFF1A\u53EA\u6709stop\u624Dtrue\u4E14wechat\u7559\u7A7A\uFF1B\u5176\u4ED6action\u5747false\u5E76\u5199\u6709\u6548\u6B63\u6587\u3002paused\u662F\u6682\u505C\u91C7\u8D2D\uFF0C\u4E0D\u7B49\u4E8E\u7981\u6B62\u56DE\u5E94\uFF1B\u672C\u8F6Eplan\u9009answer\u65F6\uFF0C\u7B80\u5355\u63A5\u4F4F\u5373\u53EF\uFF0C\u4E0D\u7528\u91CD\u8BB2\u65E7\u6761\u4EF6\u3002\nDATA\n" + JSON.stringify({ turn_packet: packet });
|
|
11673
11765
|
}
|
|
11674
11766
|
async function generateReply(rpc, workspaceId, contact, latest, signal, options = {}) {
|
|
11675
11767
|
if (!workspaceId.trim()) throw new Error("\u8BF7\u5148\u9009\u62E9\u5B89\u88C5\u4E86\u9500\u552E\u6280\u80FD\u7684\u5DE5\u4F5C\u533A\u3002");
|
|
@@ -11871,7 +11963,7 @@ async function generateReply(rpc, workspaceId, contact, latest, signal, options
|
|
|
11871
11963
|
const catalogObservation = catalogMaterialObservation(material);
|
|
11872
11964
|
if (catalogObservation) packet = { ...packet, sources: { ...packet.sources, MC0: { authority: "retrieval_observation", text: "Host\u6838\u9A8C\u7684\u5BA2\u6237\u7D20\u6750\u4E0E\u6700\u7EC8\u8349\u7A3F\u9644\u4EF6\u72B6\u6001\uFF1A" + JSON.stringify(catalogObservation) + "\u3002matched\u8868\u793A\u7CFB\u7EDF\u5C06\u5728\u6B63\u6587\u540E\u8FFD\u52A0\u8FD9\u91CC\u7684\u5DF2\u6838\u7D20\u6750\uFF0C\u4E0D\u4EE3\u8868\u5DF2\u901A\u8FC7\u5FAE\u4FE1\u53D1\u9001\uFF0C\u4E5F\u4E0D\u8BC1\u660E\u8D44\u6599\u91CC\u63D0\u5230\u7684\u529F\u80FD\u6216\u653F\u7B56\u5F53\u524D\u751F\u6548\u3002" } } };
|
|
11873
11965
|
const company = packet.current_company_facts.map(({ source_id, ...fact }) => fact);
|
|
11874
|
-
let plan, planFeedback = "";
|
|
11966
|
+
let plan, recoveredPlan, planFeedback = "";
|
|
11875
11967
|
progress("planning");
|
|
11876
11968
|
for (let attempt = 0; attempt < 2; attempt++) {
|
|
11877
11969
|
const text4 = await turn(sessionId, buildTurnPlanPrompt(contact, latest, knowledge.contextId, packet) + planFeedback);
|
|
@@ -11881,8 +11973,13 @@ async function generateReply(rpc, workspaceId, contact, latest, signal, options
|
|
|
11881
11973
|
} catch (error) {
|
|
11882
11974
|
signal.throwIfAborted();
|
|
11883
11975
|
planFeedback = buildTurnPlanCorrection(error);
|
|
11976
|
+
if (contact.wechat) try {
|
|
11977
|
+
recoveredPlan = parseTurnPlan(text4, contact, latest, packet, true);
|
|
11978
|
+
} catch {
|
|
11979
|
+
}
|
|
11884
11980
|
}
|
|
11885
11981
|
}
|
|
11982
|
+
plan ??= recoveredPlan;
|
|
11886
11983
|
if (!plan) throw new Error("\u8FD8\u6CA1\u7406\u6E05\u8FD9\u8F6E\u5BA2\u6237\u7684\u9700\u6C42\uFF0C\u672C\u6B21\u672A\u751F\u6210\u8349\u7A3F\u3002");
|
|
11887
11984
|
let materials = null;
|
|
11888
11985
|
if (plan.material_need && !catalogMaterial) {
|
|
@@ -12333,7 +12430,7 @@ function mountSales(ctx, Page, Icon) {
|
|
|
12333
12430
|
store.reset();
|
|
12334
12431
|
restores.clear();
|
|
12335
12432
|
if (ws) for (const c of contacts.filter((c2) => !c2.crm && !c2.wechat)) void journal.reset(ws, c).catch((e) => store.dispatch({ type: "history-error", id: c.id, error: e.message }));
|
|
12336
|
-
}
|
|
12433
|
+
} })
|
|
12337
12434
|
}, Page));
|
|
12338
12435
|
ctx.slots.inject("sidebar.panellist", () => ctx.slots.register({
|
|
12339
12436
|
name: "sidebar.panellist",
|
|
@@ -12350,26 +12447,30 @@ function mountSales(ctx, Page, Icon) {
|
|
|
12350
12447
|
|
|
12351
12448
|
// src/intent-styles.ts
|
|
12352
12449
|
var intentCss = `
|
|
12353
|
-
.ws-intent-sortline { display:flex; align-items:center; justify-content:space-between; gap:
|
|
12354
|
-
.ws-intent-sortline
|
|
12355
|
-
.ws-intent-sort { min-width:0; max-width:
|
|
12450
|
+
.ws-intent-sortline { display:flex; align-items:center; justify-content:space-between; gap:6px; min-height:28px; margin-bottom:10px; }
|
|
12451
|
+
.ws-intent-sortline h2 { min-width:0; font-size:13px; overflow-wrap:anywhere; }
|
|
12452
|
+
.ws-intent-sort-control { position:relative; min-width:0; max-width:58%; }
|
|
12453
|
+
.ws-intent-sort-control > svg { position:absolute; inset-inline-end:3px; top:50%; transform:translateY(-50%) rotate(90deg); pointer-events:none; color:var(--ws-muted); }
|
|
12454
|
+
.ws-intent-sort { appearance:none; field-sizing:content; max-width:100%; min-height:28px; text-align:end; padding:3px 19px 3px 5px; border:0; border-radius:5px; color:var(--ws-muted); background:transparent; font-size:11px; cursor:pointer; }
|
|
12455
|
+
.ws-intent-sort:hover { background:var(--ws-soft); }
|
|
12456
|
+
.ws-intent-sort option { color:var(--ws-ink); background:var(--ws-bg); }
|
|
12356
12457
|
.ws-intent-badge { display:inline-flex; justify-content:center; align-items:center; width:max-content; white-space:nowrap; border:1px solid var(--ws-line); border-radius:6px; padding:1px 5px; font-size:10px; font-weight:600; color:var(--ws-muted); }
|
|
12357
12458
|
.ws-intent-badge[data-grade] { color:var(--ws-ink); background:var(--ws-soft); }
|
|
12358
12459
|
.ws-intent-badge[data-grade="A"] { border-color:currentColor; }
|
|
12359
12460
|
.ws-contact-content > .ws-intent-badge { grid-column:2; grid-row:2; align-self:center; line-height:14px; }
|
|
12360
|
-
.ws-intent-sort:focus-visible
|
|
12361
|
-
.ws-person-title .ws-intent-title { display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; }
|
|
12362
|
-
.ws-person-title .ws-intent-title h2 { min-width:0; overflow-wrap:anywhere; }
|
|
12461
|
+
.ws-intent-sort:focus-visible { outline:2px solid var(--ws-accent); outline-offset:2px; }
|
|
12363
12462
|
.ws-intent-details { position:relative; flex:none; margin:0; font-size:11px; }
|
|
12364
|
-
.ws-intent-details
|
|
12365
|
-
.ws-intent-
|
|
12366
|
-
.ws-intent-
|
|
12367
|
-
.ws-intent-
|
|
12463
|
+
.ws-intent-details > .ws-intent-trigger { display:flex; align-items:center; gap:4px; min-height:21px; padding:0 2px; border:0; background:none; color:var(--ws-muted); white-space:nowrap; user-select:none; -webkit-tap-highlight-color:transparent; }
|
|
12464
|
+
.ws-intent-trigger:hover .ws-intent-value, .ws-intent-trigger[aria-expanded=true] .ws-intent-value { text-decoration:underline; text-underline-offset:2px; }
|
|
12465
|
+
.ws-intent-value { color:var(--ws-ink); font-weight:600; }
|
|
12466
|
+
.ws-intent-popover { position:absolute; inset-inline-start:0; top:100%; z-index:6; width:min(310px,66vw); padding-top:5px; }
|
|
12467
|
+
.ws-intent-panel { max-height:52vh; overflow:auto; background:var(--ws-bg); color:var(--ws-ink); border:1px solid var(--ws-line); border-radius:9px; padding:11px 13px; box-shadow:0 6px 20px #0002; }
|
|
12368
12468
|
.ws-intent-panel dl, .ws-intent-panel dd { margin:0; }
|
|
12369
12469
|
.ws-intent-panel dt { margin-top:9px; font-weight:650; }
|
|
12370
12470
|
.ws-intent-panel blockquote { margin:3px 0 0; white-space:normal; overflow-wrap:anywhere; color:var(--ws-muted); }
|
|
12371
12471
|
.ws-intent-panel > p { display:block; white-space:normal; margin:0 0 5px; }
|
|
12372
|
-
@
|
|
12472
|
+
@container(max-width:760px){ .ws-person-meta { position:relative; } .ws-intent-details { position:static; } .ws-intent-popover { width:min(310px,100%); } }
|
|
12473
|
+
@media(max-width:640px) and (hover:none){ .ws-intent-popover { position:fixed; inset:30vh 12px auto; width:auto; padding:0; } .ws-intent-panel { max-height:54vh; } }
|
|
12373
12474
|
`;
|
|
12374
12475
|
|
|
12375
12476
|
// src/reply-styles.ts
|
|
@@ -12381,12 +12482,13 @@ var replyStyles = `
|
|
|
12381
12482
|
.ws-reply-editor-bar [role=tab]{border:0;border-radius:5px;background:transparent;color:var(--ws-muted);padding:5px 11px;font-size:12px;cursor:pointer}
|
|
12382
12483
|
.ws-reply-editor-bar [role=tab][aria-selected=true]{background:var(--ws-bg);color:var(--ws-ink);box-shadow:0 1px 3px rgb(0 0 0 / .06)}
|
|
12383
12484
|
.ws-reply-editor-bar>small{color:var(--ws-muted);font-size:10px}
|
|
12384
|
-
.ws-reply-editor-body{
|
|
12485
|
+
.ws-reply-editor-body{height:110px;overflow:auto;padding:12px 13px;scrollbar-gutter:stable}
|
|
12385
12486
|
.ws-reply-editor-body:focus-visible{outline:2px solid var(--ws-accent);outline-offset:-3px}
|
|
12386
|
-
.ws-reply-editor-body .ws-editor{padding:0;border:0;background:none}
|
|
12387
|
-
.ws-reply-editor-body textarea{height:
|
|
12388
|
-
.ws-reply-empty{font-size:12px;
|
|
12389
|
-
.ws-reply-
|
|
12487
|
+
.ws-reply-editor-body .ws-editor{height:100%;padding:0;border:0;background:none}
|
|
12488
|
+
.ws-reply-editor-body .ws-editor textarea{height:100%;min-height:0;max-height:none;padding:0;resize:none}
|
|
12489
|
+
.ws-reply-editor-body .ws-editor textarea,.ws-reply-empty,.ws-reply-markdown{font-size:12px;line-height:1.8}
|
|
12490
|
+
.ws-reply-editor-body .ws-editor textarea::placeholder,.ws-reply-empty{color:var(--ws-muted);opacity:1}
|
|
12491
|
+
.ws-reply-markdown{overflow-wrap:anywhere;color:var(--ws-ink)}
|
|
12390
12492
|
.ws-reply-markdown p{margin:0 0 .6em;white-space:pre-wrap}.ws-reply-markdown p:last-child{margin-bottom:0}
|
|
12391
12493
|
.ws-reply-markdown h1,.ws-reply-markdown h2,.ws-reply-markdown h3,.ws-reply-markdown h4,.ws-reply-markdown h5,.ws-reply-markdown h6{font-size:1.12em;margin:.8em 0 .4em;line-height:1.5}
|
|
12392
12494
|
.ws-reply-markdown>:first-child{margin-top:0}.ws-reply-markdown ol,.ws-reply-markdown ul{padding-left:1.7em;margin:.4em 0}.ws-reply-markdown li{padding-left:.15em}.ws-reply-markdown li>p{margin:0}
|
|
@@ -12407,15 +12509,17 @@ var replyStyles = `
|
|
|
12407
12509
|
// src/wechat/media-styles.ts
|
|
12408
12510
|
var mediaStyles = `
|
|
12409
12511
|
.ws-avatar-image{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
|
|
12512
|
+
.ws-native-media video{display:block;width:320px;max-width:100%;max-height:320px;border-radius:7px;background:#111}
|
|
12513
|
+
.ws-page .ws-video-load{background:var(--ws-bg);color:var(--ws-ink)}
|
|
12410
12514
|
|
|
12411
12515
|
.ws-image-trigger{display:block;padding:0;max-width:100%;border:0;border-radius:7px;background:transparent;cursor:zoom-in!important}
|
|
12412
12516
|
.ws-image-trigger:focus-visible,.ws-voice-button:focus-visible{outline:2px solid var(--ws-accent);outline-offset:3px}
|
|
12413
12517
|
.ws-native-media .ws-image-dialog{--ws-preview-top:max(40px,env(safe-area-inset-top,0px),var(--dsh-windows-titlebar-height,env(titlebar-area-height,0px)));position:fixed;inset:calc(var(--ws-preview-top) + 24px) 24px 24px;width:min(1080px,calc(100vw - 48px));height:min(760px,calc(100dvh - var(--ws-preview-top) - 48px));max-width:none;max-height:none;margin:auto;padding:0;border:1px solid var(--ws-line,#dfe1e4);border-radius:12px;background:var(--ws-bg,#fff);color:var(--ws-ink,#111315);overflow:hidden;box-shadow:0 20px 80px #00000040;box-sizing:border-box;-webkit-app-region:no-drag}
|
|
12414
12518
|
.ws-image-dialog::backdrop{background:rgba(9,12,16,.58)}
|
|
12415
12519
|
.ws-native-media .ws-image-dialog[open]{display:grid;grid-template-rows:auto minmax(0,1fr)}
|
|
12416
|
-
.ws-image-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px 10px 16px;border-bottom:1px solid var(--ws-line);min-width:0}.ws-image-toolbar>strong{font-size:13px;white-space:nowrap}.ws-image-tools{display:flex;align-items:center;gap:4px;min-width:0}.ws-image-tools button{display:grid;place-items:center;min-width:30px;height:32px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:inherit;font-size:20px;line-height:1;white-space:nowrap}.ws-image-tools button:hover:not(:disabled){background:var(--ws-soft)}.ws-image-tools button:focus-visible{outline:2px solid var(--ws-accent);outline-offset:2px}.ws-image-tools button:disabled{opacity:.35}.ws-image-tools .ws-image-fit{font-size:12px;min-width:66px;margin-inline:4px}.ws-image-scale{min-width:40px;
|
|
12520
|
+
.ws-image-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px 10px 16px;border-bottom:1px solid var(--ws-line);min-width:0}.ws-image-toolbar>strong{font-size:13px;white-space:nowrap}.ws-image-tools{display:flex;align-items:center;gap:4px;min-width:0}.ws-image-tools button{display:grid;place-items:center;min-width:30px;height:32px;padding:0 7px;border:0;border-radius:6px;background:transparent;color:inherit;font-size:20px;line-height:1;white-space:nowrap}.ws-image-tools button:hover:not(:disabled){background:var(--ws-soft)}.ws-image-tools button:focus-visible{outline:2px solid var(--ws-accent);outline-offset:2px}.ws-image-tools button:disabled{opacity:.35}.ws-image-tools .ws-image-fit{font-size:12px;min-width:66px;margin-inline:4px}.ws-image-tools .ws-image-scale{min-width:40px;padding:0 3px;font-size:11px;color:var(--ws-muted);font-variant-numeric:tabular-nums}.ws-image-tools .ws-image-close{font-size:25px;margin-left:4px;border-left:1px solid var(--ws-line);border-radius:0 5px 5px 0}
|
|
12417
12521
|
.ws-image-canvas{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;background:var(--ws-soft);scrollbar-width:thin}.ws-image-stage{display:flex;align-items:center;justify-content:center;width:max-content;height:max-content;min-width:100%;min-height:100%;padding:16px;box-sizing:border-box}.ws-native-media .ws-image-dialog img{display:block;flex:none;max-width:none;max-height:none;border-radius:2px;user-select:none;object-fit:contain}
|
|
12418
|
-
@media(max-width:600px){.ws-native-media .ws-image-dialog{inset:calc(var(--ws-preview-top) + 12px) 12px 12px;width:calc(100vw - 24px);height:min(760px,calc(100dvh - var(--ws-preview-top) - 24px));border-radius:10px}.ws-image-toolbar{gap:6px;padding:8px}.ws-image-toolbar>strong{font-size:12px}.ws-image-tools{gap:1px}.ws-image-tools .ws-image-fit{min-width:60px;margin-inline:1px}.ws-image-tools .ws-image-close{margin-left:1px}.ws-image-scale{min-width:32px}}
|
|
12522
|
+
@media(max-width:600px){.ws-native-media .ws-image-dialog{inset:calc(var(--ws-preview-top) + 12px) 12px 12px;width:calc(100vw - 24px);height:min(760px,calc(100dvh - var(--ws-preview-top) - 24px));border-radius:10px}.ws-image-toolbar{gap:6px;padding:8px}.ws-image-toolbar>strong{font-size:12px}.ws-image-tools{gap:1px}.ws-image-tools .ws-image-fit{min-width:60px;margin-inline:1px}.ws-image-tools .ws-image-close{margin-left:1px}.ws-image-tools .ws-image-scale{min-width:32px}}
|
|
12419
12523
|
.ws-page .ws-bubble.ws-voice-bubble,.ws-bubble:has(>.ws-native-media:only-child .ws-voice-message){padding:0;border:0;background:transparent}
|
|
12420
12524
|
.ws-voice-message{max-width:100%}.ws-native-media .ws-voice-message audio{display:none}
|
|
12421
12525
|
.ws-page .ws-voice-button{display:flex;align-items:center;justify-content:space-between;gap:20px;max-width:100%;min-width:100px;min-height:42px;padding:8px 12px;border:1px solid var(--ws-line);border-radius:6px;background:color-mix(in srgb,var(--ws-ink) 7%,var(--ws-bg));color:var(--ws-ink);cursor:pointer;font-size:15px;line-height:24px}
|
|
@@ -12431,11 +12535,24 @@ var mediaStyles = `
|
|
|
12431
12535
|
// src/styles.ts
|
|
12432
12536
|
var styles = `
|
|
12433
12537
|
.ws-page{--ws-line:var(--dsw-alias-border-l3);--ws-ink:var(--dsw-alias-label-primary);--ws-muted:var(--dsw-alias-label-tertiary);--ws-bg:var(--dsw-alias-bg-base);--ws-soft:var(--dsw-alias-bg-layer-1);--ws-hover:var(--dsw-alias-interactive-bg-hover);--ws-accent:var(--dsw-alias-brand-primary);display:flex;flex-direction:column;position:relative;height:100%;min-height:0;min-width:0;overflow:hidden;color:var(--ws-ink);background:var(--ws-bg);font-family:inherit;font-size:13px;line-height:1.6;container-type:inline-size}
|
|
12434
|
-
.ws-page *{box-sizing:border-box}.ws-page button,.ws-page input,.ws-page textarea,.ws-dialog button{font:inherit}.ws-page h1,.ws-page h2,.ws-page h3,.ws-page p,.ws-page dl,.ws-page dd,.ws-dialog h2,.ws-dialog p{margin:0}.ws-page button,.ws-dialog button{cursor:pointer;color:inherit}.ws-page button:disabled{cursor:not-allowed;opacity:.42}.ws-page button:focus-visible,.ws-page input:focus-visible,.ws-page textarea:focus-visible,.ws-dialog button:focus-visible{outline:2px solid var(--ws-accent,var(--dsw-alias-brand-primary));outline-offset:3px}.ws-page svg,.ws-dialog svg{flex-shrink:0}.ws-page strong,.ws-page h1,.ws-page h2,.ws-page h3,.ws-dialog h2,.ws-dialog strong{font-weight:500}.ws-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:24px 28px 20px;padding-inline-start:max(28px,var(--dsh-frame-leading-clearance,0px));flex-shrink:0;-webkit-app-region:drag}.ws-header button{-webkit-app-region:no-drag}.ws-heading{display:flex;align-items:center;gap:12px}.ws-brand{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;color:var(--ws-accent);background:var(--ws-soft)}.ws-title-line{display:flex;align-items:center;gap:10px}.ws-title-line h1{font-size:20px;line-height:1.4}.ws-heading p{color:var(--ws-muted);font-size:12px;margin-top:3px}.ws-demo-label,.ws-example-badge{display:inline-flex;align-items:center;font-size:10px;line-height:18px;border:1px solid var(--ws-line);padding:0 6px;border-radius:4px;color:var(--ws-muted);white-space:nowrap}.ws-header-actions{display:flex;align-items:center;gap:14px}.ws-knowledge{display:flex;align-items:center;gap:6px;border:0;background:none;font-size:11px;color:var(--ws-muted)!important;white-space:nowrap}.ws-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:32px;padding:6px 11px;background:transparent;border:1px solid var(--ws-line);border-radius:7px;white-space:nowrap;font-size:12px!important}.ws-button:hover:not(:disabled){background:var(--ws-hover)}.ws-button.ws-primary{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);border-color:transparent}.ws-button.ws-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}.ws-icon-button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:30px;height:30px;background:transparent;border:0;border-radius:6px}.ws-icon-button:hover{background:var(--ws-hover,var(--dsw-alias-interactive-bg-hover))}.ws-demo-note{display:flex;align-items:center;gap:8px;flex-shrink:0;padding:8px 28px;color:var(--ws-muted);background:var(--ws-soft);border-block:1px solid var(--ws-line);font-size:11px}.ws-dot{display:inline-block;width:5px;height:5px;border-radius:50%;background:currentColor;flex-shrink:0;opacity:.65}.ws-demo-note button{background:none;border:0;color:var(--ws-muted);white-space:nowrap;margin-left:auto;padding:0 0 0 12px;font-size:11px}.ws-demo-note button:hover{color:var(--ws-ink)}.ws-body{position:relative;display:grid;grid-template-columns:244px minmax(0,1fr) 264px;flex:1;min-height:0;overflow:hidden}.ws-contacts{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--ws-line)}.ws-contacts-head{padding:22px 16px 14px}.ws-section-title{display:flex;align-items:center;gap:7px;margin-bottom:13px}.ws-section-title h2{font-size:13px}.ws-section-title>span{font-size:10px;color:var(--ws-muted);background:var(--ws-soft);padding:0 5px;border-radius:4px}.ws-section-title .ws-icon-button{margin-left:auto;width:24px;height:24px}.ws-search{display:flex;gap:7px;align-items:center;padding:7px 9px;border:1px solid var(--ws-line);border-radius:7px;color:var(--ws-muted);background:var(--ws-soft)}.ws-search:focus-within{border-color:var(--ws-accent)}.ws-search input{min-width:0;width:100%;border:0;background:none;color:var(--ws-ink);font-size:11px;line-height:20px;outline:none!important}.ws-search input::placeholder{color:var(--ws-muted)}.ws-filters{display:flex;gap:4px;margin-top:12px}.ws-filters button{display:flex;gap:5px;align-items:center;justify-content:center;flex:1;border:0;border-radius:6px;padding:5px 2px;background:none;color:var(--ws-muted);font-size:11px}.ws-filters button[aria-pressed=true]{background:var(--ws-soft);color:var(--ws-ink);font-weight:500}.ws-filters span{font-size:10px;font-variant-numeric:tabular-nums;opacity:.7}.ws-contact-list{overflow:auto;flex:1;padding:0 8px}.ws-contact{display:flex;align-items:center;gap:10px;width:100%;padding:14px 10px;border:0;border-radius:8px;margin-bottom:3px;background:none;text-align:left}.ws-contact:hover{background:var(--ws-hover)}.ws-contact.is-selected{background:var(--dsw-alias-interactive-bg-active)}.ws-avatar{display:grid;place-items:center;width:38px;height:38px;flex-shrink:0;border-radius:11px;background:var(--ws-soft);color:var(--dsw-alias-label-secondary);font-size:15px}.ws-contact.is-selected .ws-avatar{background:var(--ws-bg);color:var(--ws-accent)}.ws-contact-content{min-width:0;flex:1;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:22px 18px;column-gap:8px;row-gap:3px}.ws-contact-line{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:6px;line-height:20px}.ws-contact-line strong{font-size:13px}.ws-contact-line time{font-size:10px;color:var(--ws-muted);font-variant-numeric:tabular-nums;white-space:nowrap}.ws-preview{grid-column:1;grid-row:2;display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:18px;margin:0}.ws-sync{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-top:1px solid var(--ws-line);color:var(--ws-muted);font-size:10px}.ws-sync>span{display:flex;align-items:center;gap:5px}.ws-text-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:none;border:0;padding:3px 0;color:var(--ws-muted)!important;font-size:11px!important}.ws-text-button:hover:not(:disabled){color:var(--ws-ink)!important}.ws-empty{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--ws-muted);padding:48px 10px;text-align:center;font-size:12px}.ws-conversation{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:auto}.ws-conversation-head{display:flex;align-items:center;gap:10px;padding:19px 24px;border-bottom:1px solid var(--ws-line);min-height:83px}.ws-person-title{min-width:0}.ws-person-title h2{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:16px}.ws-person-title h2>span{font-size:10px;color:var(--ws-muted);font-weight:400}.ws-person-title p{display:flex;gap:5px;align-items:center;color:var(--ws-muted);font-size:10px;margin-top:2px}.ws-separator{opacity:.5;margin:0 3px}.ws-conversation-actions{display:flex;align-items:center;gap:5px;margin-left:auto}.ws-handle{font-size:11px!important;min-height:28px;padding:4px 8px}.ws-messages{flex:1;min-height:100px;overflow:auto;padding:20px 24px 16px;scrollbar-gutter:stable}.ws-date{display:flex;align-items:center;justify-content:center;margin:0 0 24px;color:var(--ws-muted);font-size:10px}.ws-date span{background:var(--ws-soft);border-radius:5px;padding:1px 10px}.ws-message{display:flex;align-items:flex-start;gap:9px;margin-bottom:22px}.ws-message-avatar{width:30px;height:30px;border-radius:9px;font-size:12px}.ws-message-content{min-width:0;max-width:82%}.ws-message-meta{display:flex;gap:8px;align-items:center;margin-bottom:5px;color:var(--ws-muted);font-size:10px;line-height:14px}.ws-message-meta time{font-variant-numeric:tabular-nums}.ws-bubble{padding:10px 13px;border-radius:2px 10px 10px 10px;background:var(--ws-soft);font-size:12px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}.ws-out{flex-direction:row-reverse}.ws-out .ws-message-meta{justify-content:flex-end}.ws-out .ws-bubble{background:var(--dsw-alias-interactive-bg-active);border-radius:10px 2px 10px 10px}.ws-out .ws-message-avatar{color:var(--ws-accent)}.ws-replies{flex-shrink:0;border-top:1px solid var(--ws-line);padding:15px 24px 0}.ws-reply-heading,.ws-reply-heading>div{display:flex;align-items:center;gap:7px}.ws-reply-heading{justify-content:space-between}.ws-reply-heading h3{font-size:12px}.ws-reply-heading>div>svg{color:var(--ws-accent)}.ws-candidates{display:flex;flex-wrap:wrap;gap:6px;margin:11px 0 10px}.ws-candidates button{border:1px solid var(--ws-line);border-radius:5px;background:none;padding:3px 9px;color:var(--ws-muted);font-size:11px}.ws-candidates button[aria-pressed=true]{color:var(--ws-accent);border-color:var(--ws-accent);background:var(--ws-soft)}.ws-editor{display:block;padding:10px 12px;background:var(--ws-soft);border:1px solid var(--ws-line);border-radius:8px}.ws-editor:focus-within{border-color:var(--ws-accent)}.ws-editor textarea{display:block;width:100%;height:82px;min-height:56px;resize:vertical;max-height:180px;border:0;background:none;color:var(--ws-ink);font-size:12px;line-height:1.9;outline:none!important}.ws-editor-footer{display:flex;align-items:center;gap:8px;margin-top:10px;flex-wrap:wrap}.ws-draft-note{display:flex;align-items:center;gap:5px;font-size:10px;color:var(--ws-muted)}.ws-char-count{margin-left:auto;color:var(--ws-muted);font-size:10px;white-space:nowrap}.ws-notice{font-size:10px;line-height:21px;min-height:24px;color:var(--ws-accent)}.ws-profile{display:flex;flex-direction:column;min-height:0;overflow:auto;border-left:1px solid var(--ws-line);background:var(--ws-bg)}.ws-profile-head{display:flex;align-items:center;justify-content:space-between;padding:22px 20px 0}.ws-profile-head h2{font-size:12px}.ws-profile-person{display:flex;flex-direction:column;align-items:center;padding:23px 20px 25px}.ws-profile-avatar{width:54px;height:54px;border-radius:16px;font-size:22px}.ws-profile-person h3{font-size:17px;margin-top:10px}.ws-profile-person>p{font-size:11px;color:var(--ws-muted);margin-top:2px}.ws-tags{display:flex;justify-content:center;flex-wrap:wrap;gap:5px;margin-top:14px}.ws-tags>span{font-size:10px;color:var(--ws-muted);background:var(--ws-soft);padding:2px 7px;border-radius:4px}.ws-profile-section{margin:0 20px;padding:18px 0;border-top:1px solid var(--ws-line)}.ws-profile-section>h3{font-size:11px;margin-bottom:13px}.ws-product{display:flex;align-items:center;gap:10px;padding:11px;background:var(--ws-soft);border-radius:7px}.ws-product>svg{color:var(--ws-accent)}.ws-product strong{font-size:11px}.ws-product p{color:var(--ws-muted);font-size:9px;margin-top:2px}.ws-budget{display:flex;align-items:center;justify-content:space-between;font-size:10px;margin-top:12px;gap:8px}.ws-budget>span{color:var(--ws-muted)}.ws-budget strong{font-size:11px}.ws-profile dl{display:flex;flex-direction:column;gap:15px}.ws-profile dt{color:var(--ws-muted);font-size:10px;margin-bottom:3px}.ws-profile dd{font-size:11px;line-height:1.8}.ws-profile-caption{margin-top:auto;display:flex;align-items:flex-start;gap:6px;color:var(--ws-muted);font-size:9px;padding:15px 20px}.ws-profile-toggle,.ws-profile-close,.ws-mobile-back{display:none}.ws-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
|
|
12538
|
+
.ws-page *{box-sizing:border-box}.ws-page button,.ws-page input,.ws-page textarea,.ws-dialog button{font:inherit}.ws-page h1,.ws-page h2,.ws-page h3,.ws-page p,.ws-page dl,.ws-page dd,.ws-dialog h2,.ws-dialog p{margin:0}.ws-page button,.ws-dialog button{cursor:pointer;color:inherit}.ws-page button:disabled{cursor:not-allowed;opacity:.42}.ws-page button:focus-visible,.ws-page input:focus-visible,.ws-page textarea:focus-visible,.ws-dialog button:focus-visible{outline:2px solid var(--ws-accent,var(--dsw-alias-brand-primary));outline-offset:3px}.ws-page svg,.ws-dialog svg{flex-shrink:0}.ws-page strong,.ws-page h1,.ws-page h2,.ws-page h3,.ws-dialog h2,.ws-dialog strong{font-weight:500}.ws-header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:24px 28px 20px;padding-inline-start:max(28px,var(--dsh-frame-leading-clearance,0px));flex-shrink:0;-webkit-app-region:drag}.ws-header button{-webkit-app-region:no-drag}.ws-heading{display:flex;align-items:center;gap:12px}.ws-brand{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;color:var(--ws-accent);background:var(--ws-soft)}.ws-title-line{display:flex;align-items:center;gap:10px}.ws-title-line h1{font-size:20px;line-height:1.4}.ws-heading p{color:var(--ws-muted);font-size:12px;margin-top:3px}.ws-demo-label,.ws-example-badge{display:inline-flex;align-items:center;font-size:10px;line-height:18px;border:1px solid var(--ws-line);padding:0 6px;border-radius:4px;color:var(--ws-muted);white-space:nowrap}.ws-header-actions{display:flex;align-items:center;gap:14px}.ws-knowledge{display:flex;align-items:center;gap:6px;border:0;background:none;font-size:11px;color:var(--ws-muted)!important;white-space:nowrap}.ws-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:32px;padding:6px 11px;background:transparent;border:1px solid var(--ws-line);border-radius:7px;white-space:nowrap;font-size:12px!important}.ws-button:hover:not(:disabled){background:var(--ws-hover)}.ws-button.ws-primary{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground);border-color:transparent}.ws-button.ws-primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}.ws-icon-button{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:30px;height:30px;background:transparent;border:0;border-radius:6px}.ws-icon-button:hover{background:var(--ws-hover,var(--dsw-alias-interactive-bg-hover))}.ws-demo-note{display:flex;align-items:center;gap:8px;flex-shrink:0;padding:8px 28px;color:var(--ws-muted);background:var(--ws-soft);border-block:1px solid var(--ws-line);font-size:11px}.ws-dot{display:inline-block;width:5px;height:5px;border-radius:50%;background:currentColor;flex-shrink:0;opacity:.65}.ws-demo-note button{background:none;border:0;color:var(--ws-muted);white-space:nowrap;margin-left:auto;padding:0 0 0 12px;font-size:11px}.ws-demo-note button:hover{color:var(--ws-ink)}.ws-body{--ws-contacts-width:244px;position:relative;display:grid;grid-template-columns:var(--ws-contacts-width) minmax(0,1fr) 264px;flex:1;min-height:0;overflow:hidden}.ws-contacts{display:flex;flex-direction:column;min-height:0;border-right:1px solid var(--ws-line)}.ws-contacts-head{padding:18px 16px 10px}.ws-search{display:flex;gap:7px;align-items:center;padding:6px 9px;border:1px solid transparent;border-radius:6px;color:var(--ws-muted);background:var(--ws-soft)}.ws-search:focus-within{border-color:var(--ws-accent)}.ws-search input{min-width:0;width:100%;border:0;background:none;color:var(--ws-ink);font-size:11px;line-height:20px;outline:none!important}.ws-search input::placeholder{color:var(--ws-muted)}
|
|
12539
|
+
.ws-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin-top:6px;border-bottom:1px solid var(--ws-line)}
|
|
12540
|
+
.ws-filters button{position:relative;display:flex;flex-wrap:wrap;gap:0 4px;align-content:center;align-items:center;justify-content:center;min-width:0;min-height:36px;border:0;padding:4px 2px;background:none;color:var(--ws-muted);font-size:11px}
|
|
12541
|
+
.ws-filters button[aria-pressed=true]{color:var(--ws-ink);font-weight:600}
|
|
12542
|
+
.ws-filters button[aria-pressed=true]::after{content:"";position:absolute;inset-inline:10px;bottom:-1px;height:2px;border-radius:2px 2px 0 0;background:currentColor}
|
|
12543
|
+
.ws-filters span{font-size:10px;font-weight:400;font-variant-numeric:tabular-nums}
|
|
12544
|
+
@media(forced-colors:active){.ws-filters button[aria-pressed=true]::after{background:CanvasText}}
|
|
12545
|
+
.ws-contact-list{overflow:auto;flex:1;padding:0 8px}.ws-contact{display:flex;align-items:center;gap:10px;width:100%;padding:14px 10px;border:0;border-radius:8px;margin-bottom:3px;background:none;text-align:left}.ws-contact:hover{background:var(--ws-hover)}.ws-contact.is-selected{background:var(--dsw-alias-interactive-bg-active)}.ws-avatar{display:grid;place-items:center;width:38px;height:38px;flex-shrink:0;border-radius:11px;background:var(--ws-soft);color:var(--dsw-alias-label-secondary);font-size:15px}.ws-contact.is-selected .ws-avatar{background:var(--ws-bg);color:var(--ws-accent)}.ws-contact-content{min-width:0;flex:1;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:22px 18px;column-gap:8px;row-gap:3px}.ws-contact-line{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:6px;line-height:20px}.ws-contact-line strong{font-size:13px}.ws-contact-line time{font-size:10px;color:var(--ws-muted);font-variant-numeric:tabular-nums;white-space:nowrap}.ws-preview{grid-column:1;grid-row:2;display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;color:var(--dsw-alias-label-secondary);font-size:11px;line-height:18px;margin:0}.ws-sync{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-top:1px solid var(--ws-line);color:var(--ws-muted);font-size:10px}.ws-sync>span{display:flex;align-items:center;gap:5px}.ws-text-button{display:inline-flex;align-items:center;justify-content:center;gap:6px;background:none;border:0;padding:3px 0;color:var(--ws-muted)!important;font-size:11px!important}.ws-text-button:hover:not(:disabled){color:var(--ws-ink)!important}.ws-empty{display:flex;flex-direction:column;align-items:center;gap:10px;color:var(--ws-muted);padding:48px 10px;text-align:center;font-size:12px}.ws-conversation{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:auto}.ws-conversation-head{display:flex;align-items:center;gap:10px;padding:19px 24px;border-bottom:1px solid var(--ws-line);min-height:83px}.ws-person-title{flex:1;min-width:0}.ws-person-title h2{display:flex;align-items:center;flex-wrap:wrap;gap:10px;font-size:16px}.ws-person-title h2>span{font-size:10px;color:var(--ws-muted);font-weight:400}
|
|
12546
|
+
.ws-person-meta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;margin-top:2px;color:var(--ws-muted);font-size:10px}
|
|
12547
|
+
.ws-person-source{display:inline-flex;flex-wrap:wrap;align-items:center;gap:5px;min-width:0}
|
|
12548
|
+
.ws-separator{opacity:.5;margin:0 3px}.ws-conversation-actions{display:flex;align-items:center;gap:5px;margin-left:auto}.ws-handle{font-size:11px!important;min-height:28px;padding:4px 8px}.ws-messages{flex:1;min-height:100px;overflow:auto;padding:20px 24px 16px;scrollbar-gutter:stable}.ws-date{display:flex;align-items:center;justify-content:center;margin:0 0 24px;color:var(--ws-muted);font-size:10px}.ws-date span{background:var(--ws-soft);border-radius:5px;padding:1px 10px}.ws-message{display:flex;align-items:flex-start;gap:9px;margin-bottom:22px}.ws-message-avatar{width:30px;height:30px;border-radius:9px;font-size:12px}.ws-message-content{min-width:0;max-width:82%}.ws-message-meta{display:flex;gap:8px;align-items:center;margin-bottom:5px;color:var(--ws-muted);font-size:10px;line-height:14px}.ws-message-meta time{font-variant-numeric:tabular-nums}.ws-bubble{padding:10px 13px;border-radius:2px 10px 10px 10px;background:var(--ws-soft);font-size:12px;line-height:1.9;white-space:pre-wrap;overflow-wrap:anywhere}.ws-out{flex-direction:row-reverse}.ws-out .ws-message-meta{justify-content:flex-end}.ws-out .ws-bubble{background:var(--dsw-alias-interactive-bg-active);border-radius:10px 2px 10px 10px}.ws-out .ws-message-avatar{color:var(--ws-accent)}.ws-replies{flex-shrink:0;border-top:1px solid var(--ws-line);padding:15px 24px 0}.ws-reply-heading,.ws-reply-heading>div{display:flex;align-items:center;gap:7px}.ws-reply-heading{justify-content:space-between}.ws-reply-heading h3{font-size:12px}.ws-reply-heading>div>svg{color:var(--ws-accent)}.ws-candidates{display:flex;flex-wrap:wrap;gap:6px;margin:11px 0 10px}.ws-candidates button{border:1px solid var(--ws-line);border-radius:5px;background:none;padding:3px 9px;color:var(--ws-muted);font-size:11px}.ws-candidates button[aria-pressed=true]{color:var(--ws-accent);border-color:var(--ws-accent);background:var(--ws-soft)}.ws-editor{display:block;padding:10px 12px;background:var(--ws-soft);border:1px solid var(--ws-line);border-radius:8px}.ws-editor:focus-within{border-color:var(--ws-accent)}.ws-editor textarea{display:block;width:100%;height:82px;min-height:56px;resize:vertical;max-height:180px;border:0;background:none;color:var(--ws-ink);font-size:12px;line-height:1.9;outline:none!important}.ws-editor-footer{display:flex;align-items:center;gap:8px;margin-top:10px;flex-wrap:wrap}.ws-draft-note{display:flex;align-items:center;gap:5px;font-size:10px;color:var(--ws-muted)}.ws-char-count{margin-left:auto;color:var(--ws-muted);font-size:10px;white-space:nowrap}.ws-notice{font-size:10px;line-height:21px;min-height:24px;color:var(--ws-accent)}.ws-profile{display:flex;flex-direction:column;min-height:0;overflow:auto;border-left:1px solid var(--ws-line);background:var(--ws-bg)}.ws-profile-head{display:flex;align-items:center;justify-content:space-between;padding:22px 20px 0}.ws-profile-head h2{font-size:12px}.ws-profile-person{display:flex;flex-direction:column;align-items:center;padding:23px 20px 25px}.ws-profile-avatar{width:54px;height:54px;border-radius:16px;font-size:22px}.ws-profile-person h3{font-size:17px;margin-top:10px}.ws-profile-person>p{font-size:11px;color:var(--ws-muted);margin-top:2px}.ws-tags{display:flex;justify-content:center;flex-wrap:wrap;gap:5px;margin-top:14px}.ws-tags>span{font-size:10px;color:var(--ws-muted);background:var(--ws-soft);padding:2px 7px;border-radius:4px}.ws-profile-section{margin:0 20px;padding:18px 0;border-top:1px solid var(--ws-line)}.ws-profile-section>h3{font-size:11px;margin-bottom:13px}.ws-product{display:flex;align-items:center;gap:10px;padding:11px;background:var(--ws-soft);border-radius:7px}.ws-product>svg{color:var(--ws-accent)}.ws-product strong{font-size:11px}.ws-product p{color:var(--ws-muted);font-size:9px;margin-top:2px}.ws-budget{display:flex;align-items:center;justify-content:space-between;font-size:10px;margin-top:12px;gap:8px}.ws-budget>span{color:var(--ws-muted)}.ws-budget strong{font-size:11px}.ws-profile dl{display:flex;flex-direction:column;gap:15px}.ws-profile dt{color:var(--ws-muted);font-size:10px;margin-bottom:3px}.ws-profile dd{font-size:11px;line-height:1.8}.ws-profile-caption{margin-top:auto;display:flex;align-items:flex-start;gap:6px;color:var(--ws-muted);font-size:9px;padding:15px 20px}.ws-profile-toggle,.ws-mobile-back{display:none}
|
|
12549
|
+
.ws-body[data-profile=closed]{grid-template-columns:var(--ws-contacts-width) minmax(0,1fr)}
|
|
12550
|
+
.ws-body[data-profile=closed]>.ws-profile{display:none}
|
|
12551
|
+
.ws-body[data-profile=closed] .ws-profile-toggle{display:inline-flex}.ws-sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
|
|
12435
12552
|
.ws-dialog{--ws-accent:var(--dsw-alias-brand-primary);width:min(500px,calc(100vw - 32px));padding:24px;border:1px solid var(--dsw-alias-border-l3);border-radius:14px;background:var(--dsw-alias-bg-base);color:var(--dsw-alias-label-primary);font-family:inherit;font-size:13px;line-height:1.7}.ws-dialog::backdrop{background:var(--dsw-alias-bg-module-platform);opacity:.7}.ws-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.ws-dialog-head h2{font-size:17px}.ws-dialog-note{margin:12px 0 20px!important;color:var(--dsw-alias-label-tertiary);font-size:12px}.ws-connection{display:flex;align-items:center;gap:13px;padding:17px 0;border-top:1px solid var(--dsw-alias-border-l3)}.ws-connection>svg{color:var(--dsw-alias-label-tertiary)}.ws-connection>div{flex:1;min-width:0}.ws-connection strong{font-size:12px}.ws-connection p{font-size:11px;color:var(--dsw-alias-label-tertiary);margin-top:2px}.ws-state{font-size:10px;color:var(--dsw-alias-label-tertiary);white-space:nowrap}.ws-dialog-foot{display:flex;justify-content:flex-end;padding-top:16px}.ws-dialog .ws-button{border-color:var(--dsw-alias-border-l3)}
|
|
12436
|
-
@container(max-width:1050px){.ws-body{grid-template-columns:
|
|
12437
|
-
@container(max-width:700px){.ws-body{
|
|
12438
|
-
@container(max-width:530px){.ws-body{display:flex}.ws-contacts{width:100%;border:0}.ws-conversation{display:none;width:100%}.ws-body[data-show-chat=true]>.ws-contacts{display:none}.ws-body[data-show-chat=true]>.ws-conversation{display:flex}.ws-mobile-back{display:flex}.ws-brand{display:none}.ws-header{padding:15px 16px;padding-inline-start:max(16px,var(--dsh-frame-leading-clearance,0px))}.ws-header-actions .ws-button{font-size:10px!important;padding:4px 7px}.ws-demo-note{align-items:flex-start}.ws-demo-note>.ws-dot{margin-top:6px}.ws-contact{padding:14px 12px}.ws-conversation-head{min-height:76px;padding:13px 12px;gap:7px}.ws-person-title h2{font-size:15px}.ws-person-title h2>span{display:none}.ws-editor textarea{height:96px}.ws-bubble{font-size:12px}.ws-message-content{max-width:85%}.ws-connection{align-items:flex-start}.ws-connection>svg{margin-top:3px}}
|
|
12553
|
+
@container(max-width:1050px){.ws-body{--ws-contacts-width:230px;grid-template-columns:var(--ws-contacts-width) minmax(0,1fr)}.ws-profile{display:none}.ws-profile-toggle{display:inline-flex}.ws-body[data-profile=open] .ws-profile-toggle{display:none}.ws-body[data-profile=open]>.ws-profile{display:flex;position:absolute;inset:0 0 0 auto;width:min(272px,100%);z-index:5}.ws-header{padding:20px 22px;padding-inline-start:max(22px,var(--dsh-frame-leading-clearance,0px))}.ws-demo-note{padding-inline:22px}.ws-knowledge{font-size:10px}.ws-header-actions{gap:8px}}
|
|
12554
|
+
@container(max-width:700px){.ws-body{--ws-contacts-width:210px}.ws-profile-toggle{width:30px;height:30px;padding:0;border-color:transparent}.ws-profile-toggle>span{display:none}.ws-header{padding:17px 18px;padding-inline-start:max(18px,var(--dsh-frame-leading-clearance,0px))}.ws-heading p{display:none}.ws-title-line h1{font-size:18px}.ws-header-actions .ws-knowledge{display:none}.ws-demo-note{padding:8px 18px;font-size:10px}.ws-demo-note button{display:none}.ws-conversation-head{padding:16px}.ws-messages{padding:18px 16px}.ws-replies{padding:13px 16px 0}.ws-handle{font-size:0!important;gap:0;padding:4px 7px}.ws-handle svg{width:15px}.ws-draft-note{font-size:9px}.ws-char-count{display:none}}
|
|
12555
|
+
@container(max-width:530px){.ws-body{display:flex}.ws-contacts{width:100%;border:0}.ws-conversation{display:none;width:100%}.ws-body[data-show-chat=true]>.ws-contacts{display:none}.ws-body[data-show-chat=true]>.ws-conversation{display:flex}.ws-body[data-show-chat=false][data-profile=open]>.ws-profile{display:none}.ws-mobile-back{display:flex}.ws-brand{display:none}.ws-header{padding:15px 16px;padding-inline-start:max(16px,var(--dsh-frame-leading-clearance,0px))}.ws-header-actions .ws-button{font-size:10px!important;padding:4px 7px}.ws-demo-note{align-items:flex-start}.ws-demo-note>.ws-dot{margin-top:6px}.ws-contact{padding:14px 12px}.ws-conversation-head{min-height:76px;padding:13px 12px;gap:7px}.ws-person-title h2{font-size:15px}.ws-person-title h2>span{display:none}.ws-editor textarea{height:96px}.ws-bubble{font-size:12px}.ws-message-content{max-width:85%}.ws-connection{align-items:flex-start}.ws-connection>svg{margin-top:3px}}
|
|
12439
12556
|
@media(prefers-reduced-motion:reduce){.ws-page *{scroll-behavior:auto!important}}
|
|
12440
12557
|
|
|
12441
12558
|
.ws-workspace,.ws-latest{display:flex;gap:8px;flex-direction:column;font-size:12px;color:var(--ws-muted);margin:8px 0}
|
|
@@ -12512,7 +12629,7 @@ function SalesIcon({ size = 18 }) {
|
|
|
12512
12629
|
return /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "chat", size });
|
|
12513
12630
|
}
|
|
12514
12631
|
var EMPTY_CONTACT = { id: "", name: "", initials: "", segment: "", time: "", preview: "", status: "pending", unread: 0, product: "", budget: "", moneyAmounts: [], tags: [], facts: [], messages: [], candidates: [] };
|
|
12515
|
-
function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConversation, refreshWorkspaces,
|
|
12632
|
+
function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConversation, refreshWorkspaces, wechat, useWechat, setMode, bindWechat, useUpdate, updater, updateFormDirty, runDelivery }) {
|
|
12516
12633
|
const update = useUpdate?.((s) => s);
|
|
12517
12634
|
const frozen = update?.preparing ?? false;
|
|
12518
12635
|
const state = useSales((snapshot) => snapshot);
|
|
@@ -12530,7 +12647,14 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
12530
12647
|
const [sort, setSort] = (0, import_react11.useState)("recent");
|
|
12531
12648
|
const [filter, setFilter] = (0, import_react11.useState)("all");
|
|
12532
12649
|
const [showChat, setShowChat] = (0, import_react11.useState)(false);
|
|
12533
|
-
const [
|
|
12650
|
+
const [profileVisibility, setProfileVisibility] = (0, import_react11.useState)("default");
|
|
12651
|
+
const profileId = (0, import_react11.useId)();
|
|
12652
|
+
const openProfileButton = (0, import_react11.useRef)(null);
|
|
12653
|
+
const closeProfileButton = (0, import_react11.useRef)(null);
|
|
12654
|
+
(0, import_react11.useEffect)(() => {
|
|
12655
|
+
if (profileVisibility === "open") closeProfileButton.current?.focus({ preventScroll: true });
|
|
12656
|
+
if (profileVisibility === "closed") openProfileButton.current?.focus({ preventScroll: true });
|
|
12657
|
+
}, [profileVisibility]);
|
|
12534
12658
|
const [notice, setNotice] = (0, import_react11.useState)("");
|
|
12535
12659
|
const [copyResult, setCopyResult] = (0, import_react11.useState)(null);
|
|
12536
12660
|
const contact = state.contacts.find((c) => c.id === state.selectedId) ?? state.contacts[0] ?? EMPTY_CONTACT;
|
|
@@ -12693,13 +12817,13 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
12693
12817
|
const syncProgress = presentation.blocked || view.status?.phase === "authorizing" ? void 0 : view.status?.progress;
|
|
12694
12818
|
const syncPercent = wechatProgressPercent({ progress: syncProgress });
|
|
12695
12819
|
const syncLabel = view.error ? "wxProgressUnavailable" : view.status?.phase === "error" ? "wxProgressFailed" : view.status?.phase === "paused" ? "wxPaused" : syncActive ? "wxIncremental" : "wxRoundComplete";
|
|
12696
|
-
return /* @__PURE__ */ import_react11.default.createElement("section", { className: "ws-page", "aria-label": t("title") }, /* @__PURE__ */ import_react11.default.createElement("style", null, styles + updateStyles), /* @__PURE__ */ import_react11.default.createElement("header", { className: "ws-header" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-heading" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-brand" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "chat", size: 22 })), /* @__PURE__ */ import_react11.default.createElement("div", null, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-title-line" }, /* @__PURE__ */ import_react11.default.createElement("h1", null, t("title")), /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-demo-label" }, t("wxConnected"))), /* @__PURE__ */ import_react11.default.createElement("p", null, t("subtitle")))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-header-actions" },
|
|
12820
|
+
return /* @__PURE__ */ import_react11.default.createElement("section", { className: "ws-page", "aria-label": t("title") }, /* @__PURE__ */ import_react11.default.createElement("style", null, styles + updateStyles), /* @__PURE__ */ import_react11.default.createElement("header", { className: "ws-header" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-heading" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-brand" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "chat", size: 22 })), /* @__PURE__ */ import_react11.default.createElement("div", null, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-title-line" }, /* @__PURE__ */ import_react11.default.createElement("h1", null, t("title")), /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-demo-label" }, t("wxConnected"))), /* @__PURE__ */ import_react11.default.createElement("p", null, t("subtitle")))), updater && update && /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-header-actions" }, /* @__PURE__ */ import_react11.default.createElement(UpdatePanel, { client: updater, view: update, t }))), frozen && /* @__PURE__ */ import_react11.default.createElement("p", { role: "status", className: "ws-update-freeze" }, t("updateFreeze")), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-inline-sync" }, wechat && /* @__PURE__ */ import_react11.default.createElement(SyncPanel, { client: wechat, t, view, workspaceId: selectedWorkspace }), !contact.id && workspaceState.error && /* @__PURE__ */ import_react11.default.createElement("span", { role: "status" }, workspaceState.error)), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-body", "data-empty": !contact.id, "data-show-chat": showChat, "data-profile": profileVisibility }, /* @__PURE__ */ import_react11.default.createElement("aside", { className: "ws-contacts", "aria-label": t("customers") }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-contacts-head" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-intent-sortline" }, /* @__PURE__ */ import_react11.default.createElement("h2", null, t("customers")), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-intent-sort-control" }, /* @__PURE__ */ import_react11.default.createElement("select", { className: "ws-intent-sort", "aria-label": t("intentSort"), value: sort, onChange: (event) => setSort(event.currentTarget.value === "intent" ? "intent" : "recent") }, /* @__PURE__ */ import_react11.default.createElement("option", { value: "recent" }, t("intentSortRecent")), /* @__PURE__ */ import_react11.default.createElement("option", { value: "intent" }, t("intentSortHigh"))), /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "chevron", size: 12 }))), /* @__PURE__ */ import_react11.default.createElement("label", { className: "ws-search" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "search", size: 15 }), /* @__PURE__ */ import_react11.default.createElement("input", { name: "sales-search", autoComplete: "off", "aria-label": t("search"), placeholder: t("search"), value: query, onChange: (e) => setQuery(e.target.value) })), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-filters", role: "group", "aria-label": t("customers") }, ["all", "pending", "handled"].map((value) => /* @__PURE__ */ import_react11.default.createElement("button", { key: value, type: "button", "aria-pressed": filter === value, onClick: () => setFilter(value) }, t(value), /* @__PURE__ */ import_react11.default.createElement("span", null, value === "all" ? state.contacts.length : value === "pending" ? pending : state.contacts.length - pending))))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-contact-list" }, contacts.map((c) => /* @__PURE__ */ import_react11.default.createElement("button", { key: c.id, className: `ws-contact ${c.id === contact.id ? "is-selected" : ""}`, "aria-pressed": c.id === contact.id, onClick: () => select(c.id) }, /* @__PURE__ */ import_react11.default.createElement(WechatAvatar, { client: wechat, scope: JSON.stringify([selectedWorkspace, c.wechat?.accountId]), owner: c.wechat?.chatKey ?? c.id, mediaId: c.wechat?.avatarId, fallback: c.initials }), /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-contact-content" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-contact-line" }, /* @__PURE__ */ import_react11.default.createElement("strong", { title: c.name }, c.name), /* @__PURE__ */ import_react11.default.createElement("time", { dateTime: c.time, title: c.time }, displayTime(c.time))), /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-preview" }, c.wechat && c.preview === "[image]" ? t("wxImageListPreview") : c.preview), c.wechat && /* @__PURE__ */ import_react11.default.createElement(IntentBadge, { intent: c.intent, t })))), !contacts.length && /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-empty" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "search", size: 26 }), /* @__PURE__ */ import_react11.default.createElement("p", null, t(state.contacts.length ? "noResults" : presentation.emptyKey)), state.contacts.length > 0 && /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-text-button", onClick: () => {
|
|
12697
12821
|
setQuery("");
|
|
12698
12822
|
setFilter("all");
|
|
12699
|
-
} }, t("clearSearch")))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-sync" }, state.contacts.length > 0 ? /* @__PURE__ */ import_react11.default.createElement(SyncFooter, { view, t }) : /* @__PURE__ */ import_react11.default.createElement("span", null, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-dot" }), t("wxLocalHistory")))), /* @__PURE__ */ import_react11.default.createElement("main", { className: "ws-conversation" }, !contact.id ? /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-conversation-empty" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "chat", size: 34 }), /* @__PURE__ */ import_react11.default.createElement("h2", null, t("wxRealTitle")), /* @__PURE__ */ import_react11.default.createElement("p", null, syncActive || syncPercent !== void 0 ? /* @__PURE__ */ import_react11.default.createElement(SyncActivity, { active: syncActive, percent: syncPercent }, t(syncActive ? "wxSyncingHint" : syncLabel)) : t(presentation.blocked ? "wxAwaitConnectionHistory" : presentation.hintKey ?? "wxSelectChat")), (syncActive || syncPercent !== void 0) && /* @__PURE__ */ import_react11.default.createElement(SyncProgressTrack, { progress: syncProgress, active: syncActive, t })) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-conversation-head" }, /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-icon-button ws-mobile-back", "aria-label": t("contactsBack"), onClick: () => setShowChat(false) }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "arrow" })), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-person-title" }, /* @__PURE__ */ import_react11.default.createElement("
|
|
12823
|
+
} }, t("clearSearch")))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-sync" }, state.contacts.length > 0 ? /* @__PURE__ */ import_react11.default.createElement(SyncFooter, { view, t }) : /* @__PURE__ */ import_react11.default.createElement("span", null, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-dot" }), t("wxLocalHistory")))), /* @__PURE__ */ import_react11.default.createElement("main", { className: "ws-conversation" }, !contact.id ? /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-conversation-empty" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "chat", size: 34 }), /* @__PURE__ */ import_react11.default.createElement("h2", null, t("wxRealTitle")), /* @__PURE__ */ import_react11.default.createElement("p", null, syncActive || syncPercent !== void 0 ? /* @__PURE__ */ import_react11.default.createElement(SyncActivity, { active: syncActive, percent: syncPercent }, t(syncActive ? "wxSyncingHint" : syncLabel)) : t(presentation.blocked ? "wxAwaitConnectionHistory" : presentation.hintKey ?? "wxSelectChat")), (syncActive || syncPercent !== void 0) && /* @__PURE__ */ import_react11.default.createElement(SyncProgressTrack, { progress: syncProgress, active: syncActive, t })) : /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-conversation-head" }, /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-icon-button ws-mobile-back", "aria-label": t("contactsBack"), onClick: () => setShowChat(false) }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "arrow" })), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-person-title" }, /* @__PURE__ */ import_react11.default.createElement("h2", null, contact.name, !contact.wechat && /* @__PURE__ */ import_react11.default.createElement("span", null, contact.segment)), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-person-meta" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-person-source" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-dot", "aria-hidden": "true" }), t("wechat"), /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-separator", "aria-hidden": "true" }, "/"), contact.wechat ? contact.crm ? t("wxBound") : t("wxUnbound") : t("sampleContact")), contact.wechat && /* @__PURE__ */ import_react11.default.createElement(IntentDetails, { key: contact.id, intent: contact.intent, t }))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-conversation-actions" }, /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-button ws-handle", disabled: frozen || contact.status === "handled", onClick: () => {
|
|
12700
12824
|
dispatch({ type: "handled", id: contact.id });
|
|
12701
12825
|
setNotice(t(contact.wechat ? "wxHandled" : "handledDone"));
|
|
12702
|
-
} }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "check", size: 15 }), contact.status === "handled" ? t("handled") : t("markHandled")), /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-
|
|
12826
|
+
} }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "check", size: 15 }), contact.status === "handled" ? t("handled") : t("markHandled")), /* @__PURE__ */ import_react11.default.createElement("button", { type: "button", className: "ws-button ws-profile-toggle", ref: openProfileButton, "aria-label": t("expand"), "aria-controls": profileId, "aria-expanded": profileVisibility === "open", onClick: () => setProfileVisibility("open") }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "user", size: 15 }), /* @__PURE__ */ import_react11.default.createElement("span", null, t("profile"))))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-history-wrap" }, /* @__PURE__ */ import_react11.default.createElement("div", { ref: reading.viewport, onScroll: reading.onScroll, className: "ws-messages", role: "region", tabIndex: 0, "aria-label": t("conversation") }, /* @__PURE__ */ import_react11.default.createElement("div", { ref: reading.content }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-date" }, /* @__PURE__ */ import_react11.default.createElement("span", null, contact.wechat ? t("wxHistory") : t("today"))), contact.wechat && wechat && view.contactId === contact.id ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, view.hasMore && /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-button ws-earlier", onClick: () => void wechat.messages(contact.id, true).catch((e) => setNotice(e.message)) }, t("wxEarlier")), view.messages.map((m) => /* @__PURE__ */ import_react11.default.createElement("div", { key: m.id, "data-message-id": m.id, className: `ws-message ${m.direction === "outbound" ? "ws-out" : ""}` }, /* @__PURE__ */ import_react11.default.createElement(WechatAvatar, { client: wechat, scope: JSON.stringify([selectedWorkspace, contact.wechat.accountId]), owner: m.direction === "outbound" ? contact.wechat.accountId : contact.wechat.chatKey, mediaId: m.direction === "outbound" ? contact.wechat.selfAvatarId : contact.wechat.avatarId, fallback: m.direction === "outbound" ? t("user") : contact.initials, className: "ws-message-avatar" }), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-message-content" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-message-meta" }, /* @__PURE__ */ import_react11.default.createElement("span", null, m.direction === "inbound" ? contact.name : m.direction === "outbound" ? t("user") : t("wxSystem")), /* @__PURE__ */ import_react11.default.createElement("time", { dateTime: m.sentAt, title: m.sentAt }, displayTime(m.sentAt, true))), /* @__PURE__ */ import_react11.default.createElement("div", { className: `ws-bubble${m.kind === "voice" || m.kind === "audio" ? " ws-voice-bubble" : ""}` }, /* @__PURE__ */ import_react11.default.createElement(WechatMessageBody, { message: m, client: wechat, revision: view.status?.revision, t })))))) : contact.messages.map((message) => /* @__PURE__ */ import_react11.default.createElement("div", { key: message.id, "data-message-id": message.id, className: `ws-message ${message.direction === "out" ? "ws-out" : ""}` }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-avatar ws-message-avatar" }, message.direction === "out" ? t("user") : contact.initials), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-message-content" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-message-meta" }, /* @__PURE__ */ import_react11.default.createElement("span", null, message.direction === "out" ? t("user") : contact.name), /* @__PURE__ */ import_react11.default.createElement("time", null, message.time)), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-bubble" }, message.text)))))), reading.unseen && /* @__PURE__ */ import_react11.default.createElement("button", { type: "button", className: "ws-latest-action", onClick: reading.goToLatest }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-latest-dot", "aria-hidden": "true" }), t("wxNewMessagesLatest"), /* @__PURE__ */ import_react11.default.createElement("svg", { width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": "true" }, /* @__PURE__ */ import_react11.default.createElement("path", { d: "m6 9 6 6 6-6" })))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-replies" }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-reply-heading" }, /* @__PURE__ */ import_react11.default.createElement("div", null, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "spark", size: 16 }), /* @__PURE__ */ import_react11.default.createElement("h3", null, t("reply")), /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-example-badge" }, t(replyView.key))), /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-text-button", disabled: frozen || running || !selectedWorkspace || !replyView.canGenerate, onClick: () => {
|
|
12703
12827
|
setCopyResult(null);
|
|
12704
12828
|
setNotice("");
|
|
12705
12829
|
void generate(selectedWorkspace, contact.id);
|
|
@@ -12714,7 +12838,7 @@ function SalesPage({ t, useSales, useWorkspaces, dispatch, generate, loadConvers
|
|
|
12714
12838
|
setCopyResult(null);
|
|
12715
12839
|
} }), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-editor-footer" }, /* @__PURE__ */ import_react11.default.createElement("span", { className: "ws-char-count" }, draft.length, " ", t("chars")), /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-button ws-primary", disabled: frozen || running || !draft.trim() || generation?.result?.no_send, onClick: () => {
|
|
12716
12840
|
void copy();
|
|
12717
|
-
} }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: copyResult?.id === contact.id && copyResult.success ? "check" : "copy", size: 15 }), copyResult?.id === contact.id && copyResult.success ? t("copied") : t("copy"))), wechatSendingEnabled && contact.wechat && /* @__PURE__ */ import_react11.default.createElement("p", { role: "status", "aria-live": "polite" }, !delivery.available ? t("wxCuaRequired") : delivery.status === "sending" ? t("wxSending") : delivery.status === "awaiting-receipt" ? t("wxAwaitReceipt") : delivery.status === "sent" ? t("wxSent") : ["unknown", "claimed", "stopped", "blocked"].includes(delivery.status) ? t("wxSendStopped") : t("wxManualNote")), state.historyErrors?.[contact.id] && /* @__PURE__ */ import_react11.default.createElement("p", { role: "status" }, state.historyErrors[contact.id]), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-notice", role: "status" }, copyResult?.id === contact.id && !copyResult.success ? t("copyError") : notice)))), contact.id && /* @__PURE__ */ import_react11.default.createElement("aside", { className: "ws-profile", "aria-label": t("profile") }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-head" }, /* @__PURE__ */ import_react11.default.createElement("h2", null, t("profile")), /* @__PURE__ */ import_react11.default.createElement("button", { className: "ws-icon-button ws-profile-close", "aria-label": t("closeProfile"), onClick: () =>
|
|
12841
|
+
} }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: copyResult?.id === contact.id && copyResult.success ? "check" : "copy", size: 15 }), copyResult?.id === contact.id && copyResult.success ? t("copied") : t("copy"))), wechatSendingEnabled && contact.wechat && /* @__PURE__ */ import_react11.default.createElement("p", { role: "status", "aria-live": "polite" }, !delivery.available ? t("wxCuaRequired") : delivery.status === "sending" ? t("wxSending") : delivery.status === "awaiting-receipt" ? t("wxAwaitReceipt") : delivery.status === "sent" ? t("wxSent") : ["unknown", "claimed", "stopped", "blocked"].includes(delivery.status) ? t("wxSendStopped") : t("wxManualNote")), state.historyErrors?.[contact.id] && /* @__PURE__ */ import_react11.default.createElement("p", { role: "status" }, state.historyErrors[contact.id]), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-notice", role: "status" }, copyResult?.id === contact.id && !copyResult.success ? t("copyError") : notice)))), contact.id && /* @__PURE__ */ import_react11.default.createElement("aside", { id: profileId, className: "ws-profile", "aria-label": t("profile") }, /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-head" }, /* @__PURE__ */ import_react11.default.createElement("h2", null, t("profile")), /* @__PURE__ */ import_react11.default.createElement("button", { type: "button", className: "ws-icon-button ws-profile-close", ref: closeProfileButton, "aria-label": t("closeProfile"), title: t("closeProfile"), onClick: () => setProfileVisibility("closed") }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "close", size: 17 }))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-person" }, /* @__PURE__ */ import_react11.default.createElement(WechatAvatar, { client: wechat, scope: JSON.stringify([selectedWorkspace, contact.wechat?.accountId]), owner: contact.wechat?.chatKey ?? contact.id, mediaId: contact.wechat?.avatarId, fallback: contact.initials, className: "ws-profile-avatar" }), /* @__PURE__ */ import_react11.default.createElement("h3", null, contact.name), /* @__PURE__ */ import_react11.default.createElement("p", null, contact.segment), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-tags" }, contact.tags.map((tag) => /* @__PURE__ */ import_react11.default.createElement("span", { key: tag }, tag)))), contact.wechat && bindWechat && /* @__PURE__ */ import_react11.default.createElement(CrmForm, { key: contact.id, contact, t, frozen, dirty: updateFormDirty, bind: (binding) => bindWechat(selectedWorkspace, contact.id, binding) }), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-section" }, /* @__PURE__ */ import_react11.default.createElement("h3", null, t("interest")), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-product" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "chat", size: 18 }), /* @__PURE__ */ import_react11.default.createElement("div", null, /* @__PURE__ */ import_react11.default.createElement("strong", null, contact.product), /* @__PURE__ */ import_react11.default.createElement("p", null, contact.wechat ? t("wxContext") : t("contextHint")))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-budget" }, /* @__PURE__ */ import_react11.default.createElement("span", null, t("budget")), /* @__PURE__ */ import_react11.default.createElement("strong", null, contact.budget))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-section" }, /* @__PURE__ */ import_react11.default.createElement("h3", null, t("facts")), /* @__PURE__ */ import_react11.default.createElement("dl", null, contact.facts.map((fact) => /* @__PURE__ */ import_react11.default.createElement("div", { key: fact.label }, /* @__PURE__ */ import_react11.default.createElement("dt", null, fact.label), /* @__PURE__ */ import_react11.default.createElement("dd", null, fact.value))))), /* @__PURE__ */ import_react11.default.createElement("div", { className: "ws-profile-caption" }, /* @__PURE__ */ import_react11.default.createElement(Glyph, { name: "spark", size: 14 }), /* @__PURE__ */ import_react11.default.createElement("span", null, contact.wechat ? t("wxSources") : t("profileNote"))))));
|
|
12718
12842
|
}
|
|
12719
12843
|
var inject = ["slots", "layout", "locale", "connection", "remote", "remote.session"];
|
|
12720
12844
|
function apply(ctx) {
|
package/dist/host.js
CHANGED
|
@@ -16330,6 +16330,10 @@ function activationPhase(installed, running) {
|
|
|
16330
16330
|
}
|
|
16331
16331
|
|
|
16332
16332
|
// src/update/coordinator.ts
|
|
16333
|
+
var FIRST_CHECK_SPREAD_MS = 5e3;
|
|
16334
|
+
var CHECK_INTERVAL_MS = 3e4;
|
|
16335
|
+
var TICK_INTERVAL_MS = 5e3;
|
|
16336
|
+
var CHECK_RETRY_MS = [3e4, 12e4, 3e5];
|
|
16333
16337
|
var code = (error) => error instanceof Error && /^[a-zA-Z0-9_-]{1,80}$/.test(error.message) ? error.message : "UPDATE_FAILED";
|
|
16334
16338
|
function resultFacts(result) {
|
|
16335
16339
|
const clean2 = (r) => {
|
|
@@ -16349,7 +16353,7 @@ var UpdateCoordinator = class {
|
|
|
16349
16353
|
lifetime = new AbortController();
|
|
16350
16354
|
disposed = false;
|
|
16351
16355
|
invalid = false;
|
|
16352
|
-
nextCheck = Date.now() +
|
|
16356
|
+
nextCheck = Date.now() + Math.floor(Math.random() * FIRST_CHECK_SPREAD_MS);
|
|
16353
16357
|
failures = 0;
|
|
16354
16358
|
constructor(options) {
|
|
16355
16359
|
this.options = options;
|
|
@@ -16434,15 +16438,15 @@ var UpdateCoordinator = class {
|
|
|
16434
16438
|
}
|
|
16435
16439
|
}
|
|
16436
16440
|
start() {
|
|
16437
|
-
void this.initialize().then(() => this.schedule());
|
|
16441
|
+
void this.initialize().then(() => this.schedule(Math.max(0, this.nextCheck - Date.now())));
|
|
16438
16442
|
}
|
|
16439
|
-
schedule() {
|
|
16443
|
+
schedule(delay2 = this.view.phase === "installing" ? 1e3 : TICK_INTERVAL_MS) {
|
|
16440
16444
|
if (this.disposed) return;
|
|
16441
16445
|
this.timer = setTimeout(() => {
|
|
16442
16446
|
void this.tick().catch((e) => {
|
|
16443
16447
|
this.view.error = code(e);
|
|
16444
16448
|
}).finally(() => this.schedule());
|
|
16445
|
-
},
|
|
16449
|
+
}, delay2);
|
|
16446
16450
|
this.timer.unref();
|
|
16447
16451
|
}
|
|
16448
16452
|
async tick() {
|
|
@@ -16459,7 +16463,10 @@ var UpdateCoordinator = class {
|
|
|
16459
16463
|
await this.reconcile();
|
|
16460
16464
|
return;
|
|
16461
16465
|
}
|
|
16462
|
-
if (Date.now() >= this.nextCheck)
|
|
16466
|
+
if (Date.now() >= this.nextCheck) {
|
|
16467
|
+
this.nextCheck = Date.now() + CHECK_INTERVAL_MS;
|
|
16468
|
+
await this.check();
|
|
16469
|
+
}
|
|
16463
16470
|
if (this.view.automatic && this.view.candidate?.automatic && this.view.candidate.version !== this.record.failedTarget && ["available", "waiting-idle"].includes(this.view.phase)) {
|
|
16464
16471
|
if (this.options.clients.idle()) await this.requestInstall(false);
|
|
16465
16472
|
else this.view.phase = "waiting-idle";
|
|
@@ -16500,13 +16507,13 @@ var UpdateCoordinator = class {
|
|
|
16500
16507
|
this.view.phase = this.view.candidate ? "available" : "idle";
|
|
16501
16508
|
this.view.checkedAt = Date.now();
|
|
16502
16509
|
this.record.checkedAt = this.view.checkedAt;
|
|
16503
|
-
this.nextCheck = Date.now() +
|
|
16510
|
+
this.nextCheck = Date.now() + CHECK_INTERVAL_MS;
|
|
16504
16511
|
this.failures = 0;
|
|
16505
16512
|
} catch (error) {
|
|
16506
16513
|
if (!this.disposed) {
|
|
16507
16514
|
this.view.phase = "failed";
|
|
16508
16515
|
this.view.error = code(error);
|
|
16509
|
-
this.nextCheck = Date.now() + [
|
|
16516
|
+
this.nextCheck = Date.now() + CHECK_RETRY_MS[Math.min(this.failures++, CHECK_RETRY_MS.length - 1)];
|
|
16510
16517
|
}
|
|
16511
16518
|
}
|
|
16512
16519
|
})().finally(() => {
|
|
@@ -16791,7 +16798,7 @@ function registerUpdateRoutes(ctx, coordinator, clients) {
|
|
|
16791
16798
|
}
|
|
16792
16799
|
|
|
16793
16800
|
// src/update/version.ts
|
|
16794
|
-
var RUNNING_VERSION = true ? "0.10.
|
|
16801
|
+
var RUNNING_VERSION = true ? "0.10.3" : "0.0.0-dev";
|
|
16795
16802
|
|
|
16796
16803
|
// src/update/integration.ts
|
|
16797
16804
|
function mountUpdates(ctx, storageDir, activity, sync) {
|
|
@@ -17364,7 +17371,7 @@ var LoopbackReceiver = class {
|
|
|
17364
17371
|
while (!this.stopped) {
|
|
17365
17372
|
try {
|
|
17366
17373
|
if (!this.connected) {
|
|
17367
|
-
const result = await this.request("connect", { capabilities: ["wanji.media-patch.v1"] });
|
|
17374
|
+
const result = await this.request("connect", { capabilities: ["wanji.media-patch.v1", "wanji.video-mp4.v1"] });
|
|
17368
17375
|
if (result.success !== true) throw Error("WECHAT_RECEIVER_CONNECT");
|
|
17369
17376
|
this.connected = true;
|
|
17370
17377
|
wait = Math.max(0, Math.min(20, Number(result.pending_wait_seconds) || 0));
|
package/dist/types/agent.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare function buildPrompt(contact: Contact, latest: string, knowledge?
|
|
|
37
37
|
merchant_counterparty: string;
|
|
38
38
|
};
|
|
39
39
|
latest_customer_message: string;
|
|
40
|
+
current_customer_turn: string[];
|
|
40
41
|
sources: Record<string, import("./turn-packet.ts").Evidence>;
|
|
41
42
|
selection_rule: string;
|
|
42
43
|
current_company_facts: {
|
|
@@ -37,6 +37,7 @@ export declare function buildFactReviewPrompt(contact: Contact, latest: string,
|
|
|
37
37
|
merchant_counterparty: string;
|
|
38
38
|
};
|
|
39
39
|
latest_customer_message: string;
|
|
40
|
+
current_customer_turn: string[];
|
|
40
41
|
sources: Record<string, import("./turn-packet.ts").Evidence>;
|
|
41
42
|
selection_rule: string;
|
|
42
43
|
current_company_facts: {
|
|
@@ -188,6 +189,7 @@ export declare function buildConversationReviewPrompt(contact: Contact, latest:
|
|
|
188
189
|
merchant_counterparty: string;
|
|
189
190
|
};
|
|
190
191
|
latest_customer_message: string;
|
|
192
|
+
current_customer_turn: string[];
|
|
191
193
|
sources: Record<string, import("./turn-packet.ts").Evidence>;
|
|
192
194
|
selection_rule: string;
|
|
193
195
|
current_company_facts: {
|
|
@@ -58,6 +58,7 @@ export declare function buildTurnPacket(contact: Contact, latest: string, knowle
|
|
|
58
58
|
merchant_counterparty: string;
|
|
59
59
|
};
|
|
60
60
|
latest_customer_message: string;
|
|
61
|
+
current_customer_turn: string[];
|
|
61
62
|
sources: Record<string, Evidence>;
|
|
62
63
|
selection_rule: string;
|
|
63
64
|
current_company_facts: {
|
|
@@ -15,7 +15,7 @@ export interface TurnPlan {
|
|
|
15
15
|
material_need?: MaterialNeed;
|
|
16
16
|
}
|
|
17
17
|
export declare function buildTurnPlanCorrection(error: unknown): string;
|
|
18
|
-
export declare function parseTurnPlan(text: string, contact: Contact, latest: string, packet?: TurnPacket): TurnPlan;
|
|
18
|
+
export declare function parseTurnPlan(text: string, contact: Contact, latest: string, packet?: TurnPacket, recoverProgress?: boolean): TurnPlan;
|
|
19
19
|
export declare function buildTurnPlanPrompt(contact: Contact, latest: string, contextId?: string, packet?: {
|
|
20
20
|
schemaVersion: "1.0";
|
|
21
21
|
calendar: {
|
|
@@ -33,6 +33,7 @@ export declare function buildTurnPlanPrompt(contact: Contact, latest: string, co
|
|
|
33
33
|
merchant_counterparty: string;
|
|
34
34
|
};
|
|
35
35
|
latest_customer_message: string;
|
|
36
|
+
current_customer_turn: string[];
|
|
36
37
|
sources: Record<string, import("./turn-packet.ts").Evidence>;
|
|
37
38
|
selection_rule: string;
|
|
38
39
|
current_company_facts: {
|
|
@@ -34,8 +34,8 @@ export interface SalesBatchChat {
|
|
|
34
34
|
}
|
|
35
35
|
export interface SalesBatchMedia {
|
|
36
36
|
media_key: string;
|
|
37
|
-
kind: 'image' | 'avatar' | 'voice';
|
|
38
|
-
mime_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'audio/wav';
|
|
37
|
+
kind: 'image' | 'avatar' | 'voice' | 'video';
|
|
38
|
+
mime_type: 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'audio/wav' | 'video/mp4';
|
|
39
39
|
data_base64: string;
|
|
40
40
|
byte_size: number;
|
|
41
41
|
width: number;
|
|
@@ -9,6 +9,7 @@ import { createHash, randomBytes } from "node:crypto";
|
|
|
9
9
|
|
|
10
10
|
// src/wechat/batch.ts
|
|
11
11
|
var SALES_BATCH_SCHEMA = "wanji.wechat.batch.v1";
|
|
12
|
+
var MAX_VIDEO_BYTES = 16 * 1024 * 1024;
|
|
12
13
|
var SALES_MESSAGE_KINDS = [
|
|
13
14
|
"text",
|
|
14
15
|
"image",
|
|
@@ -61,28 +62,30 @@ function validateSalesBatch(value) {
|
|
|
61
62
|
throw new Error("Invalid incremental sync envelope");
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
const
|
|
65
|
+
const mediaKinds = /* @__PURE__ */ new Map();
|
|
65
66
|
for (const media of value.media) {
|
|
66
67
|
if (!isRecord(media)) throw new Error("media item must be an object");
|
|
67
68
|
requiredString(media.media_key, "media_key");
|
|
68
|
-
if (
|
|
69
|
-
mediaKeys.add(media.media_key);
|
|
69
|
+
if (mediaKinds.has(media.media_key)) throw new Error("duplicate media_key");
|
|
70
70
|
const isVoice = media.kind === "voice";
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
|
|
71
|
+
const isVideo = media.kind === "video";
|
|
72
|
+
if (typeof media.kind !== "string" || !["image", "avatar", "voice", "video"].includes(media.kind)) throw new Error("invalid media kind");
|
|
73
|
+
mediaKinds.set(media.media_key, media.kind);
|
|
74
|
+
if (isVoice ? media.mime_type !== "audio/wav" : isVideo ? media.mime_type !== "video/mp4" : !["image/jpeg", "image/png", "image/gif", "image/webp"].includes(String(media.mime_type))) throw new Error("invalid media MIME type");
|
|
75
|
+
const maxBytes = isVideo ? MAX_VIDEO_BYTES : isVoice ? 10 * 1024 * 1024 : 2 * 1024 * 1024;
|
|
74
76
|
if (!Number.isInteger(media.byte_size) || Number(media.byte_size) < 1 || Number(media.byte_size) > maxBytes) throw new Error("invalid media byte_size");
|
|
75
|
-
if (typeof media.data_base64 !== "string" || media.data_base64.length > Math.ceil(maxBytes / 3) * 4 || !/^
|
|
77
|
+
if (typeof media.data_base64 !== "string" || media.data_base64.length > Math.ceil(maxBytes / 3) * 4 || media.data_base64.length % 4 !== 0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(media.data_base64)) throw new Error("invalid media base64");
|
|
76
78
|
const bytes = atob(media.data_base64);
|
|
77
79
|
if (bytes.length !== media.byte_size) throw new Error("media byte_size does not match data");
|
|
78
80
|
const signature = Array.from(bytes.slice(0, 12), (char) => char.charCodeAt(0));
|
|
79
|
-
const
|
|
81
|
+
const boxSize = isVideo ? signature.slice(0, 4).reduce((size, byte) => size * 256 + byte, 0) : 0;
|
|
82
|
+
const matches = isVoice ? bytes.startsWith("RIFF") && bytes.slice(8, 12) === "WAVE" : isVideo ? bytes.slice(4, 8) === "ftyp" && boxSize >= 16 && boxSize <= bytes.length : media.mime_type === "image/jpeg" ? signature[0] === 255 && signature[1] === 216 : media.mime_type === "image/png" ? bytes.startsWith("\x89PNG\r\n\n") : media.mime_type === "image/gif" ? bytes.startsWith("GIF87a") || bytes.startsWith("GIF89a") : bytes.startsWith("RIFF") && bytes.slice(8, 12) === "WEBP";
|
|
80
83
|
if (!matches) throw new Error("media signature does not match MIME type");
|
|
81
84
|
if (media.kind === "avatar") {
|
|
82
85
|
requiredString(media.owner_wxid, "avatar owner_wxid");
|
|
83
86
|
if (media.observed_at !== void 0 && (typeof media.observed_at !== "string" || !/^\d{4}-\d{2}-\d{2}T/.test(media.observed_at) || !Number.isFinite(Date.parse(media.observed_at)))) throw new Error("invalid avatar observation time");
|
|
84
87
|
}
|
|
85
|
-
if (!Number.isInteger(media.width) || !Number.isInteger(media.height) || (isVoice ? Number(media.width) !== 0 || Number(media.height) !== 0 : Number(media.width) <= 0 || Number(media.height) <= 0)) throw new Error("invalid media dimensions");
|
|
88
|
+
if (!Number.isInteger(media.width) || !Number.isInteger(media.height) || (isVoice || isVideo ? Number(media.width) !== 0 || Number(media.height) !== 0 : Number(media.width) <= 0 || Number(media.height) <= 0)) throw new Error("invalid media dimensions");
|
|
86
89
|
}
|
|
87
90
|
let messageCount = 0;
|
|
88
91
|
const chatKeys = /* @__PURE__ */ new Set();
|
|
@@ -97,7 +100,7 @@ function validateSalesBatch(value) {
|
|
|
97
100
|
const displayName = typeof rawChat.display_name === "string" ? rawChat.display_name.trim() : "";
|
|
98
101
|
rawChat.display_name = displayName || rawChat.chat_key;
|
|
99
102
|
requiredString(rawChat.display_name, `display_name: ${rawChat.chat_key}`);
|
|
100
|
-
if (rawChat.avatar_media_key && !
|
|
103
|
+
if (rawChat.avatar_media_key && !mediaKinds.has(String(rawChat.avatar_media_key))) throw new Error("missing avatar media");
|
|
101
104
|
if (rawChat.avatar_media_key && !value.media.some((m) => m.media_key === rawChat.avatar_media_key && m.kind === "avatar" && m.owner_wxid === rawChat.chat_key)) throw new Error("avatar owner does not match chat");
|
|
102
105
|
if (!Array.isArray(rawChat.messages)) throw new Error(`messages must be an array: ${rawChat.chat_key}`);
|
|
103
106
|
const messageKeys = /* @__PURE__ */ new Set();
|
|
@@ -113,7 +116,10 @@ function validateSalesBatch(value) {
|
|
|
113
116
|
throw new Error("Invalid message source revision");
|
|
114
117
|
}
|
|
115
118
|
if (mediaPatch) requiredString(rawMessage.media_key, "media patch media_key");
|
|
116
|
-
if (rawMessage.media_key && !
|
|
119
|
+
if (rawMessage.media_key && !mediaKinds.has(String(rawMessage.media_key))) throw new Error("missing message media");
|
|
120
|
+
if (rawMessage.media_key && rawMessage.kind === "video" !== (mediaKinds.get(String(rawMessage.media_key)) === "video")) {
|
|
121
|
+
throw new Error("video media does not match message kind");
|
|
122
|
+
}
|
|
117
123
|
requiredString(rawMessage.local_id, `local_id: ${rawMessage.message_key}`);
|
|
118
124
|
requiredString(rawMessage.sort_seq, `sort_seq: ${rawMessage.message_key}`);
|
|
119
125
|
if (!/^\d+$/.test(rawMessage.sort_seq)) throw new Error(`sort_seq must be numeric: ${rawMessage.message_key}`);
|
|
@@ -292,6 +298,7 @@ var WechatRepository = class _WechatRepository {
|
|
|
292
298
|
if (batch.delivery && active !== account) throw Error("WANJI_RESYNC_REQUIRED: media account baseline missing");
|
|
293
299
|
const changed = /* @__PURE__ */ new Set(), replyChanges = /* @__PURE__ */ new Set(), voiceChanges = /* @__PURE__ */ new Map();
|
|
294
300
|
let messages = 0, avatarsUpdated = 0;
|
|
301
|
+
const imageAreas = new Map(batch.delivery ? batch.media.filter((media) => media.kind === "image").map((media) => [media.media_key, media.width * media.height]) : []);
|
|
295
302
|
const trackVoiceChange = (chatId, id) => {
|
|
296
303
|
const voices = voiceChanges.get(chatId) ?? /* @__PURE__ */ new Set();
|
|
297
304
|
voices.add(id);
|
|
@@ -339,6 +346,10 @@ var WechatRepository = class _WechatRepository {
|
|
|
339
346
|
if (old2.kind !== m.kind || old2.direction !== m.direction || old2.source_revision !== m.source_revision) throw Error("WANJI_RESYNC_REQUIRED: media identity mismatch");
|
|
340
347
|
const mediaId2 = hash([source, m.media_key]);
|
|
341
348
|
if (old2.media_id !== mediaId2) {
|
|
349
|
+
if (old2.kind === "image" && old2.media_id) {
|
|
350
|
+
const current = this.row("SELECT json_extract(metadata,'$.width') * json_extract(metadata,'$.height') AS area FROM media WHERE id=?", old2.media_id);
|
|
351
|
+
if ((imageAreas.get(m.media_key) ?? 0) < (current?.area ?? 0)) continue;
|
|
352
|
+
}
|
|
342
353
|
this.db.prepare("UPDATE messages SET media_id=? WHERE id=?").run(mediaId2, old2.id);
|
|
343
354
|
changed.add(chatId);
|
|
344
355
|
if (old2.kind === "voice" && old2.direction === "inbound" && old2.auto_draft_arrival === 1) trackVoiceChange(chatId, old2.id);
|
package/docs/auto-update.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
2. 安装后自动检查,并在空闲时自动安装补丁;无需打开面板或勾选开关。页头「版本与更新」可查看进度;如主动关闭自动安装,该选择会保留到下次启动。
|
|
9
9
|
3. 同一 major/minor 的正式补丁可自动安装,例如 0.10.0 → 0.10.1。跨 minor(0.10 → 0.11)只提示,点「立即更新」后仍要先保存和等待任务结束。
|
|
10
10
|
|
|
11
|
-
Host
|
|
11
|
+
Host 启动后约 5 秒内发起首次检查,运行中约每 30 秒检查一次。发现兼容、未弃用的正式 `latest` 补丁后,同一轮检查就进入空闲安装流程。网络检查连续失败时,分别等待 30 秒、2 分钟,之后最多每 5 分钟重试一次。安装失败的版本可手动重试。退出 DSH 或禁用插件后不运行后台服务。
|
|
12
12
|
|
|
13
13
|
## 检查反馈
|
|
14
14
|
|
package/docs/wechat-sync.md
CHANGED
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
图片和语音进入可见区域及附近时自动加载,无需点击加载按钮;纯媒体消息不显示`[image]`或`[voice]`占位正文。图片点击可打开大图,支持关闭按钮、Esc或点遮罩返回;语音显示微信式声波气泡及解码后的实际秒数,点击播放/暂停,不展示浏览器原生控件。同一时间只播放一条语音,切走消息或页面会停止播放。媒体尚未入库时显示中文状态,新同步版本到达会自动更新;加载失败可重试,切换会话后的迟到结果不会覆盖当前附件。
|
|
18
18
|
|
|
19
|
+
更新 Mac 或 Windows 桌面采集组件后,微信已下载到本机的 MP4 可在文字入库后后台补传,单条上限 16 MiB。视频同步完成后,点「加载视频」即可使用播放器。微信里尚未下载的视频会继续显示同步占位。
|
|
20
|
+
|
|
19
21
|
## Windows与Mac
|
|
20
22
|
|
|
21
23
|
- Windows x64:固定启动器通过UAC启动采集Worker,DSH本身保持普通权限。当前授权会话复用常驻Worker,不每轮提权。授权为不同Windows用户、微信未登录或组件退出时暂停并要求重连。当前读取器最低版本门控4.1.0,验证线4.1.x。
|
package/package.json
CHANGED