@relaymessenger/openclaw-plugin 0.4.1-staging.2 → 0.4.1

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
@@ -67,12 +67,13 @@ default account. Every named account must set its own inline token or
67
67
  - A **Chat** is direct or group.
68
68
  - A **Message** belongs to one Chat and contains ordered parts.
69
69
 
70
- The plugin starts OpenClaw turns for every inbound user-authored
70
+ The plugin starts OpenClaw turns for inbound user- or agent-authored
71
71
  `message.received` event in a direct Chat. In a group Chat, it starts a turn
72
72
  only when a text part's canonical `mention` Handle matches the canonical
73
73
  `chat.owner_handle`, or when `reply_to.message_id` resolves through Relay to a
74
74
  Message authored by this agent in the same Chat. Visible `@handle` text is not
75
- parsed as a mention. Unmentioned group traffic, agent-authored Messages,
75
+ parsed as a mention. Both sender kinds pass the same `allowFrom` checks.
76
+ Unmentioned group traffic, outbound self echoes,
76
77
  reactions, typing events, receipts, and membership events are durably accepted
77
78
  without starting a turn.
78
79
 
@@ -101,9 +102,9 @@ Handles:
101
102
  }
102
103
  ```
103
104
 
104
- Without `allowFrom`, any user Contact whose Message Relay delivers to this
105
- agent can start a direct turn, while the group activation rules above still
106
- apply.
105
+ Without `allowFrom`, any user or agent Contact whose Message Relay delivers
106
+ to this agent can start a direct turn, while the group activation rules above
107
+ still apply.
107
108
 
108
109
  ## Durable delivery
109
110
 
@@ -7,8 +7,8 @@
7
7
  },
8
8
  "relaySdk": {
9
9
  "package": "@relaymessenger/sdk",
10
- "version": "0.3.1-staging.2",
11
- "integrity": "sha512-76hUul0ihr3Zyx3gN/DC4FG8nP+tKhWW1KkrZhgKlHiD7NYq5tg5Pn2mMPYSnoVA+I4OXNVoEGFY7XbIfU5wdg==",
10
+ "version": "0.3.1",
11
+ "integrity": "sha512-VWg62E81N34XdICg9+phflzSh56yB8KU7btXDgd3KWakZAAVpwv6wJMykWDujJvIABeINnCT+1B/5RKKQymGgA==",
12
12
  "operationsSha256": "e06b2f44366b57dc1b5385b5b1f76585576f5bf9600d4bbe15e49cfdfb394996",
13
13
  "workspaceOpenapiSha256": "7094178cb01c0ddc05f9254dc91094900a0a7b6273979c0cad6257eec486f0d8",
14
14
  "usedOperations": [
@@ -27,13 +27,14 @@ export function isRelayMessageReceivedEvent(event) {
27
27
  Array.isArray(data.parts));
28
28
  }
29
29
  /**
30
- * Map the current Relay v1 Message event to OpenClaw facts. Agent-authored
31
- * Messages are accepted at the transport boundary but do not start turns.
30
+ * Map inbound Messages from either contract-defined Contact kind. Sender
31
+ * authorization and direct/group activation remain the dispatcher's concern.
32
32
  */
33
33
  export function buildRelayInboundFacts(event) {
34
34
  if (!isRelayMessageReceivedEvent(event))
35
35
  return null;
36
- if (event.data.sender_handle.kind !== "user")
36
+ if (event.data.sender_handle.kind !== "user" &&
37
+ event.data.sender_handle.kind !== "agent")
37
38
  return null;
38
39
  const text = renderRelayMessageParts(event.data.parts);
39
40
  if (!text.trim())
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relaymessenger/openclaw-plugin",
3
- "version": "0.4.1-staging.2",
3
+ "version": "0.4.1",
4
4
  "description": "Native Relay channel plugin for OpenClaw",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -37,7 +37,7 @@
37
37
  "prepack": "npm run build"
38
38
  },
39
39
  "dependencies": {
40
- "@relaymessenger/sdk": "0.3.1-staging.2"
40
+ "@relaymessenger/sdk": "0.3.1"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/node": "^26.0.0",
package/src/inbound.ts CHANGED
@@ -44,14 +44,17 @@ export function isRelayMessageReceivedEvent(
44
44
  }
45
45
 
46
46
  /**
47
- * Map the current Relay v1 Message event to OpenClaw facts. Agent-authored
48
- * Messages are accepted at the transport boundary but do not start turns.
47
+ * Map inbound Messages from either contract-defined Contact kind. Sender
48
+ * authorization and direct/group activation remain the dispatcher's concern.
49
49
  */
50
50
  export function buildRelayInboundFacts(
51
51
  event: RelayWebhookEvent,
52
52
  ): RelayInboundFacts | null {
53
53
  if (!isRelayMessageReceivedEvent(event)) return null;
54
- if (event.data.sender_handle.kind !== "user") return null;
54
+ if (
55
+ event.data.sender_handle.kind !== "user" &&
56
+ event.data.sender_handle.kind !== "agent"
57
+ ) return null;
55
58
 
56
59
  const text = renderRelayMessageParts(event.data.parts);
57
60
  if (!text.trim()) return null;