oh-my-opencode 3.17.14 → 3.17.15

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/index.js CHANGED
@@ -6653,25 +6653,128 @@ var init_external_plugin_detector = __esm(() => {
6653
6653
  init_plugin_identity();
6654
6654
  });
6655
6655
 
6656
+ // src/shared/bun-spawn-shim.ts
6657
+ import { spawn as nodeSpawn, spawnSync as nodeSpawnSync } from "child_process";
6658
+ import { Readable, Writable } from "stream";
6659
+ function emptyReadableStream() {
6660
+ return new ReadableStream({
6661
+ start(controller) {
6662
+ controller.close();
6663
+ }
6664
+ });
6665
+ }
6666
+ function toReadableStream(stream) {
6667
+ if (!stream)
6668
+ return emptyReadableStream();
6669
+ return Readable.toWeb(stream);
6670
+ }
6671
+ function emptyWritableStream() {
6672
+ return new Writable({
6673
+ write(_chunk, _encoding, callback) {
6674
+ callback();
6675
+ }
6676
+ });
6677
+ }
6678
+ function resolveCommand(cmdOrOpts, optsArg) {
6679
+ const isObj = !Array.isArray(cmdOrOpts);
6680
+ const opts = isObj ? cmdOrOpts : optsArg ?? {};
6681
+ return {
6682
+ cmd: isObj ? cmdOrOpts.cmd : cmdOrOpts,
6683
+ opts
6684
+ };
6685
+ }
6686
+ function resolveStdio(options) {
6687
+ if (options.stdio)
6688
+ return options.stdio;
6689
+ return [options.stdin ?? "ignore", options.stdout ?? "pipe", options.stderr ?? "inherit"];
6690
+ }
6691
+ function wrapNodeProcess(proc) {
6692
+ let exitCode = null;
6693
+ const exited = new Promise((resolve4, reject) => {
6694
+ proc.on("exit", (code) => {
6695
+ exitCode = code ?? 1;
6696
+ resolve4(exitCode);
6697
+ });
6698
+ proc.on("error", (error) => {
6699
+ if (exitCode === null) {
6700
+ exitCode = 1;
6701
+ reject(error);
6702
+ }
6703
+ });
6704
+ });
6705
+ return {
6706
+ get exitCode() {
6707
+ return exitCode;
6708
+ },
6709
+ exited,
6710
+ stdout: toReadableStream(proc.stdout),
6711
+ stderr: toReadableStream(proc.stderr),
6712
+ stdin: proc.stdin ?? emptyWritableStream(),
6713
+ kill(signal) {
6714
+ if (proc.killed || exitCode !== null)
6715
+ return;
6716
+ try {
6717
+ proc.kill(signal);
6718
+ } catch (error) {
6719
+ if (!String(error).includes("kill"))
6720
+ throw error;
6721
+ }
6722
+ },
6723
+ pid: proc.pid,
6724
+ ref() {
6725
+ proc.ref();
6726
+ },
6727
+ unref() {
6728
+ proc.unref();
6729
+ }
6730
+ };
6731
+ }
6732
+ function spawn(cmdOrOpts, opts) {
6733
+ if (IS_BUN)
6734
+ return runtime.Bun.spawn(cmdOrOpts, opts);
6735
+ const { cmd, opts: options } = resolveCommand(cmdOrOpts, opts);
6736
+ const [bin, ...args] = cmd;
6737
+ const proc = nodeSpawn(bin, args, {
6738
+ cwd: options.cwd,
6739
+ env: options.env,
6740
+ stdio: resolveStdio(options),
6741
+ detached: options.detached
6742
+ });
6743
+ return wrapNodeProcess(proc);
6744
+ }
6745
+ var runtime, IS_BUN;
6746
+ var init_bun_spawn_shim = __esm(() => {
6747
+ runtime = globalThis;
6748
+ IS_BUN = typeof runtime.Bun !== "undefined";
6749
+ });
6750
+
6656
6751
  // src/shared/archive-entry-validator.ts
6657
6752
  var init_archive_entry_validator = () => {};
6658
6753
 
6659
6754
  // src/shared/zip-entry-listing/python-zip-entry-listing.ts
6660
- var init_python_zip_entry_listing = () => {};
6755
+ var init_python_zip_entry_listing = __esm(() => {
6756
+ init_bun_spawn_shim();
6757
+ });
6661
6758
 
6662
6759
  // src/shared/zip-entry-listing/powershell-zip-entry-listing.ts
6663
- var init_powershell_zip_entry_listing = () => {};
6760
+ var init_powershell_zip_entry_listing = __esm(() => {
6761
+ init_bun_spawn_shim();
6762
+ });
6664
6763
 
6665
6764
  // src/shared/zip-entry-listing/tar-zip-entry-listing.ts
6666
6765
  var init_tar_zip_entry_listing = __esm(() => {
6766
+ init_bun_spawn_shim();
6667
6767
  init_logger();
6668
6768
  });
6669
6769
 
6670
6770
  // src/shared/zip-entry-listing/read-zip-symlink-target.ts
6671
- var init_read_zip_symlink_target = () => {};
6771
+ var init_read_zip_symlink_target = __esm(() => {
6772
+ init_bun_spawn_shim();
6773
+ });
6672
6774
 
6673
6775
  // src/shared/zip-entry-listing/zipinfo-zip-entry-listing.ts
6674
6776
  var init_zipinfo_zip_entry_listing = __esm(() => {
6777
+ init_bun_spawn_shim();
6675
6778
  init_read_zip_symlink_target();
6676
6779
  });
6677
6780
 
@@ -6685,6 +6788,7 @@ var init_zip_entry_listing = __esm(() => {
6685
6788
 
6686
6789
  // src/shared/zip-extractor.ts
6687
6790
  var init_zip_extractor = __esm(() => {
6791
+ init_bun_spawn_shim();
6688
6792
  init_archive_entry_validator();
6689
6793
  init_zip_entry_listing();
6690
6794
  });
@@ -6697,6 +6801,7 @@ function getCachedBinaryPath(cacheDir, binaryName) {
6697
6801
  return existsSync6(binaryPath) ? binaryPath : null;
6698
6802
  }
6699
6803
  var init_binary_downloader = __esm(() => {
6804
+ init_bun_spawn_shim();
6700
6805
  init_archive_entry_validator();
6701
6806
  init_zip_extractor();
6702
6807
  });
@@ -50635,31 +50740,38 @@ var init_server_health = __esm(() => {
50635
50740
  });
50636
50741
 
50637
50742
  // src/tools/interactive-bash/tmux-path-resolver.ts
50638
- var init_tmux_path_resolver = () => {};
50743
+ var init_tmux_path_resolver = __esm(() => {
50744
+ init_bun_spawn_shim();
50745
+ });
50639
50746
 
50640
50747
  // src/shared/tmux/tmux-utils/pane-dimensions.ts
50641
50748
  var init_pane_dimensions = __esm(() => {
50749
+ init_bun_spawn_shim();
50642
50750
  init_tmux_path_resolver();
50643
50751
  });
50644
50752
 
50645
50753
  // src/shared/tmux/tmux-utils/pane-spawn.ts
50646
50754
  var init_pane_spawn = __esm(() => {
50755
+ init_bun_spawn_shim();
50647
50756
  init_tmux_path_resolver();
50648
50757
  init_server_health();
50649
50758
  });
50650
50759
  // src/shared/tmux/tmux-utils/pane-replace.ts
50651
50760
  var init_pane_replace = __esm(() => {
50761
+ init_bun_spawn_shim();
50652
50762
  init_tmux_path_resolver();
50653
50763
  });
50654
50764
 
50655
50765
  // src/shared/tmux/tmux-utils/window-spawn.ts
50656
50766
  var init_window_spawn = __esm(() => {
50767
+ init_bun_spawn_shim();
50657
50768
  init_tmux_path_resolver();
50658
50769
  init_server_health();
50659
50770
  });
50660
50771
 
50661
50772
  // src/shared/tmux/tmux-utils/session-spawn.ts
50662
50773
  var init_session_spawn = __esm(() => {
50774
+ init_bun_spawn_shim();
50663
50775
  init_tmux_path_resolver();
50664
50776
  init_server_health();
50665
50777
  });
@@ -50668,6 +50780,7 @@ var init_stale_session_sweep = () => {};
50668
50780
 
50669
50781
  // src/shared/tmux/tmux-utils/layout.ts
50670
50782
  var init_layout = __esm(() => {
50783
+ init_bun_spawn_shim();
50671
50784
  init_tmux_path_resolver();
50672
50785
  });
50673
50786
 
@@ -52054,16 +52167,15 @@ var init_write_omo_config = __esm(() => {
52054
52167
  });
52055
52168
 
52056
52169
  // src/shared/spawn-with-windows-hide.ts
52057
- var {spawn: bunSpawn } = globalThis.Bun;
52058
- import { spawn as nodeSpawn } from "child_process";
52059
- import { Readable } from "stream";
52060
- function toReadableStream(stream) {
52170
+ import { spawn as nodeSpawn2 } from "child_process";
52171
+ import { Readable as Readable2 } from "stream";
52172
+ function toReadableStream2(stream) {
52061
52173
  if (!stream) {
52062
52174
  return;
52063
52175
  }
52064
- return Readable.toWeb(stream);
52176
+ return Readable2.toWeb(stream);
52065
52177
  }
52066
- function wrapNodeProcess(proc) {
52178
+ function wrapNodeProcess2(proc) {
52067
52179
  let resolveExited;
52068
52180
  let exitCode = null;
52069
52181
  const exited = new Promise((resolve4) => {
@@ -52084,8 +52196,8 @@ function wrapNodeProcess(proc) {
52084
52196
  return exitCode;
52085
52197
  },
52086
52198
  exited,
52087
- stdout: toReadableStream(proc.stdout),
52088
- stderr: toReadableStream(proc.stderr),
52199
+ stdout: toReadableStream2(proc.stdout),
52200
+ stderr: toReadableStream2(proc.stderr),
52089
52201
  kill(signal) {
52090
52202
  try {
52091
52203
  if (!signal) {
@@ -52099,19 +52211,21 @@ function wrapNodeProcess(proc) {
52099
52211
  }
52100
52212
  function spawnWithWindowsHide(command, options) {
52101
52213
  if (process.platform !== "win32") {
52102
- return bunSpawn(command, options);
52214
+ return spawn(command, options);
52103
52215
  }
52104
52216
  const [cmd, ...args] = command;
52105
- const proc = nodeSpawn(cmd, args, {
52217
+ const proc = nodeSpawn2(cmd, args, {
52106
52218
  cwd: options.cwd,
52107
52219
  env: options.env,
52108
- stdio: [options.stdin ?? "pipe", options.stdout ?? "pipe", options.stderr ?? "pipe"],
52220
+ stdio: [options.stdin ?? "ignore", options.stdout ?? "pipe", options.stderr ?? "inherit"],
52109
52221
  windowsHide: true,
52110
52222
  shell: true
52111
52223
  });
52112
- return wrapNodeProcess(proc);
52224
+ return wrapNodeProcess2(proc);
52113
52225
  }
52114
- var init_spawn_with_windows_hide = () => {};
52226
+ var init_spawn_with_windows_hide = __esm(() => {
52227
+ init_bun_spawn_shim();
52228
+ });
52115
52229
 
52116
52230
  // src/cli/config-manager/opencode-binary.ts
52117
52231
  async function findOpenCodeBinaryWithVersion() {
@@ -52678,10 +52792,10 @@ var require_resolveCommand = __commonJS((exports, module) => {
52678
52792
  }
52679
52793
  return resolved;
52680
52794
  }
52681
- function resolveCommand(parsed) {
52795
+ function resolveCommand2(parsed) {
52682
52796
  return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
52683
52797
  }
52684
- module.exports = resolveCommand;
52798
+ module.exports = resolveCommand2;
52685
52799
  });
52686
52800
 
52687
52801
  // node_modules/cross-spawn/lib/util/escape.js
@@ -52749,19 +52863,19 @@ var require_readShebang = __commonJS((exports, module) => {
52749
52863
  // node_modules/cross-spawn/lib/parse.js
52750
52864
  var require_parse = __commonJS((exports, module) => {
52751
52865
  var path6 = __require("path");
52752
- var resolveCommand = require_resolveCommand();
52866
+ var resolveCommand2 = require_resolveCommand();
52753
52867
  var escape = require_escape();
52754
52868
  var readShebang = require_readShebang();
52755
52869
  var isWin = process.platform === "win32";
52756
52870
  var isExecutableRegExp = /\.(?:com|exe)$/i;
52757
52871
  var isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
52758
52872
  function detectShebang(parsed) {
52759
- parsed.file = resolveCommand(parsed);
52873
+ parsed.file = resolveCommand2(parsed);
52760
52874
  const shebang = parsed.file && readShebang(parsed.file);
52761
52875
  if (shebang) {
52762
52876
  parsed.args.unshift(parsed.file);
52763
52877
  parsed.command = shebang;
52764
- return resolveCommand(parsed);
52878
+ return resolveCommand2(parsed);
52765
52879
  }
52766
52880
  return parsed.file;
52767
52881
  }
@@ -52857,21 +52971,21 @@ var require_cross_spawn = __commonJS((exports, module) => {
52857
52971
  var cp = __require("child_process");
52858
52972
  var parse7 = require_parse();
52859
52973
  var enoent = require_enoent();
52860
- function spawn(command, args, options) {
52974
+ function spawn2(command, args, options) {
52861
52975
  const parsed = parse7(command, args, options);
52862
52976
  const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
52863
52977
  enoent.hookChildProcess(spawned, parsed);
52864
52978
  return spawned;
52865
52979
  }
52866
- function spawnSync(command, args, options) {
52980
+ function spawnSync2(command, args, options) {
52867
52981
  const parsed = parse7(command, args, options);
52868
52982
  const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
52869
52983
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
52870
52984
  return result;
52871
52985
  }
52872
- module.exports = spawn;
52873
- module.exports.spawn = spawn;
52874
- module.exports.sync = spawnSync;
52986
+ module.exports = spawn2;
52987
+ module.exports.spawn = spawn2;
52988
+ module.exports.sync = spawnSync2;
52875
52989
  module.exports._parse = parse7;
52876
52990
  module.exports._enoent = enoent;
52877
52991
  });
@@ -53882,7 +53996,7 @@ var {
53882
53996
  // package.json
53883
53997
  var package_default = {
53884
53998
  name: "oh-my-opencode",
53885
- version: "3.17.14",
53999
+ version: "3.17.15",
53886
54000
  description: "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
53887
54001
  main: "./dist/index.js",
53888
54002
  types: "dist/index.d.ts",
@@ -53904,7 +54018,8 @@ var package_default = {
53904
54018
  "./schema.json": "./dist/oh-my-opencode.schema.json"
53905
54019
  },
53906
54020
  scripts: {
53907
- build: "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external zod && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
54021
+ build: "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi --external zod && bun run build:node-require-shim && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
54022
+ "build:node-require-shim": "bun run script/patch-node-require-shim.ts",
53908
54023
  "build:all": "bun run build && bun run build:binaries",
53909
54024
  "build:binaries": "bun run script/build-binaries.ts",
53910
54025
  "build:schema": "bun run script/build-schema.ts",
@@ -53962,17 +54077,17 @@ var package_default = {
53962
54077
  zod: "^4.3.0"
53963
54078
  },
53964
54079
  optionalDependencies: {
53965
- "oh-my-opencode-darwin-arm64": "3.17.14",
53966
- "oh-my-opencode-darwin-x64": "3.17.14",
53967
- "oh-my-opencode-darwin-x64-baseline": "3.17.14",
53968
- "oh-my-opencode-linux-arm64": "3.17.14",
53969
- "oh-my-opencode-linux-arm64-musl": "3.17.14",
53970
- "oh-my-opencode-linux-x64": "3.17.14",
53971
- "oh-my-opencode-linux-x64-baseline": "3.17.14",
53972
- "oh-my-opencode-linux-x64-musl": "3.17.14",
53973
- "oh-my-opencode-linux-x64-musl-baseline": "3.17.14",
53974
- "oh-my-opencode-windows-x64": "3.17.14",
53975
- "oh-my-opencode-windows-x64-baseline": "3.17.14"
54080
+ "oh-my-opencode-darwin-arm64": "3.17.15",
54081
+ "oh-my-opencode-darwin-x64": "3.17.15",
54082
+ "oh-my-opencode-darwin-x64-baseline": "3.17.15",
54083
+ "oh-my-opencode-linux-arm64": "3.17.15",
54084
+ "oh-my-opencode-linux-arm64-musl": "3.17.15",
54085
+ "oh-my-opencode-linux-x64": "3.17.15",
54086
+ "oh-my-opencode-linux-x64-baseline": "3.17.15",
54087
+ "oh-my-opencode-linux-x64-musl": "3.17.15",
54088
+ "oh-my-opencode-linux-x64-musl-baseline": "3.17.15",
54089
+ "oh-my-opencode-windows-x64": "3.17.15",
54090
+ "oh-my-opencode-windows-x64-baseline": "3.17.15"
53976
54091
  },
53977
54092
  overrides: {},
53978
54093
  trustedDependencies: [
@@ -71449,12 +71564,12 @@ function createOpencodeClient(config2) {
71449
71564
  var import_cross_spawn = __toESM(require_cross_spawn(), 1);
71450
71565
 
71451
71566
  // node_modules/@opencode-ai/sdk/dist/process.js
71452
- import { spawnSync } from "child_process";
71567
+ import { spawnSync as spawnSync2 } from "child_process";
71453
71568
  function stop(proc) {
71454
71569
  if (proc.exitCode !== null || proc.signalCode !== null)
71455
71570
  return;
71456
71571
  if (process.platform === "win32" && proc.pid) {
71457
- const out = spawnSync("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true });
71572
+ const out = spawnSync2("taskkill", ["/pid", String(proc.pid), "/T", "/F"], { windowsHide: true });
71458
71573
  if (!out.error && out.status === 0)
71459
71574
  return;
71460
71575
  }
@@ -79775,7 +79890,7 @@ async function findAvailablePort2(startPort = DEFAULT_PORT) {
79775
79890
  }
79776
79891
 
79777
79892
  // src/features/mcp-oauth/oauth-authorization-flow.ts
79778
- import { spawn } from "child_process";
79893
+ import { spawn as spawn2 } from "child_process";
79779
79894
  import { createHash as createHash2, randomBytes as randomBytes2 } from "crypto";
79780
79895
  import { createServer } from "http";
79781
79896
  function generateCodeVerifier() {
@@ -79856,7 +79971,7 @@ function openBrowser(url2) {
79856
79971
  args = [url2];
79857
79972
  }
79858
79973
  try {
79859
- const child = spawn(command, args, { stdio: "ignore", detached: true });
79974
+ const child = spawn2(command, args, { stdio: "ignore", detached: true });
79860
79975
  child.on("error", () => {});
79861
79976
  child.unref();
79862
79977
  } catch {}