gentle-pi 3.4.0 → 3.5.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.
@@ -0,0 +1,36 @@
1
+ // Interactive RPC host signal: the desktop app sets this environment variable
2
+ // on the pi process it spawns directly (`--mode rpc`), letting Gentle answer
3
+ // ask-user tools through pi's RPC dialogs and publish live subagent state.
4
+ // `lib/agents-runner.ts` strips it from every subagent child env so headless
5
+ // RPC children never see it and stay unaffected by this feature.
6
+
7
+ /** Environment variable the desktop app sets on its own interactive pi process. */
8
+ export const INTERACTIVE_HOST_ENV = "GENTLE_SHELL_INTERACTIVE_HOST";
9
+
10
+ /**
11
+ * True only when running under `--mode rpc` with the interactive host
12
+ * variable set to exactly `"1"`. Any other value, or its absence, keeps RPC
13
+ * headless (the existing subagent behaviour).
14
+ */
15
+ export function isInteractiveRpcHost(mode: string, env: NodeJS.ProcessEnv = process.env): boolean {
16
+ return mode === "rpc" && env[INTERACTIVE_HOST_ENV] === "1";
17
+ }
18
+
19
+ /**
20
+ * True for the interactive TUI, or for an interactive RPC host. Extensions
21
+ * use this to offer dialog-capable behaviour without special-casing RPC.
22
+ */
23
+ export function isInteractiveMode(mode: string, env: NodeJS.ProcessEnv = process.env): boolean {
24
+ return mode === "tui" || isInteractiveRpcHost(mode, env);
25
+ }
26
+
27
+ /**
28
+ * Copy of `env` with the interactive host variable removed. Used when
29
+ * assembling a subagent child's environment so it never inherits the
30
+ * parent's interactive-host signal, even when the parent itself is one.
31
+ */
32
+ export function withoutInteractiveHost(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
33
+ const next = { ...env };
34
+ delete next[INTERACTIVE_HOST_ENV];
35
+ return next;
36
+ }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "gentle-pi",
3
- "version": "3.4.0",
3
+ "version": "3.5.1",
4
4
  "description": "Turn Pi into el Gentleman: a senior-architect development harness with SDD/OpenSpec, subagents, strict TDD evidence, review guardrails, and skill discovery.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
+ "bin": {
8
+ "gentle-shell": "bin/gentle-shell.mjs"
9
+ },
7
10
  "keywords": [
8
11
  "pi-package",
9
12
  "pi",
@@ -24,6 +27,7 @@
24
27
  },
25
28
  "files": [
26
29
  "assets/",
30
+ "bin/",
27
31
  "contracts/",
28
32
  "docs/",
29
33
  "extensions/",