dsh-message-gateway 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +1 -1
- package/README.es.md +1 -1
- package/README.md +1 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +2 -2
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -21,7 +21,7 @@ A message-platform gateway plugin for the DSH Web GUI: a "Message platforms" ent
|
|
|
21
21
|
- **WeCom AI bot persistent bridge**: official SDK WebSocket long connection with exponential backoff reconnect; incoming text messages are injected into an isolated dedicated agent session that wakes the DSH driver; replies stream back as chunks and finalize via `response_url`
|
|
22
22
|
- **Group-chat @mention stripping**: the leading `@bot-name` is removed before the assistant sees the message
|
|
23
23
|
- **Slash commands**: `/help` / `/time` / `/status` (Chinese aliases: 帮助/菜单/时间/状态)
|
|
24
|
-
- **Enter-chat welcome**:
|
|
24
|
+
- **Enter-chat welcome**: optional configuration (`welcomeReply`, defaults to `false` for zero disturbance; when set to `true`, auto-replies a greeting when a user enters single chat for the first time that day)
|
|
25
25
|
- **Proactive send channel**: `POST /gateway/send` (`{"chatid": "...", "content": "..."}`, single chat = userid, group chat = group id) sends markdown messages as the bot
|
|
26
26
|
- **Universal proactive push**: `POST /gateway/push` (`{"platform": "...", "target": "...", "content": "...", "title": "optional"}`) pushes text to any platform target for task notifications / other plugins:
|
|
27
27
|
- `platform` supports `telegram` (target = numeric chatId), `discord` (target = channelId), `wecom-aibot` (target = userid/group id), `email` (target = address, title becomes the subject)
|
package/README.es.md
CHANGED
|
@@ -21,7 +21,7 @@ Un plugin de pasarela de mensajería para la GUI web de DSH: una entrada "Plataf
|
|
|
21
21
|
- **Puente persistente del Bot de IA de WeCom**: conexión larga WebSocket del SDK oficial con reconexión por retroceso exponencial; los mensajes de texto entrantes se inyectan en una sesión de agente dedicada y aislada que despierta al controlador de DSH; las respuestas se transmiten como fragmentos y finalizan vía `response_url`
|
|
22
22
|
- **Eliminación de menciones @ en grupos**: se quita el `@nombre-del-bot` inicial antes de que el asistente vea el mensaje
|
|
23
23
|
- **Comandos de barra**: `/help` / `/time` / `/status` (alias en chino: 帮助/菜单/时间/状态)
|
|
24
|
-
- **Mensaje de bienvenida**:
|
|
24
|
+
- **Mensaje de bienvenida**: configuración opcional (`welcomeReply`, por defecto `false` para cero interrupciones; al activarse en `true`, responde un saludo cuando un usuario entra al chat individual por primera vez ese día)
|
|
25
25
|
- **Canal de envío proactivo**: `POST /gateway/send` (`{"chatid": "...", "content": "..."}`, chat individual = userid, grupo = id de grupo) envía mensajes markdown como el bot
|
|
26
26
|
- **Push proactivo universal**: `POST /gateway/push` (`{"platform": "...", "target": "...", "content": "...", "title": "opcional"}`) envía texto a cualquier plataforma para notificaciones de tareas / otros plugins:
|
|
27
27
|
- `platform` admite `telegram` (target = chatId numérico), `discord` (target = channelId), `wecom-aibot` (target = userid/id de grupo), `email` (target = correo, title como asunto)
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ DSH Web GUI 的消息平台网关插件:在侧边栏「新会话」按钮下
|
|
|
21
21
|
- **企业微信智能机器人常驻桥**:官方 SDK WebSocket 长连接,断线自动指数退避重连;收到文本消息 → 注入隔离的专用 agent 会话唤醒 DSH 驱动 → 回复按 chunk 流式回发,结束时经 response_url 定稿
|
|
22
22
|
- **群聊 @提及剥离**:去掉开头的 @机器人名后交给助手
|
|
23
23
|
- **斜杠命令**:`/help` / `/time` / `/status`(含中文别名:帮助/菜单/时间/状态)
|
|
24
|
-
-
|
|
24
|
+
- **进入会话欢迎语**:可选配置(配置项 `welcomeReply`,默认 `false` 保持免打扰,开启后用户当天首次进入单聊自动回复欢迎词)
|
|
25
25
|
- **主动发送通道**:`POST /gateway/send`(`{"chatid": "...", "content": "..."}`,单聊=userid,群聊=群 ID)以机器人身份主动发送 markdown 消息
|
|
26
26
|
- **通用主动推送**:`POST /gateway/push`(`{"platform": "...", "target": "...", "content": "...", "title": "可选"}`)向任意平台目标推送文本,供定时任务通知 / 其他插件调用:
|
|
27
27
|
- `platform` 支持:`telegram`(target=chatId 数字)、`discord`(target=channelId)、`wecom-aibot`(target=userid/群ID)、`email`(target=收件地址,title 作邮件主题)
|
package/lib/index.js
CHANGED
|
@@ -4973,8 +4973,9 @@ var BridgeManager = class {
|
|
|
4973
4973
|
void this.handleExternalMessage({ key, frame, sink, chatType: chattype === "group" ? "group" : "single" }, rawText);
|
|
4974
4974
|
},
|
|
4975
4975
|
onEnter: (frame) => {
|
|
4976
|
+
if (!this.config.welcomeReply) return;
|
|
4976
4977
|
const userid = frame.body?.from?.userid ?? "";
|
|
4977
|
-
console.log("[dsh-message-gateway] enter chat", { userid });
|
|
4978
|
+
console.log("[dsh-message-gateway] enter chat welcome", { userid });
|
|
4978
4979
|
void this.wecom?.welcome(frame, this.t("welcome"));
|
|
4979
4980
|
}
|
|
4980
4981
|
});
|
|
@@ -6222,6 +6223,7 @@ var Config = Schema.object({
|
|
|
6222
6223
|
autoStartQQ: Schema.boolean().default(true).description("\u542F\u52A8\u65F6\u81EA\u52A8\u7528\u5DF2\u4FDD\u5B58\u7684 QQ \u51ED\u636E\u5EFA\u7ACB\u5E38\u9A7B\u8FDE\u63A5"),
|
|
6223
6224
|
autoStartEmail: Schema.boolean().default(true).description("\u542F\u52A8\u65F6\u81EA\u52A8\u7528\u5DF2\u4FDD\u5B58\u7684 Email \u51ED\u636E\u5EFA\u7ACB\u5E38\u9A7B\u8FDE\u63A5\uFF08IMAP \u8F6E\u8BE2\uFF09"),
|
|
6224
6225
|
groupReply: Schema.boolean().default(true).description("\u662F\u5426\u56DE\u590D\u7FA4\u804A\u6D88\u606F\uFF08false \u65F6\u53EA\u5904\u7406\u5355\u804A\uFF09"),
|
|
6226
|
+
welcomeReply: Schema.boolean().default(false).description("\u662F\u5426\u5728\u7528\u6237\u5F53\u5929\u9996\u6B21\u8FDB\u5165\u5355\u804A\u65F6\u81EA\u52A8\u53D1\u9001\u6B22\u8FCE\u8BED\uFF08\u9ED8\u8BA4 false \u4FDD\u6301\u514D\u6253\u6270\uFF0C\u8BBE\u4E3A true \u5F00\u542F\uFF09"),
|
|
6225
6227
|
routes: Schema.array(Schema.object({
|
|
6226
6228
|
id: Schema.string().required().description("\u89C4\u5219 id\uFF08\u552F\u4E00\u6807\u8BC6\uFF09"),
|
|
6227
6229
|
matchPlatform: Schema.string().description("\u5339\u914D\u5E73\u53F0 id\uFF08telegram/discord/qq/wecom-aibot/email/webhook \u7B49\uFF09\uFF1B\u7F3A\u7701=\u5168\u90E8\u5E73\u53F0"),
|