@erichll/pi-sandbox 0.16.0 → 0.17.0

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,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.0 - 2026-09-05
4
+
5
+ - Depend on the coordinated `@erichll/pi-auto-review 0.17.0` release.
6
+ - Accept the whole pi-subagents 0.65.x line for protected native mode instead
7
+ of pinning exactly 0.65.0: patch updates such as 0.65.1 (background session
8
+ and worktree-patch fixes) now load normally. Any minor or major bump still
9
+ fails closed, and the real compatibility gates remain the
10
+ `./capability-ceiling` export check and the capability-ceiling version
11
+ check, so the version range only guards against blind accept-on-drift.
12
+ - Widen the `pi-subagents` peer range to `>=0.65.0 <0.66.0` and the dev pin
13
+ accordingly.
14
+
3
15
  ## 0.16.0 - 2026-09-05
4
16
 
5
17
  - 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.0",
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.65.0 <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.65.0 <0.66.0",
72
72
  "typescript": "^6.0.3"
73
73
  }
74
74
  }
@@ -3,7 +3,13 @@ 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.65.x. Patch updates (e.g. 0.65.1) are accepted;
8
+ * any minor or major bump fails closed until this adapter is revalidated against
9
+ * the new internal layout. The exports/ceiling checks below are the real
10
+ * compatibility gate; this range only guards against blind accept-on-drift.
11
+ */
12
+ export const PI_SUBAGENTS_COMPAT_RANGE = ">=0.65.0 <0.66.0";
7
13
  export const NATIVE_CHILD_TOOLS = ["bash", "read", "grep", "find", "ls"] as const;
8
14
  export const PI_SANDBOX_ACKNOWLEDGEMENT = "@erichll:pi-sandbox";
9
15
 
@@ -57,12 +63,22 @@ function requiredFunction(
57
63
  name: string,
58
64
  ): asserts value is (...args: never[]) => unknown {
59
65
  if (typeof value !== "function") {
60
- throw new Error(`pi-subagents 0.65.0 compatibility failure: missing ${name}`);
66
+ throw new Error(`pi-subagents 0.65.x compatibility failure: missing ${name}`);
61
67
  }
62
68
  }
63
69
 
64
70
  /**
65
- * Load the public ceiling API and the exact 0.65.0 discovery/config internals.
71
+ * Accept only versions inside PI_SUBAGENTS_COMPAT_RANGE (0.65.x, including
72
+ * prerelease suffixes like 0.65.2-beta.1) without pulling in a semver runtime.
73
+ */
74
+ export function isCompatiblePiSubagentsVersion(version: unknown): boolean {
75
+ if (typeof version !== "string") return false;
76
+ const match = /^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(version);
77
+ if (!match) return false;
78
+ return Number(match[1] ?? "") === 0 && Number(match[2] ?? "") === 65;
79
+ }
80
+
81
+ /** Load the public ceiling API and the 0.65.x discovery/config internals.
66
82
  * This intentionally fails closed on package version, export, or layout drift.
67
83
  */
68
84
  export async function loadPiSubagentsNativeRuntime(
@@ -73,14 +89,14 @@ export async function loadPiSubagentsNativeRuntime(
73
89
  const packageJson = JSON.parse(
74
90
  await readFile(join(root, "package.json"), "utf8"),
75
91
  ) as { version?: unknown; exports?: Record<string, unknown> };
76
- if (packageJson.version !== PI_SUBAGENTS_VERSION) {
92
+ if (!isCompatiblePiSubagentsVersion(packageJson.version)) {
77
93
  throw new Error(
78
- `pi-subagents protected mode requires exactly ${PI_SUBAGENTS_VERSION}; found ${String(packageJson.version)}`,
94
+ `pi-subagents protected mode requires ${PI_SUBAGENTS_COMPAT_RANGE}; found ${String(packageJson.version)}`,
79
95
  );
80
96
  }
81
97
  if (packageJson.exports?.["./capability-ceiling"] !== "./src/api/capability-ceiling.ts") {
82
98
  throw new Error(
83
- "pi-subagents 0.65.0 compatibility failure: capability-ceiling export changed",
99
+ "pi-subagents 0.65.x compatibility failure: capability-ceiling export changed",
84
100
  );
85
101
  }
86
102
 
@@ -94,11 +110,11 @@ export async function loadPiSubagentsNativeRuntime(
94
110
  jiti.import(pathToFileURL(join(root, "src/extension/config.ts")).href) as Promise<ConfigModule>,
95
111
  ]).catch((error) => {
96
112
  throw new Error(
97
- `pi-subagents 0.65.0 compatibility failure: ${error instanceof Error ? error.message : String(error)}`,
113
+ `pi-subagents 0.65.x compatibility failure: ${error instanceof Error ? error.message : String(error)}`,
98
114
  );
99
115
  });
100
116
  if (ceiling.SUBAGENT_CAPABILITY_CEILING_VERSION !== 1) {
101
- throw new Error("pi-subagents 0.65.0 compatibility failure: unsupported capability ceiling version");
117
+ throw new Error("pi-subagents 0.65.x compatibility failure: unsupported capability ceiling version");
102
118
  }
103
119
  requiredFunction(ceiling.registerSubagentCapabilityCeiling, "registerSubagentCapabilityCeiling");
104
120
  requiredFunction(discovery.discoverAgents, "discoverAgents");
@@ -195,7 +211,7 @@ export function nativeSubagentCallBlockReason(
195
211
  }
196
212
  const isDirect = typeof input.agent === "string" && input.agent.trim() !== "";
197
213
  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";
214
+ return "workflowScript and workflowScriptPath are disabled because pi-subagents 0.65.x disables ambient extensions for their native children";
199
215
  }
200
216
  if (!isDirect) {
201
217
  return "protected mode supports only direct agent launches";