pi-roundtable-sandbox 0.49.1 → 0.50.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 +13 -0
- package/README.md +2 -2
- package/package.json +3 -3
- package/src/channel-context.ts +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.50.1] - 2026-11-16
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `ChannelContextOptions.conversation` that throws, or returns something other than a string or `undefined`, is now logged and counts as `undefined` instead of rejecting the read; the docs say to set it as the host default or on every read of a channel, since an unnamed read is a conversation of its own.
|
|
10
|
+
- The sandbox's `channelContext` refuses `conversation` (a clear error) and ignores a host default of it: its history is one file per channel that never starts fresh for another asker, so the option would only hand the window over again.
|
|
11
|
+
|
|
12
|
+
## [0.50.0] - 2026-11-16
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `ChannelContextOptions.conversation(message)` (and the host default `discord.channelContext.conversation`, code only) names the conversation a turn runs in, such as the principal of a person's private conversation in a forum post. What channel context remembers as handed over then belongs to that conversation: a turn of another conversation than the channel's last reads the window as if nothing had been handed over, the thread's starter too, so a second person who asks in a post gets the card, the comments and the earlier discussion that the first asker's turn already read. One record is still kept per channel, so it takes no more memory. Without the option nothing changes. The sandbox's `channelContext` accepts it.
|
|
17
|
+
|
|
5
18
|
## [0.49.1] - 2026-11-16
|
|
6
19
|
|
|
7
20
|
### Fixed
|
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Opt-in options (below) can also sandbox a whole Discord server, share one worksp
|
|
|
11
11
|
|
|
12
12
|
## Requirements
|
|
13
13
|
|
|
14
|
-
- Bun 1.4.4 or later and pi-roundtable `>=0.
|
|
14
|
+
- Bun 1.4.4 or later and pi-roundtable `>=0.50.0 <0.51.0`.
|
|
15
15
|
- A native Linux host with a local Docker daemon and a non-root service account permitted to run Docker.
|
|
16
16
|
- The worker UID/GID match that account; root workers are refused.
|
|
17
17
|
- A trusted OpenAI-compatible, non-streaming Chat Completions endpoint supporting function tools and `max_tokens`.
|
|
@@ -210,7 +210,7 @@ The access rules still have to serve the peer's identity (`discord:<id>`).
|
|
|
210
210
|
`channelContext: true` (or the Discord plugin's `ChannelContextOptions`) is off by default.
|
|
211
211
|
On, a turn in a Discord server channel starts with what others said in that channel since the assistant last posted, so "can you see the messages above?" has an answer.
|
|
212
212
|
The sandbox calls `DISCORD.channelContext` with the addressed message, which reads that message's own channel and no other; a direct message, a message without a guild, or another surface gets no context and no read.
|
|
213
|
-
Core's defaults and caps apply (the newest 15 messages, 500 characters each, other bots 80), and so do the host's `discord.channelContext` settings, which the option overrides key by key; a host `channelContext: false` turns it off and the option then does nothing. `attachments` is ignored, because the sealed worker has no image input.
|
|
213
|
+
Core's defaults and caps apply (the newest 15 messages, 500 characters each, other bots 80), and so do the host's `discord.channelContext` settings, which the option overrides key by key; a host `channelContext: false` turns it off and the option then does nothing. `attachments` is ignored, because the sealed worker has no image input. `conversation` is refused as an option and ignored as a host default: the sandbox's history is one file per channel that never starts fresh for another asker, so a per-conversation record would hand the window over again at every change of asker.
|
|
214
214
|
The addressed message (with its quote) comes first and the block follows it, framed as untrusted public text, not instructions, so the worker's saved history, which keeps the head of an entry, keeps the message. The framing says the addressed message is only the text before the block.
|
|
215
215
|
It is cut oldest first so the whole stays within `runTurn`'s 32,000 characters and the worker's current-message budget; the addressed message is never cut, and when no context fits, the turn is sent as before.
|
|
216
216
|
Options are validated at startup with core's bounds (`keep`, `fetch` at most 100; `messageChars`, `botMessageChars`, `peerMessageChars` at most 4000; unknown keys refused), and the option needs the Discord plugin.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-roundtable-sandbox",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.50.1",
|
|
4
4
|
"description": "Sealed guest channels and an allow-listed credential broker for pi-roundtable",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@earendil-works/pi-coding-agent": ">=1.0.0 <2",
|
|
40
|
-
"pi-roundtable": ">=0.
|
|
40
|
+
"pi-roundtable": ">=0.50.0 <0.51.0",
|
|
41
41
|
"typebox": ">=1.3.34 <2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@biomejs/biome": "2.5.15",
|
|
54
54
|
"@types/bun": "1.4.3",
|
|
55
55
|
"discord.js": "14.27.0",
|
|
56
|
-
"pi-roundtable": "0.
|
|
56
|
+
"pi-roundtable": "0.50.1",
|
|
57
57
|
"typebox": "1.4.6",
|
|
58
58
|
"typescript": "7.0.2"
|
|
59
59
|
}
|
package/src/channel-context.ts
CHANGED
|
@@ -68,6 +68,10 @@ export function resolveChannelContextOptions(
|
|
|
68
68
|
"channelContext must be true or channel context options",
|
|
69
69
|
);
|
|
70
70
|
const given = option === true ? {} : (option as ChannelContextOptions);
|
|
71
|
+
if ("conversation" in given)
|
|
72
|
+
throw new TypeError(
|
|
73
|
+
"channelContext.conversation is not supported in the sandbox: its history is one file per channel and never starts fresh for another asker",
|
|
74
|
+
);
|
|
71
75
|
onlyKeys("channelContext", given, KEYS);
|
|
72
76
|
bounded("fetch", given.fetch, 100);
|
|
73
77
|
bounded("keep", given.keep, 100);
|
|
@@ -116,7 +120,8 @@ export function resolveChannelContextOptions(
|
|
|
116
120
|
`channelContext.attachments.images must be an integer from 0 to 4, got ${String(images)}`,
|
|
117
121
|
);
|
|
118
122
|
const { attachments: _images, ...rest } = given;
|
|
119
|
-
|
|
123
|
+
// `conversation` is forced off too, so a host default of it does not reach the sandbox.
|
|
124
|
+
return { ...rest, conversation: () => undefined, attachments: { images: 0 } };
|
|
120
125
|
}
|
|
121
126
|
|
|
122
127
|
/** Whether a message is one whose channel context the sandbox may read: a Discord server message. */
|