@erichll/pi-sandbox 0.16.0 → 0.17.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.1 - 2026-09-06
4
+
5
+ - Move the `pi-subagents` compatibility floor to 0.66.0 for protected native
6
+ mode and drop the upper pin: new minors are accepted, and the real
7
+ compatibility gates remain the `./capability-ceiling` export check and the
8
+ capability-ceiling version check.
9
+ - Revalidated the adapter against the published pi-subagents 0.66.0 package:
10
+ the ceiling registry (`SUBAGENT_CAPABILITY_CEILING_VERSION` 1),
11
+ `registerSubagentCapabilityCeiling` options and handle, agent discovery and
12
+ resolution, config loading with `scheduledRuns`, and the
13
+ `runtimeAcknowledgedExtensions` acknowledgement mechanism are unchanged.
14
+ - Widen the `pi-subagents` peer and dev ranges to `>=0.66.0`. Protected mode
15
+ now requires pi-subagents 0.66.0 or newer; 0.65.x installs fail closed with
16
+ an explicit version error.
17
+
18
+ ## 0.17.0 - 2026-09-05
19
+
20
+ - Depend on the coordinated `@erichll/pi-auto-review 0.17.0` release.
21
+ - Accept the whole pi-subagents 0.65.x line for protected native mode instead
22
+ of pinning exactly 0.65.0: patch updates such as 0.65.1 (background session
23
+ and worktree-patch fixes) now load normally. Any minor or major bump still
24
+ fails closed, and the real compatibility gates remain the
25
+ `./capability-ceiling` export check and the capability-ceiling version
26
+ check, so the version range only guards against blind accept-on-drift.
27
+ - Widen the `pi-subagents` peer range to `>=0.65.0 <0.66.0` and the dev pin
28
+ accordingly.
29
+
3
30
  ## 0.16.0 - 2026-09-05
4
31
 
5
32
  - Depend on the coordinated `@erichll/pi-auto-review 0.16.0` release.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erichll/pi-sandbox",
3
- "version": "0.16.0",
3
+ "version": "0.17.1",
4
4
  "description": "Linux (bubblewrap) and macOS (Seatbelt) process sandbox for Pi backed by Anthropic's @anthropic-ai/sandbox-runtime. Fail-closed static filesystem policy plus per-connection network approval from pi-auto-review; sandboxes main-agent Bash and built-in subagent process trees.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -51,12 +51,12 @@
51
51
  },
52
52
  "dependencies": {
53
53
  "@anthropic-ai/sandbox-runtime": "0.0.75",
54
- "@erichll/pi-auto-review": "0.16.0",
54
+ "@erichll/pi-auto-review": "0.17.0",
55
55
  "jiti": "2.7.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "@earendil-works/pi-coding-agent": "^0.85.0",
59
- "pi-subagents": "0.65.0",
59
+ "pi-subagents": ">=0.66.0",
60
60
  "typebox": ">=1.0.0"
61
61
  },
62
62
  "peerDependenciesMeta": {
@@ -68,7 +68,7 @@
68
68
  "@earendil-works/pi-coding-agent": "^0.85.0",
69
69
  "@earendil-works/pi-server": "^0.85.0",
70
70
  "@types/node": "^26.2.0",
71
- "pi-subagents": "0.65.0",
71
+ "pi-subagents": ">=0.66.0",
72
72
  "typescript": "^6.0.3"
73
73
  }
74
74
  }
@@ -3,7 +3,15 @@ import { dirname, join } from "node:path";
3
3
  import { fileURLToPath, pathToFileURL } from "node:url";
4
4
  import { createJiti } from "jiti";
5
5
 
6
- export const PI_SUBAGENTS_VERSION = "0.65.0";
6
+ /**
7
+ * Compatible pi-subagents line: 0.66.0 and above (no upper pin). Any new minor
8
+ * is accepted, so the exports/ceiling checks below are the real compatibility
9
+ * gate; this range only rejects old lines and guards against blind
10
+ * accept-on-drift. Revalidated against 0.66.0: ceiling registry, discovery,
11
+ * and config internals unchanged (verified 2026-09-06 against the published
12
+ * 0.66.0 package).
13
+ */
14
+ export const PI_SUBAGENTS_COMPAT_RANGE = ">=0.66.0";
7
15
  export const NATIVE_CHILD_TOOLS = ["bash", "read", "grep", "find", "ls"] as const;
8
16
  export const PI_SANDBOX_ACKNOWLEDGEMENT = "@erichll:pi-sandbox";
9
17
 
@@ -57,12 +65,23 @@ function requiredFunction(
57
65
  name: string,
58
66
  ): asserts value is (...args: never[]) => unknown {
59
67
  if (typeof value !== "function") {
60
- throw new Error(`pi-subagents 0.65.0 compatibility failure: missing ${name}`);
68
+ throw new Error(`pi-subagents compatibility failure: missing ${name}`);
61
69
  }
62
70
  }
63
71
 
64
72
  /**
65
- * Load the public ceiling API and the exact 0.65.0 discovery/config internals.
73
+ * Accept only versions at or above PI_SUBAGENTS_COMPAT_RANGE (>= 0.66.0,
74
+ * including prerelease suffixes like 0.66.1-beta.1) without pulling in a
75
+ * semver runtime.
76
+ */
77
+ export function isCompatiblePiSubagentsVersion(version: unknown): boolean {
78
+ if (typeof version !== "string") return false;
79
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(version);
80
+ if (!match) return false;
81
+ return Number(match[1] ?? "") === 0 && Number(match[2] ?? "") >= 66;
82
+ }
83
+
84
+ /** Load the public ceiling API and the discovery/config internals.
66
85
  * This intentionally fails closed on package version, export, or layout drift.
67
86
  */
68
87
  export async function loadPiSubagentsNativeRuntime(
@@ -73,14 +92,14 @@ export async function loadPiSubagentsNativeRuntime(
73
92
  const packageJson = JSON.parse(
74
93
  await readFile(join(root, "package.json"), "utf8"),
75
94
  ) as { version?: unknown; exports?: Record<string, unknown> };
76
- if (packageJson.version !== PI_SUBAGENTS_VERSION) {
95
+ if (!isCompatiblePiSubagentsVersion(packageJson.version)) {
77
96
  throw new Error(
78
- `pi-subagents protected mode requires exactly ${PI_SUBAGENTS_VERSION}; found ${String(packageJson.version)}`,
97
+ `pi-subagents protected mode requires ${PI_SUBAGENTS_COMPAT_RANGE}; found ${String(packageJson.version)}`,
79
98
  );
80
99
  }
81
100
  if (packageJson.exports?.["./capability-ceiling"] !== "./src/api/capability-ceiling.ts") {
82
101
  throw new Error(
83
- "pi-subagents 0.65.0 compatibility failure: capability-ceiling export changed",
102
+ "pi-subagents compatibility failure: capability-ceiling export changed",
84
103
  );
85
104
  }
86
105
 
@@ -94,11 +113,11 @@ export async function loadPiSubagentsNativeRuntime(
94
113
  jiti.import(pathToFileURL(join(root, "src/extension/config.ts")).href) as Promise<ConfigModule>,
95
114
  ]).catch((error) => {
96
115
  throw new Error(
97
- `pi-subagents 0.65.0 compatibility failure: ${error instanceof Error ? error.message : String(error)}`,
116
+ `pi-subagents compatibility failure: ${error instanceof Error ? error.message : String(error)}`,
98
117
  );
99
118
  });
100
119
  if (ceiling.SUBAGENT_CAPABILITY_CEILING_VERSION !== 1) {
101
- throw new Error("pi-subagents 0.65.0 compatibility failure: unsupported capability ceiling version");
120
+ throw new Error("pi-subagents compatibility failure: unsupported capability ceiling version");
102
121
  }
103
122
  requiredFunction(ceiling.registerSubagentCapabilityCeiling, "registerSubagentCapabilityCeiling");
104
123
  requiredFunction(discovery.discoverAgents, "discoverAgents");
@@ -195,7 +214,7 @@ export function nativeSubagentCallBlockReason(
195
214
  }
196
215
  const isDirect = typeof input.agent === "string" && input.agent.trim() !== "";
197
216
  if (input.workflowScript !== undefined || input.workflowScriptPath !== undefined) {
198
- return "workflowScript and workflowScriptPath are disabled because pi-subagents 0.65.0 disables ambient extensions for their native children";
217
+ return "workflowScript and workflowScriptPath are disabled because pi-subagents disables ambient extensions for their native children";
199
218
  }
200
219
  if (!isDirect) {
201
220
  return "protected mode supports only direct agent launches";