@relaymessenger/openclaw-plugin 0.4.1-staging.2 → 0.4.1-staging.3
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 +6 -5
- package/dist/src/inbound.js +4 -3
- package/package.json +1 -1
- package/src/inbound.ts +6 -3
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
|
|
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.
|
|
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
|
|
105
|
-
agent can start a direct turn, while the group activation rules above
|
|
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
|
|
package/dist/src/inbound.js
CHANGED
|
@@ -27,13 +27,14 @@ export function isRelayMessageReceivedEvent(event) {
|
|
|
27
27
|
Array.isArray(data.parts));
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* Map
|
|
31
|
-
*
|
|
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
package/src/inbound.ts
CHANGED
|
@@ -44,14 +44,17 @@ export function isRelayMessageReceivedEvent(
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
|
-
* Map
|
|
48
|
-
*
|
|
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 (
|
|
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;
|