pi-roundtable 0.7.3 → 0.7.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.
- package/CHANGELOG.md +15 -0
- package/docs/plugins.md +1 -0
- package/package.json +1 -1
- package/src/kit/diagnostics.ts +43 -0
- package/src/kit/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.7.4] - 2026-10-03
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- 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.
|
|
13
|
+
- 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.
|
|
14
|
+
- 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.
|
|
15
|
+
- Drawing: `cardPresentation.result` words the card draw result, and `mapLimits` lets a host accept longer relationship-map text.
|
|
16
|
+
- Web: a channel Discord cannot name shows the `channel name unavailable` text.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- 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.
|
|
21
|
+
- 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".
|
|
22
|
+
|
|
8
23
|
## [0.7.3] - 2026-10-03
|
|
9
24
|
|
|
10
25
|
### 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
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
[
|
|
14
|
+
/\b([A-Z0-9_]*(?:TOKEN|SECRET|PASSWORD|PASSWD|API_?KEY|CREDENTIAL)[A-Z0-9_]*)\s*=\s*\S+/g,
|
|
15
|
+
"$1=[redacted]",
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z ]*PRIVATE KEY-----|$)/g,
|
|
19
|
+
"[redacted]",
|
|
20
|
+
],
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Text from a failed subprocess or worker, safe to show a model or the owner: credentials are
|
|
25
|
+
* masked, control characters are removed, and the length is bounded. Empty input returns "".
|
|
26
|
+
*/
|
|
27
|
+
export function scrubDiagnostic(text: string, max = 600): string {
|
|
28
|
+
let clean = text;
|
|
29
|
+
for (const [pattern, replacement] of CREDENTIALS)
|
|
30
|
+
clean = clean.replace(pattern, replacement);
|
|
31
|
+
clean = Array.from(clean, (char) => {
|
|
32
|
+
const code = char.charCodeAt(0);
|
|
33
|
+
// Keep tab and newline; every other control character becomes a space.
|
|
34
|
+
return code === 9 || code === 10 || code > 31
|
|
35
|
+
? code === 127
|
|
36
|
+
? " "
|
|
37
|
+
: char
|
|
38
|
+
: " ";
|
|
39
|
+
})
|
|
40
|
+
.join("")
|
|
41
|
+
.trim();
|
|
42
|
+
return clean.length > max ? `${clean.slice(0, max - 1)}…` : clean;
|
|
43
|
+
}
|