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.cjs CHANGED
@@ -2422,7 +2422,6 @@ function parseConfirmationResponse(response) {
2422
2422
  var path4 = __toESM(require("path"), 1);
2423
2423
  var os3 = __toESM(require("os"), 1);
2424
2424
  var import_url = require("url");
2425
- var import_module = require("module");
2426
2425
  var import_meta = {};
2427
2426
  function getNativeBinding() {
2428
2427
  const platform2 = os3.platform();
@@ -2441,13 +2440,18 @@ function getNativeBinding() {
2441
2440
  } else {
2442
2441
  throw new Error(`Unsupported platform: ${platform2}-${arch2}`);
2443
2442
  }
2444
- const currentFileUrl = typeof import_meta !== "undefined" ? import_meta.url : __filename;
2445
- const currentDir = typeof currentFileUrl === "string" && currentFileUrl.startsWith("file:") ? path4.dirname((0, import_url.fileURLToPath)(currentFileUrl)) : __dirname;
2443
+ let currentDir;
2444
+ if (typeof import_meta !== "undefined" && import_meta.url) {
2445
+ currentDir = path4.dirname((0, import_url.fileURLToPath)(import_meta.url));
2446
+ } else if (typeof __dirname !== "undefined") {
2447
+ currentDir = __dirname;
2448
+ } else {
2449
+ currentDir = process.cwd();
2450
+ }
2446
2451
  const isDevMode = currentDir.includes("/src/native");
2447
2452
  const packageRoot = isDevMode ? path4.resolve(currentDir, "../..") : path4.resolve(currentDir, "..");
2448
2453
  const nativePath = path4.join(packageRoot, "native", bindingName);
2449
- const require2 = (0, import_module.createRequire)(currentFileUrl);
2450
- return require2(nativePath);
2454
+ return require(nativePath);
2451
2455
  }
2452
2456
  var native = getNativeBinding();
2453
2457
  function parseFile(filePath, content) {