@relaymessenger/openclaw-plugin 0.4.7-staging.2 → 0.4.7-staging.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.
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "relayServer": {
3
3
  "repository": "RelayMessenger/Relay-Server",
4
- "commit": "74b7603fff3025b6d591a35f9b6f8ed9e2383173",
4
+ "commit": "ef8cedb1015e1e0d0856d61b69057f2b831f7c90",
5
5
  "openapiPath": "contracts/developer/openapi.yaml",
6
- "sha256": "9e92c51df654d6896e13a56e95b6a32ce0fbb4c77ed9c754603482890e84dfde"
6
+ "sha256": "1b687dc9ffc7a6296a04b570d20fe32bed758deb2ed8f38fc48d0d44a10db2ec"
7
7
  },
8
8
  "relaySdk": {
9
9
  "package": "@relaymessenger/sdk",
10
- "version": "0.3.6-staging.2",
11
- "integrity": "sha512-v430wR76ud6ZyUCVqVW7RK0be2iT83NS1lQQAGKpbA4XINs0kC0zPI7SBEVFrQgq1HVmZF+zcqbjgAdeF+z9Ig==",
12
- "operationsSha256": "a7c3367841e1f7803ff4a040586e30a6347d80548999015503f18d8e32f47b40",
13
- "workspaceOpenapiSha256": "9e92c51df654d6896e13a56e95b6a32ce0fbb4c77ed9c754603482890e84dfde",
10
+ "version": "0.3.6-staging.4",
11
+ "integrity": "sha512-WkjSggp1VDo8kLTnUWb4OOED3p1fyPPrE996EGEsn6T6YTk0RPD/HlleqkIPSgaSjwJw7EBunhApwzO6a7kDKg==",
12
+ "operationsSha256": "5c482165296df7d0634a0f57950936887b118e7159baf3bdabc42fce0d4fe6d8",
13
+ "workspaceOpenapiSha256": "1b687dc9ffc7a6296a04b570d20fe32bed758deb2ed8f38fc48d0d44a10db2ec",
14
14
  "usedOperations": [
15
15
  {
16
16
  "method": "GET",
@@ -170,7 +170,9 @@ export async function dispatchRelayEvent(params) {
170
170
  reply: {
171
171
  to: facts.chatId,
172
172
  originatingTo: facts.chatId,
173
- ...(facts.replyToId ? { replyToId: facts.replyToId } : {}),
173
+ ...((facts.replyAnchorId ?? facts.replyToId)
174
+ ? { replyToId: facts.replyAnchorId ?? facts.replyToId }
175
+ : {}),
174
176
  },
175
177
  message: {
176
178
  inboundEventKind: "user_request",
@@ -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
- ? { replyToId: event.data.reply_to.message_id }
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.2",
3
+ "version": "0.4.7-staging.4",
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.2"
40
+ "@relaymessenger/sdk": "0.3.6-staging.4"
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.replyToId ? { replyToId: facts.replyToId } : {}),
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
- ? { replyToId: event.data.reply_to.message_id }
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
  };