pi-quiet 0.2.0 → 0.2.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/README.md +1 -1
- package/package.json +1 -1
- package/src/bash-options.ts +10 -0
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ The extension re-registers the built-in `bash` tool via pi's own `createBashTool
|
|
|
25
25
|
|
|
26
26
|
- **Rendering.** The two render slots above. Execution *is* the built-in tool: the model receives the full output, permission systems, reviewers, and sandboxes that hook execution are unaffected, and session logs store the full result.
|
|
27
27
|
- **pi's shell settings.** The built-in is constructed with `shellCommandPrefix` and `shellPath` — read with the same settings pi itself would use, including pi's own project-trust decision for the current directory (`session_start` is where that decision becomes available, so that is where the tool is registered). A trusted project's `.pi/settings.json` contributes its `shellCommandPrefix` and `shellPath`; an untrusted project's are ignored, exactly as pi ignores them. Re-registration on each `session_start` means a `/reload` after editing settings picks up the new prefix.
|
|
28
|
-
- **Session identity.** Every command's environment carries `AGENT_SESSION_ID`, set from pi's per-command `PI_SESSION_ID`. Tools that scope themselves to the session that ran them (muster, galley, tackle) read that neutral name. It is set per command from pi's live session, never from the extension's process environment, so an in-process subagent can never leave the parent's commands carrying a child's id.
|
|
28
|
+
- **Session identity.** Every command's environment carries `AGENT_SESSION_ID`, set from pi's per-command `PI_SESSION_ID`. Tools that scope themselves to the session that ran them (muster, galley, tackle) read that neutral name. It is set per command from pi's live session, never from the extension's process environment, so an in-process subagent can never leave the parent's commands carrying a child's id. An inherited `AGENT_SESSION_CHILD` is removed: that marker belongs only to processes that run as part of the session (pi-claude-bridge's Claude children), so a Claude session started from a command keeps its own id.
|
|
29
29
|
|
|
30
30
|
## Install
|
|
31
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-quiet",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "This rig's bash tool for the pi coding agent: calm one-line rendering (ctrl+o expands), pi's shell settings honoured, AGENT_SESSION_ID stamped per command from PI_SESSION_ID. Execution is still pi's built-in.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/src/bash-options.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BashSpawnContext, BashToolOptions } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
|
|
3
3
|
export const SESSION_ID_VAR = "AGENT_SESSION_ID";
|
|
4
|
+
export const SESSION_CHILD_VAR = "AGENT_SESSION_CHILD";
|
|
4
5
|
|
|
5
6
|
// The two pi settings the built-in bash tool is constructed with. pi's own
|
|
6
7
|
// SettingsManager satisfies this; tests pass a literal.
|
|
@@ -17,8 +18,17 @@ export type ShellSettings = {
|
|
|
17
18
|
// When pi did not expose a session (exposeSessionEnvironment: false), an
|
|
18
19
|
// inherited value is removed rather than passed through — a command never
|
|
19
20
|
// carries an identity that is not its session's.
|
|
21
|
+
//
|
|
22
|
+
// AGENT_SESSION_CHILD is always removed. It tells tools-common's harness rule
|
|
23
|
+
// that AGENT_SESSION_ID beats CLAUDE_CODE_SESSION_ID because the process runs
|
|
24
|
+
// as part of that session (pi-claude-bridge sets it on its Claude children).
|
|
25
|
+
// pi never sets it, so any value here was inherited from whatever started pi;
|
|
26
|
+
// passed through, it would make a Claude session launched from a command
|
|
27
|
+
// resolve to pi's id instead of its own. pi's own commands resolve through
|
|
28
|
+
// AGENT_SESSION_ID alone, marker or not.
|
|
20
29
|
export function identitySpawnHook(context: BashSpawnContext): BashSpawnContext {
|
|
21
30
|
const env: NodeJS.ProcessEnv = { ...context.env };
|
|
31
|
+
delete env[SESSION_CHILD_VAR];
|
|
22
32
|
const id = env.PI_SESSION_ID;
|
|
23
33
|
if (id === undefined || id === "") delete env[SESSION_ID_VAR];
|
|
24
34
|
else env[SESSION_ID_VAR] = id;
|