@rubytech/taskmaster 1.0.78 → 1.0.79

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.78",
3
- "commit": "cc4f7066cfec691f8073ad9ad7d188b2c526ff37",
4
- "builtAt": "2026-02-20T21:10:41.087Z"
2
+ "version": "1.0.79",
3
+ "commit": "44763c4d80e54f336dba0a7fe8f2df0822ffc102",
4
+ "builtAt": "2026-02-20T21:17:54.788Z"
5
5
  }
@@ -4,6 +4,24 @@ import { fileURLToPath } from "node:url";
4
4
  export function resolveBundledPluginsDir() {
5
5
  return resolveBundledPluginsDirDetailed().dir;
6
6
  }
7
+ /**
8
+ * Walk up from a starting directory looking for an `extensions/` child.
9
+ * Returns the extensions path if found, otherwise undefined.
10
+ */
11
+ function walkUpForExtensions(startDir, triedPaths, maxLevels = 6) {
12
+ let cursor = startDir;
13
+ for (let i = 0; i < maxLevels; i += 1) {
14
+ const candidate = path.join(cursor, "extensions");
15
+ triedPaths.push(candidate);
16
+ if (fs.existsSync(candidate))
17
+ return candidate;
18
+ const parent = path.dirname(cursor);
19
+ if (parent === cursor)
20
+ break;
21
+ cursor = parent;
22
+ }
23
+ return undefined;
24
+ }
7
25
  export function resolveBundledPluginsDirDetailed() {
8
26
  const triedPaths = [];
9
27
  const override = process.env.TASKMASTER_BUNDLED_PLUGINS_DIR?.trim();
@@ -20,22 +38,52 @@ export function resolveBundledPluginsDirDetailed() {
20
38
  catch {
21
39
  // ignore
22
40
  }
23
- // npm/dev: walk up from this module to find `extensions/` at the package root.
41
+ // Strategy 1: walk up from this module's real path (handles symlinks).
24
42
  try {
25
- let cursor = path.dirname(fileURLToPath(import.meta.url));
26
- for (let i = 0; i < 6; i += 1) {
27
- const candidate = path.join(cursor, "extensions");
28
- triedPaths.push(candidate);
29
- if (fs.existsSync(candidate))
30
- return { dir: candidate, source: "walk-up" };
31
- const parent = path.dirname(cursor);
32
- if (parent === cursor)
33
- break;
34
- cursor = parent;
43
+ const modulePath = fs.realpathSync(fileURLToPath(import.meta.url));
44
+ const found = walkUpForExtensions(path.dirname(modulePath), triedPaths);
45
+ if (found)
46
+ return { dir: found, source: "walk-up-realpath" };
47
+ }
48
+ catch {
49
+ // ignore
50
+ }
51
+ // Strategy 2: walk up from this module's raw path (without realpath).
52
+ try {
53
+ const rawModulePath = fileURLToPath(import.meta.url);
54
+ const found = walkUpForExtensions(path.dirname(rawModulePath), triedPaths);
55
+ if (found)
56
+ return { dir: found, source: "walk-up-raw" };
57
+ }
58
+ catch {
59
+ // ignore
60
+ }
61
+ // Strategy 3: walk up from the entry script (process.argv[1]).
62
+ // On npm global install, process.argv[1] resolves through bin symlinks
63
+ // to the actual entry.js in the package — a different starting point
64
+ // than import.meta.url which resolves from this specific module file.
65
+ try {
66
+ const entryScript = process.argv[1];
67
+ if (entryScript) {
68
+ const realEntry = fs.realpathSync(entryScript);
69
+ const found = walkUpForExtensions(path.dirname(realEntry), triedPaths);
70
+ if (found)
71
+ return { dir: found, source: "walk-up-argv1" };
35
72
  }
36
73
  }
37
74
  catch {
38
75
  // ignore
39
76
  }
77
+ // Strategy 4: walk up from the package's main module.
78
+ // require.resolve finds the package entry regardless of how we were loaded.
79
+ try {
80
+ const pkgEntry = require.resolve("@rubytech/taskmaster");
81
+ const found = walkUpForExtensions(path.dirname(pkgEntry), triedPaths);
82
+ if (found)
83
+ return { dir: found, source: "walk-up-require-resolve" };
84
+ }
85
+ catch {
86
+ // ignore
87
+ }
40
88
  return { dir: undefined, triedPaths };
41
89
  }
@@ -274,8 +274,8 @@ export function discoverTaskmasterPlugins(params) {
274
274
  }
275
275
  else {
276
276
  diagnostics.push({
277
- level: "warn",
278
- message: `bundled extensions dir not resolved${bundled.triedPaths?.length ? ` (tried: ${bundled.triedPaths.join(", ")})` : ""}`,
277
+ level: "error",
278
+ message: `bundled extensions dir not resolved (tried: ${bundled.triedPaths?.join(", ") || "none"})`,
279
279
  source: "bundled-dir",
280
280
  });
281
281
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/taskmaster",
3
- "version": "1.0.78",
3
+ "version": "1.0.79",
4
4
  "description": "AI-powered business assistant for small businesses",
5
5
  "publishConfig": {
6
6
  "access": "public"