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 +1 -1
- package/src/apps.js +3 -1
- package/src/sessionHooks.js +8 -7
package/package.json
CHANGED
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
|
-
|
|
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
|
package/src/sessionHooks.js
CHANGED
|
@@ -141,10 +141,10 @@ function shellQuote(value) {
|
|
|
141
141
|
return `'${String(value).replaceAll("'", `'"'"'`)}'`;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
function
|
|
144
|
+
function powershellQuote(value) {
|
|
145
145
|
const text = String(value);
|
|
146
|
-
if (/[\r\n\0
|
|
147
|
-
return `
|
|
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(
|
|
213
|
-
// Codex
|
|
214
|
-
//
|
|
215
|
-
|
|
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,
|