@silo-code/sdk 0.10.1 → 0.11.0

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.
@@ -11,8 +11,15 @@ export interface SearchOptions {
11
11
  * Search root. Defaults to the open **workspace folder** when omitted. A `cwd`
12
12
  * outside the workspace throws {@link PathDeniedError} unless the extension
13
13
  * declared the `process` {@link Permission}; first-party extensions are unscoped.
14
+ * Ignored when {@link SearchOptions.cwds} is non-empty.
14
15
  */
15
16
  cwd?: string;
17
+ /**
18
+ * Multiple search roots. When provided, all listed folders are searched and
19
+ * results are merged. Each root is subject to the same scope guard as `cwd`.
20
+ * Takes precedence over `cwd` when non-empty.
21
+ */
22
+ cwds?: string[];
16
23
  /** Treat `query` as a regular expression instead of a literal string. */
17
24
  regex?: boolean;
18
25
  /** Match case exactly. When false (default), the search is case-insensitive. */
@@ -59,7 +66,13 @@ export interface SearchMatch {
59
66
  * @public
60
67
  */
61
68
  export interface SearchFileResult {
62
- /** File path **relative to** the search `cwd` (the workspace folder by default). */
69
+ /**
70
+ * Absolute path of the search root this file lives under. Present when
71
+ * searching multiple roots (via {@link SearchOptions.cwds}); omitted for
72
+ * single-root searches where the caller already knows the root.
73
+ */
74
+ root?: string;
75
+ /** File path **relative to** `root` (or the search `cwd` for single-root searches). */
63
76
  path: string;
64
77
  /** The matching lines within this file, in file order. */
65
78
  matches: SearchMatch[];
@@ -1 +1 @@
1
- {"version":3,"file":"search-service.d.ts","sourceRoot":"","sources":["../src/search-service.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oFAAoF;IACpF,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACzE"}
1
+ {"version":3,"file":"search-service.d.ts","sourceRoot":"","sources":["../src/search-service.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,yEAAyE;IACzE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,gFAAgF;IAChF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,0FAA0F;IAC1F,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,mEAAmE;IACnE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,iDAAiD;IACjD,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACzE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silo-code/sdk",
3
- "version": "0.10.1",
3
+ "version": "0.11.0",
4
4
  "description": "The public, types-first SDK for building Silo extensions — the only surface third-party extensions import.",
5
5
  "license": "MIT",
6
6
  "author": "Dave Weaver",
@@ -16,8 +16,15 @@ export interface SearchOptions {
16
16
  * Search root. Defaults to the open **workspace folder** when omitted. A `cwd`
17
17
  * outside the workspace throws {@link PathDeniedError} unless the extension
18
18
  * declared the `process` {@link Permission}; first-party extensions are unscoped.
19
+ * Ignored when {@link SearchOptions.cwds} is non-empty.
19
20
  */
20
21
  cwd?: string;
22
+ /**
23
+ * Multiple search roots. When provided, all listed folders are searched and
24
+ * results are merged. Each root is subject to the same scope guard as `cwd`.
25
+ * Takes precedence over `cwd` when non-empty.
26
+ */
27
+ cwds?: string[];
21
28
  /** Treat `query` as a regular expression instead of a literal string. */
22
29
  regex?: boolean;
23
30
  /** Match case exactly. When false (default), the search is case-insensitive. */
@@ -66,7 +73,13 @@ export interface SearchMatch {
66
73
  * @public
67
74
  */
68
75
  export interface SearchFileResult {
69
- /** File path **relative to** the search `cwd` (the workspace folder by default). */
76
+ /**
77
+ * Absolute path of the search root this file lives under. Present when
78
+ * searching multiple roots (via {@link SearchOptions.cwds}); omitted for
79
+ * single-root searches where the caller already knows the root.
80
+ */
81
+ root?: string;
82
+ /** File path **relative to** `root` (or the search `cwd` for single-root searches). */
70
83
  path: string;
71
84
  /** The matching lines within this file, in file order. */
72
85
  matches: SearchMatch[];