filesInScope
filesInScope(
patterns,opts?):Promise<string[]>
The concrete on-disk files matching patterns — a scope’s context slice
(DR-0011: build a headless-script’s working set).
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
patterns | Patterns | The scope to resolve (Patterns). |
opts? | FsOptions | FsOptions: matching semantics plus cwd / ignore / onlyFiles / absolute. |
Returns
Section titled “Returns”Promise<string[]>
The matching files, sorted; cwd-relative unless opts.absolute.
Remarks
Section titled “Remarks”Same semantics as the pure layer — a bare path is an exact match and
a subtree needs **. The globber only enumerates the tree; every
include/exclude decision is the path API’s matches.
Example
Section titled “Example”const context = await filesInScope(["src/api/**", "src/db/**"], { cwd: repoRoot });// → ["src/api/routes/list.ts", "src/api/user.ts", "src/db/pool.ts"] (sorted, cwd-relative)