wave-agent-sdk 0.15.3 → 0.15.5

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.
@@ -9,6 +9,7 @@
9
9
  * - Local configs: {workdir}/.wave/settings.local.json > {workdir}/.wave/settings.json
10
10
  * - Project configs override user configs (existing behavior)
11
11
  */
12
+ export declare function getPackageRoot(): string;
12
13
  /**
13
14
  * Get the builtin skills directory path
14
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"configPaths.d.ts","sourceRoot":"","sources":["../../src/utils/configPaths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAI5C;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAI/C;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAG7C;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAG/D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;IAClD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAWA;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG;IACvD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB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IACxB,cAAc,EAAE;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,CAAC;CACH,CAcA"}
@@ -13,23 +13,38 @@ import { join, dirname } from "path";
13
13
  import { homedir } from "os";
14
14
  import { existsSync } from "fs";
15
15
  import { fileURLToPath } from "url";
16
+ import { findUpSync } from "find-up";
16
17
  const __filename = fileURLToPath(import.meta.url);
17
18
  const __dirname = dirname(__filename);
19
+ /**
20
+ * Resolve the package root directory by finding the nearest package.json.
21
+ * Works correctly even when bundled (e.g. esbuild into a VS Code extension),
22
+ * as long as vendor/ and builtin/ remain alongside package.json on disk.
23
+ */
24
+ let _packageRoot;
25
+ export function getPackageRoot() {
26
+ if (_packageRoot)
27
+ return _packageRoot;
28
+ const pkgPath = findUpSync("package.json", { cwd: __dirname });
29
+ if (pkgPath) {
30
+ _packageRoot = dirname(pkgPath);
31
+ return _packageRoot;
32
+ }
33
+ // Fallback: relative to this file (works during development)
34
+ _packageRoot = join(__dirname, "..", "..");
35
+ return _packageRoot;
36
+ }
18
37
  /**
19
38
  * Get the builtin skills directory path
20
39
  */
21
40
  export function getBuiltinSkillsDir() {
22
- // Builtin skills are now in the 'builtin/skills' directory at the root of the package
23
- // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/skills
24
- return join(__dirname, "..", "..", "builtin", "skills");
41
+ return join(getPackageRoot(), "builtin", "skills");
25
42
  }
26
43
  /**
27
44
  * Get the builtin subagents directory path
28
45
  */
29
46
  export function getBuiltinSubagentsDir() {
30
- // Builtin subagents are now in the 'builtin/subagents' directory at the root of the package
31
- // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/subagents
32
- return join(__dirname, "..", "..", "builtin", "subagents");
47
+ return join(getPackageRoot(), "builtin", "subagents");
33
48
  }
34
49
  /**
35
50
  * Get the user-specific configuration file path (legacy function)
@@ -1,5 +1,7 @@
1
1
  /**
2
2
  * Path to the ripgrep binary bundled in the vendor directory.
3
+ * Uses findUpSync to locate the package root, working correctly even
4
+ * when bundled (e.g. esbuild into a VS Code extension).
3
5
  */
4
6
  export declare const rgPath: string;
5
7
  //# sourceMappingURL=ripgrep.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ripgrep.d.ts","sourceRoot":"","sources":["../../src/utils/ripgrep.ts"],"names":[],"mappings":"AA6BA;;GAEG;AACH,eAAO,MAAM,MAAM,QAGlB,CAAC"}
1
+ {"version":3,"file":"ripgrep.d.ts","sourceRoot":"","sources":["../../src/utils/ripgrep.ts"],"names":[],"mappings":"AA0BA;;;;GAIG;AACH,eAAO,MAAM,MAAM,QAGlB,CAAC"}
@@ -1,8 +1,6 @@
1
- import { fileURLToPath } from "url";
2
1
  import path from "path";
3
2
  import process from "process";
4
- const __filename = fileURLToPath(import.meta.url);
5
- const __dirname = path.dirname(__filename);
3
+ import { getPackageRoot } from "./configPaths.js";
6
4
  /**
7
5
  * Detect the current platform and architecture to find the correct bundled ripgrep binary.
8
6
  */
@@ -25,5 +23,7 @@ const isWindows = platformKey.startsWith("windows");
25
23
  const binaryName = isWindows ? "rg.exe" : "rg";
26
24
  /**
27
25
  * Path to the ripgrep binary bundled in the vendor directory.
26
+ * Uses findUpSync to locate the package root, working correctly even
27
+ * when bundled (e.g. esbuild into a VS Code extension).
28
28
  */
29
- export const rgPath = path.resolve(__dirname, `../../vendor/ripgrep/${platformKey}/${binaryName}`);
29
+ export const rgPath = path.join(getPackageRoot(), `vendor/ripgrep/${platformKey}/${binaryName}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave-agent-sdk",
3
- "version": "0.15.3",
3
+ "version": "0.15.5",
4
4
  "description": "SDK for building AI-powered development tools and agents",
5
5
  "keywords": [
6
6
  "ai",
@@ -31,6 +31,7 @@
31
31
  "@modelcontextprotocol/sdk": "^1.18.2",
32
32
  "chokidar": "^5.0.0",
33
33
  "cron-parser": "^5.5.0",
34
+ "find-up": "^8.0.0",
34
35
  "fuzzysort": "^3.1.0",
35
36
  "glob": "^13.0.0",
36
37
  "lru-cache": "^11.3.5",
@@ -14,26 +14,41 @@ import { join, dirname } from "path";
14
14
  import { homedir } from "os";
15
15
  import { existsSync } from "fs";
16
16
  import { fileURLToPath } from "url";
17
+ import { findUpSync } from "find-up";
17
18
 
18
19
  const __filename = fileURLToPath(import.meta.url);
19
20
  const __dirname = dirname(__filename);
20
21
 
22
+ /**
23
+ * Resolve the package root directory by finding the nearest package.json.
24
+ * Works correctly even when bundled (e.g. esbuild into a VS Code extension),
25
+ * as long as vendor/ and builtin/ remain alongside package.json on disk.
26
+ */
27
+ let _packageRoot: string | undefined;
28
+ export function getPackageRoot(): string {
29
+ if (_packageRoot) return _packageRoot;
30
+ const pkgPath = findUpSync("package.json", { cwd: __dirname });
31
+ if (pkgPath) {
32
+ _packageRoot = dirname(pkgPath);
33
+ return _packageRoot;
34
+ }
35
+ // Fallback: relative to this file (works during development)
36
+ _packageRoot = join(__dirname, "..", "..");
37
+ return _packageRoot;
38
+ }
39
+
21
40
  /**
22
41
  * Get the builtin skills directory path
23
42
  */
24
43
  export function getBuiltinSkillsDir(): string {
25
- // Builtin skills are now in the 'builtin/skills' directory at the root of the package
26
- // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/skills
27
- return join(__dirname, "..", "..", "builtin", "skills");
44
+ return join(getPackageRoot(), "builtin", "skills");
28
45
  }
29
46
 
30
47
  /**
31
48
  * Get the builtin subagents directory path
32
49
  */
33
50
  export function getBuiltinSubagentsDir(): string {
34
- // Builtin subagents are now in the 'builtin/subagents' directory at the root of the package
35
- // Relative to this file (src/utils/configPaths.ts), it's ../../builtin/subagents
36
- return join(__dirname, "..", "..", "builtin", "subagents");
51
+ return join(getPackageRoot(), "builtin", "subagents");
37
52
  }
38
53
 
39
54
  /**
@@ -1,9 +1,6 @@
1
- import { fileURLToPath } from "url";
2
1
  import path from "path";
3
2
  import process from "process";
4
-
5
- const __filename = fileURLToPath(import.meta.url);
6
- const __dirname = path.dirname(__filename);
3
+ import { getPackageRoot } from "./configPaths.js";
7
4
 
8
5
  /**
9
6
  * Detect the current platform and architecture to find the correct bundled ripgrep binary.
@@ -29,8 +26,10 @@ const binaryName = isWindows ? "rg.exe" : "rg";
29
26
 
30
27
  /**
31
28
  * Path to the ripgrep binary bundled in the vendor directory.
29
+ * Uses findUpSync to locate the package root, working correctly even
30
+ * when bundled (e.g. esbuild into a VS Code extension).
32
31
  */
33
- export const rgPath = path.resolve(
34
- __dirname,
35
- `../../vendor/ripgrep/${platformKey}/${binaryName}`,
32
+ export const rgPath = path.join(
33
+ getPackageRoot(),
34
+ `vendor/ripgrep/${platformKey}/${binaryName}`,
36
35
  );