pi-roundtable 0.7.3 → 0.7.5

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,36 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.7.5] - 2026-10-03
9
+
10
+ ### Added
11
+
12
+ - Coding: `workerBlockText` (what the worker reads for a declined or held call), `limits` (`reportChars`, `heldEntries`, `heldChars`) and `diagnosticChars`.
13
+ - Drawing: `permissive` accepts what a looser host's callers send (unknown card exclusions, shared spread cells, repeated or empty node ids, self-edges), and `mapLimits` values are checked.
14
+ - Sandbox: `ScopedSandboxDelegator` accepts `maxTitleChars`, `maxReportChars` and `diagnosticChars`.
15
+ - Web: `skills.errorDetail` shows why a skill could not be read.
16
+
17
+ ### Changed
18
+
19
+ - `scrubDiagnostic` also masks token, secret, password and API-key assignments in any case (query strings and JSON fields included), Cookie and API-key headers and JWTs, and works on a bounded prefix so hostile input stays fast.
20
+ - Sandbox: `ScopedSandboxDelegator` limits a title to 200 characters again by default.
21
+ - Web: the skill detail no longer refuses a body over 1 MiB or frontmatter over 64 KiB.
22
+
23
+ ## [0.7.4] - 2026-10-03
24
+
25
+ ### Added
26
+
27
+ - Export `scrubDiagnostic` from the kit: mask credentials in subprocess or worker text (URL userinfo, bearer values, well-known token shapes, secret-named assignments), drop control characters and bound the length, so a host can show a failure's reason without its secrets.
28
+ - Coding: `toolText` for the repository tools' descriptions and argument descriptions, `presentation.list` for the `repo_list` result, and `repo_push` takes a 7–40 character sha prefix of the reported commit.
29
+ - Sandbox: `SandboxResearchWorker` accepts the host's own `tools` (extension packages and factories, active tool names, prompt), a `scope` around the session and the `aborted` wording.
30
+ - Drawing: `cardPresentation.result` words the card draw result, and `mapLimits` lets a host accept longer relationship-map text.
31
+ - Web: a channel Discord cannot name shows the `channel name unavailable` text.
32
+
33
+ ### Changed
34
+
35
+ - Coding: git and gh failures name their scrubbed stderr again, a worker's own error reaches the report (scrubbed and bounded), the timeout and stop texts read as before ("the worker ran out of time (N minutes)", "the worker was stopped"), the refusals for a busy repository, a missing or over-long task and a full channel say what is wrong, a declined call is no longer listed as held, and the service reports the channels it works for so a shutdown can name them.
36
+ - Sandbox: `ScopedSandboxDelegator` refuses with the reasons the core delegator gave ("title and task are required", the task length, the channel's running count), no longer limits the title, and reports a failed job's scrubbed error message or "the worker ran out of time" instead of "Sandbox task failed".
37
+
8
38
  ## [0.7.3] - 2026-10-03
9
39
 
10
40
  ### Fixed
package/docs/plugins.md CHANGED
@@ -2490,6 +2490,7 @@ Import from the entries listed below; source area files are internal.
2490
2490
  | `withReplyFiles` | `pi-roundtable` | value |
2491
2491
  | `prepareImageBytes` | `pi-roundtable/kit` | value |
2492
2492
  | `ImagePreparationError` | `pi-roundtable/kit` | value |
2493
+ | `scrubDiagnostic` | `pi-roundtable/kit` | value |
2493
2494
  | `channelKey` | `pi-roundtable` | value |
2494
2495
  | `definePlugin` | `pi-roundtable` | value |
2495
2496
  | `defineRoundtable` | `pi-roundtable` | value |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-roundtable",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "description": "A plugin-driven Pi agent server for Discord",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -0,0 +1,50 @@
1
+ /** Tool text that may name a credential: userinfo in URLs, bearer values, and well-known token shapes. */
2
+ const CREDENTIALS: [RegExp, string][] = [
3
+ [/\b([a-z][a-z0-9+.-]*:\/\/)[^\s/@]+@/gi, "$1[redacted]@"],
4
+ [
5
+ /\b(authorization|proxy-authorization)\s*[:=]\s*[^\r\n]+/gi,
6
+ "$1: [redacted]",
7
+ ],
8
+ [/\b(bearer|basic|token)\s+[A-Za-z0-9._~+/=-]{8,}/gi, "$1 [redacted]"],
9
+ [
10
+ /\b(gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|glpat-[A-Za-z0-9_-]{16,}|sk-[A-Za-z0-9_-]{16,}|xox[abprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_-]{30,})\b/g,
11
+ "[redacted]",
12
+ ],
13
+ // Assignments, query parameters and JSON fields whose name says it is a secret, in any case.
14
+ [
15
+ /\b([a-z0-9_-]*(?:token|secret|password|passwd|api[_-]?key|credential)[a-z0-9_-]*)(["']?\s*[:=]\s*["']?)[^\s"',&;]+/gi,
16
+ "$1$2[redacted]",
17
+ ],
18
+ [
19
+ /\b(cookie|set-cookie|x-api-key|x-auth-token|x-access-token)\s*:\s*[^\r\n]+/gi,
20
+ "$1: [redacted]",
21
+ ],
22
+ [/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]*/g, "[redacted]"],
23
+ [
24
+ /-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z ]*PRIVATE KEY-----|$)/g,
25
+ "[redacted]",
26
+ ],
27
+ ];
28
+
29
+ /**
30
+ * Text from a failed subprocess or worker, safe to show a model or the owner: credentials are
31
+ * masked, control characters are removed, and the length is bounded. Empty input returns "".
32
+ */
33
+ export function scrubDiagnostic(text: string, max = 600): string {
34
+ // The patterns run on a bounded prefix, so hostile input cannot make them slow.
35
+ let clean = text.slice(0, Math.max(max * 4, 4096));
36
+ for (const [pattern, replacement] of CREDENTIALS)
37
+ clean = clean.replace(pattern, replacement);
38
+ clean = Array.from(clean, (char) => {
39
+ const code = char.charCodeAt(0);
40
+ // Keep tab and newline; every other control character becomes a space.
41
+ return code === 9 || code === 10 || code > 31
42
+ ? code === 127
43
+ ? " "
44
+ : char
45
+ : " ";
46
+ })
47
+ .join("")
48
+ .trim();
49
+ return clean.length > max ? `${clean.slice(0, max - 1)}…` : clean;
50
+ }
package/src/kit/index.ts CHANGED
@@ -14,6 +14,7 @@ export {
14
14
  withAttachmentsBlock,
15
15
  withReference,
16
16
  } from "./channels.ts";
17
+ export { scrubDiagnostic } from "./diagnostics.ts";
17
18
  export type {
18
19
  ChoiceAnswer,
19
20
  ChoiceQuestion,