@karlorz/codexhost-cli-win32-x64 0.16.1-0 → 0.16.1-3

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 @karlorz/codexhost-cli@0.16.1-0
10
+ npm install -g @karlorz/codexhost-cli@0.16.1-3
11
11
  ```
12
12
 
13
13
  Do not install this package directly. npm selects it through the optional dependencies of `@karlorz/codexhost-cli`.
@@ -1 +1 @@
1
- {"schemaVersion":1,"version":"0.16.1-0","distribution":"npm","target":"windows-x64"}
1
+ {"schemaVersion":1,"version":"0.16.1-3","distribution":"npm","target":"windows-x64"}
@@ -17030,6 +17030,37 @@ var voiceSettingsStateSchema = external_exports.strictObject({
17030
17030
  })
17031
17031
  });
17032
17032
 
17033
+ // packages/shared-contracts/dist/background-activity.js
17034
+ var backgroundActivitySchema = external_exports.strictObject({
17035
+ id: external_exports.string().min(1),
17036
+ kind: external_exports.enum(["task", "monitor", "loop", "subagent"]),
17037
+ label: external_exports.string(),
17038
+ status: external_exports.enum(["running", "scheduled", "completed", "failed", "cancelled", "unknown"]),
17039
+ canStop: external_exports.boolean(),
17040
+ /** Existing detached command Item presented by Desktop's native process UI. */
17041
+ commandItemId: hostItemIdSchema.optional(),
17042
+ schedule: external_exports.string().optional(),
17043
+ nextRunAt: external_exports.string().datetime({ offset: true }).optional(),
17044
+ relatedActivityId: external_exports.string().optional(),
17045
+ threadId: hostThreadIdSchema.optional()
17046
+ });
17047
+ var backgroundActivityDetailSchema = external_exports.strictObject({
17048
+ activity: backgroundActivitySchema,
17049
+ output: external_exports.string(),
17050
+ truncated: external_exports.boolean()
17051
+ });
17052
+ var threadActivityParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
17053
+ var threadActivityItemParamsSchema = threadActivityParamsSchema.extend({
17054
+ activityId: external_exports.string().min(1)
17055
+ });
17056
+ var threadActivityListResultSchema = external_exports.strictObject({
17057
+ supported: external_exports.boolean(),
17058
+ activities: external_exports.array(backgroundActivitySchema)
17059
+ });
17060
+ var threadActivityStopResultSchema = external_exports.strictObject({
17061
+ outcome: external_exports.enum(["stopped", "alreadyStopped", "notFound"])
17062
+ });
17063
+
17033
17064
  // packages/shared-contracts/dist/index.js
17034
17065
  var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
17035
17066
 
@@ -16261,6 +16261,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16261
16261
  })
16262
16262
  });
16263
16263
 
16264
+ // ../shared-contracts/dist/background-activity.js
16265
+ var backgroundActivitySchema = external_exports.strictObject({
16266
+ id: external_exports.string().min(1),
16267
+ kind: external_exports.enum(["task", "monitor", "loop", "subagent"]),
16268
+ label: external_exports.string(),
16269
+ status: external_exports.enum(["running", "scheduled", "completed", "failed", "cancelled", "unknown"]),
16270
+ canStop: external_exports.boolean(),
16271
+ /** Existing detached command Item presented by Desktop's native process UI. */
16272
+ commandItemId: hostItemIdSchema.optional(),
16273
+ schedule: external_exports.string().optional(),
16274
+ nextRunAt: external_exports.string().datetime({ offset: true }).optional(),
16275
+ relatedActivityId: external_exports.string().optional(),
16276
+ threadId: hostThreadIdSchema.optional()
16277
+ });
16278
+ var backgroundActivityDetailSchema = external_exports.strictObject({
16279
+ activity: backgroundActivitySchema,
16280
+ output: external_exports.string(),
16281
+ truncated: external_exports.boolean()
16282
+ });
16283
+ var threadActivityParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
16284
+ var threadActivityItemParamsSchema = threadActivityParamsSchema.extend({
16285
+ activityId: external_exports.string().min(1)
16286
+ });
16287
+ var threadActivityListResultSchema = external_exports.strictObject({
16288
+ supported: external_exports.boolean(),
16289
+ activities: external_exports.array(backgroundActivitySchema)
16290
+ });
16291
+ var threadActivityStopResultSchema = external_exports.strictObject({
16292
+ outcome: external_exports.enum(["stopped", "alreadyStopped", "notFound"])
16293
+ });
16294
+
16264
16295
  // ../shared-contracts/dist/index.js
16265
16296
  var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
16266
16297
 
@@ -16156,6 +16156,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16156
16156
  })
16157
16157
  });
16158
16158
 
16159
+ // ../shared-contracts/dist/background-activity.js
16160
+ var backgroundActivitySchema = external_exports.strictObject({
16161
+ id: external_exports.string().min(1),
16162
+ kind: external_exports.enum(["task", "monitor", "loop", "subagent"]),
16163
+ label: external_exports.string(),
16164
+ status: external_exports.enum(["running", "scheduled", "completed", "failed", "cancelled", "unknown"]),
16165
+ canStop: external_exports.boolean(),
16166
+ /** Existing detached command Item presented by Desktop's native process UI. */
16167
+ commandItemId: hostItemIdSchema.optional(),
16168
+ schedule: external_exports.string().optional(),
16169
+ nextRunAt: external_exports.string().datetime({ offset: true }).optional(),
16170
+ relatedActivityId: external_exports.string().optional(),
16171
+ threadId: hostThreadIdSchema.optional()
16172
+ });
16173
+ var backgroundActivityDetailSchema = external_exports.strictObject({
16174
+ activity: backgroundActivitySchema,
16175
+ output: external_exports.string(),
16176
+ truncated: external_exports.boolean()
16177
+ });
16178
+ var threadActivityParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
16179
+ var threadActivityItemParamsSchema = threadActivityParamsSchema.extend({
16180
+ activityId: external_exports.string().min(1)
16181
+ });
16182
+ var threadActivityListResultSchema = external_exports.strictObject({
16183
+ supported: external_exports.boolean(),
16184
+ activities: external_exports.array(backgroundActivitySchema)
16185
+ });
16186
+ var threadActivityStopResultSchema = external_exports.strictObject({
16187
+ outcome: external_exports.enum(["stopped", "alreadyStopped", "notFound"])
16188
+ });
16189
+
16159
16190
  // ../shared-contracts/dist/index.js
16160
16191
  var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
16161
16192
 
@@ -16361,9 +16392,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16361
16392
  const matchesMetadata = (profile) => (version2 === void 0 || profile.version === version2) && (platform === void 0 || profile.platform === platform);
16362
16393
  if (present.length > 0) {
16363
16394
  const profile = present.length === 1 ? present[0] : void 0;
16364
- return profile && matchesMetadata(profile) && [profile.initial, profile.shared].every(
16365
- (asset) => auditedAppInitialAssetPresent(names, asset)
16366
- ) ? profile : void 0;
16395
+ if (!profile || !matchesMetadata(profile)) return void 0;
16396
+ const initialPresent = auditedAppInitialAssetPresent(names, profile.initial);
16397
+ const sharedPresent = auditedAppInitialAssetPresent(names, profile.shared);
16398
+ return sharedPresent && (initialPresent || version2 !== void 0 && platform !== void 0) ? profile : void 0;
16367
16399
  }
16368
16400
  if (version2 === void 0) return void 0;
16369
16401
  const candidates = profiles.filter(matchesMetadata);
@@ -16391,10 +16423,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16391
16423
  var RENDERER_NEW_THREAD_PREFERENCE_KEY = "codexhost.new-thread-preference.v1";
16392
16424
 
16393
16425
  // src/renderer-client-owned-voice.ts
16394
- var CLIENT_OWNED_VOICE_VERSION = "26.1023.51421";
16395
- var CLIENT_OWNED_VOICE_INITIAL_ASSET = "app-initial-bc8256c3cccb.js";
16396
- var CLIENT_OWNED_VOICE_SHARED_ASSET = "app-shared-e9f258fd3588.js";
16397
- var CLIENT_OWNED_VOICE_OVERLAY_ASSET = "avatar-overlay-native-page-af6c3662f64f.js";
16426
+ var CLIENT_OWNED_VOICE_VERSION = "26.1027.30824";
16427
+ var CLIENT_OWNED_VOICE_INITIAL_ASSET = "app-initial-60f141238751.js";
16428
+ var CLIENT_OWNED_VOICE_SHARED_ASSET = "app-shared-7815d5a1a42a.js";
16429
+ var CLIENT_OWNED_VOICE_OVERLAY_ASSET = "avatar-overlay-native-page-d9d400e751cd.js";
16398
16430
  var CLIENT_OWNED_VOICE_ASSETS = [
16399
16431
  {
16400
16432
  platform: "darwin",
@@ -16402,6 +16434,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16402
16434
  initial: CLIENT_OWNED_VOICE_INITIAL_ASSET,
16403
16435
  shared: CLIENT_OWNED_VOICE_SHARED_ASSET,
16404
16436
  overlay: CLIENT_OWNED_VOICE_OVERLAY_ASSET,
16437
+ init: "Edr",
16438
+ fetch: "wdr",
16439
+ fetchFrom: "initial",
16440
+ bridge: "LRt",
16441
+ services: "Vct",
16442
+ responseError: "Adr",
16443
+ responseErrorFrom: "initial",
16444
+ capabilityInit: "Ner",
16445
+ capabilityFamily: "Mer",
16446
+ inferenceGateFamily: "Lfr"
16447
+ },
16448
+ {
16449
+ platform: "darwin",
16450
+ version: "26.1023.51421",
16451
+ initial: "app-initial-bc8256c3cccb.js",
16452
+ shared: "app-shared-e9f258fd3588.js",
16453
+ overlay: "avatar-overlay-native-page-af6c3662f64f.js",
16405
16454
  init: "xir",
16406
16455
  fetch: "yir",
16407
16456
  fetchFrom: "initial",
@@ -16723,7 +16772,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16723
16772
  if (!object2(bridgeClass) && typeof bridgeClass !== "function") throw new Error();
16724
16773
  const client = Reflect.get(fetchClass, "getInstance").call(fetchClass);
16725
16774
  const bridge = Reflect.get(bridgeClass, "getInstance").call(bridgeClass);
16726
- const responseError = typeof errorName === "string" && typeof sharedModule[errorName] === "function" ? sharedModule[errorName] : async (response) => {
16775
+ const errorModule = "responseErrorFrom" in assets && assets.responseErrorFrom === "initial" ? fetchModule : sharedModule;
16776
+ const responseError = typeof errorName === "string" && typeof errorModule[errorName] === "function" ? errorModule[errorName] : async (response) => {
16727
16777
  throw Object.assign(new Error(await response.text()), { status: response.status });
16728
16778
  };
16729
16779
  if (typeof client?.fetch !== "function" || typeof bridge?.dispatchMessage !== "function" || typeof bridge?.subscribe !== "function")
@@ -17018,6 +17068,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17018
17068
  function isRecord4(value) {
17019
17069
  return value !== null && typeof value === "object" && !Array.isArray(value);
17020
17070
  }
17071
+ function conversationIdFrom(request) {
17072
+ if (typeof request === "string" && request) return request;
17073
+ if (!isRecord4(request)) return null;
17074
+ if (typeof request.conversationId === "string" && request.conversationId)
17075
+ return request.conversationId;
17076
+ if (typeof request.threadId === "string" && request.threadId) return request.threadId;
17077
+ return null;
17078
+ }
17079
+ function isHostExternalConversation(conversation, threadId) {
17080
+ return isRecord4(conversation) && conversation.id === threadId && conversation.modelProvider === "codexhost";
17081
+ }
17021
17082
  function isManager(value) {
17022
17083
  return isRecord4(value) && ["sendRequest", "steerTurn", "startTurn", "getTurnCoordinator"].every(
17023
17084
  (key) => typeof value[key] === "function"
@@ -17053,6 +17114,27 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17053
17114
  if (!text) return params;
17054
17115
  return { ...params, input: [{ type: "text", text, text_elements: [] }] };
17055
17116
  }
17117
+ function installExternalQueueUi(manager) {
17118
+ const coordinator = manager.getTurnCoordinator();
17119
+ const options = isRecord4(coordinator) ? coordinator.options : null;
17120
+ if (!isRecord4(options) || typeof options.getMessageQueueMode !== "function") return null;
17121
+ const descriptor = Object.getOwnPropertyDescriptor(options, "getMessageQueueMode");
17122
+ if (!descriptor?.writable) return null;
17123
+ const original = options.getMessageQueueMode;
17124
+ const getMessageQueueMode = (...args) => {
17125
+ const threadId = conversationIdFrom(args[0]);
17126
+ if (threadId && typeof manager.getConversation === "function" && isHostExternalConversation(manager.getConversation(threadId), threadId)) {
17127
+ return Promise.resolve("queue");
17128
+ }
17129
+ return original.apply(options, args);
17130
+ };
17131
+ options.getMessageQueueMode = getMessageQueueMode;
17132
+ return () => {
17133
+ if (options.getMessageQueueMode === getMessageQueueMode) {
17134
+ Object.defineProperty(options, "getMessageQueueMode", descriptor);
17135
+ }
17136
+ };
17137
+ }
17056
17138
  function submissionHost(manager) {
17057
17139
  const coordinator = manager.getTurnCoordinator();
17058
17140
  const options = isRecord4(coordinator) ? coordinator.options : null;
@@ -17126,6 +17208,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17126
17208
  function installRendererExternalSteering(target, sendTurnStart, prepareTurnInput) {
17127
17209
  if (!isManager(target)) return null;
17128
17210
  const manager = target;
17211
+ const restoreQueueUi = installExternalQueueUi(manager);
17129
17212
  const originalSteer = manager.steerTurn;
17130
17213
  const originalSend = manager.sendRequest;
17131
17214
  const routes = /* @__PURE__ */ new Map();
@@ -17136,7 +17219,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17136
17219
  if ((method === "turn/start" || method === "turn/steer") && prepareTurnInput) {
17137
17220
  params = prepareTurnInput(params);
17138
17221
  }
17139
- if (method === "turn/start") params = restoreQueuedTurnStartText(manager, params);
17222
+ if (method === "turn/start" || method === "turn/steer") {
17223
+ params = restoreQueuedTurnStartText(manager, params);
17224
+ }
17140
17225
  const messageId = isRecord4(params) ? params.clientUserMessageId : null;
17141
17226
  const route = typeof messageId === "string" && isRecord4(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
17142
17227
  if (method !== "turn/start" || !isRecord4(params) || !route || route.threadId !== params.threadId) {
@@ -17343,6 +17428,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17343
17428
  });
17344
17429
  return () => {
17345
17430
  disposed = true;
17431
+ restoreQueueUi?.();
17346
17432
  restoreMethod("steerTurn");
17347
17433
  if (getStreamRole) restoreMethod("getStreamRole");
17348
17434
  if (pending.size === 0) {
@@ -16408,6 +16408,37 @@ var voiceSettingsStateSchema = external_exports.strictObject({
16408
16408
  })
16409
16409
  });
16410
16410
 
16411
+ // packages/shared-contracts/dist/background-activity.js
16412
+ var backgroundActivitySchema = external_exports.strictObject({
16413
+ id: external_exports.string().min(1),
16414
+ kind: external_exports.enum(["task", "monitor", "loop", "subagent"]),
16415
+ label: external_exports.string(),
16416
+ status: external_exports.enum(["running", "scheduled", "completed", "failed", "cancelled", "unknown"]),
16417
+ canStop: external_exports.boolean(),
16418
+ /** Existing detached command Item presented by Desktop's native process UI. */
16419
+ commandItemId: hostItemIdSchema.optional(),
16420
+ schedule: external_exports.string().optional(),
16421
+ nextRunAt: external_exports.string().datetime({ offset: true }).optional(),
16422
+ relatedActivityId: external_exports.string().optional(),
16423
+ threadId: hostThreadIdSchema.optional()
16424
+ });
16425
+ var backgroundActivityDetailSchema = external_exports.strictObject({
16426
+ activity: backgroundActivitySchema,
16427
+ output: external_exports.string(),
16428
+ truncated: external_exports.boolean()
16429
+ });
16430
+ var threadActivityParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
16431
+ var threadActivityItemParamsSchema = threadActivityParamsSchema.extend({
16432
+ activityId: external_exports.string().min(1)
16433
+ });
16434
+ var threadActivityListResultSchema = external_exports.strictObject({
16435
+ supported: external_exports.boolean(),
16436
+ activities: external_exports.array(backgroundActivitySchema)
16437
+ });
16438
+ var threadActivityStopResultSchema = external_exports.strictObject({
16439
+ outcome: external_exports.enum(["stopped", "alreadyStopped", "notFound"])
16440
+ });
16441
+
16411
16442
  // packages/shared-contracts/dist/index.js
16412
16443
  var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
16413
16444
 
@@ -17891,11 +17922,82 @@ function rendererHostRpcHostIds(discovery) {
17891
17922
  (hostId2) => typeof hostId2 === "string"
17892
17923
  );
17893
17924
  }
17925
+ function rendererHostRpcUsesExternalQueue(store, conversationId) {
17926
+ const providers = /* @__PURE__ */ new Map();
17927
+ for (const members of store.familyBindings.values()) {
17928
+ for (const member of members.values()) {
17929
+ const signal = member.value;
17930
+ if (signal === null || typeof signal !== "object" || !("get" in signal) || typeof signal.get !== "function")
17931
+ continue;
17932
+ let value;
17933
+ try {
17934
+ value = signal.get();
17935
+ } catch {
17936
+ continue;
17937
+ }
17938
+ if (value === null || typeof value !== "object" || !("conversationId" in value) || value.conversationId !== conversationId || !("hostId" in value) || typeof value.hostId !== "string" || !("modelProvider" in value) || typeof value.modelProvider !== "string")
17939
+ continue;
17940
+ const hostProviders = providers.get(value.hostId) ?? /* @__PURE__ */ new Set();
17941
+ hostProviders.add(value.modelProvider);
17942
+ providers.set(value.hostId, hostProviders);
17943
+ }
17944
+ }
17945
+ if (providers.size !== 1) return false;
17946
+ const values = providers.values().next().value;
17947
+ return values?.size === 1 && values.has("codexhost");
17948
+ }
17949
+
17950
+ // packages/desktop-control/src/renderer-external-queue-policy.ts
17951
+ function installRendererExternalQueuePolicy(root, target, dependencies) {
17952
+ if (target.__codexhostExternalQueuePolicyV1) return target.__codexhostExternalQueuePolicyV1;
17953
+ const store = dependencies.findStore(root);
17954
+ if (!store) return null;
17955
+ const record3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
17956
+ let disposed = false;
17957
+ const route = (message) => {
17958
+ if (!Array.isArray(message) || message.length !== 2 || message[0] !== "push") return message;
17959
+ const expression = message[1];
17960
+ if (!Array.isArray(expression) || expression.length !== 4 || expression[0] !== "pipeline")
17961
+ return message;
17962
+ const [, importId, path5, args] = expression;
17963
+ if (!Array.isArray(path5) || path5.length !== 1 || path5[0] !== "sendMessage" || !Array.isArray(args))
17964
+ return message;
17965
+ const input = args[0];
17966
+ if (!record3(input) || typeof input.conversationId !== "string" || !record3(input.message) || !dependencies.usesExternalQueue(store, input.conversationId))
17967
+ return message;
17968
+ return [
17969
+ "push",
17970
+ ["pipeline", importId, path5, [{ ...input, queueModeOverride: "queue" }, ...args.slice(1)]]
17971
+ ];
17972
+ };
17973
+ const port = dependencies.portPrototype;
17974
+ const original = port.postMessage;
17975
+ const postMessage = function(message, ...rest) {
17976
+ return original.call(this, disposed ? message : route(message), ...rest);
17977
+ };
17978
+ port.postMessage = postMessage;
17979
+ const policy = {
17980
+ dispose() {
17981
+ disposed = true;
17982
+ if (port.postMessage === postMessage) port.postMessage = original;
17983
+ if (target.__codexhostExternalQueuePolicyV1 === policy)
17984
+ delete target.__codexhostExternalQueuePolicyV1;
17985
+ }
17986
+ };
17987
+ Object.defineProperty(target, "__codexhostExternalQueuePolicyV1", {
17988
+ configurable: true,
17989
+ value: policy
17990
+ });
17991
+ return policy;
17992
+ }
17894
17993
 
17895
17994
  // packages/desktop-control/src/renderer-host-rpc-routing.ts
17896
17995
  function installRendererHostRpcRouting(root, target, dependencies) {
17897
17996
  const existing = target.__codexhostHostRoutingV1;
17898
- if (existing) return existing;
17997
+ if (existing) {
17998
+ dependencies.installQueuePolicy(root, target);
17999
+ return existing;
18000
+ }
17899
18001
  let disposed = false;
17900
18002
  let discovery = null;
17901
18003
  const routes = /* @__PURE__ */ new Map();
@@ -17908,6 +18010,7 @@ function installRendererHostRpcRouting(root, target, dependencies) {
17908
18010
  return discovery;
17909
18011
  };
17910
18012
  if (!read()) return null;
18013
+ const queuePolicy = dependencies.installQueuePolicy(root, target);
17911
18014
  const isRecord3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
17912
18015
  const externalDrafts = /* @__PURE__ */ new Map();
17913
18016
  const selectedModels = /* @__PURE__ */ new Map();
@@ -18130,6 +18233,7 @@ function installRendererHostRpcRouting(root, target, dependencies) {
18130
18233
  externalDrafts.clear();
18131
18234
  selectedModels.clear();
18132
18235
  if (port.postMessage === postMessage) port.postMessage = originalPostMessage;
18236
+ queuePolicy?.dispose();
18133
18237
  if (target.__codexhostHostRoutingV1 === routing) {
18134
18238
  delete target.__codexhostHostRoutingV1;
18135
18239
  publish(null);
@@ -18173,13 +18277,24 @@ function directRendererInstaller() {
18173
18277
  : (composer ?? document);
18174
18278
  return discover(source);
18175
18279
  },
18280
+ installQueuePolicy: (root, target) => (${installRendererExternalQueuePolicy.toString()})(root, target, {
18281
+ findStore: ${findRendererAppScopeStore.toString()},
18282
+ usesExternalQueue: ${rendererHostRpcUsesExternalQueue.toString()},
18283
+ portPrototype: MessagePort.prototype,
18284
+ }),
18176
18285
  portPrototype: MessagePort.prototype,
18177
18286
  });
18178
18287
  // Desktop 26.1027 moved AppServerManagers to the main process. Older builds
18179
18288
  // expose native managers in Renderer hook state; the main-process mode only
18180
18289
  // applies when none is visible and its per-Host RPC store is identified.
18181
18290
  const routing = (() => {
18182
- if (window.__codexhostHostRoutingV1) return window.__codexhostHostRoutingV1;
18291
+ if (window.__codexhostHostRoutingV1) {
18292
+ const existing = window.__codexhostHostRoutingV1;
18293
+ if (['local', ...(existing.knownHostIds?.() ?? [])].some(
18294
+ hostId => existing.forHost(hostId)?.manager.kind === 'main-process-rpc'
18295
+ )) installRpc();
18296
+ return existing;
18297
+ }
18183
18298
  const native = discover(document);
18184
18299
  if (native.managers.length || native.registries.length) return installNative();
18185
18300
  const rpc = installRpc();