Dashboard › craft › Distillation
75328a65-0f72-4034-8b68-d68b674b22f5["lore_tm_v1_Z3fTkJEySJPlTaOqjHirSSxfLyv4AQzy4MsI6gPwxpQ"]
Date: Sep 8, 2026
globFiles public output is always relative to the caller's cwd.packages/cli/src/lib/scan/glob.ts:1-28: pure-TypeScript glob engine layers on walkFiles; accepts picomatch-syntax patterns and optional exclude, yielding files under cwd that match at least one include and no exclusion. Slash-containing patterns match POSIX-normalized relative paths, slashless patterns match basenames, dot: true accepts dotfiles, and ** spans directories. Supports picomatch full grammar including extglobs, braces, and negation. Matchers are compiled once per patterns/exclude entry per call, so a 10k-file walk costs approximately 2 compile calls plus 10k (rel|basename) → bool checks.glob.ts:30-38: imports basenameOf, compileMatchers, joinPosix, matchesAny, and walkerRoot from ./path-utils.js; imports GlobOptions, GlobResult, and WalkOptions from ./types.js; imports walkFiles from ./walker.js.glob.ts:40-95: public async generator globFiles(opts: GlobOptions): AsyncGenerator<string> compiles include matchers from required opts.patterns and returns immediately when none are provided; compiles opts.exclude; derives traversal root via walkerRoot(opts.cwd, opts.path); forwards alwaysSkipDirs, respectGitignore, nestedGitignore, hidden, maxDepth, minDepth, descentHook, followSymlinks, signal, and timeBudgetMs into walkFiles.glob.ts:72-93: globFiles defaults maxResults to Number.POSITIVE_INFINITY; for each walked entry, matches includes and excludes against entry.relativePath plus basenameOf(entry.relativePath). When opts.path is set, it converts the walk-root-relative path to caller-cwd-relative output using joinPosix(opts.path, relToRoot); yields it, increments emitted, and returns once emitted >= maxResults.glob.ts:97-124: public collectGlob(opts: GlobOptions): Promise<GlobResult> drains globFiles into a byte-lexicographically sorted (Array.prototype.sort) files: string[] and returns { files, truncated }. It forwards maxResults + 1, capped at Number.MAX_SAFE_INTEGER, as a probe limit to distinguish exactly N matches from additional available matches; sets truncated = true and stops when files.length >= maxResults.