@unicitylabs/openclaw-unicity 0.3.3 → 0.3.4

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
@@ -7,6 +7,7 @@
7
7
  <p align="center">
8
8
  <a href="https://www.npmjs.com/package/@unicitylabs/openclaw-unicity"><img src="https://img.shields.io/npm/v/@unicitylabs/openclaw-unicity" alt="npm version" /></a>
9
9
  <a href="https://github.com/unicitynetwork/openclaw-unicity/blob/main/LICENSE"><img src="https://img.shields.io/github/license/unicitynetwork/openclaw-unicity" alt="license" /></a>
10
+ <a href="https://deepwiki.com/unicitynetwork/openclaw-unicity"><img src="https://deepwiki.com/badge.svg" alt="Ask DeepWiki"></a>
10
11
  </p>
11
12
 
12
13
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unicitylabs/openclaw-unicity",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Unicity wallet identity and encrypted DMs for OpenClaw agents — powered by Sphere SDK",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/channel.ts CHANGED
@@ -480,9 +480,14 @@ export const unicityChannelPlugin = {
480
480
  const metadataHeader = `[SenderName: ${senderName} | SenderId: ${msg.senderPubkey} | GroupId: ${msg.groupId} | GroupName: ${groupName} | IsOwner: ${isOwner} | CommandAuthorized: ${isOwner}]`;
481
481
  const sanitizedContent = msg.content.replace(/\[(?:SenderName|SenderId|IsOwner|CommandAuthorized|GroupId|GroupName)\s*:/gi, "[BLOCKED:");
482
482
 
483
- // Treat replies to the agent's own messages as implicit mentions,
484
- // so the mention gate doesn't skip them (mirrors Discord's behavior).
485
- const wasMentioned = isReplyToSelf(msg) || undefined;
483
+ // Detect if the agent was mentioned either by @nametag in the text
484
+ // or by replying to the agent's own message (implicit mention, mirrors
485
+ // Discord's behavior). Without this, the mention gate skips the message.
486
+ const agentTag = sphere.identity?.nametag?.replace(/^@/, "");
487
+ const wasTextMentioned = agentTag
488
+ ? msg.content.toLowerCase().includes(`@${agentTag.toLowerCase()}`)
489
+ : false;
490
+ const wasMentioned = wasTextMentioned || isReplyToSelf(msg) || undefined;
486
491
 
487
492
  ctx.log?.info(`[${ctx.account.accountId}] Group message from ${senderName} in ${groupName}: ${msg.content.slice(0, 80)}`);
488
493