pi-roundtable 0.53.0 → 0.53.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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.53.1] - 2026-11-18
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `InboundMessage.reference.channel` is the channel key of the message a reply quotes, which the Discord surface now sets on live and caught-up messages alike. A claim compares it with the message's own `channel` to tell a reply within the conversation, such as one to a forum post's starter, from a reply to a message of another channel, before it acts on `reference.attachments`.
|
|
13
|
+
|
|
8
14
|
## [0.53.0] - 2026-11-18
|
|
9
15
|
|
|
10
16
|
### Added
|
package/docs/plugins.md
CHANGED
|
@@ -2983,6 +2983,7 @@ It resolves with `AttachmentBytes` (`id`, `name`, `contentType`, empty when Disc
|
|
|
2983
2983
|
At most the host's `discord.attachmentRead.maxBytes` (default `ATTACHMENT_READ_MAX_BYTES`, 10 MiB; at most 100 MiB) is read, and a call's `maxBytes` may lower that, never raise it; a `maxBytes` that is not a positive whole number rejects with the code `invalid`. `discordPlugin` throws a `ConfigError` for an `attachmentRead.maxBytes` outside 1 to 100 MiB, as the config file does.
|
|
2984
2984
|
Nothing is parsed, stored or logged: what the bytes are for (text extraction, an image for the model, a file in the workspace) is the plugin's call.
|
|
2985
2985
|
The core checks nothing about who may read which channel beyond what the bot can see: pass the channel of the conversation the file was posted in, such as the addressed message's channel, never one a model names in a tool call.
|
|
2986
|
+
A reply may quote a message of another channel, so a reply's `reference.channel` names the channel the quoted message is in (the Discord surface sets it, live and when it catches up). It is a channel key, like `channel`: pass its id (`parseChannelKey(reference.channel).id`) to `readAttachment` to read a quoted file, and compare it with the message's `channel` before treating the quoted files as the conversation's own. A forum post's starter is in the post itself, so a reply that quotes it compares as the same channel; a message of a thread's parent text channel, such as the one the thread was started from, is in that text channel, so a reply that quotes it compares as another.
|
|
2986
2987
|
|
|
2987
2988
|
```ts
|
|
2988
2989
|
import { AttachmentReadError, DISCORD } from "pi-roundtable/discord";
|
package/package.json
CHANGED
|
@@ -117,6 +117,12 @@ export interface InboundMessage {
|
|
|
117
117
|
reference?: {
|
|
118
118
|
text: string;
|
|
119
119
|
attachments: AttachmentRef[];
|
|
120
|
+
/**
|
|
121
|
+
* The channel the referenced message is in, when the surface reports it; Discord does. Compare
|
|
122
|
+
* it with `channel` to tell a reply within the conversation (such as to a forum post's starter)
|
|
123
|
+
* from one to a message of another channel.
|
|
124
|
+
*/
|
|
125
|
+
channel?: ChannelKey;
|
|
120
126
|
/** The surface's id of the referenced message's author, when the surface reports it. */
|
|
121
127
|
authorId?: string;
|
|
122
128
|
/** The name a webhook posted the referenced message under, such as an agent's. */
|
|
@@ -41,6 +41,8 @@ function referenceOf(referenced: Message, mention: RegExp) {
|
|
|
41
41
|
.replace(mention, "")
|
|
42
42
|
.trim(),
|
|
43
43
|
attachments: attachmentRefs(referenced, referenced.id),
|
|
44
|
+
// The fetched message's own channel: a forum post's starter is in the post itself; a referenced message elsewhere, such as a crosspost's source, is in another channel.
|
|
45
|
+
channel: channelKey("discord", referenced.channelId),
|
|
44
46
|
authorId: referenced.author.id,
|
|
45
47
|
...(referenced.webhookId
|
|
46
48
|
? { webhookName: referenced.author.username }
|