impel-cli 0.18.15-beta.3 → 0.18.15-beta.4
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 +18 -7
- package/src/windowsApps.js +61 -17
package/package.json
CHANGED
package/src/apps.js
CHANGED
|
@@ -81,17 +81,27 @@ export const PINNED_VENDOR_APPS = Object.freeze({
|
|
|
81
81
|
}),
|
|
82
82
|
}),
|
|
83
83
|
chatgpt: Object.freeze({
|
|
84
|
-
version: "26.
|
|
85
|
-
codexVersion: "0.146.0-alpha.
|
|
84
|
+
version: "26.727.40816",
|
|
85
|
+
codexVersion: "0.146.0-alpha.9.2",
|
|
86
86
|
bundleName: "ChatGPT.app",
|
|
87
|
+
windows: Object.freeze({
|
|
88
|
+
storeProductId: "9PLM9XGG6VKS",
|
|
89
|
+
packageName: "OpenAI.Codex",
|
|
90
|
+
packageVersion: "26.721.11231.0",
|
|
91
|
+
advertisedPackageVersion: "26.727.4816.0",
|
|
92
|
+
codexVersion: "0.146.0-alpha.3.1",
|
|
93
|
+
publisherId: "2p2nqsd0c76g0",
|
|
94
|
+
executable: "app\\ChatGPT.exe",
|
|
95
|
+
updateManifestUrl: "https://persistent.oaistatic.com/codex-app-prod/windows-store-update.json",
|
|
96
|
+
}),
|
|
87
97
|
downloads: Object.freeze({
|
|
88
98
|
arm64: Object.freeze({
|
|
89
|
-
url: "https://persistent.oaistatic.com/codex-app-prod/ChatGPT-darwin-arm64-26.
|
|
90
|
-
sha256: "
|
|
99
|
+
url: "https://persistent.oaistatic.com/codex-app-prod/ChatGPT-darwin-arm64-26.727.40816.zip",
|
|
100
|
+
sha256: "fdbede9b8a28b5bf3bbf1213fa04291724faa6ed2d1d61bb04853bbdfebce219",
|
|
91
101
|
}),
|
|
92
102
|
x64: Object.freeze({
|
|
93
|
-
url: "https://persistent.oaistatic.com/codex-app-prod/ChatGPT-darwin-x64-26.
|
|
94
|
-
sha256: "
|
|
103
|
+
url: "https://persistent.oaistatic.com/codex-app-prod/ChatGPT-darwin-x64-26.727.40816.zip",
|
|
104
|
+
sha256: "12622d916a3993d61fb52a318dcff7af7449eea5070cdd7e094da29f380e3374",
|
|
95
105
|
}),
|
|
96
106
|
}),
|
|
97
107
|
}),
|
|
@@ -245,7 +255,7 @@ export const CURRENT_CONFIG_VERSION = 25;
|
|
|
245
255
|
// — which is what made every `impel update` re-trigger macOS permission
|
|
246
256
|
// prompts. Bump this ONLY when a code change alters the bytes of a built
|
|
247
257
|
// bundle; leave it alone for changes that don't touch bundle contents.
|
|
248
|
-
export const BUNDLE_BUILD_FINGERPRINT = "bundle-2026-07-
|
|
258
|
+
export const BUNDLE_BUILD_FINGERPRINT = "bundle-2026-07-31.1";
|
|
249
259
|
|
|
250
260
|
/** Parse the tenant's install manifest, or null when absent/corrupt. */
|
|
251
261
|
export function readTenantManifest(homeDir = os.homedir(), tenantId = null) {
|
|
@@ -2215,6 +2225,7 @@ HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
|
|
|
2215
2225
|
VENDOR_APP="$HERE/../Resources/"${shellQuote(vendorBundleName)}
|
|
2216
2226
|
export CODEX_HOME=${shellQuote(paths.chatgpt.codexHome)}
|
|
2217
2227
|
export CODEX_AUTHAPI_BASE_URL=${shellQuote(codexAccountBaseUrl)}
|
|
2228
|
+
export CODEX_SPARKLE_ENABLED=false
|
|
2218
2229
|
unset CODEX_ACCESS_TOKEN CODEX_API_KEY OPENAI_API_KEY OPENAI_BASE_URL
|
|
2219
2230
|
secure_codex_home() {
|
|
2220
2231
|
[ ! -L "$CODEX_HOME" ] || exit 1
|
package/src/windowsApps.js
CHANGED
|
@@ -11,9 +11,10 @@ import { environmentValue, nativeCommandInvocation } from "./nativeProcess.js";
|
|
|
11
11
|
import { normalizeTenantId } from "./tenants.js";
|
|
12
12
|
import { brandedEnvironmentName, RUNTIME_BRAND } from "./runtimeBrand.js";
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
export const
|
|
16
|
-
export const
|
|
14
|
+
const WINDOWS_CHATGPT_PIN = PINNED_VENDOR_APPS.chatgpt.windows;
|
|
15
|
+
export const WINDOWS_CHATGPT_PACKAGE = WINDOWS_CHATGPT_PIN.storeProductId;
|
|
16
|
+
export const WINDOWS_CHATGPT_PACKAGE_NAME = WINDOWS_CHATGPT_PIN.packageName;
|
|
17
|
+
export const WINDOWS_CHATGPT_PUBLISHER_ID = WINDOWS_CHATGPT_PIN.publisherId;
|
|
17
18
|
const WINDOWS_CLAUDE_DOWNLOAD_TIMEOUT_MS = 5 * 60 * 1000;
|
|
18
19
|
const WINDOWS_WINGET_UPDATE_NOT_APPLICABLE = 0x8A15002B;
|
|
19
20
|
|
|
@@ -60,20 +61,26 @@ function versionedSquirrelCandidates(root, readDirectory = fs.readdirSync) {
|
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
function installedMsixChatGPT(environment, run = spawnSync) {
|
|
64
|
+
function installedMsixChatGPT(environment, run = spawnSync, pin = null) {
|
|
64
65
|
const script = [
|
|
65
66
|
`$package = Get-AppxPackage -Name '${WINDOWS_CHATGPT_PACKAGE_NAME}' -ErrorAction SilentlyContinue`,
|
|
66
|
-
`$package = $package | Where-Object PublisherId -
|
|
67
|
+
`$package = $package | Where-Object { $_.PublisherId -ceq '${WINDOWS_CHATGPT_PUBLISHER_ID}' -and (-not $env:IMPEL_CHATGPT_PACKAGE_VERSION -or $_.Version.ToString() -ceq $env:IMPEL_CHATGPT_PACKAGE_VERSION) } | Sort-Object Version -Descending | Select-Object -First 1`,
|
|
67
68
|
"if ($package) {",
|
|
68
69
|
" $manifest = Get-AppxPackageManifest -Package $package",
|
|
69
70
|
" $relative = $manifest.Package.Applications.Application | Where-Object Id -eq 'App' | Select-Object -First 1 -ExpandProperty Executable",
|
|
70
|
-
"
|
|
71
|
+
" $normalized = ([string]$relative).Replace('/', '\\')",
|
|
72
|
+
" $expected = ([string]$env:IMPEL_CHATGPT_PACKAGE_EXECUTABLE).Replace('/', '\\')",
|
|
73
|
+
" if ($relative -and (-not $expected -or $normalized -ieq $expected)) { Join-Path $package.InstallLocation $relative }",
|
|
71
74
|
"}",
|
|
72
75
|
].join("; ");
|
|
73
76
|
try {
|
|
74
77
|
const result = run("powershell.exe", ["-NoProfile", "-NonInteractive", "-Command", script], {
|
|
75
78
|
encoding: "utf8",
|
|
76
|
-
env:
|
|
79
|
+
env: {
|
|
80
|
+
...windowsPowerShellEnvironment(environment),
|
|
81
|
+
IMPEL_CHATGPT_PACKAGE_VERSION: pin?.packageVersion || "",
|
|
82
|
+
IMPEL_CHATGPT_PACKAGE_EXECUTABLE: pin?.executable || "",
|
|
83
|
+
},
|
|
77
84
|
stdio: ["ignore", "pipe", "ignore"],
|
|
78
85
|
windowsHide: true,
|
|
79
86
|
});
|
|
@@ -141,9 +148,23 @@ export function findWindowsChatGPTApp(environment = process.env, dependencies =
|
|
|
141
148
|
return msix && exists(msix) ? path.win32.normalize(msix) : null;
|
|
142
149
|
}
|
|
143
150
|
|
|
144
|
-
function
|
|
151
|
+
function pinnedWindowsChatGPTApp(environment = process.env, dependencies = {}) {
|
|
152
|
+
const exists = dependencies.isFile || isFile;
|
|
153
|
+
const pin = dependencies.pin || WINDOWS_CHATGPT_PIN;
|
|
154
|
+
const msix = (dependencies.queryMsix || installedMsixChatGPT)(environment, dependencies.run, pin);
|
|
155
|
+
return msix && exists(msix) ? path.win32.normalize(msix) : null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function wingetInvocation(action, environment, {
|
|
159
|
+
packageId,
|
|
160
|
+
source = "winget",
|
|
161
|
+
scope = "user",
|
|
162
|
+
}) {
|
|
145
163
|
const verb = action === "update" ? "upgrade" : "install";
|
|
146
164
|
const scopeArgs = scope ? ["--scope", scope] : [];
|
|
165
|
+
// Microsoft Store packages commonly report Version "Unknown" to winget.
|
|
166
|
+
// Without this switch winget refuses to consider their available update.
|
|
167
|
+
const updateArgs = action === "update" ? ["--include-unknown"] : [];
|
|
147
168
|
return nativeCommandInvocation(
|
|
148
169
|
"winget",
|
|
149
170
|
[
|
|
@@ -154,6 +175,7 @@ function wingetInvocation(action, environment, { packageId, source = "winget", s
|
|
|
154
175
|
"--source",
|
|
155
176
|
source,
|
|
156
177
|
...scopeArgs,
|
|
178
|
+
...updateArgs,
|
|
157
179
|
"--silent",
|
|
158
180
|
"--disable-interactivity",
|
|
159
181
|
"--accept-package-agreements",
|
|
@@ -372,21 +394,31 @@ export async function ensureWindowsClaudeApp(_options = {}, dependencies = {}) {
|
|
|
372
394
|
|
|
373
395
|
/** Install/update OpenAI's official ChatGPT/Codex Store package. */
|
|
374
396
|
export function ensureWindowsChatGPTApp({ update = false } = {}, dependencies = {}) {
|
|
397
|
+
const find = dependencies.find || findWindowsChatGPTApp;
|
|
398
|
+
const findPinned = dependencies.findPinned || dependencies.find || pinnedWindowsChatGPTApp;
|
|
375
399
|
const io = {
|
|
376
400
|
environment: process.env,
|
|
377
|
-
find
|
|
401
|
+
find,
|
|
402
|
+
findPinned,
|
|
378
403
|
logger: console,
|
|
404
|
+
pin: WINDOWS_CHATGPT_PIN,
|
|
379
405
|
run: spawnSync,
|
|
380
406
|
...dependencies,
|
|
381
407
|
};
|
|
382
408
|
const before = io.find(io.environment);
|
|
383
|
-
|
|
409
|
+
const pinnedBefore = io.findPinned(io.environment, { pin: io.pin, run: io.run });
|
|
410
|
+
if (pinnedBefore && !update) {
|
|
411
|
+
return { binary: pinnedBefore, action: "existing", result: null };
|
|
412
|
+
}
|
|
384
413
|
|
|
385
414
|
// `impel update` also repairs missing surfaces. A missing Store package must
|
|
386
415
|
// be installed, not sent to `winget upgrade` (which returns 0x8A150014).
|
|
387
416
|
const shouldUpdate = Boolean(update && before);
|
|
417
|
+
// The msstore source rejects its AppX package version as a winget --version
|
|
418
|
+
// selector. Install the current Store package, then fail closed below unless
|
|
419
|
+
// Windows registered the exact reviewed package version and executable.
|
|
388
420
|
const invocation = wingetInvocation(shouldUpdate ? "update" : "install", io.environment, {
|
|
389
|
-
packageId:
|
|
421
|
+
packageId: io.pin.storeProductId,
|
|
390
422
|
source: "msstore",
|
|
391
423
|
scope: null,
|
|
392
424
|
});
|
|
@@ -400,26 +432,36 @@ export function ensureWindowsChatGPTApp({ update = false } = {}, dependencies =
|
|
|
400
432
|
} catch (error) {
|
|
401
433
|
result = { status: null, error };
|
|
402
434
|
}
|
|
403
|
-
|
|
435
|
+
let resultBinary = io.findPinned(io.environment, { pin: io.pin, run: io.run });
|
|
404
436
|
// winget uses an error HRESULT when `upgrade` finds an installed package
|
|
405
437
|
// with no newer Store release. That is a healthy idempotent update result,
|
|
406
438
|
// not an installation failure (APPINSTALLER_CLI_ERROR_UPDATE_NOT_APPLICABLE).
|
|
407
439
|
const alreadyUpToDate = Boolean(
|
|
408
440
|
shouldUpdate
|
|
409
|
-
&&
|
|
441
|
+
&& resultBinary
|
|
410
442
|
&& !result?.error
|
|
411
443
|
&& Number.isInteger(result?.status)
|
|
412
444
|
&& (result.status >>> 0) === WINDOWS_WINGET_UPDATE_NOT_APPLICABLE,
|
|
413
445
|
);
|
|
414
446
|
if (alreadyUpToDate) {
|
|
415
|
-
io.logger.log(
|
|
447
|
+
io.logger.log(`ChatGPT/Codex: Microsoft Store package ${io.pin.packageVersion} already up to date.`);
|
|
448
|
+
}
|
|
449
|
+
const commandSucceeded = (result?.status === 0 && !result?.error) || alreadyUpToDate;
|
|
450
|
+
if (commandSucceeded && !resultBinary) {
|
|
451
|
+
result = {
|
|
452
|
+
...result,
|
|
453
|
+
error: new Error(
|
|
454
|
+
`ChatGPT/Codex Store package ${io.pin.packageVersion} did not appear after winget completed`,
|
|
455
|
+
),
|
|
456
|
+
};
|
|
416
457
|
}
|
|
417
|
-
const succeeded =
|
|
458
|
+
const succeeded = commandSucceeded && Boolean(resultBinary);
|
|
459
|
+
if (!succeeded) resultBinary = null;
|
|
418
460
|
return {
|
|
419
|
-
binary,
|
|
461
|
+
binary: resultBinary,
|
|
420
462
|
action: alreadyUpToDate
|
|
421
463
|
? "existing"
|
|
422
|
-
: succeeded ? (shouldUpdate ? "updated" : "installed") :
|
|
464
|
+
: succeeded ? (shouldUpdate ? "updated" : "installed") : "install-failed",
|
|
423
465
|
result,
|
|
424
466
|
};
|
|
425
467
|
}
|
|
@@ -617,6 +659,7 @@ export function launchWindowsChatGPTApp(binary, {
|
|
|
617
659
|
"CODEX_AUTHAPI_BASE_URL",
|
|
618
660
|
"CODEX_ELECTRON_USER_DATA_PATH",
|
|
619
661
|
"CODEX_HOME",
|
|
662
|
+
"CODEX_SPARKLE_ENABLED",
|
|
620
663
|
"OPENAI_API_KEY",
|
|
621
664
|
"OPENAI_BASE_URL",
|
|
622
665
|
]);
|
|
@@ -625,6 +668,7 @@ export function launchWindowsChatGPTApp(binary, {
|
|
|
625
668
|
}
|
|
626
669
|
environment.CODEX_HOME = codexHome;
|
|
627
670
|
environment.CODEX_AUTHAPI_BASE_URL = `${gatewayUrl}/chatgpt_passthrough/backend-api`;
|
|
671
|
+
environment.CODEX_SPARKLE_ENABLED = "false";
|
|
628
672
|
// Codex Desktop resolves this before acquiring Electron's single-instance
|
|
629
673
|
// lock. Keep --user-data-dir below as a compatibility fallback for builds
|
|
630
674
|
// that predate the dedicated desktop override.
|