@commonlyai/cli 0.1.71 → 0.1.72

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonlyai/cli",
3
- "version": "0.1.71",
3
+ "version": "0.1.72",
4
4
  "license": "Apache-2.0",
5
5
  "description": "The Commonly CLI — connect agents, manage pods, iterate fast",
6
6
  "type": "module",
@@ -43,6 +43,7 @@ import {
43
43
  spawnCredentials,
44
44
  } from '../upstream-refusal.js';
45
45
  import { buildMemoryPreamble } from '../memory-bridge.js';
46
+ import { effectiveSandboxTrust } from '../environment.js';
46
47
  import { GRANT_BROKER_REFUSAL, isGrantBrokerUrl } from './pi-mcp-client.mjs';
47
48
  import { deliverSeatCredential, withholdRuntimeCredential } from '../mcp-credential-delivery.js';
48
49
  import { removeCredentialFile, writeCredentialFile } from '../credential-file.js';
@@ -283,10 +284,23 @@ export const sessionExists = async (sessionDir, sessionId) => {
283
284
  }
284
285
  };
285
286
 
286
- /** Fail closed: pi cannot enforce `environment.sandbox`, so a seat that declares one does not start. */
287
+ /**
288
+ * Fail closed: pi cannot enforce `environment.sandbox`, so a seat that declares
289
+ * one does not start.
290
+ *
291
+ * The trust is read THROUGH the legacy table (`effectiveSandboxTrust`), not
292
+ * raw. A stored `internal` means `public` (Vera 69592, Wren 69585) and every
293
+ * other gate in this package resolves it that way: the attach path
294
+ * (`agent.js`), the mode resolver (`sandbox/mode.js`) and the grant-broker
295
+ * guard. Reading it raw here made this gate the one site that failed OPEN — a
296
+ * legacy record passed both checks and the seat started unconfined, which is
297
+ * the exact outcome that was refused for the record it was migrated from.
298
+ * The mode clause needs no mapping: `internal` and the derived mode are
299
+ * independent, and a public-meaning record is refused before the mode is read.
300
+ */
287
301
  export const assertNoSandboxDeclared = (environment = {}) => {
288
302
  const sandbox = environment?.sandbox || {};
289
- if (sandbox.trust === 'public') {
303
+ if (effectiveSandboxTrust(sandbox.trust) === 'public') {
290
304
  throw new Error('pi adapter: public-trust seats are not supported — pi has no enforced sandbox; do not attach a pi seat to a stranger-readable pod');
291
305
  }
292
306
  if (sandbox.mode && sandbox.mode !== 'none') {
@@ -32,8 +32,9 @@ export const ADAPTERS_WITH_DEFAULT_MCP = new Set(['claude', 'codex', 'pi']);
32
32
  *
33
33
  * `pi` is absent deliberately. It has no sandbox path until #1740's transport
34
34
  * work gives it one, and since #1727 it REFUSES TO START on a spec that
35
- * declares one: `assertNoSandboxDeclared` in adapters/pi.js throws on
36
- * `trust: 'public'` and on any `mode` other than 'none'. So handing pi this
35
+ * declares one: `assertNoSandboxDeclared` in adapters/pi.js throws on an
36
+ * effective `trust: 'public'` (a legacy `internal` resolves to it) and on any
37
+ * `mode` other than 'none'. So handing pi this
37
38
  * block is not a harmless no-op — it is an unspawnable seat. A pi seat gets the
38
39
  * `mcp[]` half only, and the residual is that such a seat runs unconfined: that
39
40
  * belongs to the row that owns pi confinement, not to a declaration written