impel-cli 0.18.12-beta.0 → 0.18.12-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impel-cli",
3
- "version": "0.18.12-beta.0",
3
+ "version": "0.18.12-beta.1",
4
4
  "description": "Prepare isolated Claude and Codex workspaces for every accessible Impel tenant",
5
5
  "type": "module",
6
6
  "bin": {
package/src/apps.js CHANGED
@@ -230,7 +230,9 @@ export function managedAppIdentity(target, tenantId = null, tenantName = null) {
230
230
  // 21: Windows Codex hooks use the pinned client's PowerShell execution
231
231
  // contract instead of cmd.exe quoting that failed every managed hook.
232
232
  // 22: refresh GPT-5.6 model windows from the pinned ChatGPT Codex catalog.
233
- export const CURRENT_CONFIG_VERSION = 22;
233
+ // 23: select Codex's unelevated native Windows sandbox for managed profiles so
234
+ // enterprise machines do not enter the administrator-only setup flow.
235
+ export const CURRENT_CONFIG_VERSION = 23;
234
236
 
235
237
  // Identifies the bundle-BUILDING logic — the asar patches, plist rewrites,
236
238
  // helper rebranding, and signing. A vendored bundle is rebuilt only when this
@@ -25,7 +25,7 @@ function assignmentPattern(key) {
25
25
  return new RegExp(`^(\\s*)${escapeRegex(key)}\\s*=.*$`, "u");
26
26
  }
27
27
 
28
- function upsertManagedBoolean(toml, table, key, value, configPath) {
28
+ function upsertManagedScalar(toml, table, key, value, configPath) {
29
29
  const lines = String(toml || "").replace(/\r\n/gu, "\n").split("\n");
30
30
  const headerPattern = tableHeaderPattern(table);
31
31
  const headerIndices = lines.flatMap((line, index) => (headerPattern.test(line) ? [index] : []));
@@ -101,8 +101,12 @@ function upsertManagedRootString(toml, key, value, configPath) {
101
101
  return `${lines.join("\n").replace(/\s*$/u, "")}\n`;
102
102
  }
103
103
 
104
- /** Enable unrestricted outbound access while Codex remains in workspace-write. */
105
- export function enableManagedCodexNetworkAccess(
104
+ /**
105
+ * Keep Codex in workspace-write with outbound access. On native Windows, use
106
+ * Codex's documented unelevated sandbox fallback so an Impel-owned profile
107
+ * never opens the administrator-only sandbox setup flow.
108
+ */
109
+ export function applyManagedCodexSandboxPolicy(
106
110
  toml,
107
111
  configPath = "managed Codex config",
108
112
  ) {
@@ -112,13 +116,20 @@ export function enableManagedCodexNetworkAccess(
112
116
  "workspace-write",
113
117
  configPath,
114
118
  );
115
- return upsertManagedBoolean(
119
+ const networkedSandbox = upsertManagedScalar(
116
120
  workspaceSandbox,
117
121
  "sandbox_workspace_write",
118
122
  "network_access",
119
123
  "true",
120
124
  configPath,
121
125
  );
126
+ return upsertManagedScalar(
127
+ networkedSandbox,
128
+ "windows",
129
+ "sandbox",
130
+ JSON.stringify("unelevated"),
131
+ configPath,
132
+ );
122
133
  }
123
134
 
124
135
  /**
@@ -126,15 +137,15 @@ export function enableManagedCodexNetworkAccess(
126
137
  * enabled. Existing unrelated keys in either table are retained.
127
138
  */
128
139
  export function hardenManagedCodexToml(toml, configPath = "managed Codex config") {
129
- const withoutSnapshots = upsertManagedBoolean(toml, "features", "shell_snapshot", "false", configPath);
130
- const withoutCredentialSnapshots = upsertManagedBoolean(
140
+ const withoutSnapshots = upsertManagedScalar(toml, "features", "shell_snapshot", "false", configPath);
141
+ const withoutCredentialSnapshots = upsertManagedScalar(
131
142
  withoutSnapshots,
132
143
  "shell_environment_policy",
133
144
  "ignore_default_excludes",
134
145
  "false",
135
146
  configPath,
136
147
  );
137
- return enableManagedCodexNetworkAccess(withoutCredentialSnapshots, configPath);
148
+ return applyManagedCodexSandboxPolicy(withoutCredentialSnapshots, configPath);
138
149
  }
139
150
 
140
151
  function assertSafeManagedPath(target, expectedType) {
@@ -6,7 +6,7 @@ import readline from "node:readline";
6
6
 
7
7
  import { nativeCommandInvocation } from "../nativeProcess.js";
8
8
  import { applyImpelClaudeSandbox } from "../claudeSandbox.js";
9
- import { enableManagedCodexNetworkAccess } from "../codexSecurity.js";
9
+ import { applyManagedCodexSandboxPolicy } from "../codexSecurity.js";
10
10
 
11
11
  const SAFE_ID = /^[a-z][a-z0-9-]{2,31}$/u;
12
12
  const SAFE_NAMESPACE = /^[a-z][a-z0-9_-]{1,31}$/u;
@@ -356,7 +356,7 @@ export function createGatewayCli(options) {
356
356
  const withoutProvider = outside.replace(/^\s*model_provider\s*=.*$/mu, "").trim();
357
357
  const next = [`model_provider = ${JSON.stringify(brand.cli.providerId)}`, codexManagedBlock(gatewayUrl), withoutProvider]
358
358
  .filter(Boolean).join("\n\n").concat("\n");
359
- writePrivateFile(filePath, enableManagedCodexNetworkAccess(next, filePath));
359
+ writePrivateFile(filePath, applyManagedCodexSandboxPolicy(next, filePath));
360
360
  return { codexHome, filePath };
361
361
  }
362
362