mini-opti-bridge 0.1.1 → 0.1.2

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.
Files changed (3) hide show
  1. package/README.md +1 -0
  2. package/dist/cli.js +11 -4
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -21,6 +21,7 @@ The bridge starts `codex app-server` locally.
21
21
 
22
22
  - If `codex` is already in `PATH`, nothing else is needed.
23
23
  - If it is installed elsewhere, set `MINI_OPTI_CODEX_BIN` to the full path of `codex`, `codex.cmd`, or `codex.exe`.
24
+ - On Windows, the bridge now launches Codex through `cmd.exe`, so standard npm-installed `codex` shims work without extra setup.
24
25
 
25
26
  Windows example:
26
27
 
package/dist/cli.js CHANGED
@@ -30,8 +30,15 @@ var parseBridgeBootstrap = (input) => {
30
30
  // ../connectors/src/codex/app-server-client.ts
31
31
  import { spawn } from "child_process";
32
32
  import readline from "readline";
33
- var defaultCodexBin = (platform = process.platform) => platform === "win32" ? "codex.cmd" : "codex";
33
+ var defaultCodexBin = (platform = process.platform) => "codex";
34
34
  var resolveCodexBin = (env = process.env, platform = process.platform) => env.MINI_OPTI_CODEX_BIN?.trim() || env.CODEX_BIN?.trim() || defaultCodexBin(platform);
35
+ var resolveCodexLaunch = (env = process.env, platform = process.platform) => {
36
+ const codexBin = resolveCodexBin(env, platform);
37
+ if (platform === "win32") {
38
+ return { command: "cmd.exe", args: ["/d", "/s", "/c", codexBin, "app-server"] };
39
+ }
40
+ return { command: codexBin, args: ["app-server"] };
41
+ };
35
42
  var codexStartHelp = (input) => {
36
43
  if (input.code !== "ENOENT") return `Could not start \`${input.command} app-server\`.`;
37
44
  const verify = input.platform === "win32" ? "Run `codex --version` in PowerShell. If that fails, point MINI_OPTI_CODEX_BIN to your codex.cmd or codex.exe." : "Run `codex --version` in your shell. If that fails, point MINI_OPTI_CODEX_BIN to the full codex path.";
@@ -43,14 +50,14 @@ var CodexAppServerClient = class {
43
50
  pending = /* @__PURE__ */ new Map();
44
51
  async start() {
45
52
  if (this.proc) return;
46
- const command = resolveCodexBin(process.env, process.platform);
47
- this.proc = spawn(command, ["app-server"], { stdio: ["pipe", "pipe", "inherit"] });
53
+ const launch = resolveCodexLaunch(process.env, process.platform);
54
+ this.proc = spawn(launch.command, launch.args, { stdio: ["pipe", "pipe", "inherit"] });
48
55
  const proc = this.proc;
49
56
  const startError = await new Promise((resolve) => {
50
57
  proc.once("spawn", () => resolve(null));
51
58
  proc.once(
52
59
  "error",
53
- (error) => resolve(new Error(codexStartHelp({ code: error.code, command, platform: process.platform })))
60
+ (error) => resolve(new Error(codexStartHelp({ code: error.code, command: launch.command, platform: process.platform })))
54
61
  );
55
62
  });
56
63
  if (startError) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mini-opti-bridge",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "One-command Codex bridge bootstrap for the Mini Opti dashboard",
5
5
  "type": "module",
6
6
  "bin": "cli.js",