* feat(i18n): key translation pairing records by heading section Replace the whole-file blob hashes in *.i18n.yaml with one entry per heading section that still holds language-specific content, keyed by the English heading-slug path. Blocks identical across the pair (generated table rows, code blocks, shared regions) stay out of the hash, so edits to different sections and identical regenerations merge with Git's default text merge, including on GitHub. Remove the dsh-translation-pairing merge driver, its resolver command and installer wiring; gen-translation-brief recovers last-confirmed text from commit history. Migrate all active records, archive the superseded Agent Note, and record the replayed conflict reduction in the new one. * test(i18n): refresh translation prompt snapshot for the terminology note * feat(i18n): exclude only code blocks and generated regions from pairing records Replace byte-equality masking with an explicit rule: a record hash skips fenced code blocks and BEGIN/END GENERATED regions, the two kinds of content the pairing gate already requires to be identical on both sides. Move generated data into regions written into both pages: gen-config-catalog renders both languages and the record with per-package regions labelled by code identifiers; gen-module-graph keeps its table in a region; gen-doc-graphs splices the event matrix regions into the Chinese page. Add a generic region splice beside the region grammar.
description, kind
| description | kind |
|---|---|
| Browser-safe Workspace path helpers for joining relative paths, abbreviating POSIX homes, and deriving display titles. | package-library |
dsh-util-workspace-path
English | 中文
Summary
Browser-safe path helpers shared by Workspace-facing client and controller packages. The package joins Workspace-relative paths, abbreviates POSIX home directories for display, derives Workspace titles from POSIX or Windows paths, splits a path into its directories and final segment for display, and owns the dsh-resource://file/… address grammar that names a workspace file across the Sidebar and the resource model. relativizeToCwd removes the workspace prefix for display while preserving paths outside that directory. It has no Cordis service or runtime state.
Table of Contents
File addresses
A resource address is dsh-resource://<type>/…, and the type — the URI host — is the resource protocol key (file, or one a plugin declares in ResourceProtocolMap); any other scheme is a navigation protocol, defined elsewhere. dsh-resource://file/session/<sessionId>/<path> names the Session that authorizes the Host read and a workspace-relative or absolute path. Leading slashes remain part of the path: /etc/hosts is dsh-resource://file/session/s//etc/hosts, a Windows drive is dsh-resource://file/session/s/C:/x/y.txt, and UNC is dsh-resource://file/session/s///server/share/y.txt. The Host resolves paths and enforces access. The absolute/<path> form remains parseable but carries no authorizing Session, so the file provider cannot read it and Preview does not claim it; neither current nor Tab Session is borrowed. The grammar lives in src/file-address.ts; the path helpers stay in src/index.ts, which re-exports it.
sessionFileAddress(sessionId, path) normalizes \ to / and drops leading ./, but preserves leading / characters. Every id and path segment is component-encoded with : kept literal. fileAddressFor(sessionId, cwd, path) always builds a Session address: paths inside cwd become relative; other absolute paths, including when cwd is unknown, stay absolute within that Session address. absoluteFileAddress(absolutePath) builds only the Session-less form. parseFileAddress(address) checks the exact file-address prefix, ignores query and fragment suffixes, decodes each segment, and returns { scope, sessionId, path } for a Session address or { scope, path } for the Session-less form. Another type or scheme, an unknown scope, a missing id or path, or a malformed escape returns undefined.
fileMediaUrl(base, path) builds an authenticated file-route URL from an already-decoded absolute path. It preserves literal percent signs and deployment prefixes, and rejects non-HTTP application bases, relative paths, network-path prefixes, and control characters. Markdown owners decode authored URLs before calling it; native file-card paths are passed unchanged.
Known Limitations and Deferred Work
- Resolution is lexical — it recognizes POSIX absolute paths, Windows drive paths, and UNC paths, preserves the Workspace path's separator when joining a relative path, and does not access a filesystem or canonicalize
.and..segments. - Home abbreviation is POSIX-only — Windows paths remain unchanged because a portable browser cannot infer Windows home-path equivalence safely.
Dev Note
Working context for maintainers — click to expand
None.
Runtime invariant: No companion is published. This utility owns no mutable runtime relationship.