Expand description
Path expansion, cwd resolution, and macOS path-variant fallback for tool file arguments.
Ports .references/pi/packages/coding-agent/src/core/tools/path-utils.ts
together with the normalizePath / resolvePath helpers from
.references/pi/packages/coding-agent/src/utils/paths.ts. Inputs are
normalized with Unicode-space folding and an optional @ strip, ~ and
file:// expansion, then resolved against a cwd. When the resolved path
does not exist, the read resolvers try the macOS variants in order:
narrow no-break space before AM/PM, NFD normalization, curly apostrophe,
and NFD + curly apostrophe combined.
Enums§
- Path
Resolve Error - Errors produced while expanding or resolving tool paths.
Functions§
- expand_
path - Expand a user-supplied path without resolving it against a cwd
(TypeScript
expandPath): Unicode-space folding,@strip,~expansion, andfile://conversion. - path_
exists - Async existence check (TypeScript
pathExists). - resolve_
read_ path - Resolve a read path, falling back through the macOS variants when the
plainly resolved path does not exist (TypeScript
resolveReadPath). Returns the plainly resolved path when no variant exists either. - resolve_
read_ path_ async - Async form of
resolve_read_path(TypeScriptresolveReadPathAsync). - resolve_
to_ cwd - Resolve a path relative to
cwd(TypeScriptresolveToCwd). The input gets Unicode-space folding,@strip,~expansion, andfile://conversion; the cwd is itself~-expanded but not space-folded, matchingresolvePath(filePath, cwd, { normalizeUnicodeSpaces: true, stripAtPrefix: true }).