Saxonberg Server API
    Preparing search index...
    Index

    Constructors

    Methods

    • 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 no packages ancestor is found, in which case we throw — the shell's code tree is meaningless without one.

      Returns string

    • Pure 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.

      Parameters

      • cwd: string
      • input: string
      • opts: { home?: string } = {}

      Returns string

    • Resolve an absolute path inside the sandbox.

      Pipeline:

      1. ~ (alone or as a leading segment) expands to home.
      2. Relative paths resolve against cwd.
      3. The result is normalised (collapsing .. / . segments).
      4. The normalised result must lie inside 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.

      Parameters

      • cwd: string
      • input: string
      • opts: { home?: string } = {}

      Returns string

    • Convert 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.

      Parameters

      • absolute: string

      Returns string