@bakers-build/addon-runtime-bwrap 0.14.0 → 0.14.1-next.10

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.
@@ -9,5 +9,7 @@ export interface BwrapDeps {
9
9
  bwrapPath?: string;
10
10
  cliRoot: string;
11
11
  env: Readonly<Record<string, string | undefined>>;
12
+ /** Reads `/proc/sys/dev/tty/legacy_tiocsti`; injected by tests. */
13
+ readTiocsti?: () => string;
12
14
  }
13
15
  export declare function bwrapRuntime(options: BwrapOptions, deps: BwrapDeps): BbRuntime;
@@ -47,6 +47,17 @@ function softwarePaths(env) {
47
47
  }
48
48
  return paths;
49
49
  }
50
+ /** True only when the host reads `legacy_tiocsti` as 0; unreadable keeps `--new-session`. */
51
+ function tiocstiBlocked(deps) {
52
+ try {
53
+ const read = deps.readTiocsti ??
54
+ (() => readFileSync('/proc/sys/dev/tty/legacy_tiocsti', 'utf8'));
55
+ return read().trim() === '0';
56
+ }
57
+ catch {
58
+ return false;
59
+ }
60
+ }
50
61
  /** Build an explicit filesystem view; no blanket bind of the host root or home. */
51
62
  function argv(input, options, deps) {
52
63
  const ws = resolve(input.workspacePath);
@@ -116,7 +127,8 @@ function argv(input, options, deps) {
116
127
  '--unshare-pid',
117
128
  '--unshare-ipc',
118
129
  '--unshare-uts',
119
- '--new-session',
130
+ // TIOCSTI already blocked: stay in the pane's foreground group so herdr sees the agent.
131
+ ...(tiocstiBlocked(deps) ? [] : ['--new-session']),
120
132
  '--die-with-parent',
121
133
  '--cap-drop',
122
134
  'ALL',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-runtime-bwrap",
3
- "version": "0.14.0",
3
+ "version": "0.14.1-next.10",
4
4
  "description": "Isolate complete agent runs with an external Bubblewrap sandbox.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -23,11 +23,11 @@
23
23
  "directory": "bakers-cli/addons/runtime-bwrap"
24
24
  },
25
25
  "peerDependencies": {
26
- "@bakers-build/conductor": "^0.14.0",
27
- "@bakers-build/core": "^0.14.0"
26
+ "@bakers-build/conductor": "^0.14.1-next.10",
27
+ "@bakers-build/core": "^0.14.1-next.10"
28
28
  },
29
29
  "bakersBuild": {
30
- "commit": "9f7275a341fe96e9792bce6cd1bbc7b7afc1dcd0",
31
- "channel": "latest"
30
+ "commit": "a1604421ab259e7d70ead776e03a7773a16a961a",
31
+ "channel": "next"
32
32
  }
33
33
  }