impel-cli 0.18.0 → 0.18.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.0",
3
+ "version": "0.18.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
@@ -211,7 +211,9 @@ export function managedAppIdentity(target, tenantId = null, tenantName = null) {
211
211
  // hook/auth/MCP artifacts instead of the npm-prefix bin path.
212
212
  // 20: managed Claude sandbox disabled by default; the rewrite strips the old
213
213
  // strict sandbox keys from already-provisioned profiles.
214
- export const CURRENT_CONFIG_VERSION = 20;
214
+ // 21: Windows Codex hooks use the pinned client's PowerShell execution
215
+ // contract instead of cmd.exe quoting that failed every managed hook.
216
+ export const CURRENT_CONFIG_VERSION = 21;
215
217
 
216
218
  // Identifies the bundle-BUILDING logic — the asar patches, plist rewrites,
217
219
  // helper rebranding, and signing. A vendored bundle is rebuilt only when this
@@ -141,10 +141,10 @@ function shellQuote(value) {
141
141
  return `'${String(value).replaceAll("'", `'"'"'`)}'`;
142
142
  }
143
143
 
144
- function windowsCommandQuote(value) {
144
+ function powershellQuote(value) {
145
145
  const text = String(value);
146
- if (/[\r\n\0%]/u.test(text)) throw new Error("cannot safely write this Windows hook command");
147
- return `"${text.replaceAll('"', '""')}"`;
146
+ if (/[\r\n\0]/u.test(text)) throw new Error("cannot safely write this Windows hook command");
147
+ return `'${text.replaceAll("'", "''")}'`;
148
148
  }
149
149
 
150
150
  function canonicalize(value) {
@@ -209,10 +209,11 @@ export function ensureCodexSessionHooks(codexHome, tenantId, surface = "codex_cl
209
209
  const document = readJsonObject(hooksPath);
210
210
  const invocation = managedInvocation("codex", surface, tenantId);
211
211
  const unixCommand = [invocation.command, ...invocation.args].map(shellQuote).join(" ");
212
- const windowsTokens = [invocation.command, ...invocation.args].map(windowsCommandQuote).join(" ");
213
- // Codex executes commandWindows with `cmd.exe /C`. The outer quote preserves
214
- // a quoted executable path when it contains spaces.
215
- const windowsCommand = `"${windowsTokens}"`;
212
+ const windowsTokens = [invocation.command, ...invocation.args].map(powershellQuote).join(" ");
213
+ // Codex runs commandWindows through the session's normal Windows shell,
214
+ // which is PowerShell. A quoted executable is only invoked when prefixed by
215
+ // the call operator; cmd.exe's doubled outer-quote form is invalid here.
216
+ const windowsCommand = `& ${windowsTokens}`;
216
217
  const handler = {
217
218
  type: "command",
218
219
  command: unixCommand,