StaticcpStaticexistsStaticgetStaticisStaticisStaticjoinPure logical-path resolution for tree-shaped paths. Same ~ and
cwd-relative semantics as resolvePath, but without the
filesystem sandbox check — used for the template tree where
paths are virtual identifiers, not OS file paths.
Returns a normalised absolute path beginning with /. The
absence of a sandbox means a .. segment can resolve to a
shorter path, even all the way up to /. Callers that need a
specific bound enforce it themselves.
StaticlistStaticmkdirStaticmvStaticreadStaticresolveResolve an absolute path inside the sandbox.
Pipeline:
~ (alone or as a leading segment) expands to home.cwd... / . segments).getSandboxRoot();
otherwise throws SourceTreeSandboxError.cwd and home are themselves treated as already-sandboxed
paths — callers are expected to maintain that invariant by
routing every cwd write through resolvePath.
StaticrmStatictoConvert an absolute sandbox-rooted path back to its display
form (/<sub-path>). Inverse of the leading-/ semantics in
resolvePath — used by controllers when echoing a normalised
path back to the player.
Staticwrite
Return the absolute path to the sandbox root. Memoised.
Discovery: walk up until we find a directory named
packages; its parent is the sandbox root. The walk stops at the filesystem root if nopackagesancestor is found, in which case we throw — the shell's code tree is meaningless without one.