@codexhost/cli-darwin-x64 0.4.4 → 0.6.0

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.4.4
10
+ npm install -g @codexhost/cli@0.6.0
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.4.4","distribution":"npm","target":"macos-x64"}
1
+ {"schemaVersion":1,"version":"0.6.0","distribution":"npm","target":"macos-x64"}
@@ -297,6 +297,7 @@ function installDraftPrewarmPolicyBridge(manager, bridge, hostId, target, prewar
297
297
  const originalOnNotification = manager.onNotification;
298
298
  const originalDispatchAppServerResponse = manager.dispatchAppServerResponse;
299
299
  let selectedModel = null;
300
+ let selectedCodexAccountId = null;
300
301
  const isRecord4 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
301
302
  const isRemoteControlHost = hostId.startsWith("remote-control:");
302
303
  const knownExternalThreadIds = /* @__PURE__ */ new Set();
@@ -649,7 +650,7 @@ function installDraftPrewarmPolicyBridge(manager, bridge, hostId, target, prewar
649
650
  if (method.startsWith("codexhost/")) return true;
650
651
  if (method === "thread/list") return true;
651
652
  if (method === "thread/start") {
652
- return isRecord4(parameters) && typeof parameters.model === "string" && parameters.model.startsWith("codexhost/");
653
+ return isRecord4(parameters) && (typeof parameters.model === "string" && parameters.model.startsWith("codexhost/") || typeof parameters.__codexhostAccountId === "string");
653
654
  }
654
655
  const threadId = threadIdFromParameters(parameters);
655
656
  if (threadId && knownExternalThreadIds.has(threadId)) return true;
@@ -657,10 +658,16 @@ function installDraftPrewarmPolicyBridge(manager, bridge, hostId, target, prewar
657
658
  return selectedModel !== null && (method.startsWith("thread/") || method.startsWith("turn/") || method.startsWith("review/"));
658
659
  };
659
660
  const routeThreadStart = (parameters) => {
660
- if (selectedModel === null || !isRecord4(parameters) || parameters.ephemeral === true) {
661
+ if (!isRecord4(parameters) || parameters.ephemeral === true) {
661
662
  return parameters;
662
663
  }
663
- return { ...parameters, model: selectedModel };
664
+ const routed = {
665
+ ...parameters,
666
+ ...selectedModel === null ? {} : { model: selectedModel },
667
+ ...selectedCodexAccountId === null ? {} : { __codexhostAccountId: selectedCodexAccountId }
668
+ };
669
+ selectedCodexAccountId = null;
670
+ return routed;
664
671
  };
665
672
  const routedSend = (method, parameters, options) => {
666
673
  const routedParameters = method === "thread/start" ? routeThreadStart(parameters) : parameters;
@@ -732,6 +739,14 @@ function installDraftPrewarmPolicyBridge(manager, bridge, hostId, target, prewar
732
739
  selectedModel = model;
733
740
  return true;
734
741
  },
742
+ selectAccount(accountId) {
743
+ if (accountId !== null && !/^[A-Za-z0-9._~-]+$/u.test(accountId)) {
744
+ throw new Error("Draft Codex Account ID must be filename-safe");
745
+ }
746
+ if (selectedCodexAccountId === accountId) return false;
747
+ selectedCodexAccountId = accountId;
748
+ return true;
749
+ },
735
750
  clear() {
736
751
  prewarmedThreadManager.discardAllPrewarmedThreads();
737
752
  return Promise.resolve();
@@ -766,6 +781,7 @@ function installDraftPrewarmPolicyBridge(manager, bridge, hostId, target, prewar
766
781
  knownOfficialThreadIds.clear();
767
782
  threadOwnershipResolutions.clear();
768
783
  selectedModel = null;
784
+ selectedCodexAccountId = null;
769
785
  }
770
786
  });
771
787
  Object.defineProperty(target, "__codexhostDraftPrewarmPolicyV1", {