@codexhost/cli-win32-arm64 0.28.0 → 0.28.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/README.md CHANGED
@@ -7,7 +7,7 @@ Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.
7
7
  ## Install
8
8
 
9
9
  ```bash
10
- npm install -g @codexhost/cli@0.28.0
10
+ npm install -g @codexhost/cli@0.28.1
11
11
  ```
12
12
 
13
13
  Do not install this package directly. npm selects it through the optional dependencies of `@codexhost/cli`.
@@ -1 +1 @@
1
- {"schemaVersion":1,"version":"0.28.0","distribution":"npm","target":"windows-arm64"}
1
+ {"schemaVersion":1,"version":"0.28.1","distribution":"npm","target":"windows-arm64"}
@@ -25036,6 +25036,22 @@ async function prefetchNpmRelease(target2, run2 = runNpmCommand, onProgress) {
25036
25036
  await onProgress?.({ completed: index + 1, total: specs.length });
25037
25037
  }
25038
25038
  }
25039
+ async function fetchLatestNpmRelease(nodePath, npmCliPath, run2 = runNpmCommand) {
25040
+ const result = await run2({ nodePath, npmCliPath, packageRoot: "", version: "" }, ["view", CLI_PACKAGE, "dist-tags.latest"], VIEW_TIMEOUT_MS);
25041
+ if (result.code !== 0)
25042
+ return null;
25043
+ try {
25044
+ const version2 = requireSemanticVersion(result.stdout.trim());
25045
+ return Object.freeze({
25046
+ version: version2,
25047
+ releaseNotes: null,
25048
+ releaseNotesUrl: "",
25049
+ assets: Object.freeze([])
25050
+ });
25051
+ } catch {
25052
+ return null;
25053
+ }
25054
+ }
25039
25055
  function createNpmReleaseAvailability(run2 = runNpmCommand, now = Date.now) {
25040
25056
  const answers = /* @__PURE__ */ new Map();
25041
25057
  return Object.freeze({
@@ -27420,6 +27436,15 @@ function createConsoleUpdates(options) {
27420
27436
  });
27421
27437
  let candidate = null;
27422
27438
  let handedOff = false;
27439
+ const npmFallbackRelease = async (metadata, error62) => {
27440
+ if (!metadata || installationKind(metadata) !== "npm") throw error62;
27441
+ const fallback = await fetchLatestNpmRelease(
27442
+ absoluteEnvironmentPath(environment, "CODEXHOST_NPM_NODE_PATH"),
27443
+ absoluteEnvironmentPath(environment, "CODEXHOST_NPM_CLI_PATH")
27444
+ );
27445
+ if (!fallback) throw error62;
27446
+ return fallback;
27447
+ };
27423
27448
  let currentStatusPath = null;
27424
27449
  async function latestStatus() {
27425
27450
  if (!currentStatusPath) {
@@ -27526,7 +27551,9 @@ function createConsoleUpdates(options) {
27526
27551
  await recoverUpdateOperationLock(stateDirectory());
27527
27552
  await cleanupTerminalUpdateState(stateDirectory());
27528
27553
  status = await latestStatus();
27529
- const release = await fetchLatest(signal);
27554
+ const release = await fetchLatest(signal).catch(
27555
+ (error63) => npmFallbackRelease(metadata, error63)
27556
+ );
27530
27557
  candidate = release;
27531
27558
  const updateAvailable = compareSemanticVersions(metadata.version, release.version) < 0;
27532
27559
  const { available: installationAvailable, error: error62 } = updateAvailable ? await installable(metadata, target2, release) : { available: false, error: null };
@@ -27572,7 +27599,7 @@ function createConsoleUpdates(options) {
27572
27599
  }
27573
27600
  currentStatusPath = null;
27574
27601
  try {
27575
- const release = await fetchLatest();
27602
+ const release = await fetchLatest().catch((error62) => npmFallbackRelease(metadata, error62));
27576
27603
  if (compareSemanticVersions(metadata.version, release.version) >= 0 || candidate && candidate.version !== release.version) {
27577
27604
  throw new ConsoleUpdateError(
27578
27605
  "stale",
@@ -23955,20 +23955,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
23955
23955
  }
23956
23956
  function appendDetails(document2, root, lines, start, open2) {
23957
23957
  let depth = 1;
23958
+ let inFence = false;
23958
23959
  let index = start + 1;
23959
23960
  const innerLines = [];
23960
23961
  while (index < lines.length && depth > 0) {
23961
23962
  const current = lines[index] ?? "";
23962
- const trimmed = current.trim();
23963
- if (DETAILS_OPEN_PATTERN.test(trimmed)) {
23964
- depth += 1;
23965
- innerLines.push(current);
23966
- } else if (DETAILS_CLOSE_PATTERN.test(trimmed)) {
23967
- depth -= 1;
23968
- if (depth > 0) innerLines.push(current);
23969
- } else {
23970
- innerLines.push(current);
23971
- }
23963
+ if (FENCE_PATTERN.test(current)) {
23964
+ inFence = !inFence;
23965
+ } else if (!inFence) {
23966
+ const trimmed = current.trim();
23967
+ if (DETAILS_OPEN_PATTERN.test(trimmed)) depth += 1;
23968
+ else if (DETAILS_CLOSE_PATTERN.test(trimmed)) depth -= 1;
23969
+ }
23970
+ if (depth > 0) innerLines.push(current);
23972
23971
  index += 1;
23973
23972
  }
23974
23973
  let summaryText = "Details";
@@ -47484,7 +47483,7 @@ ${error62.stderrTail}`] : []
47484
47483
  panel.dataset.updateState = view;
47485
47484
  panel.replaceChildren();
47486
47485
  setManualFallback(Boolean(result.error) || actionableStatus !== null);
47487
- const inlineUpdate = !result.error && !actionableStatus && result.updateAvailable;
47486
+ const inlineUpdate = !result.error && !actionableStatus && !result.status?.serviceStopOutput && result.updateAvailable && result.installationAvailable;
47488
47487
  if (inlineUpdate) panel.dataset.inline = "";
47489
47488
  else delete panel.dataset.inline;
47490
47489
  panel.append(
@@ -49289,6 +49288,8 @@ ${error62.stderrTail}`] : []
49289
49288
 
49290
49289
  .settings-update-panel {
49291
49290
  display: grid;
49291
+ grid-template-columns: minmax(0, 1fr);
49292
+ min-width: 0;
49292
49293
  gap: 12px;
49293
49294
  padding: 20px;
49294
49295
  color: var(--settings-text);
@@ -49297,21 +49298,39 @@ ${error62.stderrTail}`] : []
49297
49298
  border-radius: 8px;
49298
49299
  }
49299
49300
 
49300
- /* Update available: status on the left, the one action on the right. */
49301
+ /* Update available: status on the left, the one action on the right; wraps cleanly on narrow screens. */
49301
49302
  .settings-update-panel[data-inline] {
49302
- grid-template-columns: minmax(0, 1fr) auto;
49303
+ display: flex;
49304
+ flex-wrap: wrap;
49303
49305
  align-items: center;
49306
+ justify-content: space-between;
49307
+ gap: 12px 16px;
49304
49308
  padding: 14px 16px;
49305
49309
  }
49306
49310
 
49311
+ .settings-update-panel[data-inline] > .settings-update-panel__head {
49312
+ flex: 1 1 180px;
49313
+ }
49314
+
49315
+ .settings-update-panel[data-inline] > .settings-update-actions {
49316
+ flex: none;
49317
+ }
49318
+
49319
+ .settings-update-panel[data-inline]
49320
+ > :not(.settings-update-panel__head):not(.settings-update-actions) {
49321
+ flex: 1 0 100%;
49322
+ min-width: 0;
49323
+ }
49324
+
49307
49325
  .settings-update-panel__head {
49308
49326
  display: flex;
49309
- align-items: center;
49327
+ align-items: flex-start;
49310
49328
  min-width: 0;
49311
49329
  gap: 8px;
49312
49330
  }
49313
49331
 
49314
49332
  .settings-update-panel__head .codexhost-settings-icon {
49333
+ margin-top: 3px;
49315
49334
  color: var(--settings-muted);
49316
49335
  }
49317
49336
 
@@ -49356,6 +49375,7 @@ ${error62.stderrTail}`] : []
49356
49375
 
49357
49376
  .settings-update-summary,
49358
49377
  .settings-update-error {
49378
+ min-width: 0;
49359
49379
  margin: 0;
49360
49380
  overflow-wrap: anywhere;
49361
49381
  font-size: 13px;
@@ -49369,6 +49389,7 @@ ${error62.stderrTail}`] : []
49369
49389
  /* Host stop output is opaque text of any width; wrap it so it cannot widen the panel. */
49370
49390
  .settings-update-service-stop-output {
49371
49391
  min-width: 0;
49392
+ max-width: 100%;
49372
49393
  margin: 0;
49373
49394
  color: var(--settings-muted);
49374
49395
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
@@ -49874,6 +49895,10 @@ ${error62.stderrTail}`] : []
49874
49895
  gap: 16px;
49875
49896
  }
49876
49897
 
49898
+ .settings-update-panel {
49899
+ padding: 16px;
49900
+ }
49901
+
49877
49902
  .settings-status-row {
49878
49903
  grid-template-columns: minmax(0, 1fr) auto;
49879
49904
  gap: 16px;
@@ -49996,18 +49996,21 @@ var DESKTOP_BROWSER_ACCESS_ENV = [
49996
49996
  "BROWSER_USE_ACCESS_VERIFYING_IDENTITY"
49997
49997
  ];
49998
49998
  var DESKTOP_BROWSER_MCP_ARGUMENTS_ENV = "CODEXHOST_DESKTOP_BROWSER_MCP_ARGUMENTS";
49999
- var DESKTOP_TOOL_CONTEXT_ENV = [
49999
+ var DESKTOP_CONTEXT_ENV = [
50000
+ // Codex uses Desktop's own originator to generate native HTTP client identity.
50001
+ // Losing it lets the shared Host's first management handshake set the originator.
50002
+ "CODEX_INTERNAL_ORIGINATOR_OVERRIDE",
50000
50003
  DESKTOP_APP_TOOLS_PIPE_ENV,
50001
50004
  ...DESKTOP_BROWSER_ACCESS_ENV,
50002
50005
  DESKTOP_BROWSER_MCP_ARGUMENTS_ENV
50003
50006
  ];
50004
- function withoutDesktopToolContext(environment) {
50007
+ function withoutDesktopContext(environment) {
50005
50008
  return Object.fromEntries(
50006
- Object.entries(environment).filter(([key]) => !DESKTOP_TOOL_CONTEXT_ENV.includes(key))
50009
+ Object.entries(environment).filter(([key]) => !DESKTOP_CONTEXT_ENV.includes(key))
50007
50010
  );
50008
50011
  }
50009
50012
  function isDesktopContextVariable(key) {
50010
- return key.startsWith("CODEXHOST_") || key === DESKTOP_APP_TOOLS_PIPE_ENV || DESKTOP_BROWSER_ACCESS_ENV.includes(key);
50013
+ return key.startsWith("CODEXHOST_") || DESKTOP_CONTEXT_ENV.includes(key);
50011
50014
  }
50012
50015
  function desktopBrowserMcpArguments(environment) {
50013
50016
  try {
@@ -52891,6 +52894,22 @@ async function prefetchNpmRelease(target2, run = runNpmCommand, onProgress) {
52891
52894
  await onProgress?.({ completed: index + 1, total: specs.length });
52892
52895
  }
52893
52896
  }
52897
+ async function fetchLatestNpmRelease(nodePath2, npmCliPath, run = runNpmCommand) {
52898
+ const result = await run({ nodePath: nodePath2, npmCliPath, packageRoot: "", version: "" }, ["view", CLI_PACKAGE, "dist-tags.latest"], VIEW_TIMEOUT_MS);
52899
+ if (result.code !== 0)
52900
+ return null;
52901
+ try {
52902
+ const version2 = requireSemanticVersion(result.stdout.trim());
52903
+ return Object.freeze({
52904
+ version: version2,
52905
+ releaseNotes: null,
52906
+ releaseNotesUrl: "",
52907
+ assets: Object.freeze([])
52908
+ });
52909
+ } catch {
52910
+ return null;
52911
+ }
52912
+ }
52894
52913
  function createNpmReleaseAvailability(run = runNpmCommand, now = Date.now) {
52895
52914
  const answers = /* @__PURE__ */ new Map();
52896
52915
  return Object.freeze({
@@ -83449,12 +83468,12 @@ async function resolveOfficialCodexExecutable(stockCodexPath, environment) {
83449
83468
  }
83450
83469
 
83451
83470
  // packages/host-runtime/src/native-account-host.ts
83452
- function desktopToolContextChanged(current2, next) {
83453
- return DESKTOP_TOOL_CONTEXT_ENV.some((key) => current2.environment[key] !== next.environment[key]);
83471
+ function desktopContextChanged(current2, next) {
83472
+ return DESKTOP_CONTEXT_ENV.some((key) => current2.environment[key] !== next.environment[key]);
83454
83473
  }
83455
- function withDesktopTools(startup, desktop) {
83456
- const environment = withoutDesktopToolContext(startup.environment);
83457
- for (const key of DESKTOP_TOOL_CONTEXT_ENV) {
83474
+ function withDesktopContext(startup, desktop) {
83475
+ const environment = withoutDesktopContext(startup.environment);
83476
+ for (const key of DESKTOP_CONTEXT_ENV) {
83458
83477
  const value2 = desktop[key];
83459
83478
  if (value2 !== void 0) environment[key] = value2;
83460
83479
  }
@@ -83481,7 +83500,7 @@ async function prepareLocalCodex(input3) {
83481
83500
  let startup = {
83482
83501
  stockCodexPath: input3.stockCodexPath,
83483
83502
  arguments: sharedDesktop ? ["-c", "features.code_mode_host=true", "app-server"] : [...input3.arguments],
83484
- environment: input3.deferStart ? withoutDesktopToolContext(input3.environment) : input3.environment
83503
+ environment: input3.deferStart ? withoutDesktopContext(input3.environment) : input3.environment
83485
83504
  };
83486
83505
  if (startupFile) {
83487
83506
  try {
@@ -83508,11 +83527,11 @@ async function prepareLocalCodex(input3) {
83508
83527
  diagnosticOutput: input3.diagnosticOutput,
83509
83528
  // Local Desktop connections outlive a failed official backend generation.
83510
83529
  recovery: {},
83511
- shouldReplaceIdleBackend: () => running !== void 0 && (input3.deferStart && desktopToolContextChanged(running, nextStartup()) || codexRuntimeFilesChanged(backendFiles)),
83530
+ shouldReplaceIdleBackend: () => running !== void 0 && (input3.deferStart && desktopContextChanged(running, nextStartup()) || codexRuntimeFilesChanged(backendFiles)),
83512
83531
  createBackend: () => {
83513
83532
  try {
83514
83533
  const next = nextStartup();
83515
- const configuration = input3.remoteControl && next !== startup ? withDesktopTools(startup, next.environment) : next;
83534
+ const configuration = input3.remoteControl && next !== startup ? withDesktopContext(startup, next.environment) : next;
83516
83535
  if (!configuration.stockCodexPath) throw new Error("Official Codex is unavailable");
83517
83536
  backendFiles = captureCodexRuntimeFiles(configuration.stockCodexPath);
83518
83537
  running = configuration;
@@ -83580,7 +83599,7 @@ async function prepareLocalCodex(input3) {
83580
83599
  }
83581
83600
  }
83582
83601
  if (input3.remoteControl) {
83583
- next = withDesktopTools(next, configuration.environment);
83602
+ next = withDesktopContext(next, configuration.environment);
83584
83603
  startupConfigured = true;
83585
83604
  }
83586
83605
  if (startupFile) {
@@ -83602,8 +83621,8 @@ async function prepareLocalCodex(input3) {
83602
83621
  }
83603
83622
  if (scope.closed || attachment.aborted) return;
83604
83623
  const current3 = scope.owner.running && running ? running : nextStartup();
83605
- const changed = current3.stockCodexPath !== next.stockCodexPath || JSON.stringify(current3.arguments) !== JSON.stringify(next.arguments) || desktopToolContextChanged(current3, next) || scope.owner.running && codexRuntimeFilesChanged(backendFiles);
83606
- startup = { ...next, environment: withoutDesktopToolContext(next.environment) };
83624
+ const changed = current3.stockCodexPath !== next.stockCodexPath || JSON.stringify(current3.arguments) !== JSON.stringify(next.arguments) || desktopContextChanged(current3, next) || scope.owner.running && codexRuntimeFilesChanged(backendFiles);
83625
+ startup = { ...next, environment: withoutDesktopContext(next.environment) };
83607
83626
  if (desktopStartups.has(attachment)) desktopStartups.delete(attachment);
83608
83627
  else {
83609
83628
  attachment.addEventListener("abort", () => desktopStartups.delete(attachment), {
@@ -87609,6 +87628,14 @@ function createHostUpdateCoordinator(options) {
87609
87628
  });
87610
87629
  return authenticated ?? fetchLatestGitHubRelease({ signal: requestSignal });
87611
87630
  });
87631
+ const npmFallbackRelease = async (context, error62, signal) => {
87632
+ if (signal?.aborted) throw error62;
87633
+ if (context.installation.kind !== "npm") throw error62;
87634
+ const npm = context.installation.options;
87635
+ const fallback = await fetchLatestNpmRelease(npm.nodePath, npm.npmCliPath);
87636
+ if (!fallback) throw error62;
87637
+ return fallback;
87638
+ };
87612
87639
  let candidate = null;
87613
87640
  let currentStatusPath = null;
87614
87641
  async function latestStatus(context) {
@@ -87674,7 +87701,9 @@ function createHostUpdateCoordinator(options) {
87674
87701
  }
87675
87702
  const status2 = await latestStatus(context);
87676
87703
  try {
87677
- const release = await fetchLatest(signal);
87704
+ const release = await fetchLatest(signal).catch(
87705
+ (error63) => npmFallbackRelease(context, error63, signal)
87706
+ );
87678
87707
  candidate = release;
87679
87708
  const updateAvailable = compareSemanticVersions(context.metadata.version, release.version) < 0;
87680
87709
  const { available: installationAvailable, error: error62 } = updateAvailable ? await installable(context, release) : { available: false, error: null };
@@ -87720,7 +87749,7 @@ function createHostUpdateCoordinator(options) {
87720
87749
  rejectPrepared = reject;
87721
87750
  });
87722
87751
  try {
87723
- const release = await fetchLatest();
87752
+ const release = await fetchLatest().catch((error62) => npmFallbackRelease(context, error62));
87724
87753
  if (compareSemanticVersions(context.metadata.version, release.version) >= 0 || candidate && candidate.version !== release.version) {
87725
87754
  throw new Error("The selected update is no longer the current GitHub Release");
87726
87755
  }
@@ -89380,7 +89409,7 @@ function desktopContext(base, request) {
89380
89409
  return {
89381
89410
  arguments: envelope.arguments,
89382
89411
  environment: {
89383
- ...withoutDesktopToolContext(base),
89412
+ ...withoutDesktopContext(base),
89384
89413
  ...context,
89385
89414
  CODEXHOST_DATA_DIR: base.CODEXHOST_DATA_DIR,
89386
89415
  CODEX_HOME: base.CODEX_HOME,