@arnilo/prism-coding-agent 0.0.16 → 0.0.17
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 +8 -0
- package/dist/shell.d.ts +3 -0
- package/dist/shell.js +15 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.17] - 2026-07-29
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `ShellToolOptions.envAllowlist` restricts the environment the spawn hook and child process see (secret scrubbing without re-implementing the hook).
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
- Released with exact 0.0.17 graph.
|
|
10
|
+
|
|
3
11
|
## [0.0.16] - 2026-07-26
|
|
4
12
|
|
|
5
13
|
### Changed
|
package/dist/shell.d.ts
CHANGED
|
@@ -55,6 +55,9 @@ export interface ShellToolOptions {
|
|
|
55
55
|
shellPath?: string;
|
|
56
56
|
/** Hook to adjust command, cwd, or env before execution. */
|
|
57
57
|
spawnHook?: BashSpawnHook;
|
|
58
|
+
/** Restrict the process environment cloned for the spawn hook / child process to these
|
|
59
|
+
* names (e.g. scrub secrets). Unset keeps the full `process.env` clone. */
|
|
60
|
+
envAllowlist?: readonly string[];
|
|
58
61
|
/** Max lines kept in the tail snapshot (default 2000). */
|
|
59
62
|
maxLines?: number;
|
|
60
63
|
/** Max bytes kept in the tail snapshot (default 50KB). */
|
package/dist/shell.js
CHANGED
|
@@ -29,6 +29,18 @@ import { OutputAccumulator } from "./output-accumulator.js";
|
|
|
29
29
|
import { formatSize } from "./truncate.js";
|
|
30
30
|
const EXIT_STDIO_GRACE_MS = 100;
|
|
31
31
|
// --- spawn internals (re-ported from pi utils/shell.js + utils/child-process.js) ---
|
|
32
|
+
/** Clone the process environment, optionally restricted to an allowlist of names. */
|
|
33
|
+
function pickSpawnEnv(allowlist) {
|
|
34
|
+
if (!allowlist)
|
|
35
|
+
return { ...process.env };
|
|
36
|
+
const env = {};
|
|
37
|
+
for (const name of allowlist) {
|
|
38
|
+
const value = process.env[name];
|
|
39
|
+
if (value !== undefined)
|
|
40
|
+
env[name] = value;
|
|
41
|
+
}
|
|
42
|
+
return env;
|
|
43
|
+
}
|
|
32
44
|
/** Resolve the shell binary + args. shellPath → SHELL env → /bin/bash → sh. */
|
|
33
45
|
export function getShellConfig(customShellPath) {
|
|
34
46
|
if (customShellPath) {
|
|
@@ -284,9 +296,10 @@ export function createShellTool(cwd, options) {
|
|
|
284
296
|
return { toolCallId, name: "shell", content: [{ type: "text", text: message }], error: { message } };
|
|
285
297
|
}
|
|
286
298
|
const resolvedCommand = commandPrefix ? `${commandPrefix}\n${command}` : command;
|
|
299
|
+
const baseEnv = pickSpawnEnv(options?.envAllowlist);
|
|
287
300
|
let spawnContext = spawnHook
|
|
288
|
-
? spawnHook({ command: resolvedCommand, cwd, env:
|
|
289
|
-
: { command: resolvedCommand, cwd, env:
|
|
301
|
+
? spawnHook({ command: resolvedCommand, cwd, env: baseEnv })
|
|
302
|
+
: { command: resolvedCommand, cwd, env: baseEnv };
|
|
290
303
|
const policyCheck = await enforceExecutionPolicy(options?.executionPolicy, {
|
|
291
304
|
kind: "shell",
|
|
292
305
|
operation: "execute",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arnilo/prism-coding-agent",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "Optional coding-agent tools (shell, read, write, edit, repo_list, repo_search, opt-in Git/check/ask-user-decision, and durable plan/checkpoint helpers) package for Prism.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"diff": "^9.0.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@arnilo/prism": "0.0.
|
|
32
|
-
"@arnilo/prism-workflows": "0.0.
|
|
31
|
+
"@arnilo/prism": "0.0.17",
|
|
32
|
+
"@arnilo/prism-workflows": "0.0.17"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@arnilo/prism": "file:../..",
|