@spotpatch/bridge 0.1.0 → 0.2.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/dist/cli.js CHANGED
@@ -261,7 +261,7 @@ import { z as z3 } from "zod";
261
261
  // package.json
262
262
  var package_default = {
263
263
  name: "@spotpatch/bridge",
264
- version: "0.1.0",
264
+ version: "0.2.0",
265
265
  description: "Local MCP inbox and explicit active Agent connectors for SpotPatch handoffs.",
266
266
  license: "MIT",
267
267
  repository: {
@@ -312,6 +312,7 @@ var package_default = {
312
312
  },
313
313
  dependencies: {
314
314
  "@modelcontextprotocol/server": "2.0.0",
315
+ "@spotpatch/agent": "workspace:^",
315
316
  "@spotpatch/shared": "workspace:^",
316
317
  zod: "4.4.3"
317
318
  },
@@ -1838,15 +1839,19 @@ async function applyBridgeSetupPlan(plan) {
1838
1839
 
1839
1840
  // src/active/codex/errors.ts
1840
1841
  var CODEX_ADAPTER_ERROR_CODES = Object.freeze({
1842
+ AUTH_REQUIRED: "CODEX_AUTH_REQUIRED",
1841
1843
  BUSY: "CODEX_ADAPTER_BUSY",
1842
1844
  CLOSED: "CODEX_ADAPTER_CLOSED",
1845
+ CONFIG_ISOLATION_UNSUPPORTED: "CODEX_CONFIG_ISOLATION_UNSUPPORTED",
1843
1846
  EXECUTABLE_NOT_FOUND: "CODEX_EXECUTABLE_NOT_FOUND",
1844
1847
  EXECUTABLE_UNTRUSTED: "CODEX_EXECUTABLE_UNTRUSTED",
1845
1848
  MCP_NOT_READY: "CODEX_MCP_NOT_READY",
1849
+ MODEL_UNAVAILABLE: "CODEX_MODEL_UNAVAILABLE",
1846
1850
  PROCESS_EXITED: "CODEX_PROCESS_EXITED",
1847
1851
  PROTOCOL: "CODEX_APP_SERVER_PROTOCOL_ERROR",
1848
1852
  REQUEST_FAILED: "CODEX_APP_SERVER_REQUEST_FAILED",
1849
1853
  REQUEST_TIMEOUT: "CODEX_APP_SERVER_REQUEST_TIMEOUT",
1854
+ THREAD_CLEANUP_INCOMPLETE: "CODEX_THREAD_CLEANUP_INCOMPLETE",
1850
1855
  UNSUPPORTED_VERSION: "CODEX_UNSUPPORTED_VERSION",
1851
1856
  WORKSPACE_WRITE_REQUIRED: "CODEX_WORKSPACE_WRITE_REQUIRED"
1852
1857
  });
@@ -1864,9 +1869,14 @@ import { constants as fsConstants } from "fs";
1864
1869
  import { access, realpath as realpath3, stat } from "fs/promises";
1865
1870
  import path4 from "path";
1866
1871
  import { spawn } from "child_process";
1867
- var SUPPORTED_CODEX_VERSION = "0.149.0";
1868
1872
  var VERSION_OUTPUT_LIMIT_BYTES = 8 * 1024;
1869
1873
  var VERSION_PROBE_TIMEOUT_MS = 5e3;
1874
+ function supportedVersion(value) {
1875
+ const match = /^codex-cli (0)\.(149)\.(\d+)$/u.exec(value);
1876
+ if (match === null) return void 0;
1877
+ const patchVersion = Number(match[3]);
1878
+ return Number.isSafeInteger(patchVersion) ? `0.149.${String(patchVersion)}` : void 0;
1879
+ }
1870
1880
  function isWithin(root, candidate) {
1871
1881
  const relative = path4.relative(root, candidate);
1872
1882
  return relative === "" || !relative.startsWith(`..${path4.sep}`) && relative !== "..";
@@ -1968,13 +1978,13 @@ async function resolveCodexExecutable(projectRoot, options = {}) {
1968
1978
  throw new CodexAdapterError(CODEX_ADAPTER_ERROR_CODES.EXECUTABLE_UNTRUSTED);
1969
1979
  }
1970
1980
  const output = await readCodexVersion(executable);
1971
- const expectedOutput = `codex-cli ${SUPPORTED_CODEX_VERSION}`;
1972
- if (output !== expectedOutput) {
1981
+ const version = supportedVersion(output);
1982
+ if (version === void 0) {
1973
1983
  throw new CodexAdapterError(CODEX_ADAPTER_ERROR_CODES.UNSUPPORTED_VERSION);
1974
1984
  }
1975
1985
  return Object.freeze({
1976
1986
  path: executable,
1977
- version: SUPPORTED_CODEX_VERSION
1987
+ version
1978
1988
  });
1979
1989
  }
1980
1990