@commonlyai/cli 0.1.398 → 0.1.399
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 +1 -1
- package/src/commands/agent.js +16 -4
- package/src/lib/adapters/codex.js +615 -22
- package/src/lib/sandbox/guest-home.js +178 -0
- package/src/lib/sandbox/host-check.js +17 -2
- package/src/lib/sandbox/microsandbox.js +475 -57
- package/src/lib/sandbox/mode.js +24 -2
package/package.json
CHANGED
package/src/commands/agent.js
CHANGED
|
@@ -118,8 +118,10 @@ import { claimReleaseFor, ackResultFor, EMPTY_OUTPUT } from '../lib/claim-outcom
|
|
|
118
118
|
import { createClaimedWorkGate } from '../lib/claimed-work-gate.js';
|
|
119
119
|
import { prepareCommitAttribution } from '../lib/commit-attribution.js';
|
|
120
120
|
import { detectBwrap } from '../lib/sandbox/bwrap.js';
|
|
121
|
-
import { resolvePublicSandboxMode } from '../lib/sandbox/mode.js';
|
|
122
|
-
import {
|
|
121
|
+
import { resolveCodexSandboxMode, resolvePublicSandboxMode } from '../lib/sandbox/mode.js';
|
|
122
|
+
import {
|
|
123
|
+
checkMicrovmAttach, probeWhp as defaultProbeWhp, refuseMicrovmMcpDeclarations,
|
|
124
|
+
} from '../lib/sandbox/microsandbox.js';
|
|
123
125
|
import {
|
|
124
126
|
CODEX_OPTED_IN_PUBLIC_POD_MESSAGE, UNSANDBOXED_FLAG, bwrapRefusedMessage, hostSandboxRefusal, windowsSandboxMessage,
|
|
125
127
|
} from '../lib/sandbox/host-check.js';
|
|
@@ -1497,6 +1499,13 @@ export const resolveAttachSandbox = ({
|
|
|
1497
1499
|
// Both confined trusts take their mode from the host the same way; they
|
|
1498
1500
|
// differ in what the policy inside the sandbox allows, not in the sandbox.
|
|
1499
1501
|
const confined = trust === 'public' || trust === 'workspace';
|
|
1502
|
+
// A public Codex seat on native Windows with the microVM opt-in runs in the
|
|
1503
|
+
// VM whatever access it declared (mode.js resolveCodexSandboxMode), so its
|
|
1504
|
+
// attach takes the microvm branch, never the Codex-profile one.
|
|
1505
|
+
if (adapterName === 'codex' && trust === 'public'
|
|
1506
|
+
&& resolveCodexSandboxMode(sandbox, platform) === 'microvm') {
|
|
1507
|
+
return { mode: 'microvm', trust };
|
|
1508
|
+
}
|
|
1500
1509
|
const mode = sandbox?.mode
|
|
1501
1510
|
|| (confined ? resolvePublicSandboxMode(sandbox, platform) : 'none');
|
|
1502
1511
|
if (confined && mode === 'none') {
|
|
@@ -1593,7 +1602,7 @@ export const performAttach = async ({
|
|
|
1593
1602
|
// that don't offer the flag. A seat with no sandbox block still needs the
|
|
1594
1603
|
// person's opt-in at `agent run`.
|
|
1595
1604
|
const codexRefusal = hostSandboxRefusal({
|
|
1596
|
-
environment, adapterName, platform, hostUnconfined: true, optedIn: true, detectBwrap: probeBwrap,
|
|
1605
|
+
environment, adapterName, platform, hostUnconfined: true, optedIn: true, detectBwrap: probeBwrap, detectWhp: probeWhp,
|
|
1597
1606
|
});
|
|
1598
1607
|
if (codexRefusal) throw new Error(codexRefusal);
|
|
1599
1608
|
}
|
|
@@ -1667,8 +1676,11 @@ export const performAttach = async ({
|
|
|
1667
1676
|
}
|
|
1668
1677
|
} else if (sandboxMode === 'microvm') {
|
|
1669
1678
|
// Host-resolved on native Windows with COMMONLY_SANDBOX_MICROVM=1, never
|
|
1670
|
-
// stored: claude only, and only where WHP is on.
|
|
1679
|
+
// stored: claude and codex only, and only where WHP is on.
|
|
1671
1680
|
checkMicrovmAttach({ adapterName, platform, probe: probeWhp });
|
|
1681
|
+
// An MCP server the Codex turn refuses every time is refused here, before
|
|
1682
|
+
// anything is published.
|
|
1683
|
+
if (adapterName === 'codex') refuseMicrovmMcpDeclarations(environment?.mcp);
|
|
1672
1684
|
log('sandbox: microVM via microsandbox (network fenced to the model proxy and the MCP bridge)');
|
|
1673
1685
|
} else if (sandboxMode !== 'none' && sandboxMode !== undefined) {
|
|
1674
1686
|
throw new Error(
|