feat: port quality, escalation, KB version, site-map KB, experiments and metrics

This commit is contained in:
wangliang
2026-10-23 11:41:09 +08:00
parent 81b49c9350
commit b778570045
33 changed files with 2446 additions and 344 deletions
+2
View File
@@ -1,6 +1,7 @@
'use strict';
const crypto = require('crypto');
const prom = require('./prom');
// Phase 0:验签 -> 去重 -> 只处理 contact 的 message.created -> 回一条占位消息。
// Phase 1 会把这里替换成 bridge AI 编排。
@@ -29,6 +30,7 @@ function createLibreDeskWebhook(cfg, deps = {}) {
async function handle(body) {
if (!body || body.event !== 'message.created') return;
const msg = body.payload || {};
prom.inc('bridge_webhook_events_total', { event: body.event || 'unknown' });
if (msg.sender_type !== 'contact' || msg.private) return;
if (!msg.uuid || !msg.conversation_uuid) return;
if (!markSeen(msg.uuid)) return;