@chbo297/infoflow 2026.5.7-beta.3 → 2026.5.7

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.md CHANGED
@@ -121,4 +121,5 @@ git push origin 2026.5.6
121
121
  npm publish
122
122
  # 或
123
123
  # npm publish --registry https://registry.npmjs.org
124
- ```
124
+ ```
125
+
package/dist/src/bot.js CHANGED
@@ -211,12 +211,10 @@ function checkReplyToBot(bodyItems, accountId) {
211
211
  }
212
212
  return false;
213
213
  }
214
- // ---------------------------------------------------------------------------
215
- // Shared reply judgment rules (reused across prompt builders)
216
- // ---------------------------------------------------------------------------
217
214
  /** Shared judgment rules and reply format requirements for all conditional-reply prompts */
218
- function buildReplyJudgmentRules() {
219
- return [
215
+ function buildReplyJudgmentRules(options) {
216
+ const variant = options?.variant ?? "default";
217
+ const lines = [
220
218
  "# Rules for Group Message Response",
221
219
  "",
222
220
  "## When to Reply",
@@ -231,19 +229,12 @@ function buildReplyJudgmentRules() {
231
229
  "Do NOT reply if ANY of the following is true:",
232
230
  "- The message is casual chatter, banter, emoji-only, or has no actionable question/request",
233
231
  "- The user explicitly indicates they don't want your response",
234
- "- The message is directed at another person, not at you",
235
- "- You lack the context or knowledge to give a useful answer (e.g., private/internal info you don't have access to)",
236
- "- The message intent is ambiguous and a wrong guess would be more disruptive than silence",
237
- "",
238
- "## Response Format",
239
- "",
240
- "- If you can answer: respond directly and concisely. Do not explain why you chose to answer. Do not add filler or pleasantries.",
241
- "- If you cannot answer: output exactly `NO_REPLY` — nothing else, no explanation, no apology.",
242
- "",
243
- "## Guiding Principle",
244
- "",
245
- "When in doubt, prefer silence (`NO_REPLY`). A missing reply is far less disruptive than an irrelevant or incorrect one in a group chat.",
246
- ].join("\n");
232
+ ];
233
+ if (variant === "default") {
234
+ lines.push("- The message is directed at another person, not at you");
235
+ }
236
+ lines.push("- You lack the context or knowledge to give a useful answer (e.g., private/internal info you don't have access to)", "- The message intent is ambiguous and a wrong guess would be more disruptive than silence", "", "## Response Format", "", "- If you can answer: respond directly and concisely. Do not explain why you chose to answer. Do not add filler or pleasantries.", "- If you cannot answer: output exactly `NO_REPLY` — nothing else, no explanation, no apology.", "", "## Guiding Principle", "", "When in doubt, prefer silence (`NO_REPLY`). A missing reply is far less disruptive than an irrelevant or incorrect one in a group chat.");
237
+ return lines.join("\n");
247
238
  }
248
239
  /**
249
240
  * Build a GroupSystemPrompt for watch-mention triggered messages.
@@ -251,10 +242,11 @@ function buildReplyJudgmentRules() {
251
242
  */
252
243
  function buildWatchMentionPrompt(mentionedId) {
253
244
  return [
254
- `Someone in the group @mentioned ${mentionedId}. As ${mentionedId}'s assistant, you observed this message.`,
255
- "Decide whether you can answer on their behalf or provide help.",
245
+ `Someone in the group @mentioned ${mentionedId}. You are ${mentionedId}'s assistant and you see this message.`,
246
+ "Before you write your reply, use the visible thread context, quoted/reply context if any, and your knowledge and tools to decide whether you can add value (a direct answer, a concrete next step, or a useful pointer). Prefer making a genuine attempt to help when context makes it reasonable; do not send exploratory or partial messages to the group—produce a single final message.",
247
+ "If you can provide worthwhile help or leads, reply with that information clearly and concisely. If, after that effort, you still have nothing useful to add, output exactly NO_REPLY and nothing else.",
256
248
  "",
257
- buildReplyJudgmentRules(),
249
+ buildReplyJudgmentRules({ variant: "watchAssistant" }),
258
250
  "",
259
251
  "# Examples",
260
252
  "",
@@ -283,7 +275,7 @@ function buildWatchRegexPrompt(patterns) {
283
275
  `The message content matched one of the configured watch patterns ${label}.`,
284
276
  "As the group assistant, you observed this message. Decide whether you can provide help or a valuable reply.",
285
277
  "",
286
- buildReplyJudgmentRules(),
278
+ buildReplyJudgmentRules({ variant: "watchAssistant" }),
287
279
  ].join("\n");
288
280
  }
289
281
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chbo297/infoflow",
3
- "version": "2026.5.7-beta.3",
3
+ "version": "2026.5.7",
4
4
  "description": "OpenClaw Infoflow (如流) channel plugin for Baidu enterprise messaging",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",