locus-product-planning 1.2.1 → 1.2.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.
package/dist/index.js CHANGED
@@ -12444,16 +12444,31 @@ import { fileURLToPath } from "url";
12444
12444
  function getCurrentDirname() {
12445
12445
  try {
12446
12446
  const meta = import.meta;
12447
- if (meta?.url) {
12448
- return dirname(fileURLToPath(meta.url));
12447
+ if (meta?.url && typeof meta.url === "string" && meta.url.startsWith("file:")) {
12448
+ const result = dirname(fileURLToPath(meta.url));
12449
+ if (typeof result === "string" && result.length > 0) {
12450
+ return result;
12451
+ }
12449
12452
  }
12450
12453
  } catch {
12451
12454
  }
12452
12455
  try {
12453
12456
  const packageJsonPath = __require.resolve("locus-product-planning/package.json");
12454
- return join(dirname(packageJsonPath), "dist");
12457
+ if (typeof packageJsonPath === "string") {
12458
+ return join(dirname(packageJsonPath), "dist");
12459
+ }
12455
12460
  } catch {
12456
12461
  }
12462
+ const cacheLocations = [
12463
+ join(process.env.HOME || "", ".cache", "opencode", "node_modules", "locus-product-planning"),
12464
+ join(process.env.HOME || "", ".config", "opencode", "node_modules", "locus-product-planning")
12465
+ ];
12466
+ for (const loc of cacheLocations) {
12467
+ const distPath = join(loc, "dist");
12468
+ if (existsSync(distPath)) {
12469
+ return distPath;
12470
+ }
12471
+ }
12457
12472
  const cwd = process.cwd();
12458
12473
  try {
12459
12474
  const pkgPath = resolve(cwd, "package.json");