pi-roundtable-sandbox 0.50.0 → 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 CHANGED
@@ -2,6 +2,13 @@
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
+
5
12
  ## [0.50.0] - 2026-11-16
6
13
 
7
14
  ### Added
package/README.md CHANGED
@@ -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.50.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",
@@ -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.50.0",
56
+ "pi-roundtable": "0.50.1",
57
57
  "typebox": "1.4.6",
58
58
  "typescript": "7.0.2"
59
59
  }
@@ -48,7 +48,6 @@ const KEYS = [
48
48
  "attachments",
49
49
  "starter",
50
50
  "authors",
51
- "conversation",
52
51
  ];
53
52
 
54
53
  function onlyKeys(name: string, value: object, allowed: readonly string[]) {
@@ -69,6 +68,10 @@ export function resolveChannelContextOptions(
69
68
  "channelContext must be true or channel context options",
70
69
  );
71
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
+ );
72
75
  onlyKeys("channelContext", given, KEYS);
73
76
  bounded("fetch", given.fetch, 100);
74
77
  bounded("keep", given.keep, 100);
@@ -95,11 +98,6 @@ export function resolveChannelContextOptions(
95
98
  throw new TypeError("channelContext.starter must be a boolean");
96
99
  if (given.authors !== undefined && typeof given.authors !== "function")
97
100
  throw new TypeError("channelContext.authors must be a function");
98
- if (
99
- given.conversation !== undefined &&
100
- typeof given.conversation !== "function"
101
- )
102
- throw new TypeError("channelContext.conversation must be a function");
103
101
  if (given.attachments !== undefined) {
104
102
  if (typeof given.attachments !== "object" || given.attachments === null)
105
103
  throw new TypeError("channelContext.attachments must be an object");
@@ -122,7 +120,8 @@ export function resolveChannelContextOptions(
122
120
  `channelContext.attachments.images must be an integer from 0 to 4, got ${String(images)}`,
123
121
  );
124
122
  const { attachments: _images, ...rest } = given;
125
- return { ...rest, attachments: { images: 0 } };
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 } };
126
125
  }
127
126
 
128
127
  /** Whether a message is one whose channel context the sandbox may read: a Discord server message. */