codex-copilot-dx 1.3.7 → 1.3.8

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.
@@ -8,13 +8,15 @@ import { userSettingsPath } from './user-settings.mjs';
8
8
  import { readBoundedFileSync } from './bounded-file.mjs';
9
9
  import { authProfilePaths, readAuthProfileCredentials } from './auth-profile.mjs';
10
10
  import { m365Paths } from './m365-settings.mjs';
11
+ import { imageProviderConfigPath } from './image-provider-config.mjs';
12
+ import { readPredictionSettings } from './native-prediction-profile.mjs';
11
13
 
12
14
  export const HANDOFF_MAX_BYTES = 64 * 1024 * 1024;
13
15
  export function clientStateFingerprint(options = {}) {
14
16
  const codex = codexPaths(options), connections = accessSettingsPath(options);
15
17
  const github = authProfilePaths('codex', options);
16
18
  const files = [codex.config, path.join(codex.directory, 'auth.json'), connections, userSettingsPath(options),
17
- github.tokenPath, m365Paths(options).settings, m365Paths(options).gateway,
19
+ github.tokenPath, imageProviderConfigPath(options), m365Paths(options).settings, m365Paths(options).gateway,
18
20
  path.join(path.dirname(connections), 'client-gateway-keys.json'), path.join(path.dirname(connections), 'codex-gateway-owner.json'), ...Object.values(claudeClientPaths(options))];
19
21
  const hash = createHash('sha256');
20
22
  const credentials = readAuthProfileCredentials('codex', options);
@@ -23,6 +25,11 @@ export function clientStateFingerprint(options = {}) {
23
25
  hash.update(file);try { hash.update(readBoundedFileSync(file, { maxBytes: 8 * 1024 * 1024 })); }
24
26
  catch (error) { if (error.code !== 'ENOENT') throw error;hash.update('missing'); }
25
27
  }
28
+ const prediction = readPredictionSettings(options);
29
+ // Port allocation and App stat bookkeeping can change when the new listener
30
+ // starts. User intent and trust ownership must stay stable across handoff.
31
+ hash.update(JSON.stringify([prediction.enabled, prediction.store ?? null, prediction.certificateHash ?? null,
32
+ prediction.credentialsDirectory ?? null, prediction.app?.app ?? null, prediction.app?.profile ?? null]));
26
33
  return hash.digest('hex');
27
34
  }
28
35
  export function serviceBusinessState(runtime) {
@@ -81,6 +88,11 @@ export async function createServiceWorker({ processObj = process } = {}) {
81
88
  takeState() { const state = boot.state;boot.state = undefined;return state; },
82
89
  status: () => updateStatus,
83
90
  preferenceChanged(enabled) { if (processObj.connected !== false) processObj.send({ type: 'ccdx:preference', enabled }, () => {}); },
91
+ requestUpdate() {
92
+ if (warming || draining || processObj.connected === false) throw new Error('Service update is unavailable during a version switch');
93
+ processObj.send({ type: 'ccdx:manual-update' });
94
+ return { status: 'queued' };
95
+ },
84
96
  reused() { processObj.send({ type: 'ccdx:ready', protocol: 1, value: { reused: true } }); },
85
97
  async ready(value) { handlers = value;if (stopRequested) { await handlers.stop();return; }processObj.send({ type: 'ccdx:ready', protocol: 1, value: handlers.inspect() }); },
86
98
  };