Expand description
Mirrors packages/agent/src/harness/tools/path-utils.ts — tool-path
normalization + resolution, including the read tool’s fuzzy-existence lookup
of typographic variants the model commonly emits.
resolve_tool_path (write/edit) normalizes unicode spaces + strips a leading
@, then delegates to env.absolute_path. resolve_read_tool_path (read)
additionally tries NFKC-ish/typographic variants (smart quotes, narrow spaces
in AM/PM timestamps, NFD decomposition) and returns the first that actually
exists on disk — falling back to the original resolved path when none do.
Functions§
- normalize_
tool_ path - Replace unicode spaces with ASCII space and strip a leading
@. MirrorsnormalizeToolPath. - resolve_
read_ tool_ path - Resolve a read tool path: try the normalized-resolved path first, and if it
doesn’t exist, try typographic variants (smart quotes, narrow spaces in
AM/PM timestamps, NFD decomposition) — returning the first that exists.
Falls back to the original resolved path when none exist. Mirrors
resolveReadToolPath. - resolve_
tool_ path - Resolve a tool path for write/edit: normalize, then
env.absolute_path. MirrorsresolveToolPath.