fix(host): review round 20 — canonical shape declared at the interface; hermetic home-shape spec; single resolve

This commit is contained in:
creatixchu
2026-07-30 02:10:07 +08:00
parent cc92b6b578
commit 983e6d07a4
9 changed files with 55 additions and 17 deletions

View File

@@ -15,11 +15,18 @@ export interface DirectoryEntry {
hidden: boolean
}
/** host.listDirectory response value: one directory level plus its ancestry. */
/**
* host.listDirectory response value: one directory level plus its ancestry.
* Every path in one listing — `path`, `crumbs[].path`, `entries[].path`,
* and `home` — is host-resolved canonical form: no `.`/`..` segments, no
* repeated or trailing separators (bare roots `/`, `C:\`, `\\server\share\`
* excepted), one platform separator. Clients compare paths on this promise
* without re-normalizing.
*/
export interface DirectoryListing {
/** Absolute path of the listed directory. */
path: string
/** The host account's home directory (breadcrumb "Home" rooting), in the same resolved shape as `path` and `crumbs[].path`. */
/** The host account's home directory (breadcrumb "Home" rooting), in the interface's canonical shape like every other path here. */
home: string
/**
* Ancestor chain from the filesystem root to the listed directory