@relaymessenger/openclaw-plugin 0.4.7-staging.2 → 0.4.7-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/contracts/relay-v1.lock.json +5 -5
- package/dist/src/dispatch.js +3 -1
- package/dist/src/inbound.js +13 -1
- package/package.json +2 -2
- package/src/dispatch.ts +3 -1
- package/src/inbound.ts +13 -1
- package/src/types.ts +7 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"relayServer": {
|
|
3
3
|
"repository": "RelayMessenger/Relay-Server",
|
|
4
|
-
"commit": "
|
|
4
|
+
"commit": "78d7991c7b8a615302ab30d727503779755df3ab",
|
|
5
5
|
"openapiPath": "contracts/developer/openapi.yaml",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "1d790da998a8dfc26cffc098def76d85b8275af7a343148df8e78c486cd02849"
|
|
7
7
|
},
|
|
8
8
|
"relaySdk": {
|
|
9
9
|
"package": "@relaymessenger/sdk",
|
|
10
|
-
"version": "0.3.6-staging.
|
|
11
|
-
"integrity": "sha512-
|
|
10
|
+
"version": "0.3.6-staging.3",
|
|
11
|
+
"integrity": "sha512-yT5/q4alxyFPPmrOh3MqVk9i+55ZPyiLFPX4K4QGeqQsI8/qNt5GCaNVBGewD/rq6Zlw7sfeDqR9P/9leMfPwg==",
|
|
12
12
|
"operationsSha256": "a7c3367841e1f7803ff4a040586e30a6347d80548999015503f18d8e32f47b40",
|
|
13
|
-
"workspaceOpenapiSha256": "
|
|
13
|
+
"workspaceOpenapiSha256": "1d790da998a8dfc26cffc098def76d85b8275af7a343148df8e78c486cd02849",
|
|
14
14
|
"usedOperations": [
|
|
15
15
|
{
|
|
16
16
|
"method": "GET",
|
package/dist/src/dispatch.js
CHANGED
|
@@ -170,7 +170,9 @@ export async function dispatchRelayEvent(params) {
|
|
|
170
170
|
reply: {
|
|
171
171
|
to: facts.chatId,
|
|
172
172
|
originatingTo: facts.chatId,
|
|
173
|
-
...(facts.
|
|
173
|
+
...((facts.replyAnchorId ?? facts.replyToId)
|
|
174
|
+
? { replyToId: facts.replyAnchorId ?? facts.replyToId }
|
|
175
|
+
: {}),
|
|
174
176
|
},
|
|
175
177
|
message: {
|
|
176
178
|
inboundEventKind: "user_request",
|
package/dist/src/inbound.js
CHANGED
|
@@ -8,6 +8,13 @@ function renderPart(part) {
|
|
|
8
8
|
return `[Attachment: ${part.filename} (${part.mime_type})] ${part.url}`;
|
|
9
9
|
case "system":
|
|
10
10
|
return part.value;
|
|
11
|
+
// A tap reads as the label the person chose: the same text the server
|
|
12
|
+
// derives for a button_reply. The agent's own buttons part reads as
|
|
13
|
+
// nothing, again as the server does; its question is the text beside it.
|
|
14
|
+
case "button_reply":
|
|
15
|
+
return part.label;
|
|
16
|
+
case "buttons":
|
|
17
|
+
return undefined;
|
|
11
18
|
}
|
|
12
19
|
}
|
|
13
20
|
export function renderRelayMessageParts(parts) {
|
|
@@ -61,7 +68,12 @@ export function buildRelayInboundFacts(event) {
|
|
|
61
68
|
? { ownerHandle: event.data.chat.owner_handle }
|
|
62
69
|
: {}),
|
|
63
70
|
...(event.data.reply_to?.message_id
|
|
64
|
-
? {
|
|
71
|
+
? {
|
|
72
|
+
replyToId: event.data.reply_to.message_id,
|
|
73
|
+
replyAnchorId: event.data.parts.some((part) => part.type === "button_reply")
|
|
74
|
+
? event.data.id
|
|
75
|
+
: event.data.reply_to.message_id,
|
|
76
|
+
}
|
|
65
77
|
: {}),
|
|
66
78
|
...(Number.isFinite(timestamp) ? { timestamp } : {}),
|
|
67
79
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@relaymessenger/openclaw-plugin",
|
|
3
|
-
"version": "0.4.7-staging.
|
|
3
|
+
"version": "0.4.7-staging.3",
|
|
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.6-staging.
|
|
40
|
+
"@relaymessenger/sdk": "0.3.6-staging.3"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^26.0.0",
|
package/src/dispatch.ts
CHANGED
|
@@ -236,7 +236,9 @@ export async function dispatchRelayEvent(params: {
|
|
|
236
236
|
reply: {
|
|
237
237
|
to: facts.chatId,
|
|
238
238
|
originatingTo: facts.chatId,
|
|
239
|
-
...(facts.
|
|
239
|
+
...((facts.replyAnchorId ?? facts.replyToId)
|
|
240
|
+
? { replyToId: facts.replyAnchorId ?? facts.replyToId }
|
|
241
|
+
: {}),
|
|
240
242
|
},
|
|
241
243
|
message: {
|
|
242
244
|
inboundEventKind: "user_request",
|
package/src/inbound.ts
CHANGED
|
@@ -17,6 +17,13 @@ function renderPart(part: MessagePartResponse): string | undefined {
|
|
|
17
17
|
return `[Attachment: ${part.filename} (${part.mime_type})] ${part.url}`;
|
|
18
18
|
case "system":
|
|
19
19
|
return part.value;
|
|
20
|
+
// A tap reads as the label the person chose: the same text the server
|
|
21
|
+
// derives for a button_reply. The agent's own buttons part reads as
|
|
22
|
+
// nothing, again as the server does; its question is the text beside it.
|
|
23
|
+
case "button_reply":
|
|
24
|
+
return part.label;
|
|
25
|
+
case "buttons":
|
|
26
|
+
return undefined;
|
|
20
27
|
}
|
|
21
28
|
}
|
|
22
29
|
|
|
@@ -84,7 +91,12 @@ export function buildRelayInboundFacts(
|
|
|
84
91
|
? { ownerHandle: event.data.chat.owner_handle }
|
|
85
92
|
: {}),
|
|
86
93
|
...(event.data.reply_to?.message_id
|
|
87
|
-
? {
|
|
94
|
+
? {
|
|
95
|
+
replyToId: event.data.reply_to.message_id,
|
|
96
|
+
replyAnchorId: event.data.parts.some((part) => part.type === "button_reply")
|
|
97
|
+
? event.data.id
|
|
98
|
+
: event.data.reply_to.message_id,
|
|
99
|
+
}
|
|
88
100
|
: {}),
|
|
89
101
|
...(Number.isFinite(timestamp) ? { timestamp } : {}),
|
|
90
102
|
};
|
package/src/types.ts
CHANGED
|
@@ -72,5 +72,12 @@ export type RelayInboundFacts = {
|
|
|
72
72
|
mentionHandles: string[];
|
|
73
73
|
ownerHandle?: ChatHandle;
|
|
74
74
|
replyToId?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The Message an outbound reply should quote. A tap's reply_to names the
|
|
77
|
+
* agent's buttons part, which only a button_reply may target, so the
|
|
78
|
+
* agent's answer quotes the tap itself; every other Message quotes what
|
|
79
|
+
* the person quoted.
|
|
80
|
+
*/
|
|
81
|
+
replyAnchorId?: string;
|
|
75
82
|
timestamp?: number;
|
|
76
83
|
};
|