opencode-codebase-index 0.1.3 → 0.1.4

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/index.js CHANGED
@@ -5,7 +5,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __commonJS = (cb, mod) => function __require() {
8
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
+ }) : x)(function(x) {
11
+ if (typeof require !== "undefined") return require.apply(this, arguments);
12
+ throw Error('Dynamic require of "' + x + '" is not supported');
13
+ });
14
+ var __commonJS = (cb, mod) => function __require2() {
9
15
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
16
  };
11
17
  var __copyProps = (to, from, except, desc) => {
@@ -2376,7 +2382,6 @@ function parseConfirmationResponse(response) {
2376
2382
  import * as path4 from "path";
2377
2383
  import * as os3 from "os";
2378
2384
  import { fileURLToPath } from "url";
2379
- import { createRequire } from "module";
2380
2385
  function getNativeBinding() {
2381
2386
  const platform2 = os3.platform();
2382
2387
  const arch2 = os3.arch();
@@ -2394,13 +2399,18 @@ function getNativeBinding() {
2394
2399
  } else {
2395
2400
  throw new Error(`Unsupported platform: ${platform2}-${arch2}`);
2396
2401
  }
2397
- const currentFileUrl = typeof import.meta !== "undefined" ? import.meta.url : __filename;
2398
- const currentDir = typeof currentFileUrl === "string" && currentFileUrl.startsWith("file:") ? path4.dirname(fileURLToPath(currentFileUrl)) : __dirname;
2402
+ let currentDir;
2403
+ if (typeof import.meta !== "undefined" && import.meta.url) {
2404
+ currentDir = path4.dirname(fileURLToPath(import.meta.url));
2405
+ } else if (typeof __dirname !== "undefined") {
2406
+ currentDir = __dirname;
2407
+ } else {
2408
+ currentDir = process.cwd();
2409
+ }
2399
2410
  const isDevMode = currentDir.includes("/src/native");
2400
2411
  const packageRoot = isDevMode ? path4.resolve(currentDir, "../..") : path4.resolve(currentDir, "..");
2401
2412
  const nativePath = path4.join(packageRoot, "native", bindingName);
2402
- const require2 = createRequire(currentFileUrl);
2403
- return require2(nativePath);
2413
+ return __require(nativePath);
2404
2414
  }
2405
2415
  var native = getNativeBinding();
2406
2416
  function parseFile(filePath, content) {